package dto

type ShopListRequest 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:"每页数量"`
	ShopName string `json:"shop_name" query:"shop_name" validate:"omitempty,max=100" maxLength:"100" description:"店铺名称模糊查询"`
	ShopCode string `json:"shop_code" query:"shop_code" validate:"omitempty,max=50" maxLength:"50" description:"店铺编号模糊查询"`
	ParentID *uint  `json:"parent_id" query:"parent_id" validate:"omitempty,min=1" minimum:"1" description:"上级店铺ID"`
	Level    *int   `json:"level" query:"level" validate:"omitempty,min=1,max=7" minimum:"1" maximum:"7" description:"店铺层级 (1-7级)"`
	Status   *int   `json:"status" query:"status" validate:"omitempty,oneof=0 1" description:"状态 (0:禁用, 1:启用)"`
}

type CreateShopRequest struct {
	ShopName     string `json:"shop_name" validate:"required,min=1,max=100" required:"true" minLength:"1" maxLength:"100" description:"店铺名称"`
	ShopCode     string `json:"shop_code" validate:"required,min=1,max=50" required:"true" minLength:"1" maxLength:"50" description:"店铺编号"`
	ParentID     *uint  `json:"parent_id" validate:"omitempty,min=1" minimum:"1" description:"上级店铺ID（一级店铺可不填）"`
	ContactName  string `json:"contact_name" validate:"omitempty,max=50" maxLength:"50" description:"联系人姓名"`
	ContactPhone string `json:"contact_phone" validate:"omitempty,len=11" minLength:"11" maxLength:"11" description:"联系人电话"`
	Province     string `json:"province" validate:"omitempty,max=50" maxLength:"50" description:"省份"`
	City         string `json:"city" validate:"omitempty,max=50" maxLength:"50" description:"城市"`
	District     string `json:"district" validate:"omitempty,max=50" maxLength:"50" description:"区县"`
	Address      string `json:"address" validate:"omitempty,max=255" maxLength:"255" description:"详细地址"`
	InitPassword string `json:"init_password" validate:"required,min=8,max=32" required:"true" minLength:"8" maxLength:"32" description:"初始账号密码"`
	InitUsername string `json:"init_username" validate:"required,min=3,max=50" required:"true" minLength:"3" maxLength:"50" description:"初始账号用户名"`
	InitPhone    string `json:"init_phone" validate:"required,len=11" required:"true" minLength:"11" maxLength:"11" description:"初始账号手机号"`
}

type UpdateShopRequest struct {
	ShopName     string `json:"shop_name" validate:"required,min=1,max=100" required:"true" minLength:"1" maxLength:"100" description:"店铺名称"`
	ContactName  string `json:"contact_name" validate:"omitempty,max=50" maxLength:"50" description:"联系人姓名"`
	ContactPhone string `json:"contact_phone" validate:"omitempty,len=11" minLength:"11" maxLength:"11" description:"联系人电话"`
	Province     string `json:"province" validate:"omitempty,max=50" maxLength:"50" description:"省份"`
	City         string `json:"city" validate:"omitempty,max=50" maxLength:"50" description:"城市"`
	District     string `json:"district" validate:"omitempty,max=50" maxLength:"50" description:"区县"`
	Address      string `json:"address" validate:"omitempty,max=255" maxLength:"255" description:"详细地址"`
	Status       int    `json:"status" validate:"required,oneof=0 1" required:"true" description:"状态 (0:禁用, 1:启用)"`
}

// ShopResponse 店铺响应
type ShopResponse struct {
	ID           uint   `json:"id" description:"店铺ID"`
	ShopName     string `json:"shop_name" description:"店铺名称"`
	ShopCode     string `json:"shop_code" description:"店铺编号"`
	ParentID     *uint  `json:"parent_id,omitempty" description:"上级店铺ID"`
	Level        int    `json:"level" description:"店铺层级 (1-7级)"`
	ContactName  string `json:"contact_name" description:"联系人姓名"`
	ContactPhone string `json:"contact_phone" description:"联系人电话"`
	Province     string `json:"province" description:"省份"`
	City         string `json:"city" description:"城市"`
	District     string `json:"district" description:"区县"`
	Address      string `json:"address" description:"详细地址"`
	Status       int    `json:"status" description:"状态 (0:禁用, 1:启用)"`
	CreatedAt    string `json:"created_at" description:"创建时间"`
	UpdatedAt    string `json:"updated_at" description:"更新时间"`
}

// ShopPageResult 店铺分页响应
// ShopPageResult 店铺分页响应
type ShopPageResult struct {
	Items []ShopResponse `json:"items" description:"店铺列表"`
	Total int64          `json:"total" description:"总记录数"`
	Page  int            `json:"page" description:"当前页码"`
	Size  int            `json:"size" description:"每页数量"`
}

// UpdateShopParams 更新店铺聚合参数 (用于文档生成)
type UpdateShopParams struct {
	IDReq
	UpdateShopRequest
}
