Package weight, payload capacity and per-kg payout (ISS-045)
CI / build + unit + e2e (pull_request) Successful in 8m2s
CI / build + unit + e2e (pull_request) Successful in 8m2s
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.
This commit is contained in:
+3
-3
@@ -94,18 +94,17 @@ describe('OpenAPI spec', () => {
|
||||
const catalog = openApiSpec.components.schemas.CatalogEntry.properties;
|
||||
expect(Object.keys(catalog).sort()).toEqual([
|
||||
'burnPerKm',
|
||||
'capacity',
|
||||
'emptyWeightKg', // v0.16.0 weighted burn model input
|
||||
'label',
|
||||
'maxFuel',
|
||||
'maxPayloadKg', // v0.27.0 (ISS-045) — replaces the v0.12.0 slot capacity
|
||||
'model',
|
||||
'price',
|
||||
'speedKmh',
|
||||
]);
|
||||
for (const key of ['burnPerKm', 'emptyWeightKg', 'maxFuel', 'price', 'speedKmh'] as const) {
|
||||
for (const key of ['burnPerKm', 'emptyWeightKg', 'maxFuel', 'maxPayloadKg', 'price', 'speedKmh'] as const) {
|
||||
expect(catalog[key].type, `CatalogEntry.${key}`).toBe('number');
|
||||
}
|
||||
expect(catalog.capacity.type).toBe('integer'); // v0.12.0 slot capacity
|
||||
expect(catalog.model.type).toBe('string');
|
||||
expect(catalog.label.type).toBe('string');
|
||||
|
||||
@@ -140,6 +139,7 @@ describe('OpenAPI spec', () => {
|
||||
'planeId',
|
||||
'reward',
|
||||
'status',
|
||||
'weightKg', // v0.27.0 (ISS-045) — package weight in kg
|
||||
]);
|
||||
|
||||
const sim = openApiSpec.components.schemas.SimState.properties;
|
||||
|
||||
Reference in New Issue
Block a user