7 Commits

Author SHA1 Message Date
ramram1515
76b70d3aea Fix missing LGU/tenant relations and display in tables; Add LGU hierarchy tests 2026-07-07 12:03:24 +08:00
Developer
1ee4a049dc feat(trips): live mid-trip truck load input with Pusher broadcast
- Migration: add current_load_kg (nullable unsigned int) to trips table
- Trip model: add current_load_kg to fillable + integer cast
- New TruckLoadBroadcast event (ShouldBroadcastNow)
  - Channel: private admin.live
  - Event name: truck.load
  - Payload: trip_id, team_id, truck_id, current_load_kg, capacity_kg, is_full
- DriverTripController::updateLoad()
  - PATCH /api/v1/driver/trips/{trip}/update-load
  - Validates status is in_progress, saves current_load_kg, fires broadcast
- Route: PATCH driver/trips/{trip}/update-load registered
- CollectionTeamResource: truck_is_full uses current_load_kg (live estimate)
  with fallback to total_load_kg (authoritative dumpsite weight)
- TripResource: expose current_load_kg field
- Admin Teams card:
  - data-team-id attribute added to each card for Echo targeting
  - Load bar uses current_load_kg when available
  - Echo listener for truck.load event patches load bar + badge in real-time
  - truck-status-badge class added to Collecting/Truck Full spans
2026-07-02 15:01:44 +08:00
Developer
f5d520181e feat(admin/teams): add truck operational status badge
- Add truck_is_full computed field to CollectionTeamResource
  - true when current trip load >= truck capacity_kg
  - true when trip status is at_dumpsite (driver rerouted to dumpsite)
  - uses whenLoaded() guard, safe when currentTrip not eager-loaded

- Rework teams card badge layout (Admin UI)
  - H row: remove misleading 'Not Full' for standby teams; show Full/Incomplete for active only
  - Truck Load row: always rendered with 4 context-aware states
    - IDLE (standby teams)
    - READY (active, no current trip)
    - COLLECTING (active trip, under capacity)
    - TRUCK FULL (at capacity or at dumpsite)
2026-07-02 14:23:02 +08:00
Developer
a1470eb85e feat: implement team standby status, helper persistence, and store portal foundations 2026-07-02 12:03:50 +08:00
Developer
7dc074e3c3 Implement household, QR sale, team helpers assignment, and helper endpoints 2026-06-29 16:56:33 +08:00
77af5ca876 feat(web): wire admin UI for Modules 9-13
- Dumpsites + Routes: full create forms (boundary point list,
  click-to-add ordered stops with reorder controls)
- Trucks: list + create
- Teams: list + create with conflict detection (override checkbox)
- Trips: schedule + list + detail panel showing stops + timeline
- Partner Stores: list + create + Issue-Inventory action
- Reports: tabbed dashboard (daily collection, trip performance,
  store sales, compliance CSV export) + rebuild aggregations
- Sidebar: moves Teams/Trucks/Trips/Stores/Reports out of "Soon",
  reorganized groups
- Admin resources expose db_id alongside public uuid so admin forms
  can post integer FKs without a separate lookup endpoint

164 tests still passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 19:50:08 +08:00
15f9295d34 feat(backend): complete Module 9 (teams + trucks)
trucks (with optional last_known_coordinates POINT 4326),
collection_teams, team_members. Admin CRUD for both. TeamConflictDetector
flags double-assignment of driver/scanner/truck/helper across active
teams; override_conflicts: true bypasses for emergencies. Promotes
routes.default_team_id to a real FK now that collection_teams exists.

144 feature tests passing.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-30 02:48:40 +08:00