Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions booking-app/.eslintignore

This file was deleted.

55 changes: 0 additions & 55 deletions booking-app/.eslintrc.json

This file was deleted.

12 changes: 5 additions & 7 deletions booking-app/app/[tenant]/admin/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ const AdminWithParams: React.FC = () => {
return <Admin calendarEventId={calendarEventId} />;
};

const AdminPage: React.FC = () => {
return (
<Suspense fallback={<div>Loading...</div>}>
<AdminWithParams />
</Suspense>
);
};
const AdminPage: React.FC = () => (
<Suspense fallback={<div>Loading...</div>}>
<AdminWithParams />
</Suspense>
);

export default AdminPage;
1 change: 1 addition & 0 deletions booking-app/app/[tenant]/decline/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use client";

import {
DatabaseContext,
DatabaseProvider,
Expand Down
9 changes: 5 additions & 4 deletions booking-app/app/[tenant]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ const Layout: React.FC<LayoutProps> = async ({ children, params }) => {
if (shouldBypassAuth()) {
tenantSchema = getTestTenantSchema(tenant);
} else {
const { serverGetDocumentById } = await import(
"@/lib/firebase/server/adminDb"
);
const { serverGetDocumentById } =
await import("@/lib/firebase/server/adminDb");
tenantSchema = await serverGetDocumentById<SchemaContextType>(
TableNames.TENANT_SCHEMA,
tenant,
Expand All @@ -54,7 +53,9 @@ const Layout: React.FC<LayoutProps> = async ({ children, params }) => {

// Apply environment-based calendar ID selection
if (tenantSchema.resources && Array.isArray(tenantSchema.resources)) {
tenantSchema.resources = applyEnvironmentCalendarIds(tenantSchema.resources);
tenantSchema.resources = applyEnvironmentCalendarIds(
tenantSchema.resources,
);
}

// Ensure the data is properly serializable
Expand Down
12 changes: 5 additions & 7 deletions booking-app/app/[tenant]/liaison/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@ const LiaisonWithParams: React.FC = () => {
return <Liaison calendarEventId={calendarEventId} />;
};

const LiaisonPage: React.FC = () => {
return (
<Suspense fallback={<div>Loading...</div>}>
<LiaisonWithParams />
</Suspense>
);
};
const LiaisonPage: React.FC = () => (
<Suspense fallback={<div>Loading...</div>}>
<LiaisonWithParams />
</Suspense>
);

export default LiaisonPage;
12 changes: 5 additions & 7 deletions booking-app/app/[tenant]/services/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,10 @@
import Services from "@/components/src/client/routes/services/Services";
import { Suspense } from "react";

const ServicesPage: React.FC = () => {
return (
<Suspense fallback={<div>Loading...</div>}>
<Services />
</Suspense>
);
};
const ServicesPage: React.FC = () => (
<Suspense fallback={<div>Loading...</div>}>
<Services />
</Suspense>
);

export default ServicesPage;
1 change: 1 addition & 0 deletions booking-app/app/[tenant]/signin/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"use client";

import GoogleSignIn from "@/components/src/client/routes/components/GoogleSignIn";

export default function TenantSignInPage() {
Expand Down
2 changes: 1 addition & 1 deletion booking-app/app/[tenant]/super/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ import SuperAdmin from "@/components/src/client/routes/super";

export default function SuperAdminPage() {
return <SuperAdmin />;
}
}
4 changes: 3 additions & 1 deletion booking-app/app/[tenant]/vip/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import WalkInLandingPage from "@/components/src/client/routes/walk-in/DirectLand
import { FormContextLevel } from "@/components/src/types";
import React from "react";

const VIPHomePage: React.FC = () => <WalkInLandingPage formContext={FormContextLevel.VIP} />;
const VIPHomePage: React.FC = () => (
<WalkInLandingPage formContext={FormContextLevel.VIP} />
);

export default VIPHomePage;
16 changes: 12 additions & 4 deletions booking-app/app/[tenant]/walk-in/netid/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ export default function WalkInNetIdPage() {

// Validate that the visitor's NetID is not the same as the requester's NetID
if (requesterNetId && netId === requesterNetId) {
setError("The visitor's NetID cannot be the same as the requester's NetID");
setError(
"The visitor's NetID cannot be the same as the requester's NetID",
);
return;
}

Expand All @@ -84,8 +86,14 @@ export default function WalkInNetIdPage() {
Walk-In NetID
</Typography>

<Typography variant="body2" color="text.secondary" marginBottom={3} textAlign="center">
Enter the NetID of the visitor using the space (not the requester's NetID)
<Typography
variant="body2"
color="text.secondary"
marginBottom={3}
textAlign="center"
>
Enter the NetID of the visitor using the space (not the requester's
NetID)
</Typography>

{error && (
Expand Down Expand Up @@ -116,7 +124,7 @@ export default function WalkInNetIdPage() {
value: /^[a-zA-Z0-9]+$/,
message: "NetID should only contain letters and numbers",
}}
validate={(value) => {
validate={value => {
if (!value) return true; // Required validation is handled separately
const enteredNetId = value.trim().toLowerCase();
if (requesterNetId && enteredNetId === requesterNetId) {
Expand Down
20 changes: 8 additions & 12 deletions booking-app/app/api/approve/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,8 @@ export async function POST(req: NextRequest) {
);

// Add history logging for final approval since XState doesn't handle history
const { serverGetDataByCalendarEventId } = await import(
"@/lib/firebase/server/adminDb"
);
const { serverGetDataByCalendarEventId } =
await import("@/lib/firebase/server/adminDb");
const { TableNames } = await import("@/components/src/policy");
const { BookingStatusLabel } = await import("@/components/src/types");

Expand All @@ -90,9 +89,8 @@ export async function POST(req: NextRequest) {

// Use finalApprove function for complete and consistent processing
try {
const { finalApprove } = await import(
"@/components/src/server/admin"
);
const { finalApprove } =
await import("@/components/src/server/admin");

// finalApprove handles: serverFinalApprove + logging + serverApproveEvent
await finalApprove(id, email, tenant);
Expand Down Expand Up @@ -128,9 +126,8 @@ export async function POST(req: NextRequest) {

// Handle side effects (history logging and email) outside of XState
try {
const { serverFirstApproveOnly } = await import(
"@/components/src/server/admin"
);
const { serverFirstApproveOnly } =
await import("@/components/src/server/admin");

await serverFirstApproveOnly(id, email, tenant);

Expand Down Expand Up @@ -165,9 +162,8 @@ export async function POST(req: NextRequest) {
);

// Add history logging for Services Request transition
const { serverGetDataByCalendarEventId } = await import(
"@/lib/firebase/server/adminDb"
);
const { serverGetDataByCalendarEventId } =
await import("@/lib/firebase/server/adminDb");
const { TableNames } = await import("@/components/src/policy");
const { BookingStatusLabel } = await import("@/components/src/types");

Expand Down
5 changes: 4 additions & 1 deletion booking-app/app/api/bookings/auto-cancel-declined/route.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import type { SchemaContextType } from "@/components/src/client/routes/components/SchemaProvider";
import { extractTenantFromCollectionName, TableNames } from "@/components/src/policy";
import {
extractTenantFromCollectionName,
TableNames,
} from "@/components/src/policy";
import { callXStateTransitionAPI } from "@/components/src/server/db";
import { Booking, BookingStatusLabel } from "@/components/src/types";
import { getStatusFromXState } from "@/components/src/utils/statusFromXState";
Expand Down
29 changes: 14 additions & 15 deletions booking-app/app/api/bookings/auto-checkout/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,8 @@ export async function GET(request: NextRequest) {

if (booking.xstateData) {
// Check if booking is in "Checked In" state using common helper
const { hasXStateValue, getXStateValue } = await import(
"@/components/src/utils/xstateHelpers"
);
const { hasXStateValue, getXStateValue } =
await import("@/components/src/utils/xstateHelpers");
shouldAutoCheckout = hasXStateValue(booking, "Checked In");
const currentXStateValue = getXStateValue(booking);

Expand Down Expand Up @@ -304,7 +303,8 @@ export async function GET(request: NextRequest) {
},
{ status: 200 },
);
} else if (totalUpdatedCount > 0) {
}
if (totalUpdatedCount > 0) {
return NextResponse.json(
{
message: `Successfully auto-checked out ${totalUpdatedCount} bookings across all tenants.`,
Expand All @@ -313,18 +313,17 @@ export async function GET(request: NextRequest) {
},
{ status: 200 },
);
} else {
BookingLogger.debug("No bookings met time criteria across all tenants", {
processedTenants: TENANT_COLLECTIONS,
});
return NextResponse.json(
{
message: "No bookings met the time criteria for auto-checkout.",
mode: "production",
},
{ status: 200 },
);
}
BookingLogger.debug("No bookings met time criteria across all tenants", {
processedTenants: TENANT_COLLECTIONS,
});
return NextResponse.json(
{
message: "No bookings met the time criteria for auto-checkout.",
mode: "production",
},
{ status: 200 },
);
} catch (error) {
BookingLogger.apiError("GET", "/api/bookings/auto-checkout", {}, error);
// Check if error is an object and has a message property before accessing it
Expand Down
Loading
Loading