Function: uploadFacilityContract()
uploadFacilityContract(
formData):Promise<UploadContractResult>
Defined in: src/server/actions/facilities.ts:555
Upload a facility contract PDF to the private facility-contracts bucket via the SERVICE client.
Storage RLS only passes for a request carrying the admin's Supabase session, which the browser
client doesn't have here (admin auth is server-side) — so a client-side upload fails the bucket's
row-level policy. Per ADR-0004, privileged writes go through the service role behind an explicit
role check, which is exactly this: admin-gated + company-scoped, RLS bypassed.
Parameters
formData
FormData
Returns
Promise<UploadContractResult>