Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
!.yarn/plugins
!.yarn/releases
!.yarn/versions
.idea/

# testing
/coverage
Expand Down
51 changes: 51 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,14 @@
"clsx": "^2.1.1",
"date-fns": "^4.1.0",
"framer-motion": "^12.23.24",
"leaflet": "^1.9.4",
"lucide-react": "^0.546.0",
"next": "15.5.6",
"next-themes": "^0.4.6",
"prettier": "^3.6.2",
"react": "19.1.0",
"react-dom": "19.1.0",
"react-leaflet": "^5.0.0",
"react-resizable-panels": "^3.0.6",
"sonner": "^2.0.7",
"tailwind-merge": "^3.3.1"
Expand All @@ -54,6 +56,7 @@
"@testing-library/react": "^16.3.0",
"@testing-library/user-event": "^14.6.1",
"@types/jest": "^30.0.0",
"@types/leaflet": "^1.9.21",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
Expand Down
43 changes: 43 additions & 0 deletions src/api/map.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
/**
* Map API
* API calls for map data (ambulances, dispatches, hospitals)
*/

import { api } from "@/lib/api-client";
import type { MapDataResponse, Ambulance, Dispatch, Hospital } from "@/types/map";

/**
* Get all map data (ambulances, dispatches, hospitals)
*/
export async function getMapData(lastHours: number = 24): Promise<MapDataResponse> {
const response = await api.get<MapDataResponse>(`/map/data?lastHours=${lastHours}`);
return response.data;
}

/**
* Get all active ambulances
*/
export async function getAmbulances(): Promise<{ ambulances: Ambulance[]; count: number }> {
const response = await api.get<{ ambulances: Ambulance[]; count: number }>("/map/ambulances");
return response.data;
}

/**
* Get active dispatches for map
*/
export async function getDispatches(
lastHours: number = 24
): Promise<{ dispatches: Dispatch[]; count: number }> {
const response = await api.get<{ dispatches: Dispatch[]; count: number }>(
`/map/dispatches?lastHours=${lastHours}`
);
return response.data;
}

/**
* Get all hospitals
*/
export async function getHospitals(): Promise<{ hospitals: Hospital[]; count: number }> {
const response = await api.get<{ hospitals: Hospital[]; count: number }>("/map/hospitals");
return response.data;
}
7 changes: 5 additions & 2 deletions src/app/(protected)/active-call/__tests__/page.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ describe("ActiveCallPage", () => {

render(<ActiveCallPage />);

expect(screen.getByText("AI Insights")).toBeInTheDocument();
expect(screen.getByText("AI Medical Analysis")).toBeInTheDocument();
expect(screen.getByText("Chief Complaint")).toBeInTheDocument();
});

Expand All @@ -286,6 +286,9 @@ describe("ActiveCallPage", () => {
aiStatus: "connected",
keywords: [],
emotionalState: "calm",
patientAge: 45,
patientGender: "Male",
location: "Paris",
},
],
stats: null,
Expand All @@ -295,7 +298,7 @@ describe("ActiveCallPage", () => {

render(<ActiveCallPage />);

expect(screen.getByText("Caller Information")).toBeInTheDocument();
expect(screen.getByText("Patient Information")).toBeInTheDocument();
expect(screen.getByText("John Doe")).toBeInTheDocument();
});

Expand Down
Loading
Loading