Skip to content

apps/api/src/features/homeschool/homeschool.service.ts ​

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

Purpose ​

HomeschoolService — enrollment, academic records, and education resources for the homeschool education portal. Authority model: - enrollStudent: any authenticated parent may enroll a child in their own family. The child must have accountType=CHILD and must belong to the SAME FamilyGroup as the guardian. The enrollment is created in PENDING status and an ApprovalWorkflow row (MEMBER_JOIN) is opened so a minister can approve it through the existing approval queue. - approveEnrollment: requires MINISTRY_LEADER or ADMIN. Sets status to ACTIVE and stamps enrolledAt. - listEnrollments / getEnrollment: ministry_leader+ see everything; ordinary members only see enrollments where they are the guardian. - addRecord: the enrollment's guardian OR ministry_leader+ may write a per-term per-subject academic record. - listResources: any authenticated member may browse (paginated). - createResource / deleteResource: ministry_leader+ only. - getResourceDownloadUrl: any authenticated member may request a short-lived signed URL (or the bare externalUrl for link-type resources). The download counter is incremented on every issuance. Audit: Every mutating operation writes an AuditLog row best-effort — failures are logged but do not break the transaction. /

Exports ​

  • export interface ListEnrollmentsParams
  • export interface ListEnrollmentsResult
  • export interface ListResourcesParams
  • export interface ListResourcesResult
  • export interface DownloadUrlResult
  • export class HomeschoolService
  • export const homeschoolService

Imports ​

  • ../../adapters/db
  • ../../lib/errors
  • ../../lib/logger
  • ../../lib/pagination
  • ../../middleware/requireAuth
  • @prisma/client

Imported by ​

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