1.1 KiB
1.1 KiB
name, description, type
| name | description | type |
|---|---|---|
| api-shared-models module | Status and design decisions for the modules/api shared-models library | project |
modules/api is established as the shared-models library for NowChessSystems.
Why: All microservices need a common chess domain vocabulary (Square, Move, GameState, etc.) and cross-cutting API envelope types (ApiResponse, ApiError). Without a shared module, types diverge and cause serialisation mismatches.
How to apply: When designing any new service, confirm it declares implementation(project(":modules:api")) and does not duplicate any of the types already present. New cross-cutting types (used by 2+ services) should go into modules/api, not into a service module.
Package layout:
de.nowchess.api.board— Color, PieceType, Piece, File, Rank, Squarede.nowchess.api.game— CastlingRights, GameState, GameResult, GameStatusde.nowchess.api.move— MoveType, Move, PromotionPiecede.nowchess.api.player— PlayerId (opaque type), PlayerInfode.nowchess.api.response— ApiResponse[A], ApiError, Pagination, PagedResponse[A]
ADR: docs/adr/ADR-002-api-shared-models.md