• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

rm-hull / fuel-prices-api / 22199456654

19 Feb 2026 08:46PM UTC coverage: 28.932% (+0.3%) from 28.595%
22199456654

Pull #10

github

rm-hull
feat: add import command and data cleansing

This change introduces a new `import` CLI command to allow manual
one-off data synchronization from the GOV.UK API. It also improves data
consistency by cleansing address strings and normalizing fuel prices.

*   Added `import` command to the CLI.
*   Refactored shared initialization into a `bootstrap` function.
*   Implemented `cleanseAddressLine1` to remove redundant city and
    postcode suffixes.
*   Implemented `cleansePrice` to normalize prices provided in pounds
    or tenths of pence into standard pence.
*   Updated `ApiServer` to return errors instead of terminating the
    process directly.
*   Added **health check** and **metrics** endpoints to `test_api.http`.

```mermaid
sequenceDiagram
    participant CLI as main.go
    participant Cmd as cmd/import.go
    participant Boot as cmd/bootstrap.go
    participant Client as internal.FuelPricesClient
    participant Repo as internal.FuelPricesRepository

    CLI->>Cmd: Import()
    Cmd->>Boot: bootstrap(dbPath)
    Boot-->>Cmd: client, repo
    Cmd->>Client: GetFillingStations(repo.InsertPFS)
    Client->>Repo: InsertPFS(batch)
    Cmd->>Client: GetFuelPrices(repo.InsertPrices)
    Client->>Repo: InsertPrices(batch)
    Cmd->>Repo: Close()
```
Pull Request #10: feat: add import command and data cleansing

24 of 101 new or added lines in 6 files covered. (23.76%)

2 existing lines in 2 files now uncovered.

195 of 674 relevant lines covered (28.93%)

0.31 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/cmd/api_server.go


Source Not Available

STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc