package dto

// CreateShopPackageAllocationRequest 创建单套餐分配请求
type CreateShopPackageAllocationRequest struct {
	ShopID    uint  `json:"shop_id" validate:"required" required:"true" description:"被分配的店铺ID"`
	PackageID uint  `json:"package_id" validate:"required" required:"true" description:"套餐ID"`
	CostPrice int64 `json:"cost_price" validate:"required,min=0" required:"true" minimum:"0" description:"覆盖的成本价（分）"`
}

// UpdateShopPackageAllocationRequest 更新单套餐分配请求
type UpdateShopPackageAllocationRequest struct {
	CostPrice *int64 `json:"cost_price" validate:"omitempty,min=0" minimum:"0" description:"覆盖的成本价（分）"`
}

// ShopPackageAllocationListRequest 单套餐分配列表请求
type ShopPackageAllocationListRequest struct {
	Page      int   `json:"page" query:"page" validate:"omitempty,min=1" minimum:"1" description:"页码"`
	PageSize  int   `json:"page_size" query:"page_size" validate:"omitempty,min=1,max=100" minimum:"1" maximum:"100" description:"每页数量"`
	ShopID    *uint `json:"shop_id" query:"shop_id" validate:"omitempty" description:"被分配的店铺ID"`
	PackageID *uint `json:"package_id" query:"package_id" validate:"omitempty" description:"套餐ID"`
	Status    *int  `json:"status" query:"status" validate:"omitempty,oneof=1 2" description:"状态 (1:启用, 2:禁用)"`
}

// UpdateShopPackageAllocationStatusRequest 更新单套餐分配状态请求
type UpdateShopPackageAllocationStatusRequest struct {
	Status int `json:"status" validate:"required,oneof=1 2" required:"true" description:"状态 (1:启用, 2:禁用)"`
}

// ShopPackageAllocationResponse 单套餐分配响应
type ShopPackageAllocationResponse struct {
	ID                  uint   `json:"id" description:"分配ID"`
	ShopID              uint   `json:"shop_id" description:"被分配的店铺ID"`
	ShopName            string `json:"shop_name" description:"被分配的店铺名称"`
	PackageID           uint   `json:"package_id" description:"套餐ID"`
	PackageName         string `json:"package_name" description:"套餐名称"`
	PackageCode         string `json:"package_code" description:"套餐编码"`
	AllocationID        uint   `json:"allocation_id" description:"关联的系列分配ID"`
	CostPrice           int64  `json:"cost_price" description:"覆盖的成本价（分）"`
	CalculatedCostPrice int64  `json:"calculated_cost_price" description:"原计算成本价（分），供参考"`
	Status              int    `json:"status" description:"状态 (1:启用, 2:禁用)"`
	CreatedAt           string `json:"created_at" description:"创建时间"`
	UpdatedAt           string `json:"updated_at" description:"更新时间"`
}

// ShopPackageAllocationPageResult 单套餐分配分页结果
type ShopPackageAllocationPageResult struct {
	List       []*ShopPackageAllocationResponse `json:"list" description:"分配列表"`
	Total      int64                            `json:"total" description:"总数"`
	Page       int                              `json:"page" description:"当前页"`
	PageSize   int                              `json:"page_size" description:"每页数量"`
	TotalPages int                              `json:"total_pages" description:"总页数"`
}

// UpdateShopPackageAllocationParams 更新单套餐分配聚合参数
type UpdateShopPackageAllocationParams struct {
	IDReq
	UpdateShopPackageAllocationRequest
}

// UpdateShopPackageAllocationStatusParams 更新单套餐分配状态聚合参数
type UpdateShopPackageAllocationStatusParams struct {
	IDReq
	UpdateShopPackageAllocationStatusRequest
}
