Skip to main content

Function: updateFacilityScore()

updateFacilityScore(svc, companyId, facilityId, patch): Promise<void>

Defined in: src/db/queries/pipeline.ts:447

Write a facility's computed score + tier. Scoring is deterministic from its inputs, so last-write- wins is safe; score_updated_at records freshness (the "as of" provenance the UI shows).

Parameters​

svc​

SupabaseClient

companyId​

string

facilityId​

string

patch​

score​

number

tier​

number

Returns​

Promise<void>