Skip to content

fix: correct orchestrator capacity column naming and remove redundant payload capacity columns#225

Open
roncodes wants to merge 2 commits intomainfrom
fix/orchestrator-capacity-columns
Open

fix: correct orchestrator capacity column naming and remove redundant payload capacity columns#225
roncodes wants to merge 2 commits intomainfrom
fix/orchestrator-capacity-columns

Conversation

@roncodes
Copy link
Copy Markdown
Member

Summary

This PR fixes critical naming inconsistencies and redundant columns introduced with the orchestrator feature in the previous release.

Problems fixed

1. Redundant capacity_weight_kg on vehicles — duplicates the existing payload_capacity column. Removed; OrchestrationPayloadBuilder now reads payload_capacity directly.

2. Non-standard column names on vehiclescapacity_volume_m3, capacity_pallets, capacity_parcels renamed to payload_capacity_volume, payload_capacity_pallets, payload_capacity_parcels to follow Fleetbase naming convention.

3. Redundant capacity columns on payloads — all four payload capacity columns removed entirely; OrchestrationPayloadBuilder now computes the VROOM job amount array dynamically by aggregating entity weight/dimensions with full unit normalisation (kg, g, lb, oz, t; m, cm, mm, in, ft).

4. API controllers did not accept orchestrator fieldsVehicleController and OrderController create/update whitelists now include all orchestrator constraint and capacity fields.

Migration note

Users upgrading from the previous release need to run php artisan migrate to apply the column renames.

… payload capacity columns

- Vehicle migration: remove redundant capacity_weight_kg (use existing payload_capacity),
  rename capacity_volume_m3 → payload_capacity_volume, capacity_pallets → payload_capacity_pallets,
  capacity_parcels → payload_capacity_parcels to follow Fleetbase naming convention
- Payload migration: remove all four redundant capacity columns (capacity_weight_kg,
  capacity_volume_m3, capacity_pallets, capacity_parcels) — these values are computed
  dynamically from payload entities, not stored as denormalised cache columns
- Vehicle model: update fillable and casts to match renamed columns
- Payload model: remove redundant capacity columns from fillable and casts
- OrchestrationPayloadBuilder: read payload_capacity (existing column) for vehicle weight
  capacity; compute job amount array dynamically by aggregating entity weight/dimensions
  with unit normalisation — no longer reads stale payload capacity cache columns
- VehicleController (Api/v1): add payload_capacity, payload_capacity_volume,
  payload_capacity_pallets, payload_capacity_parcels, skills, max_tasks,
  time_window_start, time_window_end, return_to_depot to create/update input whitelists
- OrderController (Api/v1): add time_window_start, time_window_end, required_skills,
  orchestrator_priority to create/update input whitelists
…ns for capacity columns

- Restore 2026_04_08_000001 and 2026_04_08_000004 to their exact released state;
  these migrations have already been run on live instances and must not be modified
- Add 2026_04_14_000001: drop redundant payload capacity columns
  (capacity_weight_kg, capacity_volume_m3, capacity_pallets, capacity_parcels)
  which are now computed dynamically from entities by OrchestrationPayloadBuilder
- Add 2026_04_14_000002: rename vehicle capacity columns to follow the
  payload_capacity_* naming convention and drop the redundant capacity_weight_kg
  (duplicate of the pre-existing payload_capacity column)
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