Skip to content

apps/api/src/db/repositories/PostgresUserRepository.ts ​

Auto-generated by scripts/generate-file-docs.ts. Do not edit — overwritten on every run.

Purpose ​

PostgresUserRepository — Prisma-backed implementation of UserRepository. First-time Clerk callers land in upsertByExternalUserId. New rows are created with role=VISITOR and status=PENDING_APPROVAL — matching the approval-gated model in docs/internal/design/auth-rbac-design.md ("Member approval workflow"). Subsequent calls update mutable profile fields (display name, email) without ever touching role or status, which are admin-only mutations. Pagination uses cursor-on-id (Prisma cursor + skip:1) to satisfy the shared API pagination contract in lib/pagination.ts. /

Exports ​

  • export class PostgresUserRepository
  • export const userRepository

Imports ​

  • ../../adapters/db

Imported by ​

Heritage Community Hub — Internal. Access restricted via Cloudflare Access + Entra ID.