Commit Graph

30 Commits (9315502369434c3a7372a3235fc4f93ff5e80e93)

Author SHA1 Message Date
Pau Costa Ferrer 9315502369 Exclude Prisma directory from API build configuration 2026-03-28 18:47:36 +01:00
Pau Costa Ferrer ca553115b8 Remove redundant node_modules copy in API Dockerfile 2026-03-28 18:41:38 +01:00
Pau Costa Ferrer 9e2476049d Update reservations logic to handle non-nullable fields and type adjustments
- Adjust `userId` handling in update DTO logic to allow undefined instead of null.
- Cast certain fields to `any` to handle edge cases in type compatibility.
- Extend Prisma imports to include `Role` for future role-based logic enhancements.
2026-03-28 18:40:02 +01:00
Pau Costa Ferrer 604d4c7244 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`.
2026-03-28 18:26:47 +01:00
Pau Costa Ferrer 0b6a043f19 Prevent past bookings and updates across web and API
- Add validation logic to block creating or updating reservations in the past.
- Update date pickers to enforce minimum selectable date as today.
- Extend i18n files (`en.json`, `es-ES.json`) with new error messages.
- Refine UI to disable interaction with past time slots and display appropriate messages.
2026-03-28 18:19:57 +01:00
Pau Costa Ferrer 9ac64de030 Refactor date picker components for improved accessibility and usability
- Add `showPicker` event to trigger native date picker overlays.
- Adjust z-index and positioning for hidden `input` elements to improve interaction.
- Reorganize markup for consistent focus and selection behavior across components.
2026-03-28 18:17:30 +01:00
Pau Costa Ferrer 6e48763947 Add filtering for past and upcoming bookings in "My Bookings" page
- Enhance UI to separate upcoming and past bookings with collapsible sections.
- Add new i18n keys for handling booking filters (`en.json`, `es-ES.json`).
- Update booking component logic to filter reservations based on time.
- Introduce "Show/Hide Past Bookings" toggle for improved user experience.
2026-03-28 18:14:51 +01:00
Pau Costa Ferrer fa93fc0ac6 Improve real-time space status handling and date-based resets
- Add logic to clear real-time updates when the selected date changes.
- Enhance space status updates to consider reservation time ranges for relevance.
- Update relevant Svelte components (`SpaceCard`, `FloorplanViewer`) to handle date-sensitive real-time updates.
- Update API to include reservation details in `space_status_changed` events for improved update precision.
2026-03-28 18:12:17 +01:00
Pau Costa Ferrer 93bd2808ac Add seed service to initialize default admin and organization
- Implement `SeedService` to create a default admin account and organization on app startup.
- Update `PrismaModule` to include `SeedService` as a provider.
- Remove seeded credentials display from login page.
- Refactor existing seed script for consistency with the new service.
2026-03-28 18:07:22 +01:00
Pau Costa Ferrer 5fe893c7ce Add i18n integration and translations for improved localization
- Extend English (`en.json`) and Spanish (`es-ES.json`) locale files with additional keys for buildings, bookings, reports, and user management.
- Update Svelte components and pages to use `svelte-i18n` for dynamic translations across the app.
- Refactor labels, titles, and error messages for multilingual support.
- Improve date formatting based on locale preferences.
2026-03-28 17:58:24 +01:00
Pau Costa Ferrer e03335be67 Add rotation support for spaces in floorplan editor
- Extend `Space` model and Prisma schema to include `rotation` property.
- Update API services and DTOs to handle rotation data.
- Add UI controls in `FloorplanEditor.svelte` for rotating spaces.
- Refactor space rendering logic in both editor and viewer to support rotation.
2026-03-28 17:47:32 +01:00
Pau Costa Ferrer 4bc2454f44 Add Docker deployment support for API and Web services
- Add Dockerfiles for API and Web apps with multi-stage builds.
- Configure `docker-compose.yml` to manage services (Postgres, API, Web, pgAdmin).
- Add `.dockerignore` for optimized builds.
- Include `DOCKER_SETUP.md` for deployment steps and guidance.
2026-03-28 17:39:43 +01:00
Pau Costa Ferrer 71404d0ed8 Add i18n support with English and Spanish translations
- Introduce `svelte-i18n` for internationalization.
- Add English (`en.json`) and Spanish (`es-ES.json`) locale files.
- Implement `setupI18n` function for initializing and managing locales.
- Update project dependencies to include `svelte-i18n`.
2026-03-28 17:34:13 +01:00
Pau Costa Ferrer e80984faa1 Add user profile management with avatar upload and update support
- Create `+page.svelte` for managing user profiles, including name, avatar, and password updates.
- Add `Avatar.svelte` component for rendering user avatars with Gravatar and fallback initials support.
- Implement backend APIs for fetching and updating user profiles (`/users/profile`).
- Add support for avatar uploads with file validation (max size: 5MB).
- Update `FloorplanViewer.svelte` to display user names and avatars in reservations.
- Introduce utilities for Gravatar URLs and user avatar management (`getGravatarUrl`, `getInitials`).
2026-03-28 17:22:57 +01:00
Pau Costa Ferrer 2bab9da7c8 Add assets module with file upload and retrieval support
- Introduce `AssetsModule` with APIs for uploading and retrieving organization logos, building images, and floor plans.
- Implement file validation for type and size (10MB max).
- Add `resolveAssetUrl` utility for generating absolute asset URLs.
- Enhance admin UI components to support image file uploads and previews.
- Update Prisma schema to associate assets with organizations, buildings, and floors.
- Modify existing update logic to clear references when external URLs are used.
2026-03-28 17:10:22 +01:00
Pau Costa Ferrer b618c10cdd Add organization management with logo support
- Implement organization settings page (`+page.svelte`) for updating organization name and logo.
- Create backend APIs for retrieving and updating organization details with role-based access control.
- Add `OrganizationsModule`, `OrganizationsService`, and DTOs for input validation in NestJS.
- Update Prisma schema to include `logoUrl` field for organizations.
- Enhance navigation to dynamically display organization logo and name.
2026-03-28 16:40:24 +01:00
Pau Costa Ferrer 56c52bfcc7 Fix ownership checks and improve delete booking button UI
- Update `isOwner` logic to account for nested user objects in reservation data.
- Enhance delete button styling for better visibility and usability.
2026-03-28 16:29:03 +01:00
Pau Costa Ferrer 453fe68e42 Enhance real-time space status updates and handling
- Improve WebSocket connection reliability with updated transport options.
- Introduce logic to prioritize real-time updates over initial data for live views.
- Add logging for better debugging of WebSocket events and data propagation.
- Update UI components (`SpaceCard`, `FloorplanViewer`) to avoid overwrites from stale data.
- Refactor date handling for consistent behavior across components.
2026-03-28 16:27:23 +01:00
Pau Costa Ferrer 1b3c3044ca Add building and floor management with admin editor modal
- Implement `BuildingEditorModal.svelte` for creating, editing, and deleting buildings and floors.
- Add `CreateBuildingDto`, `UpdateBuildingDto`, `CreateFloorDto`, and `UpdateFloorDto` for validation.
- Extend `SpacesService` and `SpacesController` with endpoints for building and floor CRUD operations.
- Update Prisma schema to include building descriptions and image URLs, and floor names.
- Enhance dashboard with building management functionality for admin users.
2026-03-28 16:22:36 +01:00
Pau Costa Ferrer 165cd76b6f Add "My Bookings" page and enable reservation updates and cancellations
- Implement `+page.svelte` for managing user reservations with real-time updates.
- Add API endpoints for updating and canceling reservations with enhanced validation and authorization.
- Introduce `UpdateReservationDto` for refined reservation update handling.
- Update `reservations.service.ts` to handle overlapping checks, time adjustments, and admin actions.
- Extend layout to include a link to the "My Bookings" page.
- Add `date-fns` library for date formatting.
2026-03-28 16:16:27 +01:00
Pau Costa Ferrer b3d7e4195f Add user management and registration features with invite-based onboarding
- Implement `+page.svelte` for admin user management, allowing role updates, password resets, and invite link generation.
- Add `+page.svelte` for user registration using invite tokens.
-
2026-03-28 16:11:10 +01:00
Pau Costa Ferrer 30d3ab0686 Add admin reporting dashboard with utilization statistics and downloadable reports
- Implement `+page.svelte` for admin reporting dashboard showing utilization and employee stats.
- Add API endpoints for utilization stats, employee stats, and Excel report export (NestJS).
- Create `ReportsService` and `ReportsModule` for backend logic.
- Introduce `xlsx` package for generating Excel reports.
- Update layout to include "Reports" link for admin users.
- Extend Prisma querying for detailed building, space type, and employee role data.
2026-03-28 16:06:05 +01:00
Pau Costa Ferrer 89fdbf6617 Add support for space resizing and enhanced layout management
- Update `SpacesService` to handle width and height properties for spaces.
- Introduce `UpdateSpaceDto` for improved validation in batch update operations.
- Extend `FloorplanEditor.svelte` and `FloorplanViewer.svelte` to support dynamic container scaling and space resizing.
- Modify Prisma schema to include `width` and `height` fields for spaces.
- Enhance floorplan rendering to maintain proportional layout during editing and viewing.
2026-03-28 15:53:33 +01:00
Pau Costa Ferrer 45e42c3d37 Add booking modal and enhance reservation handling
- Create `BookingModal.svelte` for booking spaces with custom time slots or full-day durations.
- Add API endpoint to fetch reservations by space ID and date.
- Update `SpacesService` with enhanced validation rules and conflict checks for reservations.
- Extend WebSocket updates to include reservation data for real-time synchronization.
- Enable date-based filtering and status handling in UI components (`SpaceCard.svelte`, `FloorplanViewer.svelte`).
2026-03-28 15:33:34 +01:00
Pau Costa Ferrer f8af8cf2d7 Add building-level dashboard and interactive floorplan viewer
- Create `+page.svelte` for building-level dashboard with floor selection and layout preview.
- Add `FloorplanViewer.svelte` component with WebSocket integration for real-time space status updates.
- Extend `SpacesService` and API endpoints for building floors and floor details retrieval.
- Update dashboard UI with cleaner building and floor presentation.
- Improve loading states and error handling across dashboard and floor pages.
2026-03-28 15:20:17 +01:00
Pau Costa Ferrer 7683066ceb Add floorplan editor for admin layout management
- Implement `FloorplanEditor.svelte` component for adding, editing, and positioning spaces.
- Add backend support for floorplan image upload and batch updating space positions.
- Update Prisma schema to include `planImageUrl` for floors.
- Enable API proxy in Vite configuration for straightforward local development.
- Refactor API calls to use a centralized `apiFetch` utility with token handling.
2026-03-28 15:15:28 +01:00
Pau Costa Ferrer 3b09daeb04 Add real-time space status updates and reservation management
- Integrate WebSocket functionality using `socket.io` for floor-specific updates.
- Implement `ReservationsModule` with CRUD for managing reservations (API).
- Create `LoggerMiddleware` for consistent HTTP request logging.
- Update `SpacesService` to include real-time reservation status checks.
- Add `SpaceCard.svelte` component to reflect live space status (Web).
- Enable environmental base API URL configuration for flexible deployments.
2026-03-28 00:50:51 +01:00
Pau Costa Ferrer 8dc99bc1a4 Implement authentication, organization management, and floor layout features
- Add API authentication with JWT strategy using NestJS.
- Configure Prisma schema for organizations, users, buildings, floors, and spaces.
- Seed initial database with test data and relationships.
- Build SvelteKit web pages for dashboard and floor layout with secured routing and organization hierarchy display.
- Remove deprecated `AppService` from API.
2026-03-28 00:36:05 +01:00
Pau Costa Ferrer 398752ad4d Remove compiled API files from version control
- Deleted compiled JavaScript files, type definitions, and source maps from the `dist` folder.
2026-03-28 00:25:09 +01:00
Pau Costa Ferrer 1faa0d5c8f Initialize Hot Desking app with web and API services
- Set up SvelteKit for the web interface with Tailwind CSS.
- Build the API using NestJS with Prisma ORM for database interaction.
- Add environment variable management and docker-compose for PostgreSQL and PgAdmin instances.
- Create shared data models for consistent typing across services.
- Establish basic routing and layouts for web and API services.
2026-03-28 00:06:57 +01:00