template-monorepo/internal/model/member/domain/errors.go

28 lines
1.4 KiB
Go
Raw Normal View History

2026-05-20 13:03:59 +00:00
// Package domain holds the member module's domain-level definitions
// (errors, redis key helpers, entities, enums, repository/usecase
// interfaces). External callers should import the sub-packages they need;
// this file exposes module-wide sentinels that span layers.
package domain
import "fmt"
// Module-wide sentinel errors. They are intentionally untyped so callers
// wrap them with library/errors.Builder when surfacing to HTTP/RPC layers.
var (
ErrNotFound = fmt.Errorf("member: not found")
ErrChallengeNotFound = fmt.Errorf("member: otp challenge not found")
ErrChallengeLocked = fmt.Errorf("member: otp challenge locked")
ErrInvalidOTP = fmt.Errorf("member: invalid otp code")
ErrResendCooldown = fmt.Errorf("member: resend cooldown active")
ErrDailyLimit = fmt.Errorf("member: daily verification limit exceeded")
ErrTOTPNotEnrolled = fmt.Errorf("member: totp not enrolled")
ErrTOTPEnrollMissing = fmt.Errorf("member: totp enroll secret missing or expired")
ErrTOTPAlreadyEnroll = fmt.Errorf("member: totp already enrolled")
ErrTOTPInvalidCode = fmt.Errorf("member: invalid totp code")
ErrTOTPCodeReplay = fmt.Errorf("member: totp code already used")
2026-05-20 23:51:22 +00:00
ErrDuplicateMember = fmt.Errorf("member: duplicate member")
ErrDuplicateTenant = fmt.Errorf("member: duplicate tenant")
ErrInvalidStatus = fmt.Errorf("member: invalid member status transition")
ErrTenantNotFound = fmt.Errorf("member: tenant not found")
2026-05-20 13:03:59 +00:00
)