Summary
The anonymous gpsSensors array element shape in src/config/config.ts is duplicated across multiple modules. Extracting it into a named, exported type (GpsSensorConfig) will prevent drift and make the contract explicit across the codebase.
Scope
src/config/config.ts — declare and export GpsSensorConfig (or a canonical location such as packages/server-api/src/), replace the inline anonymous shape in Config.settings.gpsSensors? with GpsSensorConfig[].
src/serverroutes.ts — import and reuse GpsSensorConfig instead of redeclaring the shape inline.
src/api/gpsOffsetCorrector/index.ts — import and reuse GpsSensorConfig for the corrector's payload type.
- Test fixtures (
test/api/gpsOffsetCorrector.test.ts and any other files that declare the shape locally) — update to import the shared type.
Background
Identified during review of PR #2399 (feat: Multi-GPS antenna position configuration). The shape { sensorId: string; sourceRef: string; fromBow: number | null; fromCenter: number | null } is currently inlined anonymously in Config.settings.gpsSensors and repeated elsewhere. Agreed to address in a follow-up PR to keep the round-2 bugfixes atomic.
References
/cc @dirkwa
Summary
The anonymous
gpsSensorsarray element shape insrc/config/config.tsis duplicated across multiple modules. Extracting it into a named, exported type (GpsSensorConfig) will prevent drift and make the contract explicit across the codebase.Scope
src/config/config.ts— declare and exportGpsSensorConfig(or a canonical location such aspackages/server-api/src/), replace the inline anonymous shape inConfig.settings.gpsSensors?withGpsSensorConfig[].src/serverroutes.ts— import and reuseGpsSensorConfiginstead of redeclaring the shape inline.src/api/gpsOffsetCorrector/index.ts— import and reuseGpsSensorConfigfor the corrector's payload type.test/api/gpsOffsetCorrector.test.tsand any other files that declare the shape locally) — update to import the shared type.Background
Identified during review of PR #2399 (feat: Multi-GPS antenna position configuration). The shape
{ sensorId: string; sourceRef: string; fromBow: number | null; fromCenter: number | null }is currently inlined anonymously inConfig.settings.gpsSensorsand repeated elsewhere. Agreed to address in a follow-up PR to keep the round-2 bugfixes atomic.References
/cc @dirkwa