Skip to content

fix(user): allow decimal supply cart days - #66

Merged
jplacht merged 1 commit into
mainfrom
fix/supply-cart-decimal-days
Oct 1, 2026
Merged

jplacht merged 1 commit into
mainfrom
fix/supply-cart-decimal-days

Conversation

@jplacht

@jplacht jplacht commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

What and why

NPS feedback: the supply cart's stock duration only takes whole days, so you can't stock e.g. 2.5 days to fill a ship's hold. The value is the supplyCartDays user preference, which the backend validated as an integer.

Changes

  • supplyCartDays preference is a FloatField (min 0, default 20) instead of an IntegerField
  • stored integer values still read back; no migration (preferences are a JSON field)
  • tests: 2.5 round-trips, negative values give 400, stored ints read back

How it was verified

  • uv run ruff check, ruff format --check, ty check, uv run pytest (721 passed)
  • /sync-api: schema validates clean; supplyCartDays is now number, which the frontend's z.number() already accepts
  • e2e stack: entered 2.5 days in the supply cart, stored as supply_cart_days = 2.5, value survives a reload

Deploy order

Deploy backend first; it is backward compatible. Paired frontend PR: PRUNplanner/frontend#539

🤖 Generated with Claude Code

- supplyCartDays preference is a FloatField (min 0, default 20) instead of
  an IntegerField, so the supply cart can stock e.g. 2.5 days
- stored integer values still read back; no migration (JSON field)
- tests: 2.5 round-trips, negative values give 400, stored ints read back

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 0 complexity · 0 duplication

Metric Results
Complexity 0
Duplication 0

View in Codacy

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

Metric Results
Coverage variation ✅ +0.00% 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 (172ce74) 4635 4424 95.45%
Head commit (29fac9b) 4635 (+0) 4424 (+0) 95.45% (+0.00%)

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 (#66) 1 1 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 de0376a into main Oct 1, 2026
6 checks passed
@jplacht
jplacht deleted the fix/supply-cart-decimal-days branch October 1, 2026 10:48
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