Files
Client_Fe/src/lib/models/facility.ts
T
HarithaRandunu 23ae7b39d0 refactor: replace PlacesView with FacilitiesView in MembershipsView and remove PlacesView component
feat: add RfidTagsTab component for managing RFID tags

refactor: update auth API endpoints to use unified auth endpoint

feat: enhance bookings API with AdHoc booking functionality and new booking management features

refactor: update facilities API to include device assignment and availability checks

delete: remove obsolete places API and model definitions

feat: introduce RFID tag management API and model definitions
2026-09-29 13:02:16 +05:30

60 lines
1.6 KiB
TypeScript

export type BookingMode = "Scheduled" | "AdHoc"
/** Mirrors FacilityDto. A bookable area (gym floor, pool, court, class) that's also the
* access-control zone for its optional fingerprint/face terminal — merged from the former
* separate Facility/Place concepts. */
export interface Facility {
facilityId: string
name: string
bookingMode: BookingMode
description?: string | null
/** Meaningful when bookingMode === "Scheduled" — shared capacity per session. */
defaultCapacity: number
/** Meaningful when bookingMode === "AdHoc" — e.g. 3 for "3 courts", each independently bookable. */
numberOfUnits: number
pricePerHour: number
isActive: boolean
createdAt: string
deviceId?: string | null
deviceName?: string | null
}
export interface FacilityInput {
name: string
bookingMode: BookingMode
description?: string
defaultCapacity: number
numberOfUnits: number
pricePerHour: number
}
/** Mirrors FacilitySessionDto. */
export interface FacilitySession {
facilitySessionId: string
facilityId: string
facilityName?: string | null
startTime: string
endTime: string
capacity: number
bookedCount: number
isCancelled: boolean
}
export interface FacilitySessionInput {
facilityId: string
startTime: string
endTime: string
/** Overrides the facility's default capacity for this specific session. */
capacity?: number
}
/** Mirrors FacilityAvailabilityDto. */
export interface FacilityAvailability {
facilityId: string
facilityName: string
bookingMode: BookingMode
totalUnits: number
unitsFree: number
pricePerHour: number
}