Skip to content

Commit dc5bb28

Browse files
authored
Merge pull request #557 from nanotaboada/feat/normalize-player-dataset-551
feat(data): normalize player dataset to 2022 FIFA World Cup squad
2 parents 5ea19d1 + ac8dd1d commit dc5bb28

File tree

8 files changed

+318
-79
lines changed

8 files changed

+318
-79
lines changed

.env.test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# Test Environment Configuration
22
# This file is used during test execution
33

4+
# Use in-memory SQLite for tests — avoids touching the seeded storage/players-sqlite3.db file
5+
STORAGE_PATH=:memory:
6+
47
# Disable rate limiting for most tests to avoid interference
58
RATE_LIMIT_ENABLED=false
69

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ yarn-error.log*
77
/prettier-debug.log
88
.env
99
*.js
10-
src/data/players-sqlite3.db-shm
11-
src/data/players-sqlite3.db-wal
10+
players-sqlite3.db-shm
11+
players-sqlite3.db-wal
1212
.claude/settings.local.json

CHANGELOG.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,26 @@ This project uses football/soccer terminology for release names:
4646

4747
### Changed
4848

49+
- Tests switched to in-memory SQLite (`STORAGE_PATH=:memory:`) — seeded via `beforeAll`, production DB never touched during test runs
50+
4951
### Deprecated
5052

53+
## [2.1.0-dribble] - 2026-03-30
54+
55+
### Added
56+
57+
- 15 substitute players seeded in `storage/players-sqlite3.db`
58+
59+
### Changed
60+
61+
- Player dataset normalised to November 2022 World Cup snapshot: Enzo Fernández (SL Benfica / Liga Portugal), Mac Allister (Brighton & Hove Albion), Messi (Paris Saint-Germain / Ligue 1), Di María `abbrPosition``RW`
62+
- Player UUIDs replaced with deterministic UUID v5 values (namespace `f201b13e-c670-473d-885d-e2be219f74c8`, formula `{firstName}-{lastName}`)
63+
- Test fixtures renamed for clarity: `playerStub.nonexistent` (Lo Celso, squad 27 — not seeded, used for POST/DELETE) and `playerStub.existing` (Emiliano Martínez, squad 23 — always seeded, used for PUT)
64+
- `playerStub.all` expanded to 26 players
65+
- `PUT describe` in tests: removed `beforeEach`, added `afterEach` to restore Martínez; all tests retargeted to squad 23
66+
- `rest/players.rest` variables updated: `@newSquadNumber = 27`, `@existingSquadNumber = 23`
67+
- Docker: run `docker compose down -v` before `docker compose up` to pick up the rebuilt seeded DB from `storage/players-sqlite3.db` (see #551)
68+
5169
### Removed
5270

5371
### Fixed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ts-node-samples-express-restful",
3-
"version": "1.0.0",
3+
"version": "2.1.0-dribble",
44
"description": "Proof of Concept for a RESTful API made with Node.js 24 (LTS/Krypton), Express.js 5 in TypeScript.",
55
"type": "module",
66
"main": "dist/server.js",

rest/players.rest

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
# https://marketplace.visualstudio.com/items?itemName=humao.rest-client
33

44
@baseUrl = http://localhost:9000
5-
@newSquadNumber = 5
6-
@existingSquadNumber = 5
5+
@newSquadNumber = 27
6+
@existingSquadNumber = 23
77

88
# -----------------------------------------------------------------------------
99
# GET /health
@@ -48,15 +48,14 @@ POST {{baseUrl}}/players
4848
Content-Type: application/json
4949

5050
{
51-
"firstName": "Leandro",
52-
"middleName": "Daniel",
53-
"lastName": "Paredes",
54-
"dateOfBirth": "1994-06-29T00:00:00.000Z",
55-
"squadNumber": 5,
56-
"position": "Defensive Midfield",
57-
"abbrPosition": "DM",
58-
"team": "AS Roma",
59-
"league": "Serie A",
51+
"firstName": "Giovani",
52+
"lastName": "Lo Celso",
53+
"dateOfBirth": "1996-04-09T00:00:00.000Z",
54+
"squadNumber": 27,
55+
"position": "Central Midfield",
56+
"abbrPosition": "CM",
57+
"team": "Villarreal CF",
58+
"league": "La Liga",
6059
"starting11": false
6160
}
6261

@@ -154,16 +153,16 @@ PUT {{baseUrl}}/players/squadNumber/{{existingSquadNumber}}
154153
Content-Type: application/json
155154

156155
{
157-
"firstName": "Leandro",
158-
"middleName": "Daniel",
159-
"lastName": "Paredes",
160-
"dateOfBirth": "1994-06-29T00:00:00.000Z",
161-
"squadNumber": 5,
162-
"position": "Defensive Midfield",
163-
"abbrPosition": "DM",
164-
"team": "AS Roma",
165-
"league": "Serie A",
166-
"starting11": false
156+
"firstName": "Emiliano",
157+
"middleName": null,
158+
"lastName": "Martínez",
159+
"dateOfBirth": "1992-09-02T00:00:00.000Z",
160+
"squadNumber": 23,
161+
"position": "Goalkeeper",
162+
"abbrPosition": "GK",
163+
"team": "Aston Villa FC",
164+
"league": "Premier League",
165+
"starting11": true
167166
}
168167

169168
### Request PUT /players/squadNumber/{squadNumber} nonexistent → Response status 404 Not Found
@@ -250,7 +249,7 @@ Content-Type: application/json
250249
# -----------------------------------------------------------------------------
251250

252251
### Request DELETE /players/squadNumber/{squadNumber} existing → Response status 204 No Content
253-
DELETE {{baseUrl}}/players/squadNumber/{{existingSquadNumber}}
252+
DELETE {{baseUrl}}/players/squadNumber/{{newSquadNumber}}
254253

255254
### Request DELETE /players/squadNumber/{squadNumber} nonexistent → Response status 404 Not Found
256255
DELETE {{baseUrl}}/players/squadNumber/99

storage/players-sqlite3.db

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)