package forms

import (
	"google.golang.org/protobuf/types/known/timestamppb"
)

// user in scope and scope role
type ScopeUser struct {
	ID         uint64                 `json:"id,string"`
	Email      string                 `json:"email"`
	FirstName  string                 `json:"first_name"`
	LastName   string                 `json:"last_name"`
	Status     string                 `json:"status"`
	Role       string                 `json:"role"`
	InviteTime *timestamppb.Timestamp `json:"invite_time"`
	LoginTime  *timestamppb.Timestamp `json:"login_time"`
}

type User struct {
	ID          uint64                 `json:"id,string"`
	Email       string                 `json:"email"`
	FirstName   string                 `json:"first_name"`
	LastName    string                 `json:"last_name"`
	Status      string                 `json:"status"`
	PhoneNumber string                 `json:"phone_number"`
	LoginTime   *timestamppb.Timestamp `json:"login_time"`
}

type GetScopeUsersReq struct {
	Pager
	Search string `form:"search" json:"search"` // email like
}
type GetScopeUsersResp struct {
	Total uint64       `json:"total"`
	Items []*ScopeUser `json:"items"`
}

type ListUsersReq struct {
	Pager
	QueryUserParam
}
type ListUsersResp struct {
	Total uint64  `json:"total"`
	Items []*User `json:"items"`
}
type QueryUserParam struct {
	UserId          uint64 `form:"user_id" json:"user_id"`
	Status          string `form:"status" json:"status"`
	EmailLike       string `form:"email_like" json:"email_like"`
	EmailEq         string `form:"email_eq" json:"email_eq"`
	PhoneNumberLike string `form:"phone_number_like" json:"phone_number_like"`
	FirstName       string `form:"first_name" json:"first_name"`
	LastName        string `form:"last_name" json:"last_name"`
}
type Pager struct {
	Page     uint32 `form:"page" json:"page"`
	PageSize uint32 `form:"page_size" json:"page_size"`
	Order    string `form:"order" json:"order"`     //   one of [asc,desc]
	SortBy   string `form:"sort_by" json:"sort_by"` //	 one of [email,invite_time,role,status]
}
