Skip to content

feat(user): construction cart remembers what is already built, with or without fio - #67

Merged
jplacht merged 1 commit into
mainfrom
feat/construction-cart-built
Oct 1, 2026
Merged

jplacht merged 1 commit into
mainfrom
feat/construction-cart-built

Conversation

@jplacht

@jplacht jplacht commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

What and why

The construction cart's top NPS request: users want to enter how many buildings already stand on the planet, once per plan, and have the cart show only what is left to build and buy. 56% of cart users have no FIO, so today they can't do this at all. This adds per-plan storage for those counts to the user preferences.

Changes

  • PlanOverrideSerializer gains optional constructionBuilt: building ticker → built count (int ≥ 0), default {}
  • Keys must match ^[A-Z0-9]{1,3}$, at most 100 entries, else 400
  • No migration; stored overrides without the field read back as {}
  • Tests: round-trip, invalid values (negative, lowercase, 4 chars, empty, F-1, 1.5, 101 entries), 100-entry limit, default on read, other override fields untouched

How it was verified

  • QA: PASS (3 rounds; qa code review, qa-e2e walk in the running app, checks.sh)
  • uv run ruff check, uv run ty check, uv run pytest: all pass
  • In the app: PATCH with -1, frm, ABCD → 400; valid built counts round-trip and load on a second device; old preferences still load
  • /sync-api: additive, spectacular --validate clean

Deploy order

Deploy backend first; it is backward compatible. Frontend PR: PRUNplanner/frontend#541

Spec: specs/2026-10-01-construction-cart-manual-built.md

🤖 Generated with Claude Code

…r without fio

- PlanOverrideSerializer gains optional constructionBuilt: building ticker
  to built count (int >= 0), default {}
- Keys must match ^[A-Z0-9]{1,3}$, at most 100 entries, else 400
- No migration; stored overrides without the field read back as {}
- Tests: round-trip, invalid values, 100-entry limit, default on read

Spec: specs/2026-10-01-construction-cart-manual-built.md

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@codacy-production

codacy-production Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

🟢 Metrics 5 complexity · 0 duplication

Metric Results
Complexity 5
Duplication 0

View in Codacy

🟢 Coverage 100.00% diff coverage · +0.01% coverage variation

Metric Results
Coverage variation ✅ +0.01% coverage variation (-1.00%)
Diff coverage ✅ 100.00% diff coverage

View coverage diff in Codacy

Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (de0376a) 4635 4424 95.45%
Head commit (0addc06) 4646 (+11) 4435 (+11) 95.46% (+0.01%)

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#67) 11 11 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@jplacht
jplacht merged commit bcee4cc into main Oct 1, 2026
6 checks passed
@jplacht
jplacht deleted the feat/construction-cart-built branch October 1, 2026 12:01
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.

1 participant