// 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")
	ErrStepUpNotFound    = fmt.Errorf("member: step-up session not found or expired")
	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")
)
