feat(frontend): register, guide, feedback, addresses & status polling

- Add register screen with onboarding redirect to address validation
- Add waste separation guide screen with 4 categories and offline tips
  (organicos, reciclables, sanitarios, especiales) plus preventive
  messaging banner
- Add feedback submission screen with 4 types and 1-5 star rating
- Add address screen: list colonias, pick one, validate against backend
- Switch from pull-to-refresh GPS hack to periodic polling of
  /tracking/status (30s) — backend now drives the simulation
- Filter notifications by logged-in user.id (tunnel-view on client side)
- Add register/logout/address actions to profile screen
- Hide login/register/feedback/addresses from tab bar (href: null)
- Set API_URL to LAN IP for physical phone testing over hotspot
This commit is contained in:
Diego Mireles
2026-05-23 02:34:13 -06:00
parent 59fcad643a
commit 131eeacbd2
14 changed files with 1034 additions and 81 deletions

View File

@@ -43,4 +43,32 @@ export const sendGpsUpdate = (payload: GpsUpdatePayload) =>
apiFetch<GpsUpdateResponse>("/api/tracking/gps-update", {
method: "POST",
body: JSON.stringify(payload),
});
});
export interface InboxNotification {
id: string;
userId: number;
type: NotificationType;
title: string;
body: string;
createdAt: string;
}
export interface UserStatusResponse {
user: { id: number; name: string; colonia: string };
route: {
routeId: string;
currentPositionId: number;
status: string;
updatedAt: string;
horarioEstimado: string | null;
};
eta: EtaResult | null;
notifications: InboxNotification[];
}
export const getMyStatus = () =>
apiFetch<UserStatusResponse>("/api/tracking/status");
export const resetDemo = () =>
apiFetch<{ message: string }>("/api/tracking/reset-demo", { method: "POST" });