Skip to content

Workspace Management

Radch-enko edited this page Jul 24, 2025 · 2 revisions

Workspace Management

This document covers the backend workspace management system, which handles the organization and tracking of physical workspaces within the Effective Office platform. The workspace module provides APIs for retrieving workspace information, managing workspace zones and utilities, and integrating with the booking system for availability checking.

For information about the booking workflow and calendar integration, see [Booking Management](Booking Management). For details about the client-side workspace display and selection, see [Room Display & Slot Management](Room Display and Slot Management).

Architecture Overview

The workspace module follows a layered architecture with clear separation between web, service, and data access layers:

Workspace Module Architecture

workspace-module-architecture.svg

Data Model Structure

The workspace system is built around several core entities that represent the physical office layout and amenities:

Entity Relationship Diagram

entity-relationship-diagram.svg

Core Entities

Entity Purpose Key Fields
WorkspaceEntity Represents physical meeting rooms and workspaces id, name, tag, zone_id
WorkspaceZoneEntity Logical grouping of workspaces by location id, name
UtilityEntity Equipment and amenities available in workspaces id, name, icon_url
WorkspaceUtilityEntity Links workspaces to utilities with quantities workspace_id, utility_id, count

REST API Endpoints

The WorkspaceController exposes the following REST endpoints for workspace operations:

API Endpoint Structure

api-endpoint-structure.svg

Primary Endpoints

Method Path Purpose Parameters
GET /v1/workspaces/{id} Retrieve single workspace by ID id (UUID)
GET /v1/workspaces Retrieve workspaces by tag with optional booking data workspace_tag, with_bookings_from, with_bookings_until
GET /v1/workspaces/zones Retrieve all workspace zones None

The controller integrates with BookingService to include booking information when time range parameters are provided in the workspace query.

Service Layer Operations

The WorkspaceService implements the WorkspaceDomainService interface and provides core business logic:

Service Operations Flow

service-operations-flow.svg

Key Service Methods

Method Return Type Purpose
findById(UUID) Workspace? Retrieve workspace by unique identifier
findAllByTag(String) List<Workspace> Filter workspaces by type (e.g., "meeting", "desk")
findAllZones() List<WorkspaceZone> Get all organizational zones
findCalendarIdByWorkspaceId(UUID) CalendarId? Map workspace to Google Calendar ID

All service methods use @Transactional(readOnly = true) for optimal database performance.

Calendar Integration

The workspace module integrates with the booking system through calendar ID mappings:

Calendar Integration Architecture

calendar-integration.svg

The CalendarIdRepository maintains the mapping between workspace UUIDs and Google Calendar IDs, enabling the booking system to create events in the correct calendar for each workspace.

Utility Management

Workspaces track available equipment and amenities through the utility system:

Utility Association Model

utitlity-association-model.svg

The count field in WorkspaceUtilityEntity tracks quantity of each utility type per workspace, added in database migration V2.

Integration Points

The workspace module integrates with several other system components:

Integration Purpose Implementation
Booking Module Availability checking and event creation BookingService injection in controller
User Module Workspace assignments and permissions Domain service interface
Notification Module Workspace-related alerts Event-driven notifications
Authorization API endpoint security JWT token validation

The controller includes booking information in workspace responses when time range parameters are provided, enabling clients to display real-time availability.

Clone this wiki locally