Remove mock seed drivers and dead marker scatter

The drivers table was seeded with 4 fake fixtures (Karim/Rana/Omar/Layal)
using randomuser.me/unsplash placeholder images. They had no user_id, no
position, and were excluded from matching and the rider map by design, so
they only ever cluttered the dashboard. The table now starts empty — real
drivers are created in-app via onboarding (driver/profile POST), which
links a row to a real user account and gives it a live GPS position.

Dropped the dead random-offset scatter in generateMarkersFromData that
fabricated fake driver positions for drivers without GPS. It was already
unreachable (the null-position filter excluded those drivers), so this is
stub cleanup, not a behavior change — drivers without a real position
simply aren't rendered.

The 4 fixture rows were also removed from the live Neon DB (user_id IS
NULL); real onboarded drivers were untouched.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Krikorios
2026-08-24 14:23:42 +03:00
co-authored by Claude
parent 90cc487c32
commit 899ca93cd5
2 changed files with 12 additions and 36 deletions
+9 -22
View File
@@ -4,13 +4,11 @@ import type { Driver, MarkerData } from "@/types/type";
const directionsAPI = process.env.EXPO_PUBLIC_GOOGLE_API_KEY;
// Build map markers from driver rows. Drivers with a real GPS position use it
// directly; only legacy seed rows (no position) fall back to a small random
// scatter around the rider so the map isn't empty during local dev.
// Build map markers from driver rows. Only drivers reporting a real GPS
// position are shown — there is no fallback/scatter, so drivers without a
// position (none, now that seed fixtures are gone) simply aren't rendered.
export const generateMarkersFromData = ({
data,
userLatitude,
userLongitude,
}: {
data: Driver[];
userLatitude: number;
@@ -18,23 +16,12 @@ export const generateMarkersFromData = ({
}): MarkerData[] => {
return data
.filter((driver) => driver.latitude != null && driver.longitude != null)
.map((driver) => {
const lat =
driver.latitude != null
? driver.latitude
: userLatitude + (Math.random() - 0.5) * 0.01;
const lng =
driver.longitude != null
? driver.longitude
: userLongitude + (Math.random() - 0.5) * 0.01;
return {
...driver,
latitude: lat,
longitude: lng,
title: `${driver.first_name} ${driver.last_name}`,
};
});
.map((driver) => ({
...driver,
latitude: driver.latitude as number,
longitude: driver.longitude as number,
title: `${driver.first_name} ${driver.last_name}`,
}));
};
export const calculateRegion = ({