# arpan-dey-web/octopi-task-backend architecture

> Architecture diagram of the GitHub repository arpan-dey-web/octopi-task-backend, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-07-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arpan-dey-web/octopi-task-backend
- Repository: https://github.com/arpan-dey-web/octopi-task-backend

## Overview

1. **What this repository is**
   - A TypeScript REST API for a **multi-tenant booking system**.
   - The central boundary is the **organization tenant**: users, resources, and bookings are always scoped to an `organizationId`.

2. **Runtime and startup shape**
   - `src/server.ts` is the process entrypoint: it likely starts the HTTP listener and handles graceful shutdown.
   - `src/app.ts` is the Express application assembly: middleware, route mounting, and global error handling.
   - `src/config/env.ts` validates environment variables at startup, so the app refuses to boot with missing or invalid config.

3. **HTTP/API layer**
   - The API is organized by domain routes under `src/routes/*`.
   - Each route module maps endpoints to a controller, and the controller delegates to a service.
   - Main route groups are: auth, organizations, users, resources, bookings, and availability.

4. **Controller/service split**
   - Controllers in `src/controllers/*` are the thin HTTP adapter layer: request parsing, response shaping, and status codes.
   - Services in `src/services/*` contain the actual business rules and cross-model orchestration.
   - This separation is especially important for bookings, availability generation, and auth flows, which involve multiple models and invariants.

5. **Persistence layer**
   - Data is stored in **MongoDB** via **Mongoose** models in `src/models/*`.
   - The domain entities are `Organization`, `User`, `Resource`, and `Booking`.
   - `src/models/index.ts` likely centralizes model exports and schema wiring.
   - The repository uses **soft deletes** for users/resources and booking cancellation, rather than hard deletion.

6. **Tenant isolation and access control**
   - Authentication middleware in `src/middleware/auth.ts` enforces JWT-based access.
   - Authorization is role-based, with `ORG_ADMIN` and `EMPLOYEE`.
   - Every protected operation must also respect `organizationId`, so users can only see or mutate data in their own tenant.
   - Admin-only operations include organization updates and most user/resource management.

7. **Booking workflow and conflict boundary**
   - `BookingService` is the most domain-critical component.
   - It must validate:
     - resource belongs to the caller’s organization,
     - booking duration falls within policy,
     - booking lies inside working hours,
     - advance booking constraints are met,
     - no overlap/conflict exists with existing bookings.
   - Conflict detection uses booking windows plus buffer time, not just raw start/end times.
   - A booking cancellation is modeled as a status change to `CANCELLED`, not deletion.

8. **Availability engine**
   - `AvailabilityService` computes free time slots from organization working hours, existing bookings, buffer rules, and requested duration.
   - Time calculations use **Luxon** and normalize to **UTC internally**, while still honoring each organization’s IANA timezone.
   - This is a separate read-model style concern: it derives slot availability from booking data rather than storing slots directly.

9. **Auth and identity flows**
   - `AuthService` handles registration, login, token refresh, and profile lookup.
   - Registration creates both an organization and the first admin user in one flow.
   - JWT access and refresh tokens are part of the boundary; password storage uses bcrypt hashing.
   - The auth subsystem is the only path that creates the initial tenant and administrator.

10. **Validation boundary**
   - `src/validation/*` contains Zod schemas for request bodies, params, and queries.
   - `src/middleware/validate.ts` sits between routes and controllers to enforce those schemas.
   - This means malformed payloads are rejected before they reach service logic, keeping business code focused on domain rules.

11. **Error handling and response contract**
   - `src/utils/errors.ts` defines domain-specific errors such as validation, authentication, authorization, conflict, and not-found cases.
   - `src/middleware/errorHandler.ts` converts those errors into consistent HTTP responses.
   - `src/utils/http.ts` likely standardizes response helpers or status handling.
   - In production, internal stack traces are suppressed per the README.

12. **Time and timezone handling**
   - `src/utils/timezone.ts` exists because time is a first-class concern in this domain.
   - Organization-local working hours are interpreted in the organization’s timezone, while stored booking timestamps are normalized to UTC.
   - This boundary is important for both booking validation and availability generation.

