User Story
As a developer maintaining the ETL spec, I want the DataSource query mock to match only the terminal code-lookup query so future SQL changes aren't accidentally masked by an overly broad string match.
Definition of Done
Acceptance Criteria
- The mock only fires for the `SELECT code, id FROM station_terminal` lookup
- INSERT and UPDATE queries against `station_terminal_distance` are not matched by this branch
Technical Elaboration
Current match: `sql.includes('station_terminal')`
`station_terminal_distance` contains the substring `station_terminal`, so INSERT/UPDATE queries to the distance table would also hit this branch and return terminal-lookup rows, silently masking any SQL bug that touches both tables.
Fix: `sql.includes('FROM station_terminal') && !sql.includes('station_terminal_distance')`
File: `backend/src/modules/catalog-etl/steps/terminal-distances-sync.step.spec.ts`
Design Elaboration
Test-only change, no production code affected.
User Story
As a developer maintaining the ETL spec, I want the DataSource query mock to match only the terminal code-lookup query so future SQL changes aren't accidentally masked by an overly broad string match.
Definition of Done
Acceptance Criteria
Technical Elaboration
Current match: `sql.includes('station_terminal')`
`station_terminal_distance` contains the substring `station_terminal`, so INSERT/UPDATE queries to the distance table would also hit this branch and return terminal-lookup rows, silently masking any SQL bug that touches both tables.
Fix: `sql.includes('FROM station_terminal') && !sql.includes('station_terminal_distance')`
File: `backend/src/modules/catalog-etl/steps/terminal-distances-sync.step.spec.ts`
Design Elaboration
Test-only change, no production code affected.