diff --git a/backend/docs/swagger.yaml b/backend/docs/swagger.yaml index f2477ed0..cf1f4bc3 100644 --- a/backend/docs/swagger.yaml +++ b/backend/docs/swagger.yaml @@ -3,7 +3,7 @@ definitions: CreateGuest: properties: first_name: - example: John + example: Jane type: string last_name: example: Doe @@ -17,9 +17,6 @@ definitions: type: object CreateUser: properties: - clerk_id: - example: user_123 - type: string department: example: Housekeeping type: string @@ -29,6 +26,9 @@ definitions: first_name: example: John type: string + id: + example: user_123 + type: string last_name: example: Doe type: string @@ -69,7 +69,7 @@ definitions: example: "2024-01-02T00:00:00Z" type: string first_name: - example: John + example: Jane type: string id: example: 530e8400-e458-41d4-a716-446655440000 @@ -219,7 +219,7 @@ definitions: UpdateGuest: properties: first_name: - example: John + example: Jane type: string last_name: example: Doe @@ -233,9 +233,6 @@ definitions: type: object User: properties: - clerk_id: - example: user_123 - type: string created_at: example: "2024-01-01T00:00:00Z" type: string @@ -249,7 +246,7 @@ definitions: example: John type: string id: - example: 550e8400-e29b-41d4-a716-446655440000 + example: user_123 type: string last_name: example: Doe @@ -401,6 +398,40 @@ paths: summary: Updates a guest tags: - guests + /api/v1/hotels: + post: + consumes: + - application/json + description: Create a new hotel with the given data + parameters: + - description: Hotel data + in: body + name: hotel + required: true + schema: + $ref: '#/definitions/Hotel' + produces: + - application/json + responses: + "201": + description: Created + schema: + $ref: '#/definitions/Hotel' + "400": + description: Bad Request + schema: + additionalProperties: + type: string + type: object + "500": + description: Internal Server Error + schema: + additionalProperties: + type: string + type: object + summary: Create hotel + tags: + - hotels /api/v1/hotels/{id}: get: description: Retrieve a hotel's details using its UUID @@ -499,40 +530,6 @@ paths: summary: Get personalized hello message tags: - hello - /hotel: - post: - consumes: - - application/json - description: Create a new hotel with the given data - parameters: - - description: Hotel data - in: body - name: hotel - required: true - schema: - $ref: '#/definitions/Hotel' - produces: - - application/json - responses: - "201": - description: Created - schema: - $ref: '#/definitions/Hotel' - "400": - description: Bad Request - schema: - additionalProperties: - type: string - type: object - "500": - description: Internal Server Error - schema: - additionalProperties: - type: string - type: object - summary: Create hotel - tags: - - hotels /request: post: consumes: diff --git a/backend/internal/models/guests.go b/backend/internal/models/guests.go index 6feca2ee..a97d51f6 100644 --- a/backend/internal/models/guests.go +++ b/backend/internal/models/guests.go @@ -7,14 +7,14 @@ type CreateGuest struct { LastName string `json:"last_name" validate:"notblank" example:"Doe"` ProfilePicture *string `json:"profile_picture,omitempty" validate:"omitempty,url" example:"https://example.com/john.jpg"` Timezone *string `json:"timezone,omitempty" validate:"omitempty,timezone" example:"America/New_York"` -} +}//@name CreateGuest type UpdateGuest struct { FirstName string `json:"first_name" validate:"notblank" example:"Jane"` LastName string `json:"last_name" validate:"notblank" example:"Doe"` ProfilePicture *string `json:"profile_picture,omitempty" validate:"omitempty,url" example:"https://example.com/john.jpg"` Timezone *string `json:"timezone,omitempty" validate:"omitempty,timezone" example:"America/New_York"` -} +}//@name UpdateGuest type Guest struct { ID string `json:"id" example:"530e8400-e458-41d4-a716-446655440000"` diff --git a/clients/shared/src/index.ts b/clients/shared/src/index.ts index 9cd67763..0b4f3c26 100644 --- a/clients/shared/src/index.ts +++ b/clients/shared/src/index.ts @@ -37,7 +37,7 @@ export { } from "./api/generated/endpoints/users/users"; export { - usePostHotel, + usePostApiV1Hotels, useGetApiV1HotelsId, } from "./api/generated/endpoints/hotels/hotels"; diff --git a/clients/web/src/components/SideBarWithContent.tsx b/clients/web/src/components/SideBarWithContent.tsx index 0db40d82..cf2d1fe0 100644 --- a/clients/web/src/components/SideBarWithContent.tsx +++ b/clients/web/src/components/SideBarWithContent.tsx @@ -5,7 +5,7 @@ export function SideBarWithContent() { return (
-
+
diff --git a/clients/web/src/components/ui/PageShell.tsx b/clients/web/src/components/ui/PageShell.tsx new file mode 100644 index 00000000..773d68f4 --- /dev/null +++ b/clients/web/src/components/ui/PageShell.tsx @@ -0,0 +1,51 @@ +import type { ReactNode } from 'react' +import { cn } from '@/lib/utils' + +type PageShellProps = { + header: ReactNode + drawer?: ReactNode + drawerOpen?: boolean + children: ReactNode +} + +export function PageShell({ + header, + drawer, + drawerOpen = false, + children, +}: PageShellProps) { + const hasDrawer = !!drawer + + return ( +
+
+
+ {header} +
+ +
+
+ {children} +
+
+
+ + {hasDrawer && ( + + )} +
+ ) +} diff --git a/clients/web/src/routes/_protected/rooms.tsx b/clients/web/src/routes/_protected/rooms.tsx index 7bc07e17..eb589b9f 100644 --- a/clients/web/src/routes/_protected/rooms.tsx +++ b/clients/web/src/routes/_protected/rooms.tsx @@ -1,14 +1,36 @@ import { createFileRoute } from '@tanstack/react-router' -import { GuestPageShell } from '@/components/guests/GuestPageShell' +import { useState } from 'react' +import { PageShell } from '@/components/ui/PageShell' export const Route = createFileRoute('/_protected/rooms')({ component: RoomsPage, }) function RoomsPage() { + const [open, setOpen] = useState(false) return ( - -

Rooms page WIP...

-
+ + Rooms + + + } + drawerOpen={open} + drawer={ +
+

Drawer content

+
+ } + > +
+

Main content goes here.

+
+
) }