package tools

import (
	"ai_scheduler/internal/config"
	"ai_scheduler/internal/domain/tools/common/excel_generator"
	"ai_scheduler/internal/domain/tools/common/image_converter"
	"ai_scheduler/internal/domain/tools/common/knowledge_base"
	"ai_scheduler/internal/domain/tools/hyt/goods_add"
	"ai_scheduler/internal/domain/tools/hyt/goods_brand_search"
	"ai_scheduler/internal/domain/tools/hyt/goods_category_add"
	"ai_scheduler/internal/domain/tools/hyt/goods_category_search"
	"ai_scheduler/internal/domain/tools/hyt/goods_media_add"
	"ai_scheduler/internal/domain/tools/hyt/product_upload"
	"ai_scheduler/internal/domain/tools/hyt/supplier_search"
	"ai_scheduler/internal/domain/tools/hyt/warehouse_search"
	"ai_scheduler/internal/domain/tools/recharge/statistics_ours_product"
)

type Manager struct {
	Hyt      *HytTools
	Recharge *RechargeTools
	Common   *CommonTools
	// Zltx *ZltxTools
}

type CommonTools struct {
	ExcelGenerator *excel_generator.Client
	ImageConverter *image_converter.Client
	KnowledgeBase  *knowledge_base.Client
}

type HytTools struct {
	ProductUpload       *product_upload.Client
	SupplierSearch      *supplier_search.Client
	WarehouseSearch     *warehouse_search.Client
	GoodsAdd            *goods_add.Client
	GoodsMediaAdd       *goods_media_add.Client
	GoodsCategoryAdd    *goods_category_add.Client
	GoodsCategorySearch *goods_category_search.Client
	GoodsBrandSearch    *goods_brand_search.Client
}

type RechargeTools struct {
	StatisticsOursProduct *statistics_ours_product.Client
}

func NewManager(cfg *config.Config) *Manager {
	return &Manager{
		Hyt: &HytTools{
			ProductUpload:       product_upload.New(cfg.EinoTools.HytProductUpload),
			SupplierSearch:      supplier_search.New(cfg.EinoTools.HytSupplierSearch),
			WarehouseSearch:     warehouse_search.New(cfg.EinoTools.HytWarehouseSearch),
			GoodsAdd:            goods_add.New(cfg.EinoTools.HytGoodsAdd),
			GoodsMediaAdd:       goods_media_add.New(cfg.EinoTools.HytGoodsMediaAdd),
			GoodsCategoryAdd:    goods_category_add.New(cfg.EinoTools.HytGoodsCategoryAdd),
			GoodsCategorySearch: goods_category_search.New(cfg.EinoTools.HytGoodsCategorySearch),
			GoodsBrandSearch:    goods_brand_search.New(cfg.EinoTools.HytGoodsBrandSearch),
		},
		Recharge: &RechargeTools{
			StatisticsOursProduct: statistics_ours_product.New(cfg.EinoTools.RechargeStatisticsOursProduct),
		},
		Common: &CommonTools{
			ExcelGenerator: excel_generator.New(),
			ImageConverter: image_converter.New(cfg.EinoTools.Excel2Pic),
			KnowledgeBase:  knowledge_base.New(cfg.KnowledgeConfig),
		},
	}
}
