Issue #45 — replace the static 6-package slot capacity with real package weights, and make payout depend on weight as well as distance.
Changes:
Packages now carry a real weightKg (drawn at generation: per-cargo-type unit weight × count × jitter; new tunable UNIT_WEIGHT_KG table in seed.ts). DB column + guarded migration.
Plane capacity is now maxPayloadKg (ATR 72-600 = 4800 kg) instead of the static capacity: 6 slot count — removed from catalog/snapshot/OpenAPI.
Load validation (server + client) sums package weights against max payload; 409 "no payload room" message with tonnage. Client eligibility mirrors the server check exactly so a near-full plane never shows an enabled Load that 409s.
Payout: reward = round(BASE_REWARD + REWARD_PER_KM·km + REWARD_PER_KG·weightKg) (REWARD_PER_KG = 0.5; typical hops stay in the €1–3k band).
Left-pane loadout display now shows tonnage (1.2t / 4.8t).
Fuel burn math untouched (cargo weight does not enter burn — possible follow-up).
OpenAPI updated (PackageState.weightKg, CatalogEntry swap); no new endpoints → path list unchanged.
Version 0.26.0 → 0.27.0.
Issue #45 — replace the static 6-package slot capacity with real package weights, and make payout depend on weight as well as distance.
Changes:
- Packages now carry a real `weightKg` (drawn at generation: per-cargo-type unit weight × count × jitter; new tunable `UNIT_WEIGHT_KG` table in seed.ts). DB column + guarded migration.
- Plane capacity is now `maxPayloadKg` (ATR 72-600 = 4800 kg) instead of the static `capacity: 6` slot count — removed from catalog/snapshot/OpenAPI.
- Load validation (server + client) sums package weights against max payload; 409 "no payload room" message with tonnage. Client eligibility mirrors the server check exactly so a near-full plane never shows an enabled Load that 409s.
- Payout: `reward = round(BASE_REWARD + REWARD_PER_KM·km + REWARD_PER_KG·weightKg)` (REWARD_PER_KG = 0.5; typical hops stay in the €1–3k band).
- Left-pane loadout display now shows tonnage (`1.2t / 4.8t`).
- Fuel burn math untouched (cargo weight does not enter burn — possible follow-up).
- OpenAPI updated (PackageState.weightKg, CatalogEntry swap); no new endpoints → path list unchanged.
Version 0.26.0 → 0.27.0.
Packages carry a real weightKg (unit weight x count with +/-30% jitter),
plane capacity becomes maxPayloadKg instead of 6 slots, load validation
sums cargo weight against the payload, and the payout gains a per-kg part.
Loadout display shows tonnage; OpenAPI swaps CatalogEntry.capacity for
maxPayloadKg and adds PackageState.weightKg.
kamilkrzywda
scheduled this pull request to auto merge when all checks succeed 2026-09-20 14:47:00 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Issue #45 — replace the static 6-package slot capacity with real package weights, and make payout depend on weight as well as distance.
Changes:
weightKg(drawn at generation: per-cargo-type unit weight × count × jitter; new tunableUNIT_WEIGHT_KGtable in seed.ts). DB column + guarded migration.maxPayloadKg(ATR 72-600 = 4800 kg) instead of the staticcapacity: 6slot count — removed from catalog/snapshot/OpenAPI.reward = round(BASE_REWARD + REWARD_PER_KM·km + REWARD_PER_KG·weightKg)(REWARD_PER_KG = 0.5; typical hops stay in the €1–3k band).1.2t / 4.8t).Version 0.26.0 → 0.27.0.