13. **API surface by domain**
   - `authRoutes` covers registration/login/token refresh/profile.
   - `organizationRoutes` exposes tenant settings.
   - `userRoutes` and `resourceRoutes` manage tenant-scoped entities with admin restrictions.
   - `bookingRoutes` covers create/list/get/update/cancel.
   - `availabilityRoutes` is a read-only computed endpoint.

14. **Operational and infrastructure boundaries**
   - The app depends on a live MongoDB instance via `src/config/database.ts`.
   - Swagger setup in `src/config/swagger.ts` suggests API documentation is generated or served from the app.
   - Tooling is Node.js + TypeScript + Express 5, with nodemon/ts-node for development and compiled output for production.
   - Graceful shutdown behavior indicates explicit lifecycle management of the HTTP server and database connection.

Main entry points: [`src/app.ts`](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/app.ts) (App), [`src/services/AuthService.ts`](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/services/AuthService.ts) (Auth Service), [`src/models/index.ts`](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/models/index.ts) (Models), [`src/services/BookingService.ts`](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/services/BookingService.ts) (Booking Service)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime"]
  node_server["Server<br/>entrypoint<br/>[server.ts]"]
end

subgraph group_http["HTTP API"]
  node_app["App<br/>[app.ts]"]
  node_authmw["Auth MW<br/>jwt middleware<br/>[auth.ts]"]
  node_validatemw["Validate MW<br/>schema middleware<br/>[validate.ts]"]
  node_errorhandler["Errors<br/>error middleware<br/>[errorHandler.ts]"]
  node_authroutes["Auth Routes<br/>route module<br/>[authRoutes.ts]"]
  node_bookingroutes["Booking Routes<br/>route module<br/>[bookingRoutes.ts]"]
  node_availroutes["Availability Routes<br/>route module"]
  node_orgroutes["Org Routes<br/>route module"]
  node_resourceroutes["Resource Routes<br/>route module<br/>[resourceRoutes.ts]"]
  node_userroutes["User Routes<br/>route module<br/>[userRoutes.ts]"]
  node_authctrl["Auth Ctrl<br/>http controller<br/>[authController.ts]"]
  node_bookingctrl["Booking Ctrl<br/>http controller"]
  node_availctrl["Avail Ctrl<br/>http controller"]
  node_orgctrl["Org Ctrl<br/>http controller"]
  node_resourcectrl["Resource Ctrl<br/>http controller"]
  node_userctrl["User Ctrl<br/>http controller<br/>[userController.ts]"]
end

subgraph group_domain["Domain"]
  node_authsvc["Auth Service<br/>business service<br/>[AuthService.ts]"]
  node_bookingsvc["Booking Service<br/>business service<br/>[BookingService.ts]"]
  node_availsvc["Availability Service<br/>read model"]
  node_orgsvc["Org Service<br/>business service"]
  node_resourcesvc["Resource Service<br/>business service<br/>[ResourceService.ts]"]
  node_usersvc["User Service<br/>business service<br/>[UserService.ts]"]
end

subgraph group_data["Data"]
  node_models[("Models<br/>[index.ts]")]
  node_bookingmodel[("Booking<br/>mongoose schema<br/>[Booking.ts]")]
  node_orgmodel[("Organization<br/>mongoose schema<br/>[Organization.ts]")]
  node_resourcemodel[("Resource<br/>mongoose schema<br/>[Resource.ts]")]
  node_usermodel[("User<br/>mongoose schema<br/>[User.ts]")]
end

subgraph group_support["Support"]
  node_env["Env<br/>config<br/>[env.ts]"]
  node_database[("Database<br/>mongo connection<br/>[database.ts]")]
  node_swagger["Swagger<br/>api docs<br/>[swagger.ts]"]
  node_errors["Errors<br/>[errors.ts]"]
  node_timezone["Timezone<br/>time utils<br/>[timezone.ts]"]
  node_httputils["HTTP Utils<br/>response helpers<br/>[http.ts]"]
