Summary
The PUT /players/{player_id} and DELETE /players/{player_id} endpoints were identifying players by their internal UUID (surrogate key) instead of Squad Number (natural key), which is the domain-meaningful identifier for external consumers.
Motivation
squad_number is the natural key — human-readable and domain-meaningful.
- A
GET /players/squadnumber/{squad_number} endpoint already existed, making the mutation endpoints inconsistent.
- Using UUID as a path parameter leaks an internal implementation detail into the public API contract.
Changes
PUT /players/squadnumber/{squad_number} — updated to accept squad_number: int
DELETE /players/squadnumber/{squad_number} — updated to accept squad_number: int
- Added
update_by_squad_number_async and delete_by_squad_number_async service methods
Additional Context
The natural key (squad_number) is already used for GET /players/squadnumber/{squad_number}, confirming the intent. This change aligns the mutation endpoints with that convention.
Summary
The
PUT /players/{player_id}andDELETE /players/{player_id}endpoints were identifying players by their internal UUID (surrogate key) instead of Squad Number (natural key), which is the domain-meaningful identifier for external consumers.Motivation
squad_numberis the natural key — human-readable and domain-meaningful.GET /players/squadnumber/{squad_number}endpoint already existed, making the mutation endpoints inconsistent.Changes
PUT /players/squadnumber/{squad_number}— updated to acceptsquad_number: intDELETE /players/squadnumber/{squad_number}— updated to acceptsquad_number: intupdate_by_squad_number_asyncanddelete_by_squad_number_asyncservice methodsAdditional Context
The natural key (
squad_number) is already used forGET /players/squadnumber/{squad_number}, confirming the intent. This change aligns the mutation endpoints with that convention.