Configurable booking rules and a validation API for the Library Booking System. booking-service calls validation synchronously before creating or changing reservations; policy changes are broadcast on policy.events.
flowchart LR
BOOK[booking-service] -->|POST /validate| POL[policy-service]
POL --> PG[(policy_db)]
POL --> RMQ[policy.events]
RMQ --> NOTIF[notification-service]
RMQ --> RT[realtime-gateway]
Admin --> GW[api-gateway] --> POL
Base path: http://localhost:8080/api/policies
| Method | Path | Description |
|---|---|---|
| GET | / |
List policies (active query supported) |
| GET | /{id} |
Policy by id |
| POST | / |
Create policy (admin) |
| PUT | /{id} |
Update policy (admin) |
| DELETE | /{id} |
Delete policy (admin) |
| POST | /validate |
Validate a booking payload (service-to-service; no end-user role gate) |
- Java 17, Spring Boot 3.5
- JPA (PostgreSQL), AMQP, Spring Security, AOP, JJWT
- common-aspects
| Variable | Purpose |
|---|---|
DB_* |
PostgreSQL (policy_db in Compose) |
RABBITMQ_* |
Policy change events |
JWT_SECRET, JWT_EXPIRATION |
Admin and read routes |
HTTP port 3005.
cd docker-compose
docker compose up -d policy-serviceSample policies can be loaded with the scripts described in docker-compose (init-dummy-data-policy.sql).
- booking-service — primary consumer of
/validate - notification-service — policy change notifications
- Documentation — authorization matrix