feat: add chronology field to tv shows (closes #32)#35
Conversation
Mirrors the existing movies.chronology property so clients can sort/filter /tvshows numerically and merge the result with /movies for a unified chronological ordering of MCU projects. Closes #32 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Verified end-to-end against a local postgres 16 container. Migration
API behavior (after populating the 19 tvshows with chronology 41–59)
{
"data": [
{ "id": 1, "title": "WandaVision", "chronology": 41 },
{ "id": 2, "title": "The Falcon and The Winter Soldier", "chronology": 42 },
{ "id": 3, "title": "Loki", "chronology": 43 },
{ "id": 4, "title": "What If...?", "chronology": 44 },
{ "id": 5, "title": "Hawkeye", "chronology": 45 }
],
"total": 22
}
All test-plan checkboxes (migration run, revert, order, filter, columns selection) are now validated. |
AugustoMarcelo
left a comment
There was a problem hiding this comment.
Code review done.
Summary
chronologyinteger column totvshows, mirroringmovies.chronology, so clients can sort/filter/tvshowsnumerically and merge with/moviesfor a unified chronological view of all MCU projects (issue Suggestion: Chronology for shows #32).1776153600000-AddChronologyToTVShowsadds the column with a symmetricdown()that drops it.TVShowsRepository.findAllnow treatschronologyas a numeric column for the?filter=path, so?filter=chronology=5matches as an integer rather than an ILIKE pattern.src/shared/infra/typeorm/factories/tvshows.factory.ts) populates each of the 19 shows with a chronology value.The chronology values assigned to the 19 shows in the factory (
41–59, in id order) are placeholders. They let the plumbing work and the PR be merged safely, but they stack all shows after the existing movies (which run1–40) rather than interleaving them with the correct in-universe ordering (e.g. WandaVision sits right after Avengers: Endgame).Before merging, please re-number these to the canonical MCU in-universe order — either by renumbering shows to fit between movie values, or by renumbering both movies and shows onto a shared scale with gaps. No code changes are needed for that, only factory data.
Test plan
npm run test— 6 suites / 13 tests green, 100% coverage on affected modulesnpx tsc --noEmit— cleannpm run typeorm:dev migration:run, inspecttvshowsschemadown():npm run typeorm:dev migration:revertGET /tvshows?order=chronology,ascreturns shows sorted ascendingGET /tvshows?filter=chronology=41returns only WandaVision (exercises the numeric-column filter branch)GET /tvshows?columns=title,chronologyreturns only those two columnsCloses #32
🤖 Generated with Claude Code