AGENTS.md@petclinic-backend · diff
git:20260928.01b4538 to git:20261001.1a810a5
0 added, 20 removed. Audit A to B.
- ### Backend Architecture
-
- **Layered Structure:**
- 1. REST Controllers (`petclinic-backend/src/main/java/.../rest/`) - expose API endpoints
- 2. Mappers (`mapper/`) - hand-written `@Component` entity↔DTO conversion
- 3. Repository Layer (`repository/`) - Spring Data JPA interfaces (no service layer!)
- 4. Domain Model (`domain/`) - JPA entities (Owner, Pet, Vet, Visit, Specialty, PetType, User, Role)
- 5. Notification (`notification/`) - `NotificationServiceClient`, called after a visit is booked:
- an HTTP POST to notification-service, best effort (a failure is logged, the booking stands).
- Takes plain values, never an entity, and reaches no repository
-
- **Data Flow:**
- Request → REST Controller → Repository / Mapper → JPA Entity
- Response ← REST Controller ← Mapper (Entity→DTO) ← Repository
-
- **Key Patterns:**
- - DTOs are hand-written in `src/main/java/.../rest/dto/` (not generated)
- - `openapi.yaml` at project root is generated output (from `OpenApiExtractorTest`), not a source spec;
- editing it by hand is denied in `.claude/settings.json` — regenerate it instead
- - Constructor injection, global exception handling via `@RestControllerAdvice`