Skip to content

fix: handle time interval in shared mobility pricing - #6307

Open
jorunnl wants to merge 4 commits into
masterfrom
jorunn/shmo-pricing-interval
Open

fix: handle time interval in shared mobility pricing#6307
jorunnl wants to merge 4 commits into
masterfrom
jorunn/shmo-pricing-interval

Conversation

@jorunnl

@jorunnl jorunnl commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

closes https://github.com/AtB-AS/kundevendt/issues/24365

Summary

image image image image image
  • Price segments now account for interval when rendering perMinPricing/perKmPricing rates, so a segment with interval: 30, rate: 5 shows as "5 kr per 30 min" instead of "5 kr/min"
  • Segments with interval: 0 (charged once, not per unit) now render as "(engangsbeløp)"/"(one-time fee)" instead of being mislabeled as per-minute/per-km
  • Minute ranges/boundaries ≥ 60 min are now formatted as hours + minutes (e.g. "0-1 time 30 min"), capped at hours
  • computeFreeMinuteCount now accounts for interval when converting a free-minutes campaign budget into minutes, instead of treating rate as a flat per-minute cost
  • The campaign free-minutes row on the pricing details screen now goes through the same interval-aware label formatting as regular segments

Price segments were rendered as if rate applied per single minute/km,
ignoring interval. A segment with interval 30 and rate 5 showed as
"5 kr/min" instead of "5 kr per 30 min". Also account for interval in
free-minutes campaign calculations and one-time (interval 0) charges.
@jorunnl jorunnl self-assigned this Sep 4, 2026
@jorunnl
jorunnl requested a review from Dahly96 September 4, 2026 09:14
…ayout

ScooterTexts held only generic, form-factor-agnostic pricing/vehicle
text and was used in just three call sites, so fold it into
MobilityTexts.pricingDetails alongside the other pricing texts.
Also fix the pricing details value column shrinking below its content
width and wrapping mid-price when the row label is long.
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