end

node_server -->|"boot"| node_app
node_server -->|"connect"| node_database
node_server -->|"load config"| node_env
node_app -->|"use"| node_authmw
node_app -->|"use"| node_validatemw
node_app -->|"use"| node_errorhandler
node_app -->|"expose"| node_swagger
node_app -->|"mount"| node_authroutes
node_app -->|"mount"| node_bookingroutes
node_app -->|"mount"| node_availroutes
node_app -->|"mount"| node_orgroutes
node_app -->|"mount"| node_resourceroutes
node_app -->|"mount"| node_userroutes
node_authroutes -->|"delegate"| node_authctrl
node_bookingroutes -->|"delegate"| node_bookingctrl
node_availroutes -->|"delegate"| node_availctrl
node_orgroutes -->|"delegate"| node_orgctrl
node_resourceroutes -->|"delegate"| node_resourcectrl
node_userroutes -->|"delegate"| node_userctrl
node_authctrl -->|"call"| node_authsvc
node_bookingctrl -->|"call"| node_bookingsvc
node_availctrl -->|"call"| node_availsvc
node_orgctrl -->|"call"| node_orgsvc
node_resourcectrl -->|"call"| node_resourcesvc
node_userctrl -->|"call"| node_usersvc
node_authsvc -->|"use models"| node_models
node_bookingsvc -->|"use models"| node_models
node_availsvc -->|"read bookings"| node_models
node_orgsvc -->|"use models"| node_models
node_resourcesvc -->|"use models"| node_models
node_usersvc -->|"use models"| node_models
node_authsvc -->|"throw"| node_errors
node_bookingsvc -->|"throw"| node_errors
node_availsvc -->|"normalize"| node_timezone
node_bookingsvc -->|"normalize"| node_timezone
node_authsvc -.->|"respond"| node_httputils
node_bookingsvc -->|"persist"| node_bookingmodel
node_authsvc -->|"create tenant"| node_orgmodel
node_authsvc -->|"create admin"| node_usermodel
node_resourcesvc -->|"persist"| node_resourcemodel
node_usersvc -->|"persist"| node_usermodel

click node_server "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/server.ts"
click node_app "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/app.ts"
click node_env "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/config/env.ts"
click node_database "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/config/database.ts"
click node_swagger "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/config/swagger.ts"
click node_authmw "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/middleware/auth.ts"
click node_validatemw "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/middleware/validate.ts"
click node_errorhandler "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/middleware/errorHandler.ts"
click node_authroutes "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/routes/authRoutes.ts"
click node_bookingroutes "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/routes/bookingRoutes.ts"
click node_availroutes "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/routes/availabilityRoutes.ts"
click node_orgroutes "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/routes/organizationRoutes.ts"
click node_resourceroutes "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/routes/resourceRoutes.ts"
click node_userroutes "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/routes/userRoutes.ts"
click node_authsvc "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/services/AuthService.ts"
click node_bookingsvc "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/services/BookingService.ts"
click node_availsvc "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/services/AvailabilityService.ts"
click node_orgsvc "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/services/OrganizationService.ts"
click node_resourcesvc "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/services/ResourceService.ts"
click node_usersvc "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/services/UserService.ts"
click node_models "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/models/index.ts"
click node_bookingmodel "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/models/Booking.ts"
click node_orgmodel "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/models/Organization.ts"
click node_resourcemodel "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/models/Resource.ts"
click node_usermodel "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/models/User.ts"
click node_errors "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/utils/errors.ts"
click node_timezone "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/utils/timezone.ts"
click node_httputils "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/utils/http.ts"
click node_authctrl "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/controllers/authController.ts"
click node_bookingctrl "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/controllers/bookingController.ts"
click node_availctrl "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/controllers/availabilityController.ts"
click node_orgctrl "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/controllers/organizationController.ts"
click node_resourcectrl "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/controllers/resourceController.ts"
click node_userctrl "https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/controllers/userController.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_server toneBlue
class node_app,node_authmw,node_validatemw,node_errorhandler,node_authroutes,node_bookingroutes,node_availroutes,node_orgroutes,node_resourceroutes,node_userroutes,node_authctrl,node_bookingctrl,node_availctrl,node_orgctrl,node_resourcectrl,node_userctrl toneAmber
class node_authsvc,node_bookingsvc,node_availsvc,node_orgsvc,node_resourcesvc,node_usersvc toneMint
class node_models,node_bookingmodel,node_orgmodel,node_resourcemodel,node_usermodel toneRose
class node_env,node_database,node_swagger,node_errors,node_timezone,node_httputils toneIndigo
```

## Components

### Runtime

Process entrypoint and bootstrapping

- [Server](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/server.ts): entrypoint · Starts the HTTP process and handles shutdown · `src/server.ts`

### HTTP API

Express app, routes, controllers, and middleware

- [App](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/app.ts): express app · Assembles middleware, routes, and error handling · `src/app.ts`
- [Auth MW](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/middleware/auth.ts): jwt middleware · JWT authentication and tenant access enforcement · `src/middleware/auth.ts`
- [Validate MW](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/middleware/validate.ts): schema middleware · Applies request validation before controllers · `src/middleware/validate.ts`
- [Errors](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/middleware/errorHandler.ts): error middleware · Maps domain errors to HTTP responses · `src/middleware/errorHandler.ts`
- [Auth Routes](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/routes/authRoutes.ts): route module · Registration, login, refresh, profile · `src/routes/authRoutes.ts`
- [Booking Routes](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/routes/bookingRoutes.ts): route module · Booking create, read, update, cancel endpoints · `src/routes/bookingRoutes.ts`
- [Availability Routes](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/routes/availabilityRoutes.ts): route module · Computed availability endpoint · `src/routes/availabilityRoutes.ts`
- [Org Routes](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/routes/organizationRoutes.ts): route module · Organization settings endpoints · `src/routes/organizationRoutes.ts`
- [Resource Routes](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/routes/resourceRoutes.ts): route module · Tenant resource management endpoints · `src/routes/resourceRoutes.ts`
- [User Routes](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/routes/userRoutes.ts): route module · Tenant user management endpoints · `src/routes/userRoutes.ts`
- [Auth Ctrl](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/controllers/authController.ts): http controller · HTTP adapter for auth flows · `src/controllers/authController.ts`
- [Booking Ctrl](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/controllers/bookingController.ts): http controller · HTTP adapter for booking operations · `src/controllers/bookingController.ts`
- [Avail Ctrl](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/controllers/availabilityController.ts): http controller · HTTP adapter for availability queries · `src/controllers/availabilityController.ts`
- [Org Ctrl](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/controllers/organizationController.ts): http controller · HTTP adapter for organization operations · `src/controllers/organizationController.ts`
- [Resource Ctrl](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/controllers/resourceController.ts): http controller · HTTP adapter for resource operations · `src/controllers/resourceController.ts`
- [User Ctrl](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/controllers/userController.ts): http controller · HTTP adapter for user operations · `src/controllers/userController.ts`

### Domain

Core business services

- [Auth Service](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/services/AuthService.ts): business service · Registration, login, refresh, and profile flows · `src/services/AuthService.ts`
- [Booking Service](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/services/BookingService.ts): business service · Booking rules, conflict checks, and cancellation · `src/services/BookingService.ts`
- [Availability Service](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/services/AvailabilityService.ts): read model · Derives free slots from bookings and working hours · `src/services/AvailabilityService.ts`
- [Org Service](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/services/OrganizationService.ts): business service · Organization settings and tenant management · `src/services/OrganizationService.ts`
- [Resource Service](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/services/ResourceService.ts): business service · Resource lifecycle within an organization · `src/services/ResourceService.ts`
- [User Service](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/services/UserService.ts): business service · Tenant user lifecycle and role management · `src/services/UserService.ts`

### Data

MongoDB models and persistence boundary

- [Models](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/models/index.ts): mongoose models · Central export of Organization, User, Resource, and Booking models · `src/models/index.ts`
- [Booking](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/models/Booking.ts): mongoose schema · Booking persistence and status lifecycle · `src/models/Booking.ts`
- [Organization](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/models/Organization.ts): mongoose schema · Tenant and working-hours data · `src/models/Organization.ts`
- [Resource](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/models/Resource.ts): mongoose schema · Organization-scoped resource data · `src/models/Resource.ts`
- [User](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/models/User.ts): mongoose schema · Organization-scoped user data · `src/models/User.ts`

### Support

Config, validation, and shared utilities

- [Env](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/config/env.ts): config · Validates required environment variables · `src/config/env.ts`
- [Database](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/config/database.ts): mongo connection · MongoDB connection setup and lifecycle · `src/config/database.ts`
- [Swagger](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/config/swagger.ts): api docs · Swagger/OpenAPI configuration · `src/config/swagger.ts`
- [Errors](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/utils/errors.ts): domain errors · Shared validation, auth, conflict, and not-found errors · `src/utils/errors.ts`
- [Timezone](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/utils/timezone.ts): time utils · UTC normalization and organization timezone handling · `src/utils/timezone.ts`
- [HTTP Utils](https://github.com/arpan-dey-web/octopi-task-backend/blob/main/src/utils/http.ts): response helpers · Common response and status helpers · `src/utils/http.ts`

## Connections

- Server → App: boot · Starts the Express application
- Server → Database: connect · Opens and closes MongoDB connection
- Server → Env: load config · Reads validated runtime configuration
- App → Auth MW: use · Protects tenant-scoped routes
- App → Validate MW: use · Validates requests before controllers
- App → Errors: use · Converts domain errors to responses
- App → Swagger: expose · Serves API documentation
- App → Auth Routes: mount · Mounts auth endpoints
- App → Booking Routes: mount · Mounts booking endpoints
- App → Availability Routes: mount · Mounts availability endpoints
- App → Org Routes: mount · Mounts organization endpoints
- App → Resource Routes: mount · Mounts resource endpoints
- App → User Routes: mount · Mounts user endpoints
- Auth Routes → Auth Ctrl: delegate · Routes auth requests to controller
- Booking Routes → Booking Ctrl: delegate · Routes booking requests to controller
- Availability Routes → Avail Ctrl: delegate · Routes availability requests to controller
- Org Routes → Org Ctrl: delegate · Routes organization requests to controller
- Resource Routes → Resource Ctrl: delegate · Routes resource requests to controller
- User Routes → User Ctrl: delegate · Routes user requests to controller
- Auth Ctrl → Auth Service: call · Executes auth business flows
- Booking Ctrl → Booking Service: call · Executes booking business flows
- Avail Ctrl → Availability Service: call · Computes available time slots
- Org Ctrl → Org Service: call · Handles organization operations
- Resource Ctrl → Resource Service: call · Handles resource operations
- User Ctrl → User Service: call · Handles user operations
- Auth Service → Models: use models · Creates and queries auth-related entities
- Booking Service → Models: use models · Reads and writes booking and tenant data
- Availability Service → Models: read bookings · Derives availability from persisted data
- Org Service → Models: use models · Reads and updates organizations
- Resource Service → Models: use models · Reads and updates resources
- User Service → Models: use models · Reads and updates users
- Auth Service → Errors: throw · Uses auth and validation errors
- Booking Service → Errors: throw · Uses conflict and not-found errors
- Availability Service → Timezone: normalize · Converts times between UTC and org timezone
- Booking Service → Timezone: normalize · Evaluates booking windows in tenant timezone
- Auth Service → HTTP Utils: respond · Uses shared response helpers
- Booking Service → Booking: persist · Booking persistence boundary
- Auth Service → Organization: create tenant · Registration creates organization
- Auth Service → User: create admin · Registration creates first admin user
- Resource Service → Resource: persist · Resource persistence boundary
- User Service → User: persist · User persistence boundary
