/**
 * Auth Domain
 *
 * Contains ONLY authentication mechanisms:
 * - Login, Signup, Password Management
 * - Token Management (JWT)
 * - MFA, SSO
 *
 * User entity types are in customer domain (@customer-portal/domain/customer)
 */

// ============================================================================
// Constants & Contract Types
// ============================================================================

export {
  AUTH_ERROR_CODE,
  TOKEN_TYPE,
  GENDER,
  PASSWORD_RESET_CONFIG,
  OTP_CONFIG,
  type AuthErrorCode,
  type TokenTypeValue,
  type GenderValue,
} from "./contract.js";

export type {
  // Request types
  LoginRequest,
  SignupRequest,
  PasswordResetRequest,
  ResetPasswordRequest,
  SetPasswordRequest,
  ChangePasswordRequest,
  LinkWhmcsRequest,
  ValidateSignupRequest,
  UpdateCustomerProfileRequest,
  AccountStatusRequest,
  SsoLinkRequest,
  CheckPasswordNeededRequest,
  RefreshTokenRequest,
  LoginVerifyOtpRequest,
  // Token types
  AuthTokens,
  AuthSession,
  PasswordResetTokenPayload,
  // Response types
  AuthResponse,
  SignupResult,
  PasswordChangeResult,
  SsoLinkResponse,
  CheckPasswordNeededResponse,
  LinkWhmcsResponse,
  LoginOtpRequiredResponse,
  LoginResponse,
  // Error types
  AuthError,
} from "./contract.js";

// ============================================================================
// Schemas (for validation)
// ============================================================================

export {
  // Request schemas
  loginRequestSchema,
  signupInputSchema,
  signupRequestSchema,
  passwordResetRequestSchema,
  passwordResetSchema,
  setPasswordRequestSchema,
  changePasswordRequestSchema,
  linkWhmcsRequestSchema,
  validateSignupRequestSchema,
  updateCustomerProfileRequestSchema,
  updateProfileRequestSchema,
  updateAddressRequestSchema,
  accountStatusRequestSchema,
  ssoLinkRequestSchema,
  checkPasswordNeededRequestSchema,
  refreshTokenRequestSchema,
  loginVerifyOtpRequestSchema,

  // Token schemas
  authTokensSchema,
  authSessionSchema,
  passwordResetTokenPayloadSchema,

  // Response schemas
  authResponseSchema,
  signupResultSchema,
  passwordChangeResultSchema,
  ssoLinkResponseSchema,
  checkPasswordNeededResponseSchema,
  linkWhmcsResponseSchema,
  loginOtpRequiredResponseSchema,
  loginResponseSchema,
} from "./schema.js";

export { buildSignupRequest } from "./helpers.js";

// ============================================================================
// Password Utilities
// ============================================================================

export {
  PASSWORD_REQUIREMENTS,
  checkPasswordStrength,
  getPasswordStrengthDisplay,
  type PasswordRequirementKey,
} from "./forms.js";

// ============================================================================
// RBAC Permissions
// ============================================================================

export {
  PERMISSIONS,
  ROLE_PERMISSIONS,
  hasPermission,
  hasAnyPermission,
  hasAllPermissions,
  getPermissionsForRole,
  type Permission,
} from "./permissions.js";
