fix: VS always a string; months_to_show in Python JSON API #44

Merged
kacerr merged 3 commits from fix/api-parity-vs-months-to-show into main 2026-10-08 11:45:53 +02:00
Owner

Stacked on the feat/python-to-legacy MR; merge that one first.

Why

make parity between the Python and Go servers reported 0/3 routes matching. Two causes:

  1. Go rendered a numeric VS cell as 2.609767878e+09.
  2. Python's /api/adults and /api/juniors did not return months_to_show.

Changes

  • VS on read (Go): text columns of the payments sheet go through a new sheets.CellString helper that never uses exponent form. Bank inference uses it too.
  • VS on write (Go and Python): sync appends VS as a text cell, so Sheets keeps it a string and leading zeros survive. Existing rows are not rewritten; the read side handles both.
  • months_to_show (Python): added to the two JSON API responses. The HTML pages already had the feature.
  • Docs: the pre-feature cleanup task list from the repo audit, and the plan for these fixes.

Testing

  • make go-test-all and make test (37 Python tests) pass, including new tests for each change.
  • Live parity between the two containers: 3/3 routes match.
  • Not exercised: a real (non-dry-run) sync. After the next one, check that a new row's VS shows as text with no visible apostrophe.

🤖 Generated with Claude Code

Stacked on the `feat/python-to-legacy` MR; merge that one first. ## Why `make parity` between the Python and Go servers reported 0/3 routes matching. Two causes: 1. Go rendered a numeric VS cell as `2.609767878e+09`. 2. Python's `/api/adults` and `/api/juniors` did not return `months_to_show`. ## Changes - **VS on read (Go):** text columns of the payments sheet go through a new `sheets.CellString` helper that never uses exponent form. Bank inference uses it too. - **VS on write (Go and Python):** sync appends VS as a text cell, so Sheets keeps it a string and leading zeros survive. Existing rows are not rewritten; the read side handles both. - **`months_to_show` (Python):** added to the two JSON API responses. The HTML pages already had the feature. - **Docs:** the pre-feature cleanup task list from the repo audit, and the plan for these fixes. ## Testing - `make go-test-all` and `make test` (37 Python tests) pass, including new tests for each change. - Live parity between the two containers: 3/3 routes match. - Not exercised: a real (non-dry-run) sync. After the next one, check that a new row's VS shows as text with no visible apostrophe. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
kacerr changed target branch from feat/python-to-legacy to main 2026-10-08 11:45:37 +02:00
kacerr added 3 commits 2026-10-08 11:45:37 +02:00
Go stringified sheet cells with fmt.Sprint, so a numeric VS read with
UNFORMATTED_VALUE was rendered as 2.609767878e+09. Text columns of the
payments sheet now go through sheets.CellString, which never uses
exponent form; bank inference uses the same helper.

Both sync implementations now append VS as a text cell so Sheets keeps
it a string and leading zeros survive. Existing rows are not rewritten.

Python already read VS as a digit string; a regression test pins that.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Go returns months_to_show in /api/adults and /api/juniors; the Python
API did not, so make parity failed on both routes. The Python HTML
pages already had the feature.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs: add pre-feature cleanup task list and API parity plan
Deploy to K8s / deploy (push) Successful in 14s
82406935ed
Task list from the 2026-10-08 repo audit, plus the plan for the two
parity fixes found while validating the legacy/ move.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kacerr merged commit cfdc5cbb2a into main 2026-10-08 11:45:53 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kacerr/fuj-management#44