Interface: FacilityShelfData
Defined in: src/server/services/invoice/weeklyRun.ts:469
Master-data profile for the facility shelf (the "who/where/what" panel beside the billing detail).
Holds the facility's address, its single chosen primaryContact (billing role preferred, then
admin, then first active contact; null when none), the active contract terms (hourlyRateCents
is integer cents; hours/rate/terms may be null), the distinct positions (service types) staffed,
and one contractors row per assigned contractor with a derived activity status: active when
they logged payable hours this week, else leave if an approved leave overlaps the week, else
no_activity. renewalDue is true when the contract end date or the facility renewal date falls
within the next 90 days (inclusive). Read-only and company-scoped.
Properties
billingAddress
billingAddress:
string|null
Defined in: src/server/services/invoice/weeklyRun.ts:474
city
city:
string|null
Defined in: src/server/services/invoice/weeklyRun.ts:472
contract
contract: {
contractedHours:number|null;endDate:string|null;hourlyRateCents:number|null;paymentTermsDays:number|null;startDate:string|null; } |null
Defined in: src/server/services/invoice/weeklyRun.ts:482
contractors
contractors:
object[]
Defined in: src/server/services/invoice/weeklyRun.ts:490
id
id:
string
name
name:
string
serviceType
serviceType:
string|null
status
status:
"active"|"leave"|"no_activity"
facilityId
facilityId:
string
Defined in: src/server/services/invoice/weeklyRun.ts:470
invoices
invoices:
object[]
Defined in: src/server/services/invoice/weeklyRun.ts:502
The facility's most recent invoices (newest first) for the shelf history list; money in cents.
dueDate
dueDate:
string|null
id
id:
string
number
number:
string|null
paidCents
paidCents:
number
periodEnd
periodEnd:
string|null
periodStart
periodStart:
string|null
status
status:
string
totalCents
totalCents:
number
name
name:
string
Defined in: src/server/services/invoice/weeklyRun.ts:471
pausedFrom
pausedFrom:
string|null
Defined in: src/server/services/invoice/weeklyRun.ts:499
Billing-pause window (ISO dates). pausedFrom null = not paused; pausedUntil null with a
pausedFrom set = paused indefinitely. Drives the shelf's Pause/Resume control.
pausedUntil
pausedUntil:
string|null
Defined in: src/server/services/invoice/weeklyRun.ts:500
positions
positions:
string[]
Defined in: src/server/services/invoice/weeklyRun.ts:489
primaryContact
primaryContact: {
string|null;name:string|null;phone:string|null;role:string; } |null
Defined in: src/server/services/invoice/weeklyRun.ts:476
renewalDue
renewalDue:
boolean
Defined in: src/server/services/invoice/weeklyRun.ts:496
state
state:
string|null
Defined in: src/server/services/invoice/weeklyRun.ts:473
zip
zip:
string|null
Defined in: src/server/services/invoice/weeklyRun.ts:475