local addon_name, addon_env = ...

if not LibStub then return end
local ldb = LibStub:GetLibrary("LibDataBroker-1.1", true)
if not ldb then return end
local Addon_Name = GetAddOnMetadata(addon_name, 'Title')

local broker = ldb:NewDataObject(addon_name, {
   type = "data source",
   label = Addon_Name or addon_name,
   icon = "Interface\\ICONS\\Achievement_Garrison_Tier01_" .. UnitFactionGroup("player"),
   OnTooltipShow = addon_env.RemoveAllWorkers_TooltipSetText
})
addon_env.broker = broker

addon_env.GarrisonBuilding_UpdateBuildings()