From 604d4c724485ca8b5498b10ce6632a368c228d5d Mon Sep 17 00:00:00 2001 From: Pau Costa Date: Sat, 28 Mar 2026 18:26:47 +0100 Subject: [PATCH] Allow admins and supervisors to book or update reservations for other users - Add role-based restrictions for booking or updating reservations on behalf of others (Admins/Supervisors only). - Extend reservation DTOs (`CreateReservationDto`, `UpdateReservationDto`) to include `userId` and `note` fields. - Update Prisma schema to allow nullable `userId` and add support for reservation notes. - Enhance API logic to validate permissions and handle ownership changes for reservations. - Improve UI for booking flow; introduce "Book for" options, user search, and reservation notes. - Localize new strings in `en.json` and `es-ES.json`. --- .idea/workspace.xml | 48 ++++- apps/api/prisma/schema.prisma | 5 +- .../dto/create-reservation.dto.ts | 10 +- .../dto/update-reservation.dto.ts | 8 + .../reservations/reservations.controller.ts | 26 ++- .../src/reservations/reservations.service.ts | 35 ++-- .../src/lib/components/BookingModal.svelte | 171 ++++++++++++++++-- apps/web/src/lib/i18n/locales/en.json | 9 + apps/web/src/lib/i18n/locales/es-ES.json | 9 + 9 files changed, 279 insertions(+), 42 deletions(-) diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 28b394f..e86c4ee 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,10 +4,16 @@