package dto

type CreateCarrierRequest struct {
	CarrierCode          string  `json:"carrier_code" validate:"required,min=1,max=50" required:"true" minLength:"1" maxLength:"50" description:"运营商编码"`
	CarrierName          string  `json:"carrier_name" validate:"required,min=1,max=100" required:"true" minLength:"1" maxLength:"100" description:"运营商名称"`
	CarrierType          string  `json:"carrier_type" validate:"required,oneof=CMCC CUCC CTCC CBN" required:"true" description:"运营商类型 (CMCC:中国移动, CUCC:中国联通, CTCC:中国电信, CBN:中国广电)"`
	Description          string  `json:"description" validate:"omitempty,max=500" maxLength:"500" description:"运营商描述"`
	DataResetDay         *int    `json:"data_reset_day" validate:"omitempty,min=1,max=28" minimum:"1" maximum:"28" description:"上游流量重置日(1-28)，运营商每月清零网关计数器的日期，默认1"`
	RealnameLinkType     *string `json:"realname_link_type" validate:"omitempty,oneof=none template gateway" description:"实名链接类型 none-不支持 template-模板URL gateway-Gateway接口"`
	RealnameLinkTemplate *string `json:"realname_link_template" validate:"omitempty,max=500" maxLength:"500" description:"实名链接模板URL，支持 {iccid}/{msisdn}/{virtual_no} 占位符"`
}

type UpdateCarrierRequest struct {
	CarrierName          *string `json:"carrier_name" validate:"omitempty,min=1,max=100" minLength:"1" maxLength:"100" description:"运营商名称"`
	Description          *string `json:"description" validate:"omitempty,max=500" maxLength:"500" description:"运营商描述"`
	DataResetDay         *int    `json:"data_reset_day" validate:"omitempty,min=1,max=28" minimum:"1" maximum:"28" description:"上游流量重置日(1-28)，运营商每月清零网关计数器的日期"`
	RealnameLinkType     *string `json:"realname_link_type" validate:"omitempty,oneof=none template gateway" description:"实名链接类型 none-不支持 template-模板URL gateway-Gateway接口"`
	RealnameLinkTemplate *string `json:"realname_link_template" validate:"omitempty,max=500" maxLength:"500" description:"实名链接模板URL，支持 {iccid}/{msisdn}/{virtual_no} 占位符"`
}

type CarrierListRequest 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:"每页数量"`
	CarrierType *string `json:"carrier_type" query:"carrier_type" validate:"omitempty,oneof=CMCC CUCC CTCC CBN" description:"运营商类型 (CMCC:中国移动, CUCC:中国联通, CTCC:中国电信, CBN:中国广电)"`
	CarrierName *string `json:"carrier_name" query:"carrier_name" validate:"omitempty,max=100" maxLength:"100" description:"运营商名称（模糊搜索）"`
	Status      *int    `json:"status" query:"status" validate:"omitempty,oneof=0 1" description:"状态 (1:启用, 0:禁用)"`
}

type UpdateCarrierStatusRequest struct {
	Status int `json:"status" validate:"required,oneof=0 1" required:"true" description:"状态 (1:启用, 0:禁用)"`
}

type CarrierResponse struct {
	ID                   uint   `json:"id" description:"运营商ID"`
	CarrierCode          string `json:"carrier_code" description:"运营商编码"`
	CarrierName          string `json:"carrier_name" description:"运营商名称"`
	CarrierType          string `json:"carrier_type" description:"运营商类型 (CMCC:中国移动, CUCC:中国联通, CTCC:中国电信, CBN:中国广电)"`
	Description          string `json:"description" description:"运营商描述"`
	DataResetDay         int    `json:"data_reset_day" description:"上游流量重置日(1-28)"`
	RealnameLinkType     string `json:"realname_link_type" description:"实名链接类型 none-不支持 template-模板URL gateway-Gateway接口"`
	RealnameLinkTemplate string `json:"realname_link_template" description:"实名链接模板URL"`
	Status               int    `json:"status" description:"状态 (1:启用, 0:禁用)"`
	CreatedAt            string `json:"created_at" description:"创建时间"`
	UpdatedAt            string `json:"updated_at" description:"更新时间"`
}

type UpdateCarrierParams struct {
	IDReq
	UpdateCarrierRequest
}

type UpdateCarrierStatusParams struct {
	IDReq
	UpdateCarrierStatusRequest
}

type CarrierPageResult struct {
	List     []*CarrierResponse `json:"items" description:"运营商列表"`
	Total    int64              `json:"total" description:"总数"`
	Page     int                `json:"page" description:"当前页"`
	PageSize int                `json:"size" description:"每页数量"`
}
