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
This commit is contained in:
2026-09-29 13:02:16 +05:30
parent a1b870fa8a
commit 23ae7b39d0
18 changed files with 1906 additions and 915 deletions
+55 -5
View File
@@ -1,10 +1,18 @@
/** Mirrors BookingDto. */
export type BookingStatus = "Confirmed" | "CheckedIn" | "Cancelled" | "NoShow" | "Completed"
/** Mirrors BookingDto. Covers both Scheduled (facilitySessionId set) and AdHoc
* (facilitySessionId null, exclusive-unit) bookings. */
export interface Booking {
bookingId: string
facilitySessionId: string
/** Null for an AdHoc booking — no pre-created session. */
facilitySessionId?: string | null
facilityId: string
facilityName?: string | null
sessionStartTime?: string | null
sessionEndTime?: string | null
bookingMode: "Scheduled" | "AdHoc"
startTime: string
endTime: string
/** Informational headcount, AdHoc only. */
partySize?: number | null
isGuest: boolean
customerId?: string | null
@@ -15,18 +23,60 @@ export interface Booking {
otpCode?: string | null
otpVerified: boolean
rfidTagId?: string | null
rfidTagLabel?: string | null
rfidAssignedAt?: string | null
rfidReturnedAt?: string | null
paymentStatus: string
amountCharged: number
status: string
status: BookingStatus
bookedAt: string
checkedInAt?: string | null
checkedOutAt?: string | null
/** Public, unauthenticated link to this booking's confirmation page. */
shareUrl?: string | null
}
export type GetBookingsFilters = {
facilityId?: string
facilitySessionId?: string
fromDate?: string
toDate?: string
status?: string
}
export interface CreateGuestBookingInput {
facilitySessionId: string
guestName: string
guestPhone: string
}
export interface CreateAdhocBookingInput {
facilityId: string
startTime: string
durationMinutes: number
partySize?: number
}
export interface CreateGuestAdhocBookingInput {
facilityId: string
startTime: string
durationMinutes: number
guestName: string
guestPhone: string
partySize?: number
}
export interface ReassignBookingInput {
guestName?: string
guestPhone?: string
}
/** Exactly one shape applies, matching the booking's current bookingMode. */
export interface RescheduleBookingInput {
startTime?: string
durationMinutes?: number
facilitySessionId?: string
}
+24 -4
View File
@@ -1,21 +1,31 @@
export type FacilityType = "Gym" | "Pool" | "Court" | "Class"
export type BookingMode = "Scheduled" | "AdHoc"
/** Mirrors FacilityDto. */
/** 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
facilityType: FacilityType
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
facilityType: FacilityType
bookingMode: BookingMode
description?: string
defaultCapacity: number
numberOfUnits: number
pricePerHour: number
}
/** Mirrors FacilitySessionDto. */
@@ -37,3 +47,13 @@ export interface FacilitySessionInput {
/** 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
}
-16
View File
@@ -1,16 +0,0 @@
/** Mirrors PlaceDto. A physical access zone (e.g. "Pool Area", "Indoor Gym") with one
* fingerprint/face terminal for now. */
export interface Place {
placeId: string
name: string
description?: string | null
isActive: boolean
createdAt: string
deviceId?: string | null
deviceName?: string | null
}
export interface PlaceInput {
name: string
description?: string
}
+17
View File
@@ -0,0 +1,17 @@
export type RfidTagStatus = "Available" | "InUse" | "Lost" | "Retired"
/** Mirrors RfidTagDto. A managed inventory tag handed to a booked party at check-in
* (Booking.rfidTagId) — staff pick from this list, never free-type a tag. */
export interface RfidTag {
rfidTagId: string
tagCode: string
label?: string | null
status: RfidTagStatus
createdAt: string
updatedAt: string
}
export interface RfidTagInput {
tagCode: string
label?: string
}