package bootstrap

import (
	"github.com/break/junhong_cmp_fiber/internal/store/postgres"
)

type stores struct {
	Account                           *postgres.AccountStore
	AccountOperationLog               *postgres.AccountOperationLogStore
	AssetOperationLog                 *postgres.AssetOperationLogStore
	Shop                              *postgres.ShopStore
	Role                              *postgres.RoleStore
	Permission                        *postgres.PermissionStore
	AccountRole                       *postgres.AccountRoleStore
	ShopRole                          *postgres.ShopRoleStore
	RolePermission                    *postgres.RolePermissionStore
	PersonalCustomer                  *postgres.PersonalCustomerStore
	PersonalCustomerOpenID            *postgres.PersonalCustomerOpenIDStore
	PersonalCustomerDevice            *postgres.PersonalCustomerDeviceStore
	PersonalCustomerPhone             *postgres.PersonalCustomerPhoneStore
	CommissionWithdrawalRequest       *postgres.CommissionWithdrawalRequestStore
	CommissionRecord                  *postgres.CommissionRecordStore
	CommissionWithdrawalSetting       *postgres.CommissionWithdrawalSettingStore
	Enterprise                        *postgres.EnterpriseStore
	EnterpriseCardAuthorization       *postgres.EnterpriseCardAuthorizationStore
	EnterpriseDeviceAuthorization     *postgres.EnterpriseDeviceAuthorizationStore
	IotCard                           *postgres.IotCardStore
	IotCardImportTask                 *postgres.IotCardImportTaskStore
	ExportTask                        *postgres.ExportTaskStore
	ExportShardTask                   *postgres.ExportShardTaskStore
	Device                            *postgres.DeviceStore
	DeviceSimBinding                  *postgres.DeviceSimBindingStore
	DeviceImportTask                  *postgres.DeviceImportTaskStore
	AssetAllocationRecord             *postgres.AssetAllocationRecordStore
	Carrier                           *postgres.CarrierStore
	PackageSeries                     *postgres.PackageSeriesStore
	Package                           *postgres.PackageStore
	PackageUsage                      *postgres.PackageUsageStore
	PackageUsageDailyRecord           *postgres.PackageUsageDailyRecordStore
	ShopSeriesAllocation              *postgres.ShopSeriesAllocationStore
	ShopPackageAllocation             *postgres.ShopPackageAllocationStore
	ShopPackageAllocationPriceHistory *postgres.ShopPackageAllocationPriceHistoryStore
	ShopSeriesCommissionStats         *postgres.ShopSeriesCommissionStatsStore
	Order                             *postgres.OrderStore
	OrderItem                         *postgres.OrderItemStore
	ExchangeOrder                     *postgres.ExchangeOrderStore
	ResourceTag                       *postgres.ResourceTagStore
	PollingConfig                     *postgres.PollingConfigStore
	PollingConcurrencyConfig          *postgres.PollingConcurrencyConfigStore
	PollingAlertRule                  *postgres.PollingAlertRuleStore
	PollingAlertHistory               *postgres.PollingAlertHistoryStore
	DataCleanupConfig                 *postgres.DataCleanupConfigStore
	DataCleanupLog                    *postgres.DataCleanupLogStore
	PollingManualTriggerLog           *postgres.PollingManualTriggerLogStore
	// 代理钱包系统
	AgentWallet            *postgres.AgentWalletStore
	AgentWalletTransaction *postgres.AgentWalletTransactionStore
	AgentRecharge          *postgres.AgentRechargeStore
	// 资产钱包系统
	AssetWallet            *postgres.AssetWalletStore
	AssetWalletTransaction *postgres.AssetWalletTransactionStore
	// 充值订单和支付记录
	RechargeOrder *postgres.RechargeOrderStore
	Payment       *postgres.PaymentStore
	// 微信参数配置
	WechatConfig *postgres.WechatConfigStore
	// 退款系统
	RefundRequest *postgres.RefundStore
	// 订单套餐失效任务
	OrderPackageInvalidateTask *postgres.OrderPackageInvalidateTaskStore
	// 资产套餐批量订购任务
	AssetPackageBatchOrderTask *postgres.AssetPackageBatchOrderTaskStore
	// 流量系统
	CardDailyUsage *postgres.CardDailyUsageStore
	// 资产标识符注册表
	AssetIdentifier *postgres.AssetIdentifierStore
}

func initStores(deps *Dependencies) *stores {
	return &stores{
		Account:                           postgres.NewAccountStore(deps.DB, deps.Redis),
		AccountOperationLog:               postgres.NewAccountOperationLogStore(deps.DB),
		AssetOperationLog:                 postgres.NewAssetOperationLogStore(deps.DB),
		Shop:                              postgres.NewShopStore(deps.DB, deps.Redis),
		Role:                              postgres.NewRoleStore(deps.DB),
		Permission:                        postgres.NewPermissionStore(deps.DB),
		AccountRole:                       postgres.NewAccountRoleStore(deps.DB, deps.Redis),
		ShopRole:                          postgres.NewShopRoleStore(deps.DB, deps.Redis),
		RolePermission:                    postgres.NewRolePermissionStore(deps.DB, deps.Redis),
		PersonalCustomer:                  postgres.NewPersonalCustomerStore(deps.DB, deps.Redis),
		PersonalCustomerOpenID:            postgres.NewPersonalCustomerOpenIDStore(deps.DB),
		PersonalCustomerDevice:            postgres.NewPersonalCustomerDeviceStore(deps.DB),
		PersonalCustomerPhone:             postgres.NewPersonalCustomerPhoneStore(deps.DB),
		CommissionWithdrawalRequest:       postgres.NewCommissionWithdrawalRequestStore(deps.DB, deps.Redis),
		CommissionRecord:                  postgres.NewCommissionRecordStore(deps.DB, deps.Redis),
		CommissionWithdrawalSetting:       postgres.NewCommissionWithdrawalSettingStore(deps.DB, deps.Redis),
		Enterprise:                        postgres.NewEnterpriseStore(deps.DB, deps.Redis),
		EnterpriseCardAuthorization:       postgres.NewEnterpriseCardAuthorizationStore(deps.DB, deps.Redis),
		EnterpriseDeviceAuthorization:     postgres.NewEnterpriseDeviceAuthorizationStore(deps.DB, deps.Redis),
		IotCard:                           postgres.NewIotCardStore(deps.DB, deps.Redis),
		IotCardImportTask:                 postgres.NewIotCardImportTaskStore(deps.DB, deps.Redis),
		ExportTask:                        postgres.NewExportTaskStore(deps.DB, deps.Redis),
		ExportShardTask:                   postgres.NewExportShardTaskStore(deps.DB, deps.Redis),
		Device:                            postgres.NewDeviceStore(deps.DB, deps.Redis),
		DeviceSimBinding:                  postgres.NewDeviceSimBindingStore(deps.DB, deps.Redis),
		DeviceImportTask:                  postgres.NewDeviceImportTaskStore(deps.DB, deps.Redis),
		AssetAllocationRecord:             postgres.NewAssetAllocationRecordStore(deps.DB, deps.Redis),
		Carrier:                           postgres.NewCarrierStore(deps.DB),
		PackageSeries:                     postgres.NewPackageSeriesStore(deps.DB),
		Package:                           postgres.NewPackageStore(deps.DB),
		PackageUsage:                      postgres.NewPackageUsageStore(deps.DB, deps.Redis),
		PackageUsageDailyRecord:           postgres.NewPackageUsageDailyRecordStore(deps.DB, deps.Redis),
		ShopSeriesAllocation:              postgres.NewShopSeriesAllocationStore(deps.DB),
		ShopPackageAllocation:             postgres.NewShopPackageAllocationStore(deps.DB),
		ShopPackageAllocationPriceHistory: postgres.NewShopPackageAllocationPriceHistoryStore(deps.DB),
		ShopSeriesCommissionStats:         postgres.NewShopSeriesCommissionStatsStore(deps.DB),
		Order:                             postgres.NewOrderStore(deps.DB, deps.Redis),
		OrderItem:                         postgres.NewOrderItemStore(deps.DB, deps.Redis),
		ExchangeOrder:                     postgres.NewExchangeOrderStore(deps.DB),
		ResourceTag:                       postgres.NewResourceTagStore(deps.DB),
		PollingConfig:                     postgres.NewPollingConfigStore(deps.DB),
		PollingConcurrencyConfig:          postgres.NewPollingConcurrencyConfigStore(deps.DB),
		PollingAlertRule:                  postgres.NewPollingAlertRuleStore(deps.DB),
		PollingAlertHistory:               postgres.NewPollingAlertHistoryStore(deps.DB),
		DataCleanupConfig:                 postgres.NewDataCleanupConfigStore(deps.DB),
		DataCleanupLog:                    postgres.NewDataCleanupLogStore(deps.DB),
		PollingManualTriggerLog:           postgres.NewPollingManualTriggerLogStore(deps.DB),
		// 代理钱包系统
		AgentWallet:            postgres.NewAgentWalletStore(deps.DB, deps.Redis),
		AgentWalletTransaction: postgres.NewAgentWalletTransactionStore(deps.DB, deps.Redis),
		AgentRecharge:          postgres.NewAgentRechargeStore(deps.DB, deps.Redis),
		// 资产钱包系统
		AssetWallet:                postgres.NewAssetWalletStore(deps.DB, deps.Redis),
		AssetWalletTransaction:     postgres.NewAssetWalletTransactionStore(deps.DB, deps.Redis),
		RechargeOrder:              postgres.NewRechargeOrderStore(deps.DB, deps.Redis),
		Payment:                    postgres.NewPaymentStore(deps.DB, deps.Redis),
		WechatConfig:               postgres.NewWechatConfigStore(deps.DB, deps.Redis),
		RefundRequest:              postgres.NewRefundStore(deps.DB),
		CardDailyUsage:             postgres.NewCardDailyUsageStore(deps.DB),
		AssetIdentifier:            postgres.NewAssetIdentifierStore(deps.DB),
		OrderPackageInvalidateTask: postgres.NewOrderPackageInvalidateTaskStore(deps.DB),
		AssetPackageBatchOrderTask: postgres.NewAssetPackageBatchOrderTaskStore(deps.DB),
	}
}
