# Domain Entities — Unit 4: Dashboard ## Entities ### AvailabilityStatus (enumeration) A union type representing the three possible system states returned by the API. | Value | Meaning | |---|---| | `Available` | System is fully operational | | `Maintenance` | System is in planned maintenance mode | | `Unavailable` | System is not accessible | --- ### AvailabilityResponse (API response shape) Returned by `GET /api/v1/Availability/status`. | Field | Type | Description | |---|---|---| | `status` | `AvailabilityStatus` | Current system status | | `checkedAt` | `string` (ISO 8601) | Timestamp when status was last evaluated | | `message` | `string` | Optional human-readable reason or note (may be empty string) | --- ## Entity Relationship Diagram ```mermaid classDiagram class AvailabilityResponse { +status: AvailabilityStatus +checkedAt: string +message: string } class AvailabilityStatus { <> Available Maintenance Unavailable } AvailabilityResponse --> AvailabilityStatus : status style AvailabilityResponse fill:#4CAF50,stroke:#2E7D32,color:#000 style AvailabilityStatus fill:#2196F3,stroke:#0D47A1,color:#000 ``` AvailabilityResponse holds a status (one of three enumeration values) plus a timestamp and message. --- ## Type Placement Both `AvailabilityStatus` and `AvailabilityResponse` are added to `frontend/src/api/types.ts` — the shared domain types file, consistent with `User`, `AuthResponse`, and `SetupStatus`. --- ## TanStack Query Dependency `@tanstack/react-query` is added as a new production dependency. A shared `QueryClient` is configured in `main.tsx` and provided via `QueryClientProvider`. This enables `staleTime`, background refetching, and persistent cached data across error states.