Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ Release names follow the **historic football clubs** naming convention (A–Z):

### Changed

- Update `CLAUDE.md`: add Flyway to Tech Stack, add `db/migration/` to structure
diagram, fix "Modify schema" workflow to use versioned Flyway migrations instead
of manually editing the SQLite file β€” produced with the
[CLAUDE.md Management plugin](https://claude.com/plugins/claude-md-management)
- Consolidate project documentation into `CLAUDE.md` as the single source of
truth; add Invariants and Architecture Decision Records sections; extend
Pre-commit Checks with ADR update requirement (#335)
Expand Down
8 changes: 5 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ REST API for managing football players built with Java and Spring Boot. Implemen
- **Validation**: Bean Validation (JSR-380)
- **Caching**: Spring `@Cacheable` (simple in-memory, no expiry)
- **Mapping**: ModelMapper
- **Migrations**: Flyway (versioned SQL under `db/migration/`; disabled in tests β€” tests use Spring SQL init instead)
- **Logging**: SLF4J
- **Testing**: JUnit 5 + AssertJ + MockMvc + Mockito
- **Coverage**: JaCoCo
Expand All @@ -31,9 +32,10 @@ src/main/java/
β”œβ”€β”€ models/ β€” Player entity + DTOs
└── converters/ β€” JPA AttributeConverter for ISO-8601 date handling
src/main/resources/ β€” application.properties, Logback config
src/main/resources/db/migration/ β€” Flyway versioned SQL (V1 schema, V2+V3 seed data; add V{N}__ here to change schema)
src/test/java/ β€” test classes mirroring main structure
src/test/resources/ β€” test config, schema (ddl.sql), seed data (dml.sql)
storage/ β€” SQLite database file (runtime)
src/test/resources/ β€” test config, schema (ddl.sql), seed data (dml.sql); Flyway disabled in tests
storage/ β€” SQLite database file (runtime, created and populated by Flyway on first start)
```

**Layer rule**: `Controller β†’ Service β†’ Repository β†’ JPA`. Controllers must not access repositories directly. Business logic must not live in controllers.
Expand Down Expand Up @@ -133,7 +135,7 @@ This project uses Spec-Driven Development (SDD): discuss in Plan mode first, cre

**Add an endpoint**: Define DTO in `models/` with Bean Validation β†’ add service method in `services/` with `@Transactional` β†’ create controller endpoint with `@Operation` annotation β†’ add tests β†’ run `./mvnw clean test jacoco:report`.

**Modify schema**: Update `@Entity` in `models/Player.java` β†’ update DTOs if API changes β†’ manually update `storage/players-sqlite3.db` (preserve 26 players) β†’ update service, repository, and tests β†’ run `./mvnw clean test`.
**Modify schema**: Create a new Flyway migration `src/main/resources/db/migration/V{N}__description.sql` (production path) β†’ update `@Entity` in `models/Player.java` β†’ update DTOs if API changes β†’ also update `src/test/resources/ddl.sql` and `dml.sql` (tests use Spring SQL init, not Flyway) β†’ update service, repository, and tests β†’ run `./mvnw clean test`. Do not manually edit the SQLite file in `storage/`; Flyway owns it.

**After completing work**: Suggest a branch name (e.g. `feat/add-player-stats`) and a commit message following Conventional Commits including co-author line:

Expand Down