Skip to content

Normalize player dataset to 2022 FIFA World Cup Argentina squad (26 players) #435

@nanotaboada

Description

@nanotaboada

Summary

Normalize the player dataset and test fixtures to the canonical 2022 FIFA World Cup Argentina squad. This covers four areas: adding the missing 27th player (Giovani Lo Celso), correcting three team/league values, replacing all hardcoded random UUIDs with deterministic UUID v5 values, and aligning PlayerFakes and test cases to the cross-repo CRUD fixture convention.


1. Add missing player: Giovani Lo Celso (Squad 27)

Lo Celso was in Argentina's preliminary squad for Qatar 2022 before suffering a hamstring injury and being replaced by Thiago Almada. He must be added as squad 27 with Starting11 = false.

This player serves as the canonical CREATE and DELETE fixture across all repos because his squad number (27) falls outside the seeded 1–26 range — a POST for him never conflicts with seeded data, and a failed cleanup leaves only an extra non-seeded record without corrupting the base dataset.

Field Value
squadNumber 27
firstName Giovani
lastName Lo Celso
middleName (none)
position Central Midfield
abbrPosition CM
team Real Betis Balompié
league La Liga
starting11 false
id (UUID v5) f8d13028-0d22-5513-8774-08a2332b5814

2. Data corrections (3 players)

These values reflect the squads as they were in November 2022 during the World Cup, which is the canonical snapshot for all repos.

Squad Player Field Current (wrong) Correct
24 Enzo Fernández team Chelsea FC SL Benfica
24 Enzo Fernández league Premier League Liga Portugal
20 Alexis Mac Allister team Liverpool FC Brighton & Hove Albion
20 Alexis Mac Allister league Premier League Premier League (no change)
10 Lionel Messi team Inter Miami CF Paris Saint-Germain
10 Lionel Messi league Major League Soccer Ligue 1

Note: Ángel Di María (squad 11) already has AbbrPosition = "RW" — no change needed.


3. Replace all hardcoded UUIDs with deterministic UUID v5

Namespace: f201b13e-c670-473d-885d-e2be219f74c8 (FIFA_WORLD_CUP_QATAR_2022_ARGENTINA_SQUAD)
Formula: uuidv5("{firstName}-{lastName}", namespace) — UTF-8, exact field values as stored.

All 27 canonical UUIDs (replace the hardcoded values in PlayerData.MakeStarting11WithId(), PlayerData.GetSubstitutesWithId(), and add Lo Celso):

Squad Player UUID v5
23 Damián Martínez 01772c59-43f0-5d85-b913-c78e4e281452
26 Nahuel Molina da31293b-4c7e-5e0f-a168-469ee29ecbc4
13 Cristian Romero c096c69e-762b-5281-9290-bb9c167a24a0
19 Nicolás Otamendi d5f7dd7a-1dcb-5960-ba27-e34865b63358
3 Nicolás Tagliafico 2f6f90a0-9b9d-5023-96d2-a2aaf03143a6
11 Ángel Di María b5b46e79-929e-5ed2-949d-0d167109c022
7 Rodrigo de Paul 0293b282-1da8-562e-998e-83849b417a42
24 Enzo Fernández d3ba552a-dac3-588a-b961-1ea7224017fd
20 Alexis Mac Allister 9613cae9-16ab-5b54-937e-3135123b9e0d
10 Lionel Messi acc433bf-d505-51fe-831e-45eb44c4d43c
9 Julián Álvarez 38bae91d-8519-55a2-b30a-b9fe38849bfb
1 Franco Armani 5a9cd988-95e6-54c1-bc34-9aa08acca8d0
12 Gerónimo Rulli c62f2ac1-41e8-5d34-b073-2ba0913d0e31
2 Juan Foyth 5fdb10e8-38c0-5084-9a3f-b369a960b9c2
4 Gonzalo Montiel bbd441f7-fcfb-5834-8468-2a9004b64c8c
6 Germán Pezzella d8bfea25-f189-5d5e-b3a5-ed89329b9f7c
8 Marcos Acuña dca343a8-12e5-53d6-89a8-916b120a5ee4
25 Lisandro Martínez 98306555-a466-5d18-804e-dc82175e697b
5 Leandro Paredes 9d140400-196f-55d8-86e1-e0b96a375c83
14 Exequiel Palacios d3b0e8e8-2c34-531a-b608-b24fed0ef986
17 Alejandro Gómez 7cc8d527-56a2-58bd-9528-2618fc139d30
18 Guido Rodríguez 191c82af-0c51-526a-b903-c3600b61b506
15 Ángel Correa b1306b7b-a3a4-5f7c-90fd-dd5bdbed57ba
16 Thiago Almada ecec27e8-487b-5622-b116-0855020477ed
21 Paulo Dybala 7941cd7c-4df1-5952-97e8-1e7f5d08e8aa
22 Lautaro Martínez 79c96f29-c59f-5f98-96b8-3a5946246624
27 Giovani Lo Celso f8d13028-0d22-5513-8774-08a2332b5814

4. EF Core migration

A new migration is required to:

  • Insert Lo Celso (squad 27) into the Players table
  • Update the three team/league fields for Fernández, Mac Allister, and Messi
  • Update all 26 existing UUIDs to the canonical v5 values

Rebuild storage/players-sqlite3.db from the migrations after the new migration is applied.


5. Test fixture alignment (PlayerFakes.cs)

Current fixtures vs. canonical convention:

Operation Current Canonical
Create Leandro Paredes (squad 5) Giovani Lo Celso (squad 27)
Retrieve Lionel Messi (squad 10) Lionel Messi (squad 10) ✓
Update Damián Martínez (squad 23) → firstName "Emiliano", middleName cleared ✓ (already aligned)
Delete Nahuel Molina (squad 26) Giovani Lo Celso (squad 27)

Changes required in PlayerFakes.cs:

  • MakeNew(): change SquadNumber == 5 to SquadNumber == 27 (Lo Celso from substitutes/preliminary)
  • MakeRequestModelForCreate(): inherits from MakeNew() — no additional change needed

Changes required in PlayerControllerTests.cs:

  • Delete_PlayerBySquadNumber_Existing_Returns204NoContent: change squad from 26 to 27
  • Post_Players_NonExisting_Returns201Created / Post_Players_Existing_Returns409Conflict: will use Lo Celso (squad 27) via the updated MakeRequestModelForCreate()

Note: Because all tests use mocked services (PlayerMocks), there are no ordering dependencies or shared in-memory state between test runs — no beforeEach/afterEach setup is required.


6. Files to change

File Change
src/.../Utilities/PlayerData.cs Replace all 26 UUIDs; fix Fernández/Mac Allister/Messi teams; add Lo Celso (squad 27) to GetSubstitutesWithId()
src/.../Migrations/ Add new EF Core migration: seed Lo Celso, correct teams/leagues, update UUIDs
storage/players-sqlite3.db Rebuild from migrations
test/.../Utilities/PlayerFakes.cs MakeNew(): squad 5 → squad 27
test/.../Unit/PlayerControllerTests.cs DELETE test: squad 26 → squad 27
CHANGELOG.md Add entry under [Unreleased]

7. CHANGELOG entry

### Changed
- Normalize player dataset: add Lo Celso (squad 27), correct Fernández/Mac Allister/Messi team data, replace random UUIDs with deterministic UUID v5 values
- Align CRUD test fixtures: Lo Celso (squad 27) for Create and Delete, Messi (squad 10) for Retrieve, Damián Martínez (squad 23) for Update

8. Version bump and Docker note

Bump to 2.1.0-<next-stadium> following the alphabetical FIFA World Cup stadium naming convention (current: 2.0.0-centenario, next codename starts with D).

Existing Docker volumes must be removed before restarting to pick up the rebuilt database:

docker compose down -v
docker compose up --build

Metadata

Metadata

Assignees

No one assigned

    Labels

    .NETPull requests that update .NET codeenhancementNew feature or requestpriority highImportant for production readiness. Schedule for current milestone.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions