Commit Graph

72 Commits

Author SHA1 Message Date
Developer
7f3357206f feat: implement fixed dashboard layout, custom geofencing shapes, and QC seeder
- UI: Refactored admin layout to a fixed 'App Shell' design with independent scrollbars for sidebar and content area.
- UI: Cleaned up sidebar partial structure to support nested scrolling.
- GEOFENCING: Added support for Circle and Rectangle tools in LGU configuration.
- GEOFENCING: Implemented high-precision (128-point) circle-to-polygon conversion for database storage.
- PAGINATION: Integrated standard Laravel pagination across Teams and Reports tables.
- PAGINATION: Added a global 'renderPagination' helper and 'Per Page' selector (25, 50, 100).
- DATA: Created QuezonCitySeeder with 142 official barangays and 3 months of historical collection/sales data.
- FIX: Corrected API total aggregations in reports to remain accurate during pagination.
- FIX: Resolved unique constraint and axis-order issues in spatial data seeders.
2026-07-03 11:19:08 +08:00
Developer
9123ffe099 Implement trip continuation and driver history 2026-07-02 17:12:28 +08:00
ramram1515
79e8ce2286 fix: improve 403 error message in StorePortalController and link demo stores to LGU 2026-07-02 15:43:15 +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
3beafa3ac2 feat(admin/trips): surface dumpsite release records in trip detail panel
- Eager-load dumpsiteReleases.dumpsite + dumpsiteReleases.releasedByDriver
  in AdminTripController::show()
- Add releases[] array to TripResource via whenLoaded('dumpsiteReleases')
  - Fields: weight_kg, released_at, dumpsite_name, driver_name,
    gate_pass_number, dumpsite_attendant, notes
- Admin Trips detail panel now shows a 'Dumpsite Releases' section
  below the timeline with per-release cards
- Load row updated to show release count e.g. '450 kg (2 releases)'
2026-07-02 15:01:23 +08:00
Developer
6b39cf645a fix: restore Endroid Builder::create() fix in StorePortalController 2026-07-02 13:57:40 +08:00
Developer
ba30a5fcdf fix: QrCode relation bug and Endroid create() error 2026-07-02 13:57:39 +08:00
Developer
d9495be0e0 feat: Implement segmented toggle for Resident/Household sales, Cash Only badge, and user_id in StoreSale 2026-07-02 13:57:39 +08:00
Developer
f517b77377 style: fix linting issues with Laravel Pint 2026-07-02 13:55:34 +08:00
Developer
c4cbdb42c7 feat(store): complete partner store overhaul with mapping, household search, financial analytics, and resident notification system 2026-07-02 13:55:08 +08:00
ramram1515
7ced07b323 feat: Relax barangay_id requirement for resident registration 2026-07-02 13:22:33 +08:00
ramram1515
ec6b9e61a3 feat: implement Live Truck Radar caching 2026-07-02 13:02:29 +08:00
Developer
a1470eb85e feat: implement team standby status, helper persistence, and store portal foundations 2026-07-02 12:03:50 +08:00
ramram1515
a9a1df93bd feat(driver): Add assigned truck details to profile screen 2026-07-02 11:44:31 +08:00
Developer
4a4b88ffe4 feat: partner store financial settlements, qr replacements, and tenant resolution fix 2026-07-01 16:38:49 +08:00
Developer
62bcf68bdb feat: add partner store analytics, history logs, and global SRP validation 2026-07-01 15:02:43 +08:00
Developer
cc4fd8ba17 feat: early dumping detour mode backend logic 2026-07-01 13:23:39 +08:00
Developer
70741a3c24 feat: live tracking setup and map parsing fixes 2026-07-01 13:04:51 +08:00
Developer
7a63d2c680 Merge branch 'main' of https://gitea-qzlf.srv1050180.hstgr.cloud/admin/Verde-Web 2026-06-30 16:10:43 +08:00
ramram1515
2467633b1b Config 2026-06-30 16:10:19 +08:00
Developer
d66d6e3396 fix: resolve tenant_id scoping issue on QR code batch generation 2026-06-30 15:59:03 +08:00
Developer
6c83d99fd7 Merge branch 'main' of https://gitea-qzlf.srv1050180.hstgr.cloud/admin/Verde-Web 2026-06-30 15:33:50 +08:00
Developer
5959f74746 chore: clean up 2026-06-30 15:32:01 +08:00
Developer
cfb09fd5fb feat: add void and delete endpoints for qr batches, fix batch list status counts 2026-06-30 15:03:25 +08:00
Developer
7452848cf9 fix: resolve duplicate entry error when adding a soft-deleted member back to a household 2026-06-30 14:48:23 +08:00
Developer
bb9825a86b feat: add batch activation endpoint and fix batch generation sequence bug 2026-06-30 14:27:17 +08:00
ramram1515
b8c56585bc UI enhancements and Actionable Notifications 2026-06-30 14:06:21 +08:00
Developer
a4e0fd3408 Merge branch 'main' of https://gitea-qzlf.srv1050180.hstgr.cloud/admin/Verde-Web 2026-06-30 13:35:28 +08:00
Developer
92f8ee95fc feat: Add Geofence Leaflet drawing tool for DOPs and Dumpsites 2026-06-30 13:31:36 +08:00
ramram1515
88caf14aa1 fix(api): force Manila timezone for upcoming pickups evaluation 2026-06-30 13:21:56 +08:00
Developer
7601d721d2 feat(api): add active-trip endpoint for helper and enable Vite dev server CORS 2026-06-30 11:25:31 +08:00
Developer
64d442ec2e feat: add proof of residency upload option during admin household creation 2026-06-30 10:27:49 +08:00
Super Admin
cfd7166a24 feat: implement drop-off points & dumpsites edit/delete and status transition logic 2026-06-29 23:15:55 +08:00
Super Admin
f2c1573f00 feat: Implement Truck edit, delete, and automatic trip cancellation when moved to maintenance/retired status 2026-06-29 22:59:47 +08:00
Super Admin
7a8fe3e7c3 feat: Add mapping, boundaries, and tabbed slide-over management to Partner Stores 2026-06-29 22:32:59 +08:00
Super Admin
31b9bbb026 feat: Implement tabbed slide-over edit modal for households 2026-06-29 19:42:16 +08:00
Developer
7dc074e3c3 Implement household, QR sale, team helpers assignment, and helper endpoints 2026-06-29 16:56:33 +08:00
Developer
b85fc255cf feat: implement barangay and household management with associated tests 2026-06-29 15:02:52 +08:00
ramram1515
9ac2ea7bda chore: apply code review checklist and web design guidelines fixes 2026-06-29 13:54:14 +08:00
Developer
2c7c3528e4 feat: implement interactive Barangay polygon map selector in Service Areas 2026-06-29 13:22:45 +08:00
Developer
4d8ccd3cd4 Merge branch 'main' of https://gitea-qzlf.srv1050180.hstgr.cloud/admin/Verde-Web 2026-06-29 12:45:13 +08:00
Developer
8dbc87b44f feat: add super admin LGU management and global user creator dashboard screens 2026-06-29 12:45:07 +08:00
ramram1515
91df4d05f0 fix: increase per_page validation limit to 500 across all remaining admin endpoints 2026-06-29 12:26:37 +08:00
ramram1515
e76eec1fbd Merge branch 'main' of https://gitea-qzlf.srv1050180.hstgr.cloud/admin/Verde-Web 2026-06-29 12:21:48 +08:00
ramram1515
4b483c093b fix: increase per_page validation limit to 500 on admin endpoints to allow drop-down populating 2026-06-29 12:17:34 +08:00
Developer
82dc044e1a merge: resolve conflicts in EnsureUserHasRole.php and echo.js 2026-06-29 12:05:52 +08:00
ramram1515
8638a80067 feat: implement interactive map location picker and address search with autocomplete suggestions 2026-06-29 11:54:39 +08:00
Developer
167abdc6ad fix: resolve super_admin login, echo crash and GD extension test failures 2026-06-29 11:43:40 +08:00
b1bc73b100 feat(mobile-driver): Phase 2 — trip lifecycle + foreground GPS
Backend:
- Driver trip endpoints now eager-load 'truck' on both index and
  show. The mobile app needs the truck UUID to target the GPS
  endpoint (POST /driver/trucks/{truck}/location); without this it
  would have to re-query.

Mobile (mobile-driver/):
- TripModel + TripStopModel + DropOffSummary + DumpsiteSummary +
  TruckSummary — typed Dart models that mirror the backend's
  TripResource shape exactly.
- TripsRepository covers all 11 driver endpoints: index, show,
  start, arrive, depart, skip, arrive-dumpsite, release-load,
  complete, report-incident, post-location.
- myTripsProvider + tripDetailProvider (FutureProvider.family)
  for declarative re-fetching after every action.
- Home screen replaces the placeholder cards with a real trip list:
  status pill (scheduled / in_progress / at_dumpsite / completed /
  cancelled), today badge, route name + trip number, scheduled
  time, truck plate, and a per-trip progress bar showing
  done/total stops. Pull-to-refresh + empty/loading/error states.
- Trip detail screen with a verde gradient header (route, trip
  number, truck plate, dumpsite), a context-aware primary action
  (Start / Arrive at dumpsite / Release load + Complete), and a
  list of stops with active-stop highlighting + per-stop Arrive /
  Depart / Skip buttons. Skip prompts for a reason. Release load
  is a bottom-sheet with a numeric weight input.
- LocationBroadcaster service: 15-second foreground GPS pump that
  posts to the truck-location endpoint, with permission cascade,
  immediate first-pulse on start, and graceful network-failure
  swallowing (Phase 3 will add a local buffer).
- activeTripWatcherProvider: listens to myTripsProvider and
  auto-starts/stops the broadcaster when a trip transitions in or
  out of the running state. Mounted from the home screen.
- Router gains /trip/:uuid.

Limitations carried forward:
- Foreground only. iOS will throttle the timer within ~30s of
  backgrounding. Phase 3 swaps in a native background-locator.
- No offline buffer — if the server is unreachable a GPS pulse is
  dropped silently.
- No incident-reporting UI yet (the repository method is in place).

Tests:
- Widget test now renders the TenantScreen in isolation. The
  full-app test was flagging timers from Dio + secure_storage that
  are tricky to flush deterministically. Phase 3 will add a
  fakeAsync harness.
- flutter analyze: 8 style infos, no warnings, no errors.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 23:36:43 +08:00
fcf2f9d0bf feat: multi-LGU tenancy — Phase A (foundation + customer-web)
Backend:
- New tenants table with PSGC-derived code, links to
  cities_municipalities, optional boundary_polygon override, theme
  color, contact info, timezone.
- Adds nullable tenant_id to users / households / drop_off_points /
  dumpsites / partner_stores. Foreign-keyed, indexed.
- Tenant model with deriveCode() helper + effectiveBoundary()
  fallback chain.
- App\Tenancy\Tenancy — process-level current-tenant register with
  withTenant() / withoutScope() helpers for jobs + super-admin.
- App\Tenancy\TenantScope — global Eloquent scope, no-op when no
  tenant is set (so seeders + super-admin reads still work).
- App\Tenancy\HasTenant trait — applied to Household, DropOffPoint,
  Dumpsite, PartnerStore. Auto-fills tenant_id on create from
  Tenancy::current().
- ResolveTenant middleware — reads X-Tenant-Code (or X-Tenant-Id),
  validates tenant exists + active, sets Tenancy::current(). Falls
  back to authenticated user's tenant_id when header missing.
  Registered globally on the api group.
- Login + register now require an active tenant (super-admin
  bypasses). Cross-tenant credential reuse is rejected with a
  403 + clear message.
- super_admin role added to RoleSeeder + users.role enum.
- Public GET /api/v1/tenants/lookup?code= — no auth, returns tenant
  details for the pre-login screen.

Seeders:
- SuperAdminSeeder seeds super@verde.local (tenant_id = null).
- SanPascualTenantSeeder seeds Region IV-A → Batangas → San Pascual
  municipality → sample Poblacion barangay → Tenant row with code
  SAN-PASCUAL-BAT, then backfills every existing tenant-aware row
  (13 users / 2 households / 5 DOPs / 1 dumpsite / 3 stores) so
  the dev environment keeps working end-to-end.
- Wired into DatabaseSeeder so migrate:fresh --seed bootstraps
  cleanly.

Customer-web:
- New /tenant page — text input, calls public lookup, confirms with
  resolved tenant card, stores code + name in cookies (1 year).
  "Pilot users: SAN-PASCUAL-BAT" hint as a clickable shortcut.
- /login + /register now redirect to /tenant?next= when no cookie,
  show a verde "signing in to <LGU>" pill with a Switch link,
  delegate the actual form to client components.
- /api/tenant route — POST sets cookie, DELETE clears.
- apiServer auto-attaches X-Tenant-Code on every API call when the
  cookie is present.
- Tenant cookies are non-httpOnly so the client can echo them; the
  session token stays httpOnly.

Build: 23 routes (added /tenant), 196 backend tests still pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-01 22:38:35 +08:00