package dto

type CustomerAccountListReq 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:"每页数量"`
	Username     string `json:"username" query:"username" description:"用户名（模糊查询）"`
	Phone        string `json:"phone" query:"phone" description:"手机号（模糊查询）"`
	UserType     *int   `json:"user_type" query:"user_type" description:"用户类型（3=代理账号, 4=企业账号）"`
	ShopID       *uint  `json:"shop_id" query:"shop_id" description:"店铺ID"`
	EnterpriseID *uint  `json:"enterprise_id" query:"enterprise_id" description:"企业ID"`
	Status       *int   `json:"status" query:"status" description:"状态（0=禁用, 1=启用）"`
}

type CustomerAccountItem struct {
	ID             uint   `json:"id" description:"账号ID"`
	Username       string `json:"username" description:"用户名"`
	Phone          string `json:"phone" description:"手机号"`
	UserType       int    `json:"user_type" description:"用户类型（3=代理账号, 4=企业账号）"`
	UserTypeName   string `json:"user_type_name" description:"用户类型名称"`
	ShopID         *uint  `json:"shop_id,omitempty" description:"店铺ID"`
	ShopName       string `json:"shop_name" description:"店铺名称"`
	EnterpriseID   *uint  `json:"enterprise_id,omitempty" description:"企业ID"`
	EnterpriseName string `json:"enterprise_name" description:"企业名称"`
	Status         int    `json:"status" description:"状态（0=禁用, 1=启用）"`
	StatusName     string `json:"status_name" description:"状态名称"`
	CreatedAt      string `json:"created_at" description:"创建时间"`
}

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

type CreateCustomerAccountReq struct {
	Username string `json:"username" validate:"required,min=2,max=50" required:"true" minimum:"2" maximum:"50" description:"用户名"`
	Phone    string `json:"phone" validate:"required,len=11" required:"true" description:"手机号"`
	Password string `json:"password" validate:"required,min=6,max=20" required:"true" minimum:"6" maximum:"20" description:"密码"`
	ShopID   uint   `json:"shop_id" validate:"required" required:"true" description:"店铺ID"`
}

type UpdateCustomerAccountRequest struct {
	Username *string `json:"username" validate:"omitempty,min=2,max=50" minimum:"2" maximum:"50" description:"用户名"`
	Phone    *string `json:"phone" validate:"omitempty,len=11" description:"手机号"`
}

// UpdateCustomerAccountReq 更新客户账号请求（用于文档生成，包含路径参数）
type UpdateCustomerAccountReq struct {
	IDReq
	UpdateCustomerAccountRequest
}

type UpdateCustomerAccountPasswordRequest struct {
	Password string `json:"password" validate:"required,min=6,max=20" required:"true" minimum:"6" maximum:"20" description:"新密码"`
}

// UpdateCustomerAccountPasswordReq 修改客户账号密码请求（用于文档生成，包含路径参数）
type UpdateCustomerAccountPasswordReq struct {
	IDReq
	UpdateCustomerAccountPasswordRequest
}

type UpdateCustomerAccountStatusRequest struct {
	Status int `json:"status" validate:"required,oneof=0 1" required:"true" enum:"0,1" description:"状态（0=禁用, 1=启用）"`
}

// UpdateCustomerAccountStatusReq 修改客户账号状态请求（用于文档生成，包含路径参数）
type UpdateCustomerAccountStatusReq struct {
	IDReq
	UpdateCustomerAccountStatusRequest
}
