{
  "id": "component",
  "title": "Components \u00b7 Booking API",
  "scope": "Booking API",
  "nodes": [
    {
      "id": "web",
      "name": "Web app",
      "type": "Supporting container",
      "responsibility": "Sends authenticated booking requests"
    },
    {
      "id": "controller",
      "name": "BookingController",
      "type": "Component: Python / FastAPI",
      "responsibility": "Parses requests and maps responses"
    },
    {
      "id": "policy",
      "name": "AccessPolicy",
      "type": "Component: Python module",
      "responsibility": "Validates identity and room access"
    },
    {
      "id": "identity",
      "name": "Workplace Identity",
      "type": "External software system",
      "responsibility": "Publishes signing keys"
    },
    {
      "id": "service",
      "name": "BookingService",
      "type": "Component: Python module",
      "responsibility": "Coordinates one booking transaction"
    },
    {
      "id": "repository",
      "name": "BookingRepository",
      "type": "Component: Python module",
      "responsibility": "Reads availability; stores reservation"
    },
    {
      "id": "outbox",
      "name": "OutboxWriter",
      "type": "Component: Python module",
      "responsibility": "Stores a confirmation event in the same transaction"
    },
    {
      "id": "db",
      "name": "Booking database",
      "type": "Supporting container: PostgreSQL",
      "responsibility": "Persists reservation and pending message"
    }
  ],
  "relationships": [
    {
      "source": "web",
      "target": "controller",
      "label": "POST /bookings [JSON / HTTPS]"
    },
    {
      "source": "controller",
      "target": "policy",
      "label": "Checks identity and room permission [in-process]"
    },
    {
      "source": "policy",
      "target": "identity",
      "label": "Refreshes signing keys [JWKS / HTTPS]"
    },
    {
      "source": "controller",
      "target": "service",
      "label": "Requests reservation [in-process]"
    },
    {
      "source": "service",
      "target": "repository",
      "label": "Reads and writes within shared transaction [in-process]"
    },
    {
      "source": "service",
      "target": "outbox",
      "label": "Adds notification within shared transaction [in-process]"
    },
    {
      "source": "repository",
      "target": "db",
      "label": "Reads slots; inserts booking [SQL / TLS]"
    },
    {
      "source": "outbox",
      "target": "db",
      "label": "Inserts outbox record [SQL / TLS]"
    }
  ],
  "scopeId": "api"
}
