Skip to content

feat: ETL sync steps for cities, space stations, outposts, and POIs#217

Merged
GitAddRemote merged 2 commits into
mainfrom
feature/ISSUE-193
May 24, 2026
Merged

feat: ETL sync steps for cities, space stations, outposts, and POIs#217
GitAddRemote merged 2 commits into
mainfrom
feature/ISSUE-193

Conversation

@GitAddRemote
Copy link
Copy Markdown
Owner

Closes #193

Summary

  • CitiesSyncStep (/cities): loads 6 parent FK sets in parallel; error-skips records where both planet and moon are unresolvable (location required)
  • SpaceStationsSyncStep (/space_stations): loads 7 parent FK sets; error-skips records with null or unknown orbit_id (required FK for space stations)
  • OutpostsSyncStep (/outposts): all location FKs optional; warns (does not skip) when no planet or moon resolves
  • PoisSyncStep (/pois): 9 parent FK lookups (most complex step); warns when no location parent at all resolves
  • All four steps registered in CatalogEtlModule providers and appended to CatalogEtlService.ETL_STEPS in dependency order (cities before space stations, since space stations reference cities)

Test plan

  • 106 unit tests across all 11 step specs (pnpm test --testPathPattern="catalog-etl/steps")
  • Happy path: two records each upserted to correct table
  • Scalar field mapping: verify all positional params in upsert call
  • Missing name: warns + skips record
  • Mandatory FK missing (city: no planet/moon, space station: no orbit): error + skip
  • Optional FK unresolvable: nulled out, warn emitted, record still upserted
  • Idempotency: two executions produce identical upsert param arrays

- CitiesSyncStep: syncs /cities; error-skips records with no resolvable planet or moon
- SpaceStationsSyncStep: syncs /space_stations; error-skips records with null/unknown orbit (required FK)
- OutpostsSyncStep: syncs /outposts; all location FKs optional; warns when no planet or moon resolves
- PoisSyncStep: syncs /pois; 9 parent FK lookups; warns when no location parent resolves at all
- All steps registered in CatalogEtlModule providers and CatalogEtlService ETL_STEPS pipeline
- 62 unit tests covering happy path, orphan parent handling, and upsert idempotency for all four steps
Copilot AI review requested due to automatic review settings May 24, 2026 22:50
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

…isSyncStep mocks to CatalogEtlService test module
@GitAddRemote GitAddRemote merged commit 9f45897 into main May 24, 2026
9 checks passed
@GitAddRemote GitAddRemote deleted the feature/ISSUE-193 branch May 24, 2026 23:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ETL: sync cities, space stations, outposts, and POIs into station_* tables

2 participants