package proto

import "intent-system/pkg/dal/models"

type CustomerRegisterReq struct {
	UserName string `json:"user_name" binding:"required"`
	Password string `json:"password" binding:"required"`
	Email    string `json:"email" binding:"required"`
	RegCode  string `json:"reg_code" binding:"required"`
}

type CustomerURegisterReq struct {
	UserName string `json:"user_name" binding:"required"`
	Password string `json:"password" binding:"required"`
	Referral  string `json:"Referral" binding:"omitempty"`
}

type CustomerRegisterResp struct {
}

type CustomerLoginReq struct {
	UserName string `json:"user_name" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type CustomerLoginResp struct {
	Id           int32    `json:"id"`
	Version      string   `json:"version"`
	IsSubscribed bool     `json:"is_subscribed"`
	UserName     string   `json:"user_name" db:"user_name" bson:"user_name"`
	FirstName    string   `json:"first_name" db:"first_name"` //姓
	LastName     string   `json:"last_name" db:"last_name"`   //名
	Title        string   `json:"title" db:"title"`           //职称
	Company      string   `json:"company" db:"company"`       //公司名称
	AuthToken    string   `json:"auth_token" db:"auth_token" bson:"auth_token"`
	LoginIp      string   `json:"login_ip" db:"login_ip" bson:"login_ip"`       //最近登录IP
	LoginTime    int64    `json:"login_time" db:"login_time" bson:"login_time"` //最近登录时间
	Privileges   []string `json:"privileges" db:"privileges" bson:"privileges"` //权限列表
	SubTags      []string `json:"sub_tags" db:"sub_tags" bson:"sub_sub"`        //订阅标签列表
}

type CustomerEditReq struct {
	Email     string `json:"email"`                      //邮箱地址
	FirstName string `json:"first_name" db:"first_name"` //姓
	LastName  string `json:"last_name" db:"last_name"`   //名
	Title     string `json:"title" db:"title"`           //职称
	Company   string `json:"company" db:"company"`       //公司名称
}

type CustomerEditResp struct {
}

type CustomerLogoutReq struct {
}

type CustomerLogoutResp struct {
}

type CustomerSubInfoReq struct {
	Email string `json:"email"  binding:"required"`
}

type CustomerSubInfoResp struct {
	IsSubscribed bool     `json:"is_subscribed"` //是否已订阅
	Tags         []string `json:"tags"`          //订阅标签列表
	FirstName    string   `json:"first_name"`    //姓
	LastName     string   `json:"last_name"`     //名
	Title        string   `json:"title"`         //职称
	Company      string   `json:"company"`       //公司名称
}

type CustomerSubscribeReq struct {
	Language  string   `json:"language" binding:"required"`                    //语言类型
	FirstName string   `json:"first_name" db:"first_name"  binding:"required"` //姓
	Email     string   `json:"email"`                                          //邮箱地址
	Tags      []string `json:"tags"`                                           //订阅标签
}

type CustomerSubscribeResp struct {
}

type CustomerUnsubscribeReq struct {
	Email  string `json:"email"`
	Reason string `json:"reason"` //退订原因
}

type CustomerUnsubscribeResp struct {
}

type CustomerListReq struct {
	Id       int32  `json:"id"`
	Email    string `json:"email"`
	PageNo   int    `json:"page_no" db:"page_no" bson:"page_no"` //page_no must >= 0
	PageSize int    `json:"page_size" db:"page_size" bson:"page_size"`
}

type CustomerListResp struct {
	List []*models.CustomerDO `json:"list"`
}
