Add Asset table, extend schema for related entities, and update .env setup

- Create `Asset` table with relevant columns and constraints.
- Extend `Organization`, `Building`, `Floor`, `Space`, and `User` tables with new fields referencing `Asset`.
- Add `Reservation` table with foreign key constraints for users and spaces.
- Introduce `.env.example` for environment variable management.
- Update `DOCKER_SETUP.md` with initialization and environment configuration instructions.
main
Pau Costa Ferrer 2026-03-28 19:26:40 +01:00
parent 07e647b582
commit 94709d86d7
3 changed files with 20 additions and 10 deletions

View File

@ -4,9 +4,7 @@
<option name="autoReloadType" value="SELECTIVE" />
</component>
<component name="ChangeListManager">
<list default="true" id="6c8b3c54-eabb-40e5-967f-c7b594c750bc" name="Changes" comment="Migrate Prisma seed configuration to `prisma.config.ts` and update API Dockerfile&#10;&#10;- Move `prisma.seed` from `package.json` to new `prisma.config.ts`.&#10;- Modify API Dockerfile to include `prisma.config.ts` in the build process.">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
</list>
<list default="true" id="6c8b3c54-eabb-40e5-967f-c7b594c750bc" name="Changes" comment="Add Asset table, extend schema for related entities, and update .env setup&#10;&#10;- Create `Asset` table with relevant columns and constraints.&#10;- Extend `Organization`, `Building`, `Floor`, `Space`, and `User` tables with new fields referencing `Asset`.&#10;- Add `Reservation` table with foreign key constraints for users and spaces.&#10;- Introduce `.env.example` for environment variable management.&#10;- Update `DOCKER_SETUP.md` with initialization and environment configuration instructions." />
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@ -127,7 +125,7 @@
<updated>1774643312599</updated>
<workItem from="1774643313611" duration="74000" />
<workItem from="1774643422240" duration="5278000" />
<workItem from="1774706361502" duration="15401000" />
<workItem from="1774706361502" duration="15706000" />
</task>
<task id="LOCAL-00001" summary="Initialize Hot Desking app with web and API services &#10;&#10;- Set up SvelteKit for the web interface with Tailwind CSS. &#10;- Build the API using NestJS with Prisma ORM for database interaction. &#10;- Add environment variable management and docker-compose for PostgreSQL and PgAdmin instances. &#10;- Create shared data models for consistent typing across services. &#10;- Establish basic routing and layouts for web and API services.">
<option name="closed" value="true" />
@ -409,7 +407,15 @@
<option name="project" value="LOCAL" />
<updated>1774721058640</updated>
</task>
<option name="localTasksCounter" value="36" />
<task id="LOCAL-00036" summary="Add Asset table, extend schema for related entities, and update .env setup&#10;&#10;- Create `Asset` table with relevant columns and constraints.&#10;- Extend `Organization`, `Building`, `Floor`, `Space`, and `User` tables with new fields referencing `Asset`.&#10;- Add `Reservation` table with foreign key constraints for users and spaces.&#10;- Introduce `.env.example` for environment variable management.&#10;- Update `DOCKER_SETUP.md` with initialization and environment configuration instructions.">
<option name="closed" value="true" />
<created>1774722075446</created>
<option name="number" value="00036" />
<option name="presentableId" value="LOCAL-00036" />
<option name="project" value="LOCAL" />
<updated>1774722075446</updated>
</task>
<option name="localTasksCounter" value="37" />
<servers />
</component>
<component name="TypeScriptGeneratedFilesManager">
@ -427,7 +433,6 @@
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="Enhance real-time space status updates and handling&#10;&#10;- Improve WebSocket connection reliability with updated transport options.&#10;- Introduce logic to prioritize real-time updates over initial data for live views.&#10;- Add logging for better debugging of WebSocket events and data propagation.&#10;- Update UI components (`SpaceCard`, `FloorplanViewer`) to avoid overwrites from stale data.&#10;- Refactor date handling for consistent behavior across components." />
<MESSAGE value="Fix ownership checks and improve delete booking button UI&#10;&#10;- Update `isOwner` logic to account for nested user objects in reservation data.&#10;- Enhance delete button styling for better visibility and usability." />
<MESSAGE value="Add organization management with logo support&#10;&#10;- Introduce `OrganizationsModule` with related logic in `AppModule`.&#10;- Update Prisma schema to include `logoUrl` field for organizations.&#10;- Enhance seeds to include default organization logo.&#10;- Update layout to dynamically display organization details, including logo and name.&#10;- Add UI support for organization-based navigation in admin routes." />
<MESSAGE value="Add organization management with logo support&#10;&#10;- Implement organization settings page (`+page.svelte`) for updating organization name and logo.&#10;- Create backend APIs for retrieving and updating organization details with role-based access control.&#10;- Add `OrganizationsModule`, `OrganizationsService`, and DTOs for input validation in NestJS.&#10;- Update Prisma schema to include `logoUrl` field for organizations.&#10;- Enhance navigation to dynamically display organization logo and name." />
@ -452,6 +457,7 @@
<MESSAGE value="Add health checks for dependent services and automate DB migrations in API Dockerfile&#10;&#10;- Configure `healthcheck` for the PostgreSQL service in `docker-compose.yml`.&#10;- Update service dependencies to use `condition: service_healthy` for PostgreSQL.&#10;- Modify API Dockerfile to run `npx prisma migrate deploy` before starting the application." />
<MESSAGE value="Add organization details to schema and update PostgreSQL health check&#10;&#10;- Add `language`, `logoId`, and `logoUrl` columns to the `Organization` table with relevant constraints and indexes.&#10;- Update `docker-compose.yml` to support dynamic environment variables in PostgreSQL health check." />
<MESSAGE value="Migrate Prisma seed configuration to `prisma.config.ts` and update API Dockerfile&#10;&#10;- Move `prisma.seed` from `package.json` to new `prisma.config.ts`.&#10;- Modify API Dockerfile to include `prisma.config.ts` in the build process." />
<option name="LAST_COMMIT_MESSAGE" value="Migrate Prisma seed configuration to `prisma.config.ts` and update API Dockerfile&#10;&#10;- Move `prisma.seed` from `package.json` to new `prisma.config.ts`.&#10;- Modify API Dockerfile to include `prisma.config.ts` in the build process." />
<MESSAGE value="Add Asset table, extend schema for related entities, and update .env setup&#10;&#10;- Create `Asset` table with relevant columns and constraints.&#10;- Extend `Organization`, `Building`, `Floor`, `Space`, and `User` tables with new fields referencing `Asset`.&#10;- Add `Reservation` table with foreign key constraints for users and spaces.&#10;- Introduce `.env.example` for environment variable management.&#10;- Update `DOCKER_SETUP.md` with initialization and environment configuration instructions." />
<option name="LAST_COMMIT_MESSAGE" value="Add Asset table, extend schema for related entities, and update .env setup&#10;&#10;- Create `Asset` table with relevant columns and constraints.&#10;- Extend `Organization`, `Building`, `Floor`, `Space`, and `User` tables with new fields referencing `Asset`.&#10;- Add `Reservation` table with foreign key constraints for users and spaces.&#10;- Introduce `.env.example` for environment variable management.&#10;- Update `DOCKER_SETUP.md` with initialization and environment configuration instructions." />
</component>
</project>

View File

@ -20,9 +20,10 @@ COPY shared ./shared
# Build the app
WORKDIR /app/apps/web
# We need VITE_API_BASE_URL at build time for SvelteKit static replacements if any,
# but usually it's better to use dynamic env vars if possible.
# For now, let's assume it can be provided during build or we use the default.
ARG VITE_API_BASE_URL
ARG ORIGIN
ENV VITE_API_BASE_URL=$VITE_API_BASE_URL
ENV ORIGIN=$ORIGIN
RUN npm run build
# ---

View File

@ -38,6 +38,9 @@ services:
build:
context: .
dockerfile: apps/web/Dockerfile
args:
VITE_API_BASE_URL: ${VITE_API_BASE_URL:-http://localhost:3000}
ORIGIN: ${WEB_ORIGIN:-http://localhost:5173}
container_name: hotdesking_web
restart: unless-stopped
ports: