feat: Webservice-Mockdaten im public-Verzeichnis hinzugefügt

- JSON-Dateien für Linienstatus, Stationsstatus, Systemdaten und Benutzerrechte unter /public/mocks/webservice/ abgelegt
- Struktur der Dateien an echte Webservice-Antworten angepasst (z. B. 'Statis' statt 'Status')
- Dienste wurden entsprechend auf Umschaltung zwischen Mock- und Echtbetrieb vorbereitet
- Ermöglicht lokale Entwicklung und Tests ohne Backend-Verbindung
This commit is contained in:
ISA
2025-06-03 13:34:38 +02:00
parent 3412d3daff
commit 5c158a0395
17 changed files with 2251 additions and 46 deletions

View File

@@ -1,5 +1,3 @@
// /services/webservice/fetchGisSystemStaticService.js
/**
* Holt GIS-Systemdaten (Systemübersicht) vom TALAS WebService oder aus Mocks.
*
@@ -8,13 +6,22 @@
*/
export const fetchGisSystemStaticService = async () => {
const useMocks = process.env.NEXT_PUBLIC_USE_MOCKS === "true";
const mode = process.env.NEXT_PUBLIC_API_PORT_MODE;
const basePath = process.env.NEXT_PUBLIC_BASE_PATH || "";
if (useMocks) {
console.log("🧪 Mock-Modus aktiviert: fetchGisSystemStaticService");
const { mockGisSystemStatic } = await import("../../__mocks__/webservice/gisSystemStatic.js");
return mockGisSystemStatic.Systems;
const response = await fetch("/mocks/webservice/gisSystemStatic.json");
if (!response.ok) {
throw new Error("Mockdaten konnten nicht geladen werden");
}
const mockData = await response.json();
if (!Array.isArray(mockData.Systems)) {
throw new Error("Ungültige Struktur: 'Systems' fehlt im Mock");
}
return mockData.Systems;
} else {
const baseUrl = `${window.location.protocol}//${window.location.hostname}:80${basePath}/ClientData/WebServiceMap.asmx`;