package dto

import "time"

type AuthorizationListReq 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:"每页数量"`
	EnterpriseID   *uint  `json:"enterprise_id" query:"enterprise_id" description:"按企业ID筛选"`
	ICCID          string `json:"iccid" query:"iccid" description:"按ICCID模糊查询"`
	AuthorizerType *int   `json:"authorizer_type" query:"authorizer_type" description:"授权人类型：2=平台，3=代理"`
	Status         *int   `json:"status" query:"status" description:"状态：0=已回收，1=有效"`
	StartTime      string `json:"start_time" query:"start_time" description:"授权时间起（格式：2006-01-02）"`
	EndTime        string `json:"end_time" query:"end_time" description:"授权时间止（格式：2006-01-02）"`
}

type AuthorizationItem struct {
	ID             uint       `json:"id" description:"授权记录ID"`
	EnterpriseID   uint       `json:"enterprise_id" description:"企业ID"`
	EnterpriseName string     `json:"enterprise_name" description:"企业名称"`
	CardID         uint       `json:"card_id" description:"卡ID"`
	ICCID          string     `json:"iccid" description:"ICCID"`
	MSISDN         string     `json:"msisdn" description:"手机号"`
	AuthorizedBy   uint       `json:"authorized_by" description:"授权人ID"`
	AuthorizerName string     `json:"authorizer_name" description:"授权人名称"`
	AuthorizerType int        `json:"authorizer_type" description:"授权人类型：2=平台，3=代理"`
	AuthorizedAt   time.Time  `json:"authorized_at" description:"授权时间"`
	RevokedBy      *uint      `json:"revoked_by,omitempty" description:"回收人ID"`
	RevokerName    string     `json:"revoker_name,omitempty" description:"回收人名称"`
	RevokedAt      *time.Time `json:"revoked_at,omitempty" description:"回收时间"`
	Status         int        `json:"status" description:"状态：1=有效，0=已回收"`
	Remark         string     `json:"remark" description:"备注"`
}

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

type AuthorizationDetailReq struct {
	ID uint `json:"-" params:"id" path:"id" validate:"required" required:"true" description:"授权记录ID"`
}

type UpdateAuthorizationRemarkReq struct {
	ID     uint   `json:"-" params:"id" path:"id" validate:"required" required:"true" description:"授权记录ID"`
	Remark string `json:"remark" validate:"max=500" description:"备注（最多500字）"`
}
