/**
 * @i-learned/db — persistence layer.
 *
 * Implements the ports declared in @i-learned/core and exposes the generated
 * Prisma client. Nothing here contains business rules: policy decisions live in
 * `core`, and this package only stores and retrieves (ARCHITECTURE.md §2).
 */

export {
  prisma,
  withTransaction,
  isUniqueConstraintError,
  isNotFoundError,
  isAppendOnlyViolation,
  Prisma,
  type Db,
  type PrismaTransaction,
  type TransactionOptions,
} from './client';

/**
 * Prisma enums, re-exported by name.
 *
 * `export *` cannot be used here: the generated client is CommonJS, so a
 * wildcard re-export forces the bundler to resolve its exports at runtime and
 * emit a warning. Naming them also documents exactly what the rest of the
 * application is allowed to depend on.
 */
export {
  AddressType,
  AdmissionDecisionType,
  ApplicantType,
  ApplicationStatus,
  AssessmentStatus,
  AuditAction,
  CivilStatus,
  ClearanceStatus,
  ClearanceStepStatus,
  CommunicationChannel,
  CommunicationDirection,
  DayOfWeek,
  DegreeLevel,
  DocumentRequestStatus,
  EmploymentType,
  EnrollmentItemStatus,
  EnrollmentStatus,
  EnrollmentType,
  ExamBookingStatus,
  ExamMode,
  ExamOutcome,
  FeeCategory,
  FeeComputation,
  GradeChangeStatus,
  GradeChangeType,
  GradeSheetStatus,
  ImportStatus,
  ImportType,
  InterviewMode,
  InterviewRecommendation,
  InterviewStatus,
  InterviewType,
  LeadActivityType,
  LeadStage,
  MfaType,
  Modality,
  NotificationCategory,
  PaymentPlanStatus,
  PaymentStatus,
  PrerequisiteType,
  ProfileUpdateStatus,
  ReleaseMode,
  RequirementStatus,
  ReversalType,
  RoomType,
  ScanVerdict,
  SchoolLevel,
  SecurityEventType,
  SettingValueType,
  SexAtBirth,
  StudentStatus,
  TermType,
  TransferCreditDecision,
  TransferEvaluationStatus,
} from '@prisma/client';

/** Model row types, for services and query result shapes. */
export type {
  PrismaClient,
  Application,
  ApplicantProfile,
  Assessment,
  AssessmentLine,
  Clearance,
  ClearanceStep,
  College,
  Course,
  Curriculum,
  CurriculumVersion,
  DocumentRequest,
  Enrollment,
  EnrollmentItem,
  ExamBooking,
  ExamSchedule,
  FacultyProfile,
  FeeDefinition,
  FeeSchedule,
  Grade,
  GradeScale,
  GradeSheet,
  Institution,
  Interview,
  Lead,
  Payment,
  Permission,
  Program,
  Role,
  Room,
  SectionOffering,
  Student,
  Term,
  User,
} from '@prisma/client';

export { centavosToDecimal, decimalToCentavos, decimalToNumber, numberToDecimal } from './money';
export { PrismaAuditWriter, diffForAudit } from './audit';
export {
  SettingsService,
  createSettingsService,
  SETTING_KEYS,
  type SettingKey,
} from './settings';
export {
  nextSequenceValue,
  nextApplicationReference,
  nextStudentNumber,
  nextPaymentNumber,
  nextDocumentRequestNumber,
  nextAssessmentNumber,
  nextCorNumber,
  type SequenceName,
} from './sequences';
export {
  Argon2PasswordHasher,
  passwordHasher,
  checkPasswordStrength,
  ARGON2_OPTIONS,
  PASSWORD_POLICY,
  type PasswordCheck,
} from './password';
