Skip to main content

Interface: FacilityShelfData

Defined in: src/server/services/invoice/weeklyRun.ts:373

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:378


city​

city: string | null

Defined in: src/server/services/invoice/weeklyRun.ts:376


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:386


contractors​

contractors: object[]

Defined in: src/server/services/invoice/weeklyRun.ts:394

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:374


invoices​

invoices: object[]

Defined in: src/server/services/invoice/weeklyRun.ts:406

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:375


pausedFrom​

pausedFrom: string | null

Defined in: src/server/services/invoice/weeklyRun.ts:403

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:404


positions​

positions: string[]

Defined in: src/server/services/invoice/weeklyRun.ts:393


primaryContact​

primaryContact: { email: string | null; name: string | null; phone: string | null; role: string; } | null

Defined in: src/server/services/invoice/weeklyRun.ts:380


renewalDue​

renewalDue: boolean

Defined in: src/server/services/invoice/weeklyRun.ts:400


state​

state: string | null

Defined in: src/server/services/invoice/weeklyRun.ts:377


zip​

zip: string | null

Defined in: src/server/services/invoice/weeklyRun.ts:379