package dto

type MyCommissionSummaryResp struct {
	ShopID                uint   `json:"shop_id" description:"店铺ID"`
	ShopName              string `json:"shop_name" description:"店铺名称"`
	TotalCommission       int64  `json:"total_commission" description:"累计佣金（分）"`
	WithdrawnCommission   int64  `json:"withdrawn_commission" description:"已提现佣金（分）"`
	UnwithdrawCommission  int64  `json:"unwithdraw_commission" description:"未提现佣金（分）"`
	FrozenCommission      int64  `json:"frozen_commission" description:"冻结佣金（分）"`
	WithdrawingCommission int64  `json:"withdrawing_commission" description:"提现中佣金（分）"`
	AvailableCommission   int64  `json:"available_commission" description:"可提现佣金（分）"`
}

type CreateMyWithdrawalReq struct {
	Amount           int64  `json:"amount" validate:"required,min=1" required:"true" minimum:"1" description:"提现金额（分）"`
	WithdrawalMethod string `json:"withdrawal_method" validate:"required,oneof=alipay" required:"true" enum:"alipay" description:"收款类型"`
	AccountName      string `json:"account_name" validate:"required,max=50" required:"true" maximum:"50" description:"收款人姓名"`
	AccountNumber    string `json:"account_number" validate:"required,max=100" required:"true" maximum:"100" description:"收款账号"`
}

type CreateMyWithdrawalResp struct {
	ID           uint   `json:"id" description:"提现申请ID"`
	WithdrawalNo string `json:"withdrawal_no" description:"提现单号"`
	Amount       int64  `json:"amount" description:"提现金额（分）"`
	FeeRate      int64  `json:"fee_rate" description:"手续费比率（基点）"`
	Fee          int64  `json:"fee" description:"手续费（分）"`
	ActualAmount int64  `json:"actual_amount" description:"实际到账金额（分）"`
	Status       int    `json:"status" description:"状态"`
	StatusName   string `json:"status_name" description:"状态名称"`
	CreatedAt    string `json:"created_at" description:"申请时间"`
}

type MyWithdrawalListReq 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:"每页数量"`
	Status    *int   `json:"status" query:"status" description:"状态（1=待审批, 2=已通过, 3=已拒绝）"`
	StartTime string `json:"start_time" query:"start_time" description:"申请开始时间"`
	EndTime   string `json:"end_time" query:"end_time" description:"申请结束时间"`
}

type MyCommissionRecordListReq 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:"每页数量"`
	CommissionSource *string `json:"commission_source" query:"commission_source" validate:"omitempty,oneof=cost_diff one_time tier_bonus" description:"佣金来源 (cost_diff:成本价差, one_time:一次性佣金, tier_bonus(已废弃):梯度奖励)"`
	ICCID            string  `json:"iccid" query:"iccid" description:"ICCID（模糊查询）"`
	DeviceNo         string  `json:"device_no" query:"device_no" description:"设备号（模糊查询）"`
	OrderNo          string  `json:"order_no" query:"order_no" description:"订单号（模糊查询）"`
}

type MyCommissionRecordItem struct {
	ID               uint   `json:"id" description:"佣金记录ID"`
	ShopID           uint   `json:"shop_id" description:"店铺ID"`
	OrderID          uint   `json:"order_id" description:"订单ID"`
	CommissionSource string `json:"commission_source" description:"佣金来源 (cost_diff:成本价差, one_time:一次性佣金, tier_bonus(已废弃):梯度奖励)"`
	Amount           int64  `json:"amount" description:"佣金金额（分）"`
	Status           int    `json:"status" description:"状态 (1:已入账, 2:已失效)"`
	StatusName       string `json:"status_name" description:"状态名称"`
	CreatedAt        string `json:"created_at" description:"创建时间"`
}

type MyCommissionRecordPageResult struct {
	Items []MyCommissionRecordItem `json:"items" description:"佣金记录列表"`
	Total int64                    `json:"total" description:"总记录数"`
	Page  int                      `json:"page" description:"当前页码"`
	Size  int                      `json:"size" description:"每页数量"`
}
