Function: materializeEnrollment()
materializeEnrollment(
svc,companyId,enrollment,steps?):Promise<number>
Defined in: src/server/services/facility-cadence.ts:48
Generate any missing tasks for an enrollment (idempotent via UNIQUE(enrollment_id, step_no)) and
write back its progress. steps is passed when the caller already has them (enroll path); the
cron passes them from a per-sequence cache. Returns the number of new tasks created.
Parameters
svc
SupabaseClient
companyId
string
enrollment
id
string
sequenceId
string
startDateIso
string
steps?
CadenceStep[]
Returns
Promise<number>