Skip to content

LibraryBookingSystem/policy-service

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

policy-service

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.

Role in the system

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
Loading

API (via gateway)

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)

Stack

  • Java 17, Spring Boot 3.5
  • JPA (PostgreSQL), AMQP, Spring Security, AOP, JJWT
  • common-aspects

Configuration

Variable Purpose
DB_* PostgreSQL (policy_db in Compose)
RABBITMQ_* Policy change events
JWT_SECRET, JWT_EXPIRATION Admin and read routes

HTTP port 3005.

Run locally

cd docker-compose
docker compose up -d policy-service

Sample policies can be loaded with the scripts described in docker-compose (init-dummy-data-policy.sql).

Related repositories

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors