2026-07-10 12:54:45 +00:00
|
|
|
|
package domain
|
|
|
|
|
|
|
|
|
|
|
|
import "errors"
|
|
|
|
|
|
|
|
|
|
|
|
// 密碼政策文案(與 FE password.policy.hint / api.err.400003 一致)
|
|
|
|
|
|
const (
|
|
|
|
|
|
PasswordMinLen = 12
|
|
|
|
|
|
PasswordPolicyEN = "Password must be at least 12 characters with upper, lower, digit, and symbol"
|
|
|
|
|
|
PasswordPolicyZH = "密碼須至少 12 碼,且含大寫、小寫、數字與符號"
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
var (
|
|
|
|
|
|
ErrNotFound = errors.New("member not found")
|
|
|
|
|
|
ErrEmailNotRegistered = errors.New("email not registered")
|
|
|
|
|
|
ErrEmailTaken = errors.New("email already exists")
|
|
|
|
|
|
ErrPhoneTaken = errors.New("phone already exists")
|
|
|
|
|
|
ErrIdentityTaken = errors.New("login identity already bound")
|
|
|
|
|
|
ErrIdentityNotFound = errors.New("login identity not found")
|
|
|
|
|
|
ErrBadPassword = errors.New("invalid credentials")
|
|
|
|
|
|
ErrSuspended = errors.New("account suspended")
|
|
|
|
|
|
ErrUnverified = errors.New("account not verified")
|
|
|
|
|
|
ErrLastAdmin = errors.New("cannot demote or suspend the last active admin")
|
|
|
|
|
|
ErrSelfSuspend = errors.New("cannot suspend yourself")
|
|
|
|
|
|
// ErrWeakPassword — API 400003;Message = PasswordPolicyEN
|
|
|
|
|
|
ErrWeakPassword = errors.New(PasswordPolicyEN)
|
|
|
|
|
|
ErrInvalidCode = errors.New("invalid or expired code")
|
2026-07-15 15:23:59 +00:00
|
|
|
|
ErrCodeRateLimited = errors.New("verification code requested too frequently")
|
2026-07-10 12:54:45 +00:00
|
|
|
|
ErrAlreadyBound = errors.New("already bound")
|
|
|
|
|
|
ErrInvalidPlatform = errors.New("invalid platform")
|
|
|
|
|
|
ErrOAuthFailed = errors.New("oauth verification failed")
|
2026-07-13 03:18:08 +00:00
|
|
|
|
|
|
|
|
|
|
// 邀請網絡(message = FE i18n key invite.err.*)
|
2026-07-15 15:23:59 +00:00
|
|
|
|
ErrInviteAlreadyBound = errors.New("invite.err.alreadyBound")
|
2026-07-13 03:18:08 +00:00
|
|
|
|
ErrInviteCodeRequired = errors.New("invite.err.codeRequired")
|
|
|
|
|
|
ErrInviteCodeNotFound = errors.New("invite.err.codeNotFound")
|
|
|
|
|
|
ErrInviteCodeSelf = errors.New("invite.err.codeSelf")
|
|
|
|
|
|
ErrInviteCycle = errors.New("invite.err.cycle")
|
|
|
|
|
|
ErrInviteSelfParent = errors.New("invite.err.selfParent")
|
|
|
|
|
|
ErrInviteParentMiss = errors.New("invite.err.parentNotFound")
|
|
|
|
|
|
ErrInviteNeedAdmin = errors.New("invite.err.needAdmin")
|
2026-07-10 12:54:45 +00:00
|
|
|
|
)
|