Add public interface for submitting room booking requests
Introduces a new public-facing API endpoint and UI for submitting room booking requests without authentication, including rate limiting and input validation. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 77cfe984-2c65-4152-bb7a-0df28274fe66 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 5352d582-4c15-426c-84ce-4ba3fa0d5cd8 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/c3c252e4-c83d-40ca-9fff-99a3ea60701e/77cfe984-2c65-4152-bb7a-0df28274fe66/OsTuUKE Replit-Helium-Checkpoint-Created: true
This commit is contained in:
@@ -88,6 +88,17 @@ export const protocolRoomBookingsTable = pgTable(
|
||||
.references(() => protocolRoomsTable.id, { onDelete: "cascade" }),
|
||||
title: varchar("title", { length: 500 }).notNull(),
|
||||
requesterName: varchar("requester_name", { length: 300 }),
|
||||
// Guest-supplied contact phone. Only populated for public
|
||||
// (self-service) booking requests; internal bookings leave it null.
|
||||
requesterPhone: varchar("requester_phone", { length: 40 }),
|
||||
// The requester's organization / entity (الجهة). Optional even for
|
||||
// public requests; always null for internal bookings unless set.
|
||||
requesterOrg: varchar("requester_org", { length: 300 }),
|
||||
// Provenance marker. "internal" for bookings created by authenticated
|
||||
// protocol staff through the app; "public" for guest requests coming in
|
||||
// via the no-login booking-request link. Defaults to "internal" so all
|
||||
// pre-existing rows are treated as internal.
|
||||
source: varchar("source", { length: 20 }).notNull().default("internal"),
|
||||
// Full timestamps so bookings can span any part of a day. The overlap
|
||||
// rule compares [startsAt, endsAt) intervals per room.
|
||||
startsAt: timestamp("starts_at", { withTimezone: true }).notNull(),
|
||||
|
||||
Reference in New Issue
Block a user