package model

import (
	"errors"

	"github.com/zeromicro/go-zero/core/stores/sqlx"
)

var ErrNotFound = sqlx.ErrNotFound
var ErrNoRowsUpdate = errors.New("update db no rows change")

// 平台
var PlatformWxMini string = "wxmini"
var PlatformWxH5 string = "wxh5"
var PlatformApp string = "app"
var PlatformH5 string = "h5"
var PlatformAdmin string = "admin"

// 用户授权类型
var UserAuthTypeMobile string = "mobile"
var UserAuthTypeWxMiniOpenID string = "wxmini_openid"
var UserAuthTypeWxh5OpenID string = "wxh5_openid"
var UserAuthTypeUUID string = "uuid"

const (
	OrderStatusPending   = "pending"
	OrderStatusPaid      = "paid"
	OrderStatusFailed    = "failed"
	OrderStatusRefunding = "refunding"
	OrderStatusRefunded  = "refunded"
	OrderStatusClosed    = "closed"
)
const (
	OrderRefundStatusPending = "pending"
	OrderRefundStatusSuccess = "success"
	OrderRefundStatusFailed  = "failed"
	OrderRefundStatusClosed  = "closed"
)
const (
	QueryStatePending    = "pending"
	QueryStateFailed     = "failed"
	QueryStateSuccess    = "success"
	QueryStateProcessing = "processing"
	QueryStateCleaned    = "cleaned"
	QueryStateRefunded   = "refunded"
)

const (
	GrantTypeFace             string = "face"
	AuthorizationGrantTypeSms string = "sms"
)
const (
	AuthorizationStatusPending  = "pending"
	AuthorizationStatusSuccess  = "success"
	AuthorizationStatusFailed   = "failed"
	AuthorizationStatusExpired  = "expired"
	AuthorizationStatusRevoked  = "revoked"
	AuthorizationStatusRejected = "rejected"
)

const (
	AuthorizationFaceStatusPending = "pending"
	AuthorizationFaceStatusSuccess = "success"
	AuthorizationFaceStatusFailed  = "failed"
)

// 系统简化：移除实名认证功能
// const (
// 	AgentRealNameStatusPending  = "pending"
// 	AgentRealNameStatusApproved = "approved"
// 	AgentRealNameStatusRejected = "rejected"
// )

// 用户身份类型
const (
	UserTypeTemp   = 0 // 临时用户
	UserTypeNormal = 1 // 正式用户
	UserTypeAdmin  = 2 // 管理员
)

// 管理员角色编码
const (
	AdminRoleCodeSuper = "SUPER" // 超级管理员
)
