diff --git a/IONOS-Infrastruktur-Kosten-und-Risiken.md b/IONOS-Infrastruktur-Kosten-und-Risiken.md new file mode 100644 index 0000000..9496140 --- /dev/null +++ b/IONOS-Infrastruktur-Kosten-und-Risiken.md @@ -0,0 +1,149 @@ +# Infrastruktur bei IONOS – Kosten- und Risikoaufstellung + +Entscheidungsgrundlage für den Aufbau der Firmeninfrastruktur (Prod-Datenbank, Backend, Backups). +**Kein HA vorerst.** Verglichen werden zwei Varianten: + +- **Variante A:** Managed-Datenbank (IONOS DBaaS PostgreSQL) + günstiger Backend-VPS +- **Variante B:** Alles auf **einem** VPS selbst gehostet (Backend + Datenbank zusammen) + +--- + +## 1. Wichtig vorab: zwei verschiedene IONOS-Produktlinien + +Der große Preisunterschied kommt daher, dass IONOS zwei sehr unterschiedliche Server-Produkte hat: + +| | **VPS Linux** (fester Tarif) | **Compute Engine / DBaaS** | +|---|---|---| +| CPU | **vCores** (geteilt / oversubscribed) | **Dedicated Cores** (garantiert, nie geteilt) | +| Preis | fester Monatspreis, sehr günstig | pay-per-use, Premium | +| Traffic | i. d. R. inklusive | separat berechnet | +| Beispiel | 6 vCores / 8 GB / 240 GB ≈ **18 €/Monat** | 1 Dedicated Core allein ≈ **43 €/Monat** | +| Wofür | Standard-Workloads, kleine/mittlere Firmen | garantierte Leistung, HA, Managed Services | + +> **Merksatz:** vCore ≠ Dedicated Core. Für ein Setup ohne HA ist der feste **VPS Linux** die richtige (und deutlich günstigere) Wahl. Die Compute-Engine-Sätze lohnen erst, wenn du garantierte, nicht geteilte Leistung brauchst. + +--- + +## 2. Annahmen & Preisbasis + +- Alle Preise **netto** (zzgl. 19 % MwSt.; für die Firma i. d. R. als Vorsteuer abziehbar). +- **Referenz-VPS:** 6 vCores / 8 GB RAM / 240 GB SSD = **18,00 €/Monat** (dein genannter Tarif). + - ⚠️ **Verlängerungspreis prüfen** – IONOS-VPS-Aktionspreise steigen oft nach den ersten Monaten. + - ⚠️ Prüfen, ob **Backup inklusive** ist oder als Acronis-Add-on extra kommt. +- **Managed-DB (DBaaS):** kein einfacher Listen-Stückpreis; wird nach Cluster-Ressourcen abgerechnet und läuft auf **dedizierten** Enterprise-Ressourcen (per-Minute). Der DB-Betrag unten ist eine **Schätzung** – im IONOS-Preisrechner / DCD verifizieren. + +### Ergänzende Ressourcensätze (Compute Engine, netto, pro 30 Tage = 720 h) + +| Ressource | Satz | Kosten / 30 Tage | +|---|---|---| +| 1 Dedicated Core | 0,06 € / Std. | 43,20 € | +| 1 GB RAM | 0,007 € / Std. | 5,04 € | +| 1 GB SSD Standard | 0,07 € / 30 Tage | 0,07 € | +| 1 GB S3-Backup | 0,007 € / 30 Tage | 0,007 € | + +--- + +## 3. Variante A – Managed-DB + Backend-VPS + +| Position | Konfiguration | Kosten / 30 Tage | +|---|---|---| +| Backend-VPS (fester Tarif) | z. B. 2–4 vCores / 4 GB / 160 GB | ~9,00 € | +| Managed-DB (DBaaS, 1 Knoten, **geschätzt**) | ~2 Cores / 4 GB / 40 GB, dediziert | ~109,00 € | +| DB-Backups (täglich + PITR 1 Woche) | im DBaaS **inklusive** | 0,00 € | +| Offsite-DB-Dumps (extern, ~50 GB) | für Retention > 1 Woche | ~0,35 € | +| **Summe Variante A** | | **~118 €/Monat netto** (~140 € brutto) | + +**Was du dafür bekommst:** kein DB-Betrieb (Updates, Failover, Backup, Monitoring automatisch), 99,95 % SLA, PITR. +**Der Aufpreis** entsteht durch die dedizierten DB-Ressourcen – nicht durch „Abzocke", sondern anderes Produkttier. + +--- + +## 4. Variante B – Alles auf einem VPS + +Backend **und** PostgreSQL (+ ggf. Gitea) auf einer Maschine. Du verwaltest die DB komplett selbst. + +| Position | Konfiguration | Kosten / 30 Tage | +|---|---|---| +| 1× VPS Linux | 6 vCores / 8 GB / 240 GB | 18,00 € | +| Offsite-Backup (extern, ~100 GB) | verschlüsselt, versioniert | ~0,70 € | +| *(optional)* IONOS-Backup-Add-on (Acronis) | managed, einfaches Restore | Add-on-Preis prüfen | +| **Summe Variante B** | | **~19 €/Monat netto** (~23 € brutto) | + +--- + +## 5. Backups vom VPS – Optionen + +Wichtig: **Snapshots/Images ≠ Backup.** Ein Snapshot ist ein Point-in-Time-Abbild; für echte Datensicherheit brauchst du versionierte, extern liegende Backups. + +| Option | Was | Aufwand | Kosten | +|---|---|---|---| +| **Externer S3 + restic/borg** | DIY, verschlüsselt, dedupliziert, versioniert, append-only gegen Ransomware | mittel (Script + Cron) | ~0,007 €/GB/Monat | +| **IONOS Backup Service (Acronis)** | agentenbasiert, managed, einfaches Restore | gering | per GB (Add-on) | +| **Snapshots / Images** | schnelles Rollback des ganzen Servers | gering | Storage-Satz | + +> **3-2-1-Regel für „überlebenswichtige" Daten:** 3 Kopien, 2 Medien, **1 außerhalb IONOS**. Wenn VPS **und** Backup bei IONOS liegen, ist der Provider ein Klumpenrisiko. Mindestens eine Kopie gehört zu einem **anderen Anbieter** (z. B. Backblaze B2, Wasabi) oder offline. +> **Datenbank-Dumps:** in Variante B täglich `pg_dump` + WAL-Archivierung; extern schieben. + +--- + +## 6. Kostenvergleich (Überblick) + +| Setup | Netto / Monat | Brutto / Monat | +|---|---|---| +| **B – alles auf 1 VPS** (kein HA) | **~19 €** | ~23 € | +| **A – Managed DBaaS + Backend-VPS** (kein HA) | **~118 €** | ~140 € | + +Der Unterschied ist **~6-fach** – und er ist kein „reiner Preis", sondern der Preis fürs **Abgeben des DB-Betriebs** (Automatik-Backups, PITR, Failover-fähige Infrastruktur, dedizierte Leistung). + +--- + +## 7. Risiken + +### Variante B – Alles auf einem VPS + +| Risiko | Bewertung | +|---|---| +| **Ein Server = ein Ausfallpunkt** (Backend + DB zusammen) | **hoch** – fällt der VPS aus, ist alles offline | +| **Kompletter DB-Betrieb bei dir** (Patching, Backup, PITR, Monitoring) | **hoch** – Zeit + Postgres-Know-how nötig | +| **Ungetestete Backups = keine Backups** | **hoch** | +| **vCores geteilt** → Leistung kann unter Last der Nachbarn schwanken | mittel | +| Sicherheitshärtung komplett selbst | mittel | +| Single-Provider-Risiko (VPS + Backup bei IONOS) | hoch – mit Offsite-Backup entschärfbar | +| **Vorteile:** sehr günstig, volle Kontrolle, kein Lock-in, jede PG-Version | – | + +### Variante A – Managed-DB + Backend-VPS + +| Risiko | Bewertung | +|---|---| +| Höhere Kosten (~6×) | mittel | +| Vendor-Lock-in an DBaaS | mittel – PostgreSQL portabel, Migration per `pg_dump` | +| PITR nur 1 Woche | mittel – längere Retention über eigene Offsite-Dumps | +| Backend-VPS bleibt in deiner Verantwortung | mittel | +| Single-Provider-Risiko (DB + VPS bei IONOS) | hoch – mit Offsite-Backup entschärfbar | +| **Vorteile:** kein DB-Betrieb, Auto-Backup/PITR, Failover-fähig, SLA | – | + +### Für beide Varianten + +- **Spiegeln ≠ Backup:** Replikation schützt gegen Ausfall, **nicht** gegen Löschfehler/Ransomware. +- **Restore-Tests einplanen** – regelmäßig komplette Wiederherstellung üben. +- **Offsite-Backup ist Pflicht**, egal welche Variante. +- **HA später:** sobald Ausfallzeit teuer wird, DB-Replica bzw. zweiter Standort ergänzen. + +--- + +## 8. Empfehlung + +Ohne HA-Bedarf und mit Kostenfokus ist **Variante B (alles auf einem VPS, ~19 €/Monat)** für den Start absolut vertretbar – **vorausgesetzt**, die Offsite-Backups (versioniert, extern, getestet) sitzen wirklich. Das ist bei einem kombinierten Backend-+-DB-Server der entscheidende Schutz. + +**Wechsle auf Variante A oder ergänze HA**, sobald: +- Ausfallzeit richtig Geld/Vertrauen kostet, **oder** +- niemand im Team dauerhaft Zeit/Know-how für DB-Betrieb hat, **oder** +- die Datenbank so groß/kritisch wird, dass manuelles Backup-Handling zu riskant ist. + +--- + +## 9. Hinweise + +- Zahlen sind eine **Schätzung** zur Entscheidungsfindung; verbindliche Preise im **IONOS-Preisrechner / DCD** prüfen (v. a. DBaaS-Anteil und VPS-**Verlängerungspreis**). +- Preise Stand der Recherche; IONOS passt Preise gelegentlich an. +- Dies ist keine Steuer- oder Vertragsberatung. diff --git a/REQUIREMENTS.md b/REQUIREMENTS.md index 82a921e..eabf680 100644 --- a/REQUIREMENTS.md +++ b/REQUIREMENTS.md @@ -41,7 +41,7 @@ Umfasst alle drei Plattform-Ebenen: OMSORG Desktop, OMSORG Connect, OMSORG Backe |---|---|---| | **OMSORG Desktop** | Vollständige Unternehmensmodule für Büromitarbeiter | 🔶 `omsorgapp/` — Electron/React, Release 0.1.1. Vorhanden: `HomePage`, `HomeStats`, `ContractWidget`, `EmployeesPage` mit Tabs/Detailpanel. Lokale JSON-DB (`~/Documents/Omsorg Business Controls Pro/database/omsorg-local-db.json`), noch keine SQLite/Server-Anbindung. | | **OMSORG Connect** | Mobile/Web-App für Außendienst | ✅ `omsorgWeb/mitarbeiter-app/` — PHP/MySQL, produktiv als PWA (Manifest + Service Worker). Deckt bereits Zeiterfassung/Stundennachweis, Urlaub, Abwesenheit, Fortbildung, Dokumente, News, Benefits, Werben, Einsatzanweisung, Dienstplan, Bewertungen ab. | -| **OMSORG Backend (Core + Engine)** | Eine Backend-Komponente, zwei interne Schichten: **Datenschicht (Core)** — gemeinsame Datenbasis, 6 Objekte; **Event-Schicht (Engine)** — Ereignis→Aktion-Automatisierung ohne eigene UI, arbeitet auf denselben Objekten der Datenschicht | 🔶 `omsorgCore/` — Grundgerüst steht (C#/.NET 8, ASP.NET Core Controller, EF Core/PostgreSQL, JWT-Auth, Rollen+Permission-Override-Rechtesystem, In-Process-Event-Dispatcher). Bisher nur `Employee` mit vollem Repository/Service/Controller; die anderen 5 Core-Objekte existieren als Domain-Entitäten, aber ohne Endpunkte. `omsorgapp` ist für Mitarbeiter jetzt **echt angebunden** (Login/Refresh sowie Employees-CRUD laufen über `omsorgCore`, keine lokale JSON-Datenhaltung mehr für dieses Modul). **Noch keine Anbindung** von `omsorgWeb` (MySQL) an dieses Backend, und die übrigen `omsorgapp`-Fachmodule (Kunden, Disposition, ...) nutzen weiterhin die lokale JSON-DB — die Insellösungen bestehen dort technisch weiter, bis diese Migration erfolgt. DB-Migration wurde noch nicht gegen eine echte PostgreSQL-Instanz verifiziert. Details: `omsorgCore/CLAUDE.md`. | +| **OMSORG Backend (Core + Engine)** | Eine Backend-Komponente, zwei interne Schichten: **Datenschicht (Core)** — gemeinsame Datenbasis, 6 Objekte; **Event-Schicht (Engine)** — Ereignis→Aktion-Automatisierung ohne eigene UI, arbeitet auf denselben Objekten der Datenschicht | 🔶 `omsorgCore/` — Grundgerüst steht (C#/.NET 8, ASP.NET Core Controller, EF Core/PostgreSQL, JWT-Auth, Rollen+Permission-Override-Rechtesystem, In-Process-Event-Dispatcher). `Employee`, `Facility` (+ `FacilityContact`), `Contract` und `Order` haben inzwischen volles Repository/Service/Controller; `TimeEntry`/`Invoice` existieren weiterhin nur als Domain-Entitäten, aber ohne Endpunkte. `omsorgapp` ist für Mitarbeiter jetzt **echt angebunden** (Login/Refresh sowie Employees-CRUD laufen über `omsorgCore`, keine lokale JSON-Datenhaltung mehr für dieses Modul), ebenso Kunden/Einrichtungen (`FacilitiesPage`). **Noch keine Anbindung** von `omsorgWeb` (MySQL) an dieses Backend, und die übrigen `omsorgapp`-Fachmodule (Disposition, ...) nutzen weiterhin die lokale JSON-DB — die Insellösungen bestehen dort technisch weiter, bis diese Migration erfolgt. DB-Migration wurde gegen eine echte PostgreSQL-Instanz verifiziert (siehe `omsorgCore/CLAUDE.md`, "Verifiziert"); die neueste Migration (`Order`/Statuspipeline) noch nicht. Details: `omsorgCore/CLAUDE.md`. | **Kernrisiko für die Roadmap:** Solange das Backend (Core + Engine) nicht existiert, sind Connect (MySQL) und Desktop (JSON) zwei Insellösungen — genau das, was Blueprint Kap. 19.9 ausschließt. Phase 1 der Roadmap muss dies zuerst auflösen (siehe Abschnitt 10). @@ -75,7 +75,7 @@ Umfasst alle drei Plattform-Ebenen: OMSORG Desktop, OMSORG Connect, OMSORG Backe | ID | Anforderung | Akteur | Akzeptanzkriterium | Status | |---|---|---|---|---| | FR-MA-1 | Stammdaten erfassen (Name, Geburtsdatum, Adresse, Kontakt, Notfallkontakt, Beschäftigungsart, Qualifikation, Ein-/Austritt, Status) [Blueprint 19.1] | Sabina, Malik, Sabrina | Datensatz anlegen/bearbeiten mit Pflichtfeldern; Validierung verhindert unvollständige Sätze | ✅ (alle Felder in `Employee`-Entity + `EmployeeForm` in `omsorgapp` vorhanden; Validierung serverseitig in `EmployeesController` (Pflichtfelder, Längen, Ein-/Austrittslogik, Beschäftigungsart-Allowlist) und clientseitig verdrahtet; `omsorgapp` spricht für Mitarbeiter jetzt über `employeesClient.cjs` echt gegen `omsorgCore`, keine JSON-lokale Persistenz mehr für dieses Modul — Abgleich mit Connect/`omsorgWeb` weiterhin offen, siehe FR-CORE-1) | -| FR-MA-2 | Arbeitsvertragsdaten (Beginn/Ende, Arbeitszeit, Stundenlohn, Zuschläge, Überstunden, Urlaubsanspruch, Probezeit) [Blueprint 19.1] | Sabina, Malik, Sabrina | Vertragsfelder je Mitarbeiter editierbar, Historie bei Änderung nachvollziehbar | ⬜ | +| FR-MA-2 | Arbeitsvertragsdaten (Beginn/Ende, Arbeitszeit, Stundenlohn, Zuschläge, Überstunden, Urlaubsanspruch, Probezeit) [Blueprint 19.1] | Sabina, Malik, Sabrina | Vertragsfelder je Mitarbeiter editierbar, Historie bei Änderung nachvollziehbar | 🔶 (`Contract`-Entity in `omsorgCore` um alle geforderten Felder erweitert, volles Repository/Service/Controller (`ContractsController`, `GET/POST/PUT /api/contracts`) nach dem Facility-Muster, gegated über `[RequirePermission(ModuleType.Contracts, ...)]`; Änderungshistorie automatisch über den generischen `AuditSaveChangesInterceptor` abgedeckt — noch kein `omsorgapp`-UI-Modul dafür) | | FR-MA-3 | Dokumente, Qualifikationen, Fortbildungen, Führerschein, Gesundheitsnachweise, Notizen, Historie je Mitarbeiter | Sabina, Malik, Sabrina | Upload/Anzeige je Kategorie, Zugriffsprotokoll | 🔶 (Dokumentenarchiv existiert bereits in Connect: `pages/dokumentenarchiv.php`, `actions/upload-dokument.php`; im Desktop-Modul fehlt es) | | FR-MA-4 | Eintrittsdatum löst Dashboard-Hinweis auf bevorstehenden Mitarbeiterstart aus [Blueprint 7] | alle Büro-Rollen | X Tage vor Eintritt erscheint Engine-Hinweis im Dashboard | ⬜ (abhängig von Engine, siehe 4.10) | | FR-MA-5 | Bei Büromitarbeitern kann der Mitarbeiterdatensatz mit einem Benutzerkonto + individuellen Rechten verknüpft werden [Blueprint 19.1] | Sabina, Malik | Rechteliste pro Modul (sehen/anlegen/bearbeiten/löschen/exportieren/freigeben) editierbar | 🔶 (`users`-Tabelle mit Rolle in `omsorgWeb/mitarbeiter-app` vorhanden, aber nur grobe Rolle, keine granularen Einzelrechte) | @@ -85,8 +85,8 @@ Umfasst alle drei Plattform-Ebenen: OMSORG Desktop, OMSORG Connect, OMSORG Backe | ID | Anforderung | Akteur | Akzeptanzkriterium | Status | |---|---|---|---|---| -| FR-EIN-1 | Stammdaten (Name, Art, Adresse, Rechnungsadresse, Telefon, E-Mail, Website, Status) [Blueprint 19.2] | Sabina, Malik, Sabrina, Sascha (Leads) | Datensatz anlegen/bearbeiten | ⬜ | -| FR-EIN-2 | Mehrere Ansprechpartner je Einrichtung mit Funktion, Abteilung, Kontaktwegen, Notizen | Sabina, Malik, Sabrina, Sascha | Liste von Ansprechpartnern editierbar, mind. 1:n-Beziehung | ⬜ | +| FR-EIN-1 | Stammdaten (Name, Art, Adresse, Rechnungsadresse, Telefon, E-Mail, Website, Status) [Blueprint 19.2] | Sabina, Malik, Sabrina, Sascha (Leads) | Datensatz anlegen/bearbeiten | 🔶 (`Facility`-Entity + volles Repository/Service/Controller (`FacilitiesController`, `GET/POST/PUT /api/facilities`) in `omsorgCore` vorhanden, serverseitige Rechteprüfung über `[RequirePermission(ModuleType.Facilities, ...)]`; Felder Name/Art(`FacilityType`)/Adresse/Rechnungsadresse/**Website**/Status(`CrmStatus`) abgedeckt — Adresse und Rechnungsadresse sind je strukturierte Felder (Straße/PLZ/Ort/Land, analog Mitarbeiter-Adresse), kein Freitext; UI-Modul in `omsorgapp` vorhanden (`FacilitiesPage`, Sidebar-Tab "Kunden", analog `EmployeesPage`) — Anlegen/Bearbeiten funktionsfähig gegen `omsorgCore`; **Telefon/E-Mail sind entgegen dieser Zeile bisher nicht als eigene `Facility`-Felder modelliert** — nur `FacilityContact` (FR-EIN-2) trägt Telefon/E-Mail je Ansprechpartner, es gibt kein allgemeines Einrichtungs-Telefon/-E-Mail; das war schon vor dieser Änderung so dokumentiert, aber sachlich falsch — noch zu klären/nachzuziehen) | +| FR-EIN-2 | Mehrere Ansprechpartner je Einrichtung mit Funktion, Abteilung, Kontaktwegen, Notizen | Sabina, Malik, Sabrina, Sascha | Liste von Ansprechpartnern editierbar, mind. 1:n-Beziehung | 🔶 (neue Entität `FacilityContact` (1:n zu `Facility`) in `omsorgCore`, `FacilityContactsController` unter `GET/POST /api/facilities/{facilityId}/contacts`, `PUT .../contacts/{id}`, gegated über dieselben `ModuleType.Facilities`-Rechte wie die Einrichtung selbst; Felder Name/Funktion(`Role`)/Abteilung(`Department`)/Telefon/E-Mail/Notizen abgedeckt; UI-Liste im `FacilityDetailPanel` (`omsorgapp`) anlegen/bearbeiten funktionsfähig; **kein Löschen** — konsistent mit dem noch fehlenden Soft-Delete für die übrigen Core-Objekte, siehe `omsorgCore/CLAUDE.md` "Offene Punkte") | | FR-EIN-3 | CRM-Status-Pipeline: Lead → kontaktiert → kein Bedarf → Wiedervorlage → Interesse → Angebot → Kunde → Bestandskunde [Blueprint, omsorg.md] | Sascha, Sabrina | Statuswechsel wird protokolliert; bei „kein Bedarf" wird automatisch Wiedervorlage in 14 Tagen erzeugt | ⬜ | | FR-EIN-4 | Konditionen (Verrechnungssatz, Zuschläge, Fahrtkosten, Mindeststunden, Zahlungsziel etc.) je Einrichtung [Blueprint 19.2] | Sabina, Malik, Sabrina | Konditionssatz ist Grundlage für Rechnungserstellung (siehe FR-RE-1) | ⬜ | | FR-EIN-5 | Verknüpfte Historie: Verträge, Aufträge, zugewiesene Mitarbeiter, Nachweise, Rechnungen, Zahlungen, Mahnungen, Kommunikation | alle Büro-Rollen (rechteabhängig) | Einrichtungsakte zeigt konsolidierte Historie ohne Datenduplizierung | ⬜ | @@ -95,8 +95,8 @@ Umfasst alle drei Plattform-Ebenen: OMSORG Desktop, OMSORG Connect, OMSORG Backe | ID | Anforderung | Akteur | Akzeptanzkriterium | Status | |---|---|---|---|---| -| FR-EM-1 | Auftrag erfassen (Einrichtung, Ansprechpartner, Qualifikation, Zeitraum, Schichtart, Anzahl Mitarbeiter, Konditionen, Priorität) [Blueprint 19.4] | Sabrina | Auftragsdatensatz mit Pflichtfeldern anlegbar | ⬜ | -| FR-EM-2 | Auftragsstatus-Pipeline: Anfrage → Prüfung → offen → teilweise besetzt → vollständig besetzt → aktiv → abgeschlossen/storniert [Blueprint 19.4] | Sabrina | Statuswechsel nur in zulässiger Reihenfolge, sichtbar im Dashboard | ⬜ | +| FR-EM-1 | Auftrag erfassen (Einrichtung, Ansprechpartner, Qualifikation, Zeitraum, Schichtart, Anzahl Mitarbeiter, Konditionen, Priorität) [Blueprint 19.4] | Sabrina | Auftragsdatensatz mit Pflichtfeldern anlegbar | 🔶 (`Order`-Entity in `omsorgCore` um alle geforderten Felder erweitert, volles Repository/Service/Controller (`OrdersController`, `GET/POST/PUT /api/orders`) nach dem Facility/Contract-Muster, gegated über `[RequirePermission(ModuleType.Orders, ...)]`; Ansprechpartner (`FacilityContactId`) wird gegen die angegebene Einrichtung cross-validiert — noch kein `omsorgapp`-UI-Modul dafür) | +| FR-EM-2 | Auftragsstatus-Pipeline: Anfrage → Prüfung → offen → teilweise besetzt → vollständig besetzt → aktiv → abgeschlossen/storniert [Blueprint 19.4] | Sabrina | Statuswechsel nur in zulässiger Reihenfolge, sichtbar im Dashboard | 🔶 (Pipeline serverseitig erzwungen: `OrderStatusDefinition`/`OrderStatusTransition` in `omsorgCore` bilden die Status und erlaubten Übergänge **DB-konfigurierbar** statt hartcodiert ab, Standard-Pipeline per `DbSeeder.SeedOrderStatusesAsync` geseedet, `OrderService.UpdateAsync` lehnt unzulässige Übergänge mit `400` ab; Dashboard-Sichtbarkeit fehlt noch — kein `omsorgapp`-UI) | | FR-EM-3 | Mitarbeiterzuweisung prüft Qualifikation, Verfügbarkeit, Arbeitszeit, Abwesenheiten, Überschneidungen, Vertragsbedingungen [Blueprint 19.4] | Sabrina | System verhindert/warnt bei Konflikten vor Zuweisung | ⬜ | | FR-EM-4 | Nach Zuweisung erhält Mitarbeiter automatisch Einsatzanweisung über OMSORG Connect [Blueprint 19.4] | System → Außendienst | Einsatzanweisung erscheint in Connect ohne manuellen Zusatzschritt | 🔶 (Connect hat bereits `pages/einsatzanweisung.php` inkl. Admin-Upload `actions/einsatzanweisung-action.php`; automatische Erzeugung aus Zuweisung fehlt, da Aufträge/Zuweisung noch nicht existieren) | | FR-EM-5 | Krankmeldung löst Ersatzbesetzungs-Workflow aus [omsorg.md, Blueprint 20.2] | System, Sabrina | Bei Krankmeldung erscheint Einsatz als "muss neu besetzt werden" inkl. Vorschlägen | ⬜ | diff --git a/omsorgCore/CLAUDE.md b/omsorgCore/CLAUDE.md index 7a67f00..fe084ca 100644 --- a/omsorgCore/CLAUDE.md +++ b/omsorgCore/CLAUDE.md @@ -27,10 +27,10 @@ omsorgCore/ .config/dotnet-tools.json # lokales dotnet-ef Tool (dotnet tool restore) src/ OmsorgCore.Domain/ # Entitäten, Enums. Keine Abhängigkeit auf andere Projekte. - Common/ # Entity, AuditableEntity (Basisklassen) - Enums/ # ModuleType, PermissionAction, PermissionEffect + Common/ # Entity, AuditableEntity, AuditRedactedAttribute (Basisklassen) + Enums/ # ModuleType, PermissionAction, PermissionEffect, AuditEventCategory Entities/ # Employee, Facility, Contract, Order, TimeEntry, Invoice, - # User, Role, RolePermission, UserPermissionOverride + # User, Role, RolePermission, UserPermissionOverride, AuditLogEntry OmsorgCore.Application/ # Business-Logik. Abhängig von Domain. Abstractions/ # Interfaces: IEmployeeRepository, IUserRepository, # IPasswordHasher, IJwtTokenGenerator, ICurrentUserService, @@ -42,16 +42,16 @@ omsorgCore/ OmsorgCoreDbContext.cs Configurations/ # ein IEntityTypeConfiguration pro Entität Migrations/ # EF-Core-Migrationen (InitialCreate bereits erzeugt) - Repositories/ # EmployeeRepository, UserRepository, RefreshTokenRepository (implementieren Application-Interfaces) + Repositories/ # EmployeeRepository, FacilityRepository, FacilityContactRepository, UserRepository, RefreshTokenRepository, AuditLogRepository (implementieren Application-Interfaces) Security/ # PasswordHasher, JwtOptions, JwtTokenGenerator, RefreshTokenOptions, RefreshTokenGenerator DependencyInjection.cs # AddInfrastructure(configuration) OmsorgCore.Engine/ # Event-Schicht. Abhängig von Domain + Application. Events/ # IDomainEvent, IDomainEventHandler, IDomainEventDispatcher, # DomainEventDispatcher (In-Process, kein Message-Bus), Beispiel-Event - Handlers/ # Beispiel-Handler (EmployeeCreatedHandler) + Handlers/ # Beispiel-Handler (EmployeeCreatedHandler), AuditEventHandler DependencyInjection.cs # AddEngine() OmsorgCore.Api/ # ASP.NET Core Web API. Abhängig von Application+Infrastructure+Engine. - Controllers/ # AuthController, EmployeesController, HealthController, AdminSessionsController + Controllers/ # AuthController, EmployeesController, FacilitiesController, FacilityContactsController, HealthController, AdminSessionsController, AuditLogController Contracts/ # Request-/Response-DTOs (LoginRequest, EmployeeResponse, ...) Security/ # CurrentUserService, RequirePermissionAttribute Program.cs # einziger Ort, an dem alle Schichten verdrahtet werden @@ -75,6 +75,21 @@ Rechteprüfung auf Controller-Actions: ``` Das Attribut (`src/OmsorgCore.Api/Security/RequirePermissionAttribute.cs`) prüft serverseitig über `IPermissionService` — nicht nur im Client (REQUIREMENTS.md NFR-9). Jeder Controller außer `AuthController` trägt zusätzlich `[Authorize]`. +**Rollen-Rechte-Matrix und User-Overrides verwalten (Admin-Flow):** Eine neu angelegte Rolle (`RoleService.CreateAsync`) hat zunächst keine `RolePermission`-Einträge — die Rechte-Matrix wird separat gesetzt über `GET /api/roles/{id}` (Rolle inkl. ihrer aktuellen `RolePermission`-Liste, `RoleService.GetByIdWithPermissionsAsync`) und `PUT /api/roles/{id}/permissions` (`RoleService.UpdatePermissionsAsync` — ersetzt die komplette `RolePermission`-Menge der Rolle durch die übergebene Menge, kein inkrementelles Patchen). Individuelle `UserPermissionOverride`-Ausnahmen eines Users werden über `GET/POST/DELETE /api/users/{id}/permission-overrides[...]` verwaltet (`UserService.GetPermissionOverridesAsync`/`AddPermissionOverrideAsync`/`RemovePermissionOverrideAsync` — `AddPermissionOverrideAsync` ist ein Upsert: existiert bereits ein Override für dasselbe Modul+Aktion bei diesem User, wird dessen `Effect` aktualisiert statt dupliziert). Alle diese Endpoints liegen auf `RolesController`/`UsersController`, gegated über `[RequirePermission(ModuleType.UserManagement, View|Edit)]` wie der Rest der Nutzerverwaltung. Admin-UI dazu: `omsorgapp/src/modules/settings/` (`SettingsPage`, `RolesPanel`, `RolePermissionMatrix`, `UserOverridesPanel`). + +**Wichtig:** Wird ein neuer `ModuleType` oder `PermissionAction`-Wert hinzugefügt, oder ändert sich sonst das Rollen-/Rechtesystem, muss dieser Abschnitt (Rechtesystem) im selben Change aktualisiert werden — diese Dokumentation ist keine Momentaufnahme, sondern muss mit der Software mitwachsen. + +## Audit-Log ("wer hat wann was verändert") + +Zwei sich ergänzende Erfassungswege, beide münden in dieselbe Tabelle `AuditLogEntry` (`src/OmsorgCore.Domain/Entities/AuditLogEntry.cs`, `Category` unterscheidet die Herkunft): + +1. **Automatisch, Entity-Änderungen:** `AuditSaveChangesInterceptor` (`src/OmsorgCore.Infrastructure/Persistence/AuditSaveChangesInterceptor.cs`, ein EF-Core-`SaveChangesInterceptor`) erfasst bei **jedem** `SaveChangesAsync` auf `OmsorgCoreDbContext` automatisch jede Create/Update/(Soft-)Delete-Änderung an einer beliebigen `AuditableEntity`-Subklasse — inkl. aller künftigen (Facility/Contract/Order/TimeEntry/Invoice), **ohne dass dafür Code in deren Services/Controllern nötig ist**. Bei Update wird nur der tatsächliche Feld-Diff (`{old, new}` je geändertem Feld) als JSON in `Details` gespeichert; ein Soft-Delete (`IsDeleted: false→true`) wird als Action `"Deleted"` erkannt, nicht als `"Updated"`. Sensible Felder (aktuell `User.PasswordHash`/`User.SecurityStamp`) sind mit `[AuditRedacted]` (`src/OmsorgCore.Domain/Common/AuditRedactedAttribute.cs`) markiert — der Interceptor ersetzt ihren Wert im Log durch `"***redacted***"`. **Neue sensible Felder in künftigen Entitäten müssen dieses Attribut bekommen**, sonst landen sie im Klartext im Audit-Log. +2. **Explizit, Verhaltens-Ereignisse ohne Entity-Änderung:** `AuditEvent` (`src/OmsorgCore.Engine/Events/AuditEvent.cs`) über den bestehenden `IDomainEventDispatcher` dispatcht, analog zu `EmployeeCreatedEvent` (siehe "Event-Schicht" unten) — für Aktionen wie Login/Logout/Session-Kill, die keine `AuditableEntity` verändern. `AuditEventHandler` (`Engine/Handlers/`) persistiert das Event als `AuditLogEntry` mit `Category = BehavioralEvent`. Aktuelle Dispatch-Stellen: `AuthController.Login` (`"Login"`/`"LoginFailed"`), `AuthController.Logout` (`"Logout"`), `AdminSessionsController.Revoke`/`RevokeAll` (`"SessionRevoked"`/`"AllSessionsRevoked"`). **Neue Aktionen folgen demselben Muster:** eine Zeile `await _dispatcher.DispatchAsync(new AuditEvent(actorUserId, actorUsername, ipAddress, "MeineAktion", details))` an der auslösenden Stelle im Api-Layer. Bewusst **kein** Event bei `AuthController.Refresh` (zu häufig/geräuschig für eine sliding Session, kein eigenständiges "wer hat was getan"-Faktum). + +Aktor-Informationen (`Username`/`RoleName`/`IpAddress`) kommen über `ICurrentUserService` (erweitert um diese drei Properties, Implementierung `CurrentUserService` liest sie aus JWT-Claims bzw. `HttpContext.Connection.RemoteIpAddress`). + +**Einsicht:** `GET /api/audit-log` (`AuditLogController`, Query-Filter `entityType`/`entityId`/`actorUserId`/`fromUtc`/`toUtc` + Pagination), gegated über `[RequirePermission(ModuleType.AuditLog, PermissionAction.View)]`. Per Default nur die Rolle `Geschäftsführung` (`DbSeeder.SeedBaseRolesAsync` iteriert für sie generisch alle `ModuleType`-Werte, siehe dort) — alle anderen Basis-Rollen sehen das Audit-Log nicht. + ## Auth-Flow 1. `POST /api/auth/login` (`AuthController`) → `AuthService.LoginAsync` prüft Username/Passwort-Hash, widerruft **alle bisherigen aktiven Refresh-Tokens dieses Users und würfelt seinen `SecurityStamp` neu** (`EndOtherSessionsAsync` — ein User hat immer nur eine aktive Session; ältere Sessions werden per Killswitch sofort ungültig, siehe "Session-Killswitch" unten), dann erzeugt `JwtTokenGenerator` ein Access-Token (Claims `sub`/`name`/`role`) + `RefreshTokenGenerator` einen langlebigen Refresh-Token. Response (`LoginResponse`): `accessToken`, `refreshToken`, `expiresAt` (camelCase, Default-JSON-Serialisierung von ASP.NET Core). @@ -85,8 +100,14 @@ Das Attribut (`src/OmsorgCore.Api/Security/RequirePermissionAttribute.cs`) prüf **Refresh-Token:** kein Rohtoken wird gespeichert, nur sein SHA-256-Hash (`RefreshToken`-Entity, `IRefreshTokenGenerator`). Gültigkeit über `RefreshToken:ExpiryDays` in `appsettings.json` (Default 60 Tage, sliding — jede Nutzung verlängert effektiv die Session), überschreibbar per `RefreshToken__ExpiryDays`. +**Passwort-Mindestlänge:** zentral über `IPasswordPolicy`/`PasswordPolicy` (`src/OmsorgCore.Infrastructure/Security/PasswordPolicy.cs`), gebunden an `PasswordPolicy:MinLength` in `appsettings.json` (Default 8, überschreibbar per `PasswordPolicy__MinLength`, siehe `CONFIGURATION.md`). Wird von `UserService` (Account-Anlage im Direct-Modus, Admin-Reset, `ChangeOwnPasswordAsync`) und `PasswordResetService.ResetPasswordAsync` injiziert geprüft — **nicht** mehr in den Controllern dupliziert. Bei Verstoß liefern die jeweiligen `*Result`-Typen einen `PasswordTooShort`-Wert, den `UsersController`/`AuthController` auf `400 BadRequest` mit der aktuell konfigurierten Zahl im Fehlertext abbilden. `GET /api/auth/password-policy` (kein `[Authorize]`) liefert `{ minLength }` für Clients, die denselben Wert für Hinweistexte/Vorab-Validierung brauchen (`omsorgapp`: `AuthContext.jsx`; `omsorgWeb/mitarbeiter-app`: `omsorgcore_password_policy()` in `lib/omsorgCoreClient.php`). + **Secret-Handling:** `appsettings.json` enthält nur Issuer/Audience/ExpiryMinutes/RefreshToken:ExpiryDays. `appsettings.Development.json` enthält einen **lokalen Platzhalter** für `Jwt:Secret` und den Connection-String (`CHANGE_ME_...`) — für echte Umgebungen über Umgebungsvariable (`Jwt__Secret`) oder `dotnet user-secrets` überschreiben, nie ein echtes Secret einchecken. +**Basis-Rollen-Seed (alle Umgebungen):** `DbSeeder.SeedBaseRolesAsync` (`src/OmsorgCore.Infrastructure/Persistence/DbSeeder.cs`) legt bei jedem Start die vier in `REQUIREMENTS.md` Abschnitt 3 ("Akteure & Rollen") und Abschnitt 7 ("Rechtematrix") beschriebenen Basis-Rollen an — `Geschäftsführung` (Sabina/Malik, voller Zugriff auf alle Module), `Disposition/Buchhaltung` (Sabrina), `Recruiting` (Sascha), `Außendienst` (ohne Modul-Rechte, da OMSORG Connect noch nicht gegen dieses Backend spricht und "nur eigene Daten" ohnehin Datenebene statt Modul-Recht ist). Läuft in Program.cs direkt nach den Migrationen, **nicht** auf `IsDevelopment()` beschränkt (im Gegensatz zum Admin-Seed unten) — enthält keine Zugangsdaten, nur Rollen-Stammdaten. Idempotent pro Rollenname: existiert eine Rolle schon (z. B. weil sie über die Rechte-Matrix-UI unter "Einstellungen" angepasst wurde), fasst der Seed sie nicht an. + +**Wichtig:** Die Zuordnung in `SeedBaseRolesAsync` ist eine Übersetzung der Rechtematrix aus `REQUIREMENTS.md` auf die aktuellen `ModuleType`/`PermissionAction`-Werte. Kommt ein neuer `ModuleType`/eine neue `PermissionAction` dazu, oder ändert sich die Rechtematrix in `REQUIREMENTS.md`, muss dieser Seed im selben Change mit aktualisiert werden — er ist keine Momentaufnahme, sondern muss mit der Software mitwachsen (siehe auch den allgemeinen Pflegehinweis am Ende dieses Abschnitts). + **Standard-Admin-Seed:** `DbSeeder.SeedDefaultAdminAsync` (`src/OmsorgCore.Infrastructure/Persistence/DbSeeder.cs`) legt beim Start **nur im Development-Modus** (`Program.cs`, `app.Environment.IsDevelopment()`) einen Benutzer `admin`/`abersicher` mit einer neuen Rolle `Administrator` (alle `ModuleType`×`PermissionAction`-Kombinationen als `RolePermission`) an — idempotent, läuft nur wenn noch **kein** `User` existiert. DB-Fehler dabei (z. B. keine Verbindung — Migrationen sind zu diesem Zeitpunkt bereits automatisch angewendet, siehe "Datenbank" unten) sind nicht fatal, werden nur geloggt (`try/catch` um den Seed-Aufruf). Bewusst **nicht** in Produktion aktiv, um kein bekanntes Standard-Passwort auszuliefern — für einen echten Produktivbetrieb muss ein richtiger User-Anlage-Flow her. ## Session-Killswitch (SecurityStamp) @@ -102,6 +123,8 @@ Ein Access-Token ist als JWT zustandslos gültig bis zum Ablauf (60 Min) — ein Exponiert über `AdminSessionsController` (`GET /api/admin/sessions`, `POST /api/admin/sessions/{id}/revoke`, `POST /api/admin/sessions/revoke-all`), geschützt über `[RequirePermission(ModuleType.UserManagement, ...)]` — per Default nur die `Administrator`-Rolle aus dem `DbSeeder`. Im Frontend: `omsorgapp/src/modules/debug/DebugSessionsPage.jsx`, im Sidebar-Menü nur sichtbar, wenn `hasPermission("UserManagement", "View")` (siehe `GET /api/auth/me` unten) — dieselbe Rechteprüfung wie serverseitig, kein reiner Rollennamen-Vergleich mehr im Client. +`Revoke`/`RevokeAll` dispatchen jeweils zusätzlich ein `AuditEvent` (`"SessionRevoked"`/`"AllSessionsRevoked"`, siehe "Audit-Log" oben) — ein Session-Kill hinterlässt damit nachvollziehbar, welcher Aktor ihn wann ausgelöst hat. + **Kosten:** ein zusätzlicher DB-Read pro authentifiziertem Request (`GetByIdAsync`). Für die aktuelle Nutzerzahl vernachlässigbar — bei relevantem Traffic-Wachstum wäre ein Cache (z. B. In-Memory mit kurzer TTL) der nächste Schritt, aber kein Caching ohne echten Bedarf, um die Sofortigkeit des Killswitches nicht zu unterlaufen. ## Passwort-Reset / E-Mail-Versand @@ -121,7 +144,7 @@ Vollständig implementiert: `PasswordResetCode`-Entity + `PasswordResetService` - Connection-String-Key: `ConnectionStrings:OmsorgCore` (Format `Host=...;Port=5432;Database=omsorg_core;Username=...;Password=...`). - `dotnet-ef` ist als lokales Tool eingerichtet (`.config/dotnet-tools.json`) — vor erster Nutzung `dotnet tool restore`. Wird nur noch zum **Erzeugen** neuer Migrationen gebraucht (`dotnet ef migrations add ...`), nicht mehr zum Anwenden. - **`Program.cs` ruft bei jedem Start `db.Database.MigrateAsync()` auf, in jeder Umgebung** (nicht nur Development) — ausstehende Migrationen werden automatisch angewendet, bevor der Server Requests annimmt. Ein manuelles `dotnet ef database update` ist dadurch nur noch zum gezielten Vorab-Prüfen/Debuggen einer Migration nötig, nicht mehr für den normalen Start/Deploy. Schlägt die Migration fehl, crasht der Start bewusst fatal (fail-fast) statt mit einem veralteten Schema weiterzulaufen. -- Migrationen `InitialCreate`, `AddRefreshTokens`, `AddUserSecurityStamp`, `AddEmployeeContactFieldConstraints` und `AddAuditableSoftDelete` existieren (`src/OmsorgCore.Infrastructure/Persistence/Migrations/`) und wurden erfolgreich gegen eine echte PostgreSQL-Instanz angewendet. +- Migrationen `InitialCreate`, `AddRefreshTokens`, `AddUserSecurityStamp`, `AddEmployeeContactFieldConstraints` und `AddAuditableSoftDelete` existieren (`src/OmsorgCore.Infrastructure/Persistence/Migrations/`) und wurden erfolgreich gegen eine echte PostgreSQL-Instanz angewendet. `AddContractDetailsAndQueryFilter` ist erzeugt, aber noch nicht gegen eine echte Instanz verifiziert (wird beim nächsten API-Start automatisch angewendet). ## Build- und Run-Befehle @@ -151,14 +174,55 @@ ASPNETCORE_ENVIRONMENT=Development dotnet run --project src/OmsorgCore.Api - `omsorgapp`s `authClient.cjs` erfolgreich gegen den laufenden Server getestet (Login/Refresh/Logout-Fehlerfälle). - **Kompletter Login-Flow end-to-end mit echtem Postgres verifiziert:** Login mit `admin`/`abersicher` (Seed) → gültiges Token-Paar; `refresh` rotiert korrekt (neues Paar, alter Refresh-Token danach 401 bei Wiederverwendung); `GET /api/employees` mit frischem Access-Token → 200 (Administrator-Rolle hat volle Rechte über den Seed). - **Session-Killswitch end-to-end verifiziert:** `GET /api/admin/sessions` liefert aktive Sessions; `POST /api/admin/sessions/revoke-all` → 204, danach liefert **derselbe, zuvor gültige Access-Token sofort 401** (nicht erst nach Ablauf) und der zugehörige Refresh-Token liefert bei `POST /api/auth/refresh` ebenfalls 401. Erneuter Login mit `admin`/`abersicher` funktioniert danach wieder normal. +- `DbSeeder.SeedBaseRolesAsync` gegen echte PostgreSQL-Instanz verifiziert: legt `Geschäftsführung`/`Disposition/Buchhaltung`/`Recruiting`/`Außendienst` mit der erwarteten Rechteanzahl an (54/33/10/0 Permissions), zweiter Lauf verändert nichts (idempotent pro Rollenname). + +## Konfigurierbare Auswahllisten + +Dropdown-Werte, die früher als hartcodierte Arrays im `omsorgapp`-Frontend lebten (Mitarbeiterstatus, Beschäftigungsart, CRM-Status, Einrichtungstyp) plus die entsprechenden, bisher nur als freier String modellierten Felder auf `Contract` (Vertragstyp/-status) und der Auftragsstatus (FR-EM-2) sind jetzt eine gemeinsame, admin-editierbare Stammdaten-Struktur statt Enum/hartcodiertes Array — Ziel: Löschen/Umbenennen/Hinzufügen ohne Code-Deploy, über die "Status-Verwaltung" unter "Einstellungen" in `omsorgapp`. + +**Datenmodell** (`src/OmsorgCore.Domain/Entities/`): `ValueList` (Stammdaten einer Liste — `Key`, eindeutig, z. B. `"EmployeeStatus"`, `"EmploymentType"`, `"CrmStatus"`, `"FacilityType"`, `"ContractType"`, `"ContractStatus"`, `"OrderStatus"`; `DisplayName` für die Admin-UI) + `ValueListItem` (`Value`, `SortOrder`, `IsDefault`, `IsInitial`/`IsTerminal` — die letzten beiden nur für `"OrderStatus"` relevant) + `ValueListItemTransition` (erlaubte Übergänge zwischen zwei Items derselben Liste, wird nur für `"OrderStatus"` befüllt). Ersetzt das frühere `OrderStatusDefinition`/`OrderStatusTransition`-Sondermodell — Migration `ReplaceOrderStatusWithValueLists` übernimmt bestehende Auftragsstatus-Zeilen 1:1 mit identischen Ids in die neuen Tabellen, damit `Order.StatusId` unverändert gültig bleibt. + +**Wo welches Feld referenziert wird:** +- `Order.StatusId` (FK, echte Fremdschlüsselbeziehung auf `ValueListItem.Id`) — einzige Liste mit Übergangsregeln. `OrderService.CreateAsync`/`UpdateAsync` nutzen `IValueListRepository.GetInitialItemAsync("OrderStatus", ...)`/`CanTransitionAsync(...)` genau wie zuvor `IOrderStatusRepository`. +- `Employee.Status`/`EmploymentType`, `Facility.CrmStatus`/`FacilityType`, `Contract.ContractType`/`Status` bleiben bewusst einfache `string`-Spalten (kein FK, keine Schema-Migration auf diesen Tabellen nötig) — stattdessen prüfen `EmployeesController`/`FacilitiesController`/`ContractsController` beim Schreiben serverseitig über `IValueListRepository.GetActiveValuesAsync(key, ...)`, dass der übergebene Wert unter den aktuell konfigurierten Werten der zugehörigen Liste ist (`400` sonst) — analog zur bereits bestehenden Passwort-Policy-Validierung. + +**Verwaltungs-API** (`ValueListsController`, Route `api/value-lists`): `GET /api/value-lists` (alle Listen), `GET /api/value-lists/{key}/items` (nur `[Authorize]`, kein Modul-Recht — die aufrufenden Formulare gehören zu unterschiedlichen Modulen), `POST`/`PUT/DELETE .../items[/...]` sowie `GET/PUT .../transitions` (nur für `"OrderStatus"`) gegated über `[RequirePermission(ModuleType.UserManagement, PermissionAction.Edit)]` — dieselbe Admin-Berechtigung wie die übrige "Einstellungen"-Seite. + +**Löschschutz ("erst überall entfernen"):** `ValueListService.DeleteItemAsync` löscht ein `ValueListItem` nur, wenn keine Verwendung mehr existiert. Eine `IValueListUsageChecker`-Implementierung je Liste (`Infrastructure/Repositories/StringFieldValueListUsageChecker.cs` — eine generische Klasse für alle String-Feld-Listen, mehrfach mit unterschiedlicher Query registriert in `Infrastructure/DependencyInjection.cs`; `OrderStatusValueListUsageChecker.cs` für die FK-basierte `"OrderStatus"`-Liste inkl. Übergangsregeln) prüft, ob der Wert noch irgendwo gesetzt ist. Bei Treffern liefert `DELETE .../items/{id}` `409` mit den Fundstellen (`EntityType`/`EntityId`/`DisplayLabel`) im Body, statt zu löschen. `GET .../items/{id}/usages` liefert dieselbe Prüfung jederzeit (nicht nur beim Löschversuch) — für den "wo wird das noch verwendet"-Info-Button in der UI. + +**Seed:** `DbSeeder.SeedValueListsAsync` (jede Umgebung, idempotent — läuft nur, solange `ValueLists` leer ist) legt alle sieben Listen mit Startwerten an, inkl. der Auftragsstatus-Pipeline (Anfrage → Prüfung → offen → teilweise besetzt → vollständig besetzt → aktiv → abgeschlossen, plus Storno aus jedem nicht-terminalen Status) samt Übergangsregeln. **Wichtig:** Kommt eine neue admin-editierbare Auswahlliste hinzu, gehört sie hier als weiterer `SeedSimpleListAsync`-Aufruf rein plus eine `IValueListUsageChecker`-Registrierung in `Infrastructure/DependencyInjection.cs` — dieser Abschnitt und der Seed müssen mit der Software mitwachsen. + +**Frontend (`omsorgapp`):** `electron/backend/valueListsClient.cjs` kapselt `/api/value-lists`, `src/app/useValueListItems.js` (Hook) lädt die Items einer Liste für Dropdowns (ersetzt die früheren hartcodierten Arrays in `EmployeeForm.jsx`/`FacilityForm.jsx`/`EmployeesPage.jsx`/`FacilitiesPage.jsx`). Verwaltungs-UI: `src/modules/settings/StatusManagementPanel.jsx`, dritter Tab ("Status-Verwaltung") in `SettingsPage.jsx`, gegated wie Rollen/Benutzerrechte über `hasPermission("UserManagement", ...)`. ## Offene Punkte -- Facility/Contract/Order/TimeEntry/Invoice haben noch keine Controller/Repositories/Services — nur Domain-Entitäten + DB-Konfiguration. Nächste Schritte folgen demselben Muster wie `Employee` (Repository-Interface in Application, Implementierung in Infrastructure, Service in Application, Controller in Api). +- `Facility` hat jetzt volles Repository/Service/Controller (`FacilitiesController`, `GET/POST/PUT /api/facilities`) nach dem Employee-Muster, inkl. `FacilityCreatedEvent`. Zusätzlich `FacilityContact` (FR-EIN-2, Ansprechpartner) als 1:n-Unterressource unter `GET/POST /api/facilities/{facilityId}/contacts`, `PUT .../contacts/{id}` (`FacilityContactsController`) — bewusst kein eigener `ModuleType`, sondern über dieselben `Facilities`-Rechte gegated, da Ansprechpartner kein eigenständiges Core-Objekt sind. Kein Delete-Endpoint für Ansprechpartner (konsistent mit dem noch fehlenden Soft-Delete für die übrigen Core-Objekte). +- `Contract` hat jetzt ebenfalls volles Repository/Service/Controller (`ContractsController`, `GET/POST/PUT /api/contracts`, gegated über `[RequirePermission(ModuleType.Contracts, ...)]`) nach demselben Facility-Muster, inkl. `ContractCreatedEvent`. Deckt FR-MA-2 auf Backend-Seite ab: `WeeklyHours` (Arbeitszeit), `HourlyWage` (Stundenlohn), `AllowancesDescription` (Zuschläge, Freitext), `OvertimeRules` (Überstundenregelung, Freitext), `VacationDaysPerYear` (Urlaubsanspruch), `ProbationPeriodMonths` (Probezeit) — alle nullable, da ein Vertrag entweder einem Mitarbeiter oder einer Einrichtung zugeordnet ist (`EmployeeId`/`FacilityId`, mindestens eins muss gesetzt sein, per Controller-Validierung erzwungen) und nicht jeder Vertragstyp alle Felder braucht. `ContractConfiguration` hat jetzt (wie `Facility`) einen `HasQueryFilter(!IsDeleted)`. Kein `omsorgapp`-UI-Modul dafür in diesem Schritt — nur das Backend-CRUD. +- `Order` hat jetzt ebenfalls volles Repository/Service/Controller (`OrdersController`, `GET/POST/PUT /api/orders`, gegated über `[RequirePermission(ModuleType.Orders, ...)]`) nach demselben Facility/Contract-Muster, inkl. `OrderCreatedEvent`. Deckt FR-EM-1 auf Backend-Seite ab: `FacilityContactId` (optionaler Ansprechpartner, gegen `FacilityId` cross-validiert — der Kontakt muss zur angegebenen Einrichtung gehören, sonst `400`), `ShiftType` (Schichtart, Freitext), `RequiredHeadcount` (Anzahl Mitarbeiter, mindestens 1), `Conditions` (Konditionen, Freitext), `Priority` (Priorität, Freitext). Der Auftragsstatus (FR-EM-2, `Order.StatusId`) ist Teil der generischen Auswahllisten — siehe "Konfigurierbare Auswahllisten" unten. `OrderConfiguration` hat jetzt (wie `Facility`/`Contract`) einen `HasQueryFilter(!IsDeleted)`. Kein `omsorgapp`-UI-Modul für Aufträge selbst in diesem Schritt (nur die Statuspflege über "Status-Verwaltung"). `TimeEntry`/`Invoice` haben weiterhin nur Domain-Entitäten + DB-Konfiguration — nächste Schritte folgen demselben Muster (Repository-Interface in Application, Implementierung in Infrastructure, Service in Application, Controller in Api). - Keine E-Mail-Verifizierung bei User-Anlage (Passwort-Reset per E-Mail ist fertig, siehe "Passwort-Reset / E-Mail-Versand" oben). - `omsorgapp` spricht seit Kurzem gegen dieses Backend (Login-Screen + Refresh-Token-Session, siehe `omsorgapp/CLAUDE.md`) — `omsorgWeb` ist noch nicht angebunden. - Kein Docker-/CI-Setup. +## Generierte API-Clients + +Aus der Swagger/OpenAPI-JSON dieses Backends (`/swagger/v1/swagger.json`, nur im Development-Modus aktiv) werden mit `openapi-generator-cli` typisierte Clients generiert — `omsorgapp/api-client-ts/` (TypeScript, `typescript-fetch`-Template) und `omsorgWeb/mitarbeiter-app/api-client-php/` (PHP). + +**Wichtig — `omsorgapp/api-client-ts` ist kein optionales Extra mehr, sondern im echten Datenpfad:** Alle Wrapper unter `omsorgapp/electron/backend/*Client.cjs` (`employeesClient.cjs`, `facilitiesClient.cjs`, `facilityContactsClient.cjs`, `usersClient.cjs`, `rolesClient.cjs`, `valueListsClient.cjs`, `auditLogClient.cjs`, `authClient.cjs`, ...) importieren die jeweilige `*Api`-Klasse aus dem generierten Paket `omsorgcore-client-ts` (`require('omsorgcore-client-ts')`) und reichen Requests/Responses **ungeprüft typisiert** durch. Nur `omsorgWeb/mitarbeiter-app/lib/omsorgCoreClient.php` bleibt tatsächlich unabhängig vom generierten PHP-Client. + +**Verbindliche Regel: nach *jeder* Änderung an einem Controller oder DTO in `omsorgCore.Api/Contracts` muss `omsorgapp/api-client-ts` neu generiert und neu gebaut werden — noch in demselben Change, nicht als Nachgang.** Wird das vergessen, gibt es **keinen Fehler, keine Exception, keine Warnung** — der generierte Client kennt das neue/geänderte Feld schlicht nicht und lässt es beim Serialisieren/Deserialisieren stillschweigend weg. Das Symptom in der UI: Speichern/Anlegen meldet Erfolg, aber das betroffene Feld kommt nie im Backend an bzw. taucht nie in der Antwort auf — schwer zu debuggen, weil weder Backend noch Frontend-Code einen sichtbaren Fehler werfen (siehe FR-EIN-1/Website-Vorfall, 2026-08-08). + +```bash +# omsorgCore muss dafür lokal im Development-Modus laufen (Swagger nur dort aktiv): +cd omsorgCore && ASPNETCORE_ENVIRONMENT=Development dotnet run --project src/OmsorgCore.Api + +# in einem zweiten Terminal: +cd omsorgapp/api-client-ts +npm run generate # entspricht ./generate.sh — überschreibt src/, README.md, package.json, tsconfig*.json +npm run build # erzeugt dist/, das die *Client.cjs-Wrapper tatsächlich importieren +``` + +`npm run generate` überschreibt `package.json` komplett (Standard-Output von openapi-generator) — das dort eingetragene `generate`-Script muss danach jedes Mal erneut ergänzt werden (`git diff package.json` prüfen), sonst verschwindet es beim nächsten Lauf wieder. Details/Voraussetzungen: `omsorgapp/api-client-ts/ANLEITUNG.md` (das jeweilige `README.md` wird vom Generator automatisch überschrieben, `ANLEITUNG.md` bleibt stabil). `omsorgWeb/mitarbeiter-app/api-client-php` ist aktuell nicht im echten Datenpfad (siehe oben), sollte aber aus Konsistenzgründen bei Gelegenheit ebenfalls regeneriert werden. + ## Die sechs Core-Objekte (Domain-Entitäten) Aus `REQUIREMENTS.md` Abschnitt 6 / Blueprint Kap. 19: **Mitarbeiter, Einrichtung, Vertrag, Auftrag, Zeiterfassung, Rechnung** — als `Employee`, `Facility`, `Contract`, `Order`, `TimeEntry`, `Invoice` in `src/OmsorgCore.Domain/Entities/` angelegt, mit Kernfeldern (nicht vollständig ausmodelliert). @@ -167,13 +231,13 @@ Verbindliche Regeln für das Datenmodell: 1. Jede Entität hat eine eindeutige `Guid Id` (siehe `Entity`-Basisklasse). 2. Beziehungen ausschließlich über Foreign Keys/IDs, keine redundante Texteingabe verwandter Daten. 3. Stammdaten nur an einer Stelle — kein Feld, das auch in `omsorgWeb` oder `omsorgapp` unabhängig gepflegt wird, sobald die Migration dorthin begonnen hat. -4. Änderungen an geschäftsrelevanten Daten müssen nachvollziehbar sein — `AuditableEntity` liefert `CreatedAt`/`UpdatedAt`; ein vollständiger Audit-Trail (wer hat was geändert) ist noch nicht gebaut. +4. Änderungen an geschäftsrelevanten Daten müssen nachvollziehbar sein — `AuditableEntity` liefert `CreatedAt`/`UpdatedAt`; ein vollständiger Audit-Trail (wer hat was geändert) läuft automatisch über den `AuditSaveChangesInterceptor` (siehe "Audit-Log" oben), keine Handarbeit pro Entität nötig. 5. Kein Hard-Delete für sensible/geschäftsrelevante Daten — Soft-Delete/Archivierung (noch nicht implementiert, bei Bedarf einbauen statt Datensätze zu löschen). 6. Berechtigungsprüfung auf Daten- und Funktionsebene (siehe Rechtesystem oben und Rechtematrix in `REQUIREMENTS.md` Abschnitt 7). 7. Rechnungen entstehen ausschließlich aus freigegebener Zeiterfassung (FR-ZE-3/FR-RE-1) — muss bei Ausbau von `TimeEntry`/`Invoice` auf Domain-/Application-Ebene erzwungen werden, nicht nur als UI-Regel im Client. ## Event-Schicht (Engine) — Funktionsweise -`IDomainEventDispatcher` (Singleton, In-Process) löst über den DI-Container alle registrierten `IDomainEventHandler` für ein Event auf und ruft sie auf. Beispiel: `EmployeesController.Create` ruft nach dem Speichern `_dispatcher.DispatchAsync(new EmployeeCreatedEvent(created.Id))` auf, `EmployeeCreatedHandler` reagiert darauf (aktuell nur Logging). Neue Trigger aus `REQUIREMENTS.md` Abschnitt 4.10 (Krankmeldung, fehlender Tätigkeitsnachweis, Vertragsende, ...) folgen demselben Muster: Event-Klasse in `Engine/Events/`, Handler in `Engine/Handlers/`, Registrierung in `Engine/DependencyInjection.cs`, Dispatch-Aufruf an der Stelle im Api-Layer, wo das auslösende Ereignis passiert. +`IDomainEventDispatcher` (Singleton, In-Process) löst über den DI-Container alle registrierten `IDomainEventHandler` für ein Event auf und ruft sie auf. Beispiel: `EmployeesController.Create` ruft nach dem Speichern `_dispatcher.DispatchAsync(new EmployeeCreatedEvent(created.Id))` auf, `EmployeeCreatedHandler` reagiert darauf (aktuell nur Logging). Zweites Beispiel, generisch statt fachspezifisch: `AuditEvent` (siehe "Audit-Log" oben) wird von mehreren Stellen im Api-Layer für beliebige Verhaltens-Ereignisse gefeuert, `AuditEventHandler` persistiert sie einheitlich. Neue Trigger aus `REQUIREMENTS.md` Abschnitt 4.10 (Krankmeldung, fehlender Tätigkeitsnachweis, Vertragsende, ...) folgen demselben Muster: Event-Klasse in `Engine/Events/`, Handler in `Engine/Handlers/`, Registrierung in `Engine/DependencyInjection.cs`, Dispatch-Aufruf an der Stelle im Api-Layer, wo das auslösende Ereignis passiert. **Wichtig:** `Application`-Services dispatchen bewusst *nicht* selbst (sie kennen `Engine` nicht, das würde die Abhängigkeitsrichtung verletzen) — das Dispatchen passiert im Api-Layer, der als einziger alle Schichten kennt. diff --git a/omsorgCore/CONFIGURATION.md b/omsorgCore/CONFIGURATION.md index 87ad1d9..74505f9 100644 --- a/omsorgCore/CONFIGURATION.md +++ b/omsorgCore/CONFIGURATION.md @@ -24,6 +24,7 @@ ASP.NET Core liest Konfiguration in dieser Reihenfolge (später gewinnt): | `RefreshToken:ExpiryDays` | `60` | `RefreshToken__ExpiryDays` | Gültigkeitsdauer eines Refresh-Tokens (sliding — jede Nutzung/Rotation verlängert effektiv die Session). | | `Auth:MaxLoginFailures` | `5` | `Auth__MaxLoginFailures` | Fehlversuche pro IP innerhalb von `Auth:LoginLockoutMinutes`, ab denen `POST /api/auth/login` mit `429` sperrt (zentral für alle Clients, siehe `AuthService.LoginAsync`/`LoginAttempt`). | | `Auth:LoginLockoutMinutes` | `10` | `Auth__LoginLockoutMinutes` | Zeitfenster, in dem Fehlversuche gezählt werden, bevor die Sperre wieder abläuft. | +| `PasswordPolicy:MinLength` | `8` | `PasswordPolicy__MinLength` | Mindestlänge für jedes neu gesetzte Passwort (Account-Anlage, Admin-Reset, Passwort ändern, Passwort-vergessen-Reset — zentral über `IPasswordPolicy`, siehe `omsorgCore/CLAUDE.md`). Über `GET /api/auth/password-policy` auch unauthentifiziert abrufbar, damit Clients denselben Wert für Hinweistexte/Vorab-Validierung nutzen können. | ## Passwort-Reset / E-Mail diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/AddUserPermissionOverrideRequest.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/AddUserPermissionOverrideRequest.cs new file mode 100644 index 0000000..330ad59 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/AddUserPermissionOverrideRequest.cs @@ -0,0 +1,5 @@ +using OmsorgCore.Domain.Enums; + +namespace OmsorgCore.Api.Contracts; + +public record AddUserPermissionOverrideRequest(ModuleType Module, PermissionAction Action, PermissionEffect Effect); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/AuditLogEntryResponse.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/AuditLogEntryResponse.cs new file mode 100644 index 0000000..2e1c65f --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/AuditLogEntryResponse.cs @@ -0,0 +1,13 @@ +namespace OmsorgCore.Api.Contracts; + +public record AuditLogEntryResponse( + Guid Id, + DateTime OccurredAtUtc, + Guid? ActorUserId, + string? ActorUsername, + string? IpAddress, + string Category, + string Action, + string? EntityType, + Guid? EntityId, + string? Details); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/ContractResponse.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/ContractResponse.cs new file mode 100644 index 0000000..ff66e4a --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/ContractResponse.cs @@ -0,0 +1,16 @@ +namespace OmsorgCore.Api.Contracts; + +public record ContractResponse( + Guid Id, + string ContractType, + Guid? EmployeeId, + Guid? FacilityId, + DateOnly StartDate, + DateOnly? EndDate, + string Status, + decimal? WeeklyHours, + decimal? HourlyWage, + string? AllowancesDescription, + string? OvertimeRules, + int? VacationDaysPerYear, + int? ProbationPeriodMonths); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/CreateContractRequest.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/CreateContractRequest.cs new file mode 100644 index 0000000..1e2ac3b --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/CreateContractRequest.cs @@ -0,0 +1,14 @@ +namespace OmsorgCore.Api.Contracts; + +public record CreateContractRequest( + string ContractType, + Guid? EmployeeId, + Guid? FacilityId, + DateOnly StartDate, + DateOnly? EndDate, + decimal? WeeklyHours, + decimal? HourlyWage, + string? AllowancesDescription, + string? OvertimeRules, + int? VacationDaysPerYear, + int? ProbationPeriodMonths); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/CreateFacilityContactRequest.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/CreateFacilityContactRequest.cs new file mode 100644 index 0000000..2c13119 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/CreateFacilityContactRequest.cs @@ -0,0 +1,9 @@ +namespace OmsorgCore.Api.Contracts; + +public record CreateFacilityContactRequest( + string Name, + string? Role, + string? Department, + string? PhoneNumber, + string? Email, + string? Notes); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/CreateFacilityRequest.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/CreateFacilityRequest.cs new file mode 100644 index 0000000..8a28f77 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/CreateFacilityRequest.cs @@ -0,0 +1,14 @@ +namespace OmsorgCore.Api.Contracts; + +public record CreateFacilityRequest( + string Name, + string? FacilityType, + string? Website, + string? Street, + string? PostalCode, + string? City, + string? Country, + string? BillingStreet, + string? BillingPostalCode, + string? BillingCity, + string? BillingCountry); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/CreateOrderRequest.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/CreateOrderRequest.cs new file mode 100644 index 0000000..947030f --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/CreateOrderRequest.cs @@ -0,0 +1,12 @@ +namespace OmsorgCore.Api.Contracts; + +public record CreateOrderRequest( + Guid FacilityId, + Guid? FacilityContactId, + DateOnly StartDate, + DateOnly? EndDate, + string? RequiredQualification, + string? ShiftType, + int RequiredHeadcount, + string? Conditions, + string Priority); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/CreateValueListItemRequest.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/CreateValueListItemRequest.cs new file mode 100644 index 0000000..dd79123 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/CreateValueListItemRequest.cs @@ -0,0 +1,8 @@ +namespace OmsorgCore.Api.Contracts; + +public record CreateValueListItemRequest( + string Value, + int SortOrder, + bool IsDefault = false, + bool IsInitial = false, + bool IsTerminal = false); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/FacilityContactResponse.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/FacilityContactResponse.cs new file mode 100644 index 0000000..1b9f0b5 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/FacilityContactResponse.cs @@ -0,0 +1,11 @@ +namespace OmsorgCore.Api.Contracts; + +public record FacilityContactResponse( + Guid Id, + Guid FacilityId, + string Name, + string? Role, + string? Department, + string? PhoneNumber, + string? Email, + string? Notes); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/FacilityResponse.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/FacilityResponse.cs new file mode 100644 index 0000000..cfad41e --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/FacilityResponse.cs @@ -0,0 +1,16 @@ +namespace OmsorgCore.Api.Contracts; + +public record FacilityResponse( + Guid Id, + string Name, + string CrmStatus, + string? FacilityType, + string? Website, + string? Street, + string? PostalCode, + string? City, + string? Country, + string? BillingStreet, + string? BillingPostalCode, + string? BillingCity, + string? BillingCountry); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/OrderResponse.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/OrderResponse.cs new file mode 100644 index 0000000..c4eef05 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/OrderResponse.cs @@ -0,0 +1,15 @@ +namespace OmsorgCore.Api.Contracts; + +public record OrderResponse( + Guid Id, + Guid FacilityId, + Guid? FacilityContactId, + DateOnly StartDate, + DateOnly? EndDate, + string? RequiredQualification, + string? ShiftType, + int RequiredHeadcount, + string? Conditions, + string Priority, + Guid StatusId, + string StatusName); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/PasswordPolicyResponse.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/PasswordPolicyResponse.cs new file mode 100644 index 0000000..83adab0 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/PasswordPolicyResponse.cs @@ -0,0 +1,3 @@ +namespace OmsorgCore.Api.Contracts; + +public record PasswordPolicyResponse(int MinLength); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/PermissionDto.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/PermissionDto.cs index 120e639..34fa004 100644 --- a/omsorgCore/src/OmsorgCore.Api/Contracts/PermissionDto.cs +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/PermissionDto.cs @@ -1,3 +1,5 @@ +using OmsorgCore.Domain.Enums; + namespace OmsorgCore.Api.Contracts; -public record PermissionDto(string Module, string Action); +public record PermissionDto(ModuleType Module, PermissionAction Action); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/RolePermissionsResponse.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/RolePermissionsResponse.cs new file mode 100644 index 0000000..9289889 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/RolePermissionsResponse.cs @@ -0,0 +1,3 @@ +namespace OmsorgCore.Api.Contracts; + +public record RolePermissionsResponse(Guid Id, string Name, IReadOnlyList Permissions); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/UpdateContractRequest.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/UpdateContractRequest.cs new file mode 100644 index 0000000..cd7029c --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/UpdateContractRequest.cs @@ -0,0 +1,15 @@ +namespace OmsorgCore.Api.Contracts; + +public record UpdateContractRequest( + string ContractType, + Guid? EmployeeId, + Guid? FacilityId, + DateOnly StartDate, + DateOnly? EndDate, + string Status, + decimal? WeeklyHours, + decimal? HourlyWage, + string? AllowancesDescription, + string? OvertimeRules, + int? VacationDaysPerYear, + int? ProbationPeriodMonths); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/UpdateFacilityContactRequest.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/UpdateFacilityContactRequest.cs new file mode 100644 index 0000000..cd69a6b --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/UpdateFacilityContactRequest.cs @@ -0,0 +1,9 @@ +namespace OmsorgCore.Api.Contracts; + +public record UpdateFacilityContactRequest( + string Name, + string? Role, + string? Department, + string? PhoneNumber, + string? Email, + string? Notes); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/UpdateFacilityRequest.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/UpdateFacilityRequest.cs new file mode 100644 index 0000000..d09501f --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/UpdateFacilityRequest.cs @@ -0,0 +1,15 @@ +namespace OmsorgCore.Api.Contracts; + +public record UpdateFacilityRequest( + string Name, + string CrmStatus, + string? FacilityType, + string? Website, + string? Street, + string? PostalCode, + string? City, + string? Country, + string? BillingStreet, + string? BillingPostalCode, + string? BillingCity, + string? BillingCountry); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/UpdateOrderRequest.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/UpdateOrderRequest.cs new file mode 100644 index 0000000..adfc302 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/UpdateOrderRequest.cs @@ -0,0 +1,13 @@ +namespace OmsorgCore.Api.Contracts; + +public record UpdateOrderRequest( + Guid FacilityId, + Guid? FacilityContactId, + DateOnly StartDate, + DateOnly? EndDate, + string? RequiredQualification, + string? ShiftType, + int RequiredHeadcount, + string? Conditions, + string Priority, + Guid StatusId); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/UpdateRolePermissionsRequest.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/UpdateRolePermissionsRequest.cs new file mode 100644 index 0000000..6b5334a --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/UpdateRolePermissionsRequest.cs @@ -0,0 +1,3 @@ +namespace OmsorgCore.Api.Contracts; + +public record UpdateRolePermissionsRequest(IReadOnlyList Permissions); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/UpdateValueListItemRequest.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/UpdateValueListItemRequest.cs new file mode 100644 index 0000000..4634dc7 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/UpdateValueListItemRequest.cs @@ -0,0 +1,8 @@ +namespace OmsorgCore.Api.Contracts; + +public record UpdateValueListItemRequest( + string Value, + int SortOrder, + bool IsDefault = false, + bool IsInitial = false, + bool IsTerminal = false); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/UserPermissionOverrideResponse.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/UserPermissionOverrideResponse.cs new file mode 100644 index 0000000..34f8a1a --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/UserPermissionOverrideResponse.cs @@ -0,0 +1,5 @@ +using OmsorgCore.Domain.Enums; + +namespace OmsorgCore.Api.Contracts; + +public record UserPermissionOverrideResponse(Guid Id, ModuleType Module, PermissionAction Action, PermissionEffect Effect); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/ValueListItemResponse.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/ValueListItemResponse.cs new file mode 100644 index 0000000..57eb227 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/ValueListItemResponse.cs @@ -0,0 +1,9 @@ +namespace OmsorgCore.Api.Contracts; + +public record ValueListItemResponse( + Guid Id, + string Value, + int SortOrder, + bool IsDefault, + bool IsInitial, + bool IsTerminal); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/ValueListResponse.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/ValueListResponse.cs new file mode 100644 index 0000000..edac1a6 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/ValueListResponse.cs @@ -0,0 +1,3 @@ +namespace OmsorgCore.Api.Contracts; + +public record ValueListResponse(Guid Id, string Key, string DisplayName); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/ValueListTransitionRequest.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/ValueListTransitionRequest.cs new file mode 100644 index 0000000..6edee70 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/ValueListTransitionRequest.cs @@ -0,0 +1,3 @@ +namespace OmsorgCore.Api.Contracts; + +public record ValueListTransitionRequest(Guid FromItemId, Guid ToItemId); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/ValueListTransitionResponse.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/ValueListTransitionResponse.cs new file mode 100644 index 0000000..c4ea6c1 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/ValueListTransitionResponse.cs @@ -0,0 +1,3 @@ +namespace OmsorgCore.Api.Contracts; + +public record ValueListTransitionResponse(Guid Id, Guid FromItemId, Guid ToItemId); diff --git a/omsorgCore/src/OmsorgCore.Api/Contracts/ValueListUsageResponse.cs b/omsorgCore/src/OmsorgCore.Api/Contracts/ValueListUsageResponse.cs new file mode 100644 index 0000000..9ecb6a6 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Contracts/ValueListUsageResponse.cs @@ -0,0 +1,3 @@ +namespace OmsorgCore.Api.Contracts; + +public record ValueListUsageResponse(string EntityType, Guid EntityId, string DisplayLabel); diff --git a/omsorgCore/src/OmsorgCore.Api/Controllers/AdminSessionsController.cs b/omsorgCore/src/OmsorgCore.Api/Controllers/AdminSessionsController.cs index a655442..3d0ed2b 100644 --- a/omsorgCore/src/OmsorgCore.Api/Controllers/AdminSessionsController.cs +++ b/omsorgCore/src/OmsorgCore.Api/Controllers/AdminSessionsController.cs @@ -1,9 +1,12 @@ +using System.Text.Json; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using OmsorgCore.Api.Contracts; using OmsorgCore.Api.Security; +using OmsorgCore.Application.Abstractions; using OmsorgCore.Application.Services; using OmsorgCore.Domain.Enums; +using OmsorgCore.Engine.Events; namespace OmsorgCore.Api.Controllers; @@ -17,10 +20,17 @@ namespace OmsorgCore.Api.Controllers; public class AdminSessionsController : ControllerBase { private readonly ISessionAdminService _sessionAdminService; + private readonly ICurrentUserService _currentUserService; + private readonly IDomainEventDispatcher _dispatcher; - public AdminSessionsController(ISessionAdminService sessionAdminService) + public AdminSessionsController( + ISessionAdminService sessionAdminService, + ICurrentUserService currentUserService, + IDomainEventDispatcher dispatcher) { _sessionAdminService = sessionAdminService; + _currentUserService = currentUserService; + _dispatcher = dispatcher; } [HttpGet] @@ -36,6 +46,14 @@ public class AdminSessionsController : ControllerBase public async Task Revoke(Guid id, CancellationToken cancellationToken) { await _sessionAdminService.RevokeSessionAsync(id, cancellationToken); + await _dispatcher.DispatchAsync( + new AuditEvent( + _currentUserService.UserId, + _currentUserService.Username, + _currentUserService.IpAddress, + "SessionRevoked", + JsonSerializer.Serialize(new { sessionId = id })), + cancellationToken); return NoContent(); } @@ -44,6 +62,13 @@ public class AdminSessionsController : ControllerBase public async Task RevokeAll(CancellationToken cancellationToken) { await _sessionAdminService.RevokeAllSessionsAsync(cancellationToken); + await _dispatcher.DispatchAsync( + new AuditEvent( + _currentUserService.UserId, + _currentUserService.Username, + _currentUserService.IpAddress, + "AllSessionsRevoked"), + cancellationToken); return NoContent(); } } diff --git a/omsorgCore/src/OmsorgCore.Api/Controllers/AuditLogController.cs b/omsorgCore/src/OmsorgCore.Api/Controllers/AuditLogController.cs new file mode 100644 index 0000000..a357b91 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Controllers/AuditLogController.cs @@ -0,0 +1,62 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using OmsorgCore.Api.Contracts; +using OmsorgCore.Api.Security; +using OmsorgCore.Application.Abstractions; +using OmsorgCore.Domain.Entities; +using OmsorgCore.Domain.Enums; + +namespace OmsorgCore.Api.Controllers; + +/// +/// Nachvollziehbarkeit "wer hat wann was am System verändert" - kombiniert automatisch erfasste +/// Entity-Änderungen (AuditSaveChangesInterceptor) und explizit gemeldete Verhaltens-Ereignisse +/// (AuditEvent, z. B. Login/Logout/Session-Kill). Per Default nur für die Rolle Geschäftsführung +/// sichtbar (siehe DbSeeder.SeedBaseRolesAsync). +/// +[ApiController] +[Authorize] +[Route("api/audit-log")] +public class AuditLogController : ControllerBase +{ + private readonly IAuditLogService _auditLogService; + + public AuditLogController(IAuditLogService auditLogService) + { + _auditLogService = auditLogService; + } + + [HttpGet] + [RequirePermission(ModuleType.AuditLog, PermissionAction.View)] + public async Task>> GetAll( + [FromQuery] string? entityType, + [FromQuery] Guid? entityId, + [FromQuery] Guid? actorUserId, + [FromQuery] AuditEventCategory? category, + [FromQuery] DateTime? fromUtc, + [FromQuery] DateTime? toUtc, + [FromQuery] int page = 1, + [FromQuery] int pageSize = 50, + CancellationToken cancellationToken = default) + { + page = Math.Max(page, 1); + pageSize = Math.Clamp(pageSize, 1, 200); + + var (items, totalCount) = await _auditLogService.GetPagedAsync( + entityType, entityId, actorUserId, category, fromUtc, toUtc, page, pageSize, cancellationToken); + + return Ok(new PagedResponse(items.Select(ToResponse).ToList(), totalCount, page, pageSize)); + } + + private static AuditLogEntryResponse ToResponse(AuditLogEntry entry) => new( + entry.Id, + entry.OccurredAtUtc, + entry.ActorUserId, + entry.ActorUsername, + entry.IpAddress, + entry.Category.ToString(), + entry.Action, + entry.EntityType, + entry.EntityId, + entry.Details); +} diff --git a/omsorgCore/src/OmsorgCore.Api/Controllers/AuthController.cs b/omsorgCore/src/OmsorgCore.Api/Controllers/AuthController.cs index aae9631..e9bb5c6 100644 --- a/omsorgCore/src/OmsorgCore.Api/Controllers/AuthController.cs +++ b/omsorgCore/src/OmsorgCore.Api/Controllers/AuthController.cs @@ -1,9 +1,11 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; using OmsorgCore.Api.Contracts; using OmsorgCore.Application.Abstractions; using OmsorgCore.Application.Services; using OmsorgCore.Engine.Events; +using OmsorgCore.Infrastructure.Security; namespace OmsorgCore.Api.Controllers; @@ -16,19 +18,22 @@ public class AuthController : ControllerBase private readonly IPasswordResetService _passwordResetService; private readonly IUserService _userService; private readonly IDomainEventDispatcher _dispatcher; + private readonly PasswordPolicyOptions _passwordPolicyOptions; public AuthController( IAuthService authService, ICurrentUserService currentUserService, IPasswordResetService passwordResetService, IUserService userService, - IDomainEventDispatcher dispatcher) + IDomainEventDispatcher dispatcher, + IOptions passwordPolicyOptions) { _authService = authService; _currentUserService = currentUserService; _passwordResetService = passwordResetService; _userService = userService; _dispatcher = dispatcher; + _passwordPolicyOptions = passwordPolicyOptions.Value; } [HttpPost("login")] @@ -44,9 +49,11 @@ public class AuthController : ControllerBase if (!result.Success || result.Token is null || result.RefreshToken is null || result.ExpiresAt is null) { + await _dispatcher.DispatchAsync(new AuditEvent(null, request.Username, ipAddress, "LoginFailed"), cancellationToken); return Unauthorized(); } + await _dispatcher.DispatchAsync(new AuditEvent(result.UserId, result.Username, ipAddress, "Login"), cancellationToken); return Ok(new LoginResponse(result.Token, result.RefreshToken, result.ExpiresAt.Value, result.MustChangePassword)); } @@ -66,6 +73,9 @@ public class AuthController : ControllerBase public async Task Logout(LogoutRequest request, CancellationToken cancellationToken) { await _authService.RevokeAsync(request.RefreshToken, cancellationToken); + await _dispatcher.DispatchAsync( + new AuditEvent(_currentUserService.UserId, _currentUserService.Username, _currentUserService.IpAddress, "Logout"), + cancellationToken); return NoContent(); } @@ -85,7 +95,7 @@ public class AuthController : ControllerBase } var permissions = profile.Permissions - .Select(p => new PermissionDto(p.Module.ToString(), p.Action.ToString())) + .Select(p => new PermissionDto(p.Module, p.Action)) .ToList(); return Ok(new MeResponse( @@ -110,13 +120,19 @@ public class AuthController : ControllerBase return Unauthorized(); } - if (string.IsNullOrWhiteSpace(request.NewPassword) || request.NewPassword.Length < 8) + var result = await _userService.ChangeOwnPasswordAsync(userId, request.CurrentPassword, request.NewPassword, cancellationToken); + return result switch { - return BadRequest("NewPassword muss mindestens 8 Zeichen lang sein."); - } + ChangeOwnPasswordResult.Success => NoContent(), + ChangeOwnPasswordResult.PasswordTooShort => BadRequest($"NewPassword muss mindestens {_passwordPolicyOptions.MinLength} Zeichen lang sein."), + _ => Unauthorized() + }; + } - var success = await _userService.ChangeOwnPasswordAsync(userId, request.CurrentPassword, request.NewPassword, cancellationToken); - return success ? NoContent() : Unauthorized(); + [HttpGet("password-policy")] + public ActionResult PasswordPolicy() + { + return Ok(new PasswordPolicyResponse(_passwordPolicyOptions.MinLength)); } [HttpPost("forgot-password/request")] @@ -156,8 +172,13 @@ public class AuthController : ControllerBase return Unauthorized(); } - var success = await _passwordResetService.ResetPasswordAsync( + var result = await _passwordResetService.ResetPasswordAsync( request.ResetToken, request.NewPassword, cancellationToken); - return success ? NoContent() : Unauthorized(); + return result switch + { + ResetPasswordResult.Success => NoContent(), + ResetPasswordResult.PasswordTooShort => BadRequest($"NewPassword muss mindestens {_passwordPolicyOptions.MinLength} Zeichen lang sein."), + _ => Unauthorized() + }; } } diff --git a/omsorgCore/src/OmsorgCore.Api/Controllers/ContractsController.cs b/omsorgCore/src/OmsorgCore.Api/Controllers/ContractsController.cs new file mode 100644 index 0000000..cc11787 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Controllers/ContractsController.cs @@ -0,0 +1,242 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using OmsorgCore.Api.Contracts; +using OmsorgCore.Api.Security; +using OmsorgCore.Application.Abstractions; +using OmsorgCore.Application.Services; +using OmsorgCore.Domain.Entities; +using OmsorgCore.Domain.Enums; +using OmsorgCore.Engine.Events; + +namespace OmsorgCore.Api.Controllers; + +[ApiController] +[Authorize] +[Route("api/contracts")] +public class ContractsController : ControllerBase +{ + private const string ContractTypeListKey = "ContractType"; + private const string ContractStatusListKey = "ContractStatus"; + + private readonly IContractService _contractService; + private readonly IValueListRepository _valueListRepository; + private readonly IDomainEventDispatcher _dispatcher; + + public ContractsController(IContractService contractService, IValueListRepository valueListRepository, IDomainEventDispatcher dispatcher) + { + _contractService = contractService; + _valueListRepository = valueListRepository; + _dispatcher = dispatcher; + } + + [HttpGet] + [RequirePermission(ModuleType.Contracts, PermissionAction.View)] + public async Task>> GetAll( + [FromQuery] string? search, + [FromQuery] string? status, + [FromQuery] Guid? employeeId, + [FromQuery] Guid? facilityId, + [FromQuery] int page = 1, + [FromQuery] int pageSize = 20, + CancellationToken cancellationToken = default) + { + page = Math.Max(page, 1); + pageSize = Math.Clamp(pageSize, 1, 100); + + var (items, totalCount) = await _contractService.GetPagedAsync(search, status, employeeId, facilityId, page, pageSize, cancellationToken); + return Ok(new PagedResponse(items.Select(ToResponse).ToList(), totalCount, page, pageSize)); + } + + [HttpGet("{id:guid}")] + [RequirePermission(ModuleType.Contracts, PermissionAction.View)] + public async Task> GetById(Guid id, CancellationToken cancellationToken) + { + var contract = await _contractService.GetByIdAsync(id, cancellationToken); + return contract is null ? NotFound() : Ok(ToResponse(contract)); + } + + [HttpPost] + [RequirePermission(ModuleType.Contracts, PermissionAction.Create)] + public async Task> Create(CreateContractRequest request, CancellationToken cancellationToken) + { + var fieldError = await ValidateFieldsAsync( + request.ContractType, + request.EmployeeId, + request.FacilityId, + request.StartDate, + request.EndDate, + request.WeeklyHours, + request.HourlyWage, + request.AllowancesDescription, + request.OvertimeRules, + request.VacationDaysPerYear, + request.ProbationPeriodMonths, + cancellationToken); + if (fieldError is not null) + { + return BadRequest(fieldError); + } + + var contract = new Contract + { + ContractType = request.ContractType, + EmployeeId = request.EmployeeId, + FacilityId = request.FacilityId, + StartDate = request.StartDate, + EndDate = request.EndDate, + WeeklyHours = request.WeeklyHours, + HourlyWage = request.HourlyWage, + AllowancesDescription = request.AllowancesDescription, + OvertimeRules = request.OvertimeRules, + VacationDaysPerYear = request.VacationDaysPerYear, + ProbationPeriodMonths = request.ProbationPeriodMonths + }; + + var created = await _contractService.CreateAsync(contract, cancellationToken); + await _dispatcher.DispatchAsync(new ContractCreatedEvent(created.Id), cancellationToken); + + return CreatedAtAction(nameof(GetById), new { id = created.Id }, ToResponse(created)); + } + + [HttpPut("{id:guid}")] + [RequirePermission(ModuleType.Contracts, PermissionAction.Edit)] + public async Task> Update(Guid id, UpdateContractRequest request, CancellationToken cancellationToken) + { + var fieldError = await ValidateFieldsAsync( + request.ContractType, + request.EmployeeId, + request.FacilityId, + request.StartDate, + request.EndDate, + request.WeeklyHours, + request.HourlyWage, + request.AllowancesDescription, + request.OvertimeRules, + request.VacationDaysPerYear, + request.ProbationPeriodMonths, + cancellationToken); + if (fieldError is not null) + { + return BadRequest(fieldError); + } + + if (string.IsNullOrWhiteSpace(request.Status) || request.Status.Length > 50) + { + return BadRequest("Status ist erforderlich und darf maximal 50 Zeichen lang sein."); + } + + var allowedStatuses = await _valueListRepository.GetActiveValuesAsync(ContractStatusListKey, cancellationToken); + if (!allowedStatuses.Contains(request.Status)) + { + return BadRequest($"Status muss einer der folgenden Werte sein: {string.Join(", ", allowedStatuses)}."); + } + + var updates = new Contract + { + ContractType = request.ContractType, + EmployeeId = request.EmployeeId, + FacilityId = request.FacilityId, + StartDate = request.StartDate, + EndDate = request.EndDate, + Status = request.Status, + WeeklyHours = request.WeeklyHours, + HourlyWage = request.HourlyWage, + AllowancesDescription = request.AllowancesDescription, + OvertimeRules = request.OvertimeRules, + VacationDaysPerYear = request.VacationDaysPerYear, + ProbationPeriodMonths = request.ProbationPeriodMonths + }; + + var updated = await _contractService.UpdateAsync(id, updates, cancellationToken); + return updated is null ? NotFound() : Ok(ToResponse(updated)); + } + + private async Task ValidateFieldsAsync( + string contractType, + Guid? employeeId, + Guid? facilityId, + DateOnly startDate, + DateOnly? endDate, + decimal? weeklyHours, + decimal? hourlyWage, + string? allowancesDescription, + string? overtimeRules, + int? vacationDaysPerYear, + int? probationPeriodMonths, + CancellationToken cancellationToken) + { + if (string.IsNullOrWhiteSpace(contractType) || contractType.Length > 100) + { + return "ContractType ist erforderlich und darf maximal 100 Zeichen lang sein."; + } + + var allowedContractTypes = await _valueListRepository.GetActiveValuesAsync(ContractTypeListKey, cancellationToken); + if (!allowedContractTypes.Contains(contractType)) + { + return $"ContractType muss einer der folgenden Werte sein: {string.Join(", ", allowedContractTypes)}."; + } + + if (employeeId is null && facilityId is null) + { + return "Ein Vertrag muss entweder einem Mitarbeiter oder einer Einrichtung zugeordnet sein."; + } + + if (startDate == default) + { + return "StartDate ist erforderlich."; + } + + if (endDate.HasValue && endDate.Value < startDate) + { + return "EndDate darf nicht vor StartDate liegen."; + } + + if (weeklyHours.HasValue && weeklyHours.Value < 0) + { + return "WeeklyHours darf nicht negativ sein."; + } + + if (hourlyWage.HasValue && hourlyWage.Value < 0) + { + return "HourlyWage darf nicht negativ sein."; + } + + if (vacationDaysPerYear.HasValue && vacationDaysPerYear.Value < 0) + { + return "VacationDaysPerYear darf nicht negativ sein."; + } + + if (probationPeriodMonths.HasValue && probationPeriodMonths.Value < 0) + { + return "ProbationPeriodMonths darf nicht negativ sein."; + } + + if (allowancesDescription is { Length: > 500 }) + { + return "AllowancesDescription darf maximal 500 Zeichen lang sein."; + } + + if (overtimeRules is { Length: > 500 }) + { + return "OvertimeRules darf maximal 500 Zeichen lang sein."; + } + + return null; + } + + private static ContractResponse ToResponse(Contract contract) + => new( + contract.Id, + contract.ContractType, + contract.EmployeeId, + contract.FacilityId, + contract.StartDate, + contract.EndDate, + contract.Status, + contract.WeeklyHours, + contract.HourlyWage, + contract.AllowancesDescription, + contract.OvertimeRules, + contract.VacationDaysPerYear, + contract.ProbationPeriodMonths); +} diff --git a/omsorgCore/src/OmsorgCore.Api/Controllers/EmployeesController.cs b/omsorgCore/src/OmsorgCore.Api/Controllers/EmployeesController.cs index a06104e..d039324 100644 --- a/omsorgCore/src/OmsorgCore.Api/Controllers/EmployeesController.cs +++ b/omsorgCore/src/OmsorgCore.Api/Controllers/EmployeesController.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using OmsorgCore.Api.Contracts; using OmsorgCore.Api.Security; +using OmsorgCore.Application.Abstractions; using OmsorgCore.Application.Services; using OmsorgCore.Domain.Entities; using OmsorgCore.Domain.Enums; @@ -14,15 +15,17 @@ namespace OmsorgCore.Api.Controllers; [Route("api/employees")] public class EmployeesController : ControllerBase { - private static readonly string[] AllowedEmploymentTypes = - { "Vollzeit", "Teilzeit", "Minijob", "Aushilfe", "Praktikant", "Freiberuflich" }; + private const string StatusListKey = "EmployeeStatus"; + private const string EmploymentTypeListKey = "EmploymentType"; private readonly IEmployeeService _employeeService; + private readonly IValueListRepository _valueListRepository; private readonly IDomainEventDispatcher _dispatcher; - public EmployeesController(IEmployeeService employeeService, IDomainEventDispatcher dispatcher) + public EmployeesController(IEmployeeService employeeService, IValueListRepository valueListRepository, IDomainEventDispatcher dispatcher) { _employeeService = employeeService; + _valueListRepository = valueListRepository; _dispatcher = dispatcher; } @@ -36,9 +39,13 @@ public class EmployeesController : ControllerBase [FromQuery] int pageSize = 20, CancellationToken cancellationToken = default) { - if (employmentType is not null && !AllowedEmploymentTypes.Contains(employmentType)) + if (employmentType is not null) { - return BadRequest($"employmentType muss einer der folgenden Werte sein: {string.Join(", ", AllowedEmploymentTypes)}."); + var allowedTypes = await _valueListRepository.GetActiveValuesAsync(EmploymentTypeListKey, cancellationToken); + if (!allowedTypes.Contains(employmentType)) + { + return BadRequest($"employmentType muss einer der folgenden Werte sein: {string.Join(", ", allowedTypes)}."); + } } page = Math.Max(page, 1); @@ -91,12 +98,13 @@ public class EmployeesController : ControllerBase return BadRequest(addressError); } - var stammdatenError = ValidateStammdatenFields( + var stammdatenError = await ValidateStammdatenFieldsAsync( request.EmergencyContactName, request.EmergencyContactPhone, request.EmergencyContactRelation, request.EmploymentType, - request.Qualification); + request.Qualification, + cancellationToken); if (stammdatenError is not null) { return BadRequest(stammdatenError); @@ -147,6 +155,12 @@ public class EmployeesController : ControllerBase return BadRequest("Status ist erforderlich und darf maximal 50 Zeichen lang sein."); } + var allowedStatuses = await _valueListRepository.GetActiveValuesAsync(StatusListKey, cancellationToken); + if (!allowedStatuses.Contains(request.Status)) + { + return BadRequest($"Status muss einer der folgenden Werte sein: {string.Join(", ", allowedStatuses)}."); + } + if (request.PhoneNumber is { Length: > 50 }) { return BadRequest("PhoneNumber darf maximal 50 Zeichen lang sein."); @@ -168,12 +182,13 @@ public class EmployeesController : ControllerBase return BadRequest(addressError); } - var stammdatenError = ValidateStammdatenFields( + var stammdatenError = await ValidateStammdatenFieldsAsync( request.EmergencyContactName, request.EmergencyContactPhone, request.EmergencyContactRelation, request.EmploymentType, - request.Qualification); + request.Qualification, + cancellationToken); if (stammdatenError is not null) { return BadRequest(stammdatenError); @@ -230,12 +245,13 @@ public class EmployeesController : ControllerBase return null; } - private static string? ValidateStammdatenFields( + private async Task ValidateStammdatenFieldsAsync( string? emergencyContactName, string? emergencyContactPhone, string? emergencyContactRelation, string? employmentType, - string? qualification) + string? qualification, + CancellationToken cancellationToken) { if (emergencyContactName is { Length: > 200 }) { @@ -252,9 +268,13 @@ public class EmployeesController : ControllerBase return "EmergencyContactRelation darf maximal 100 Zeichen lang sein."; } - if (employmentType is not null && !AllowedEmploymentTypes.Contains(employmentType)) + if (employmentType is not null) { - return $"EmploymentType muss einer der folgenden Werte sein: {string.Join(", ", AllowedEmploymentTypes)}."; + var allowedTypes = await _valueListRepository.GetActiveValuesAsync(EmploymentTypeListKey, cancellationToken); + if (!allowedTypes.Contains(employmentType)) + { + return $"EmploymentType muss einer der folgenden Werte sein: {string.Join(", ", allowedTypes)}."; + } } if (qualification is { Length: > 500 }) diff --git a/omsorgCore/src/OmsorgCore.Api/Controllers/FacilitiesController.cs b/omsorgCore/src/OmsorgCore.Api/Controllers/FacilitiesController.cs new file mode 100644 index 0000000..19741d9 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Controllers/FacilitiesController.cs @@ -0,0 +1,228 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using OmsorgCore.Api.Contracts; +using OmsorgCore.Api.Security; +using OmsorgCore.Application.Abstractions; +using OmsorgCore.Application.Services; +using OmsorgCore.Domain.Entities; +using OmsorgCore.Domain.Enums; +using OmsorgCore.Engine.Events; + +namespace OmsorgCore.Api.Controllers; + +[ApiController] +[Authorize] +[Route("api/facilities")] +public class FacilitiesController : ControllerBase +{ + private const string CrmStatusListKey = "CrmStatus"; + private const string FacilityTypeListKey = "FacilityType"; + + private readonly IFacilityService _facilityService; + private readonly IValueListRepository _valueListRepository; + private readonly IDomainEventDispatcher _dispatcher; + + public FacilitiesController(IFacilityService facilityService, IValueListRepository valueListRepository, IDomainEventDispatcher dispatcher) + { + _facilityService = facilityService; + _valueListRepository = valueListRepository; + _dispatcher = dispatcher; + } + + [HttpGet] + [RequirePermission(ModuleType.Facilities, PermissionAction.View)] + public async Task>> GetAll( + [FromQuery] string? search, + [FromQuery] string? crmStatus, + [FromQuery] int page = 1, + [FromQuery] int pageSize = 20, + CancellationToken cancellationToken = default) + { + page = Math.Max(page, 1); + pageSize = Math.Clamp(pageSize, 1, 100); + + var (items, totalCount) = await _facilityService.GetPagedAsync(search, crmStatus, page, pageSize, cancellationToken); + return Ok(new PagedResponse(items.Select(ToResponse).ToList(), totalCount, page, pageSize)); + } + + [HttpGet("{id:guid}")] + [RequirePermission(ModuleType.Facilities, PermissionAction.View)] + public async Task> GetById(Guid id, CancellationToken cancellationToken) + { + var facility = await _facilityService.GetByIdAsync(id, cancellationToken); + return facility is null ? NotFound() : Ok(ToResponse(facility)); + } + + [HttpPost] + [RequirePermission(ModuleType.Facilities, PermissionAction.Create)] + public async Task> Create(CreateFacilityRequest request, CancellationToken cancellationToken) + { + if (string.IsNullOrWhiteSpace(request.Name) || request.Name.Length > 300) + { + return BadRequest("Name ist erforderlich und darf maximal 300 Zeichen lang sein."); + } + + if (request.FacilityType is { Length: > 100 }) + { + return BadRequest("FacilityType darf maximal 100 Zeichen lang sein."); + } + + if (request.FacilityType is not null) + { + var allowedTypes = await _valueListRepository.GetActiveValuesAsync(FacilityTypeListKey, cancellationToken); + if (!allowedTypes.Contains(request.FacilityType)) + { + return BadRequest($"FacilityType muss einer der folgenden Werte sein: {string.Join(", ", allowedTypes)}."); + } + } + + if (request.Website is { Length: > 300 }) + { + return BadRequest("Website darf maximal 300 Zeichen lang sein."); + } + + var addressError = ValidateAddressFields(request.Street, request.PostalCode, request.City, request.Country, prefix: ""); + if (addressError is not null) + { + return BadRequest(addressError); + } + + var billingAddressError = ValidateAddressFields(request.BillingStreet, request.BillingPostalCode, request.BillingCity, request.BillingCountry, prefix: "Billing"); + if (billingAddressError is not null) + { + return BadRequest(billingAddressError); + } + + var facility = new Facility + { + Name = request.Name, + FacilityType = request.FacilityType, + Website = request.Website, + Street = request.Street, + PostalCode = request.PostalCode, + City = request.City, + Country = request.Country, + BillingStreet = request.BillingStreet, + BillingPostalCode = request.BillingPostalCode, + BillingCity = request.BillingCity, + BillingCountry = request.BillingCountry + }; + + var created = await _facilityService.CreateAsync(facility, cancellationToken); + await _dispatcher.DispatchAsync(new FacilityCreatedEvent(created.Id), cancellationToken); + + return CreatedAtAction(nameof(GetById), new { id = created.Id }, ToResponse(created)); + } + + [HttpPut("{id:guid}")] + [RequirePermission(ModuleType.Facilities, PermissionAction.Edit)] + public async Task> Update(Guid id, UpdateFacilityRequest request, CancellationToken cancellationToken) + { + if (string.IsNullOrWhiteSpace(request.Name) || request.Name.Length > 300) + { + return BadRequest("Name ist erforderlich und darf maximal 300 Zeichen lang sein."); + } + + if (string.IsNullOrWhiteSpace(request.CrmStatus) || request.CrmStatus.Length > 50) + { + return BadRequest("CrmStatus ist erforderlich und darf maximal 50 Zeichen lang sein."); + } + + var allowedCrmStatuses = await _valueListRepository.GetActiveValuesAsync(CrmStatusListKey, cancellationToken); + if (!allowedCrmStatuses.Contains(request.CrmStatus)) + { + return BadRequest($"CrmStatus muss einer der folgenden Werte sein: {string.Join(", ", allowedCrmStatuses)}."); + } + + if (request.FacilityType is { Length: > 100 }) + { + return BadRequest("FacilityType darf maximal 100 Zeichen lang sein."); + } + + if (request.FacilityType is not null) + { + var allowedTypes = await _valueListRepository.GetActiveValuesAsync(FacilityTypeListKey, cancellationToken); + if (!allowedTypes.Contains(request.FacilityType)) + { + return BadRequest($"FacilityType muss einer der folgenden Werte sein: {string.Join(", ", allowedTypes)}."); + } + } + + if (request.Website is { Length: > 300 }) + { + return BadRequest("Website darf maximal 300 Zeichen lang sein."); + } + + var addressError = ValidateAddressFields(request.Street, request.PostalCode, request.City, request.Country, prefix: ""); + if (addressError is not null) + { + return BadRequest(addressError); + } + + var billingAddressError = ValidateAddressFields(request.BillingStreet, request.BillingPostalCode, request.BillingCity, request.BillingCountry, prefix: "Billing"); + if (billingAddressError is not null) + { + return BadRequest(billingAddressError); + } + + var updates = new Facility + { + Name = request.Name, + CrmStatus = request.CrmStatus, + FacilityType = request.FacilityType, + Website = request.Website, + Street = request.Street, + PostalCode = request.PostalCode, + City = request.City, + Country = request.Country, + BillingStreet = request.BillingStreet, + BillingPostalCode = request.BillingPostalCode, + BillingCity = request.BillingCity, + BillingCountry = request.BillingCountry + }; + + var updated = await _facilityService.UpdateAsync(id, updates, cancellationToken); + return updated is null ? NotFound() : Ok(ToResponse(updated)); + } + + private static string? ValidateAddressFields(string? street, string? postalCode, string? city, string? country, string prefix) + { + if (street is { Length: > 200 }) + { + return $"{prefix}Street darf maximal 200 Zeichen lang sein."; + } + + if (postalCode is { Length: > 10 }) + { + return $"{prefix}PostalCode darf maximal 10 Zeichen lang sein."; + } + + if (city is { Length: > 100 }) + { + return $"{prefix}City darf maximal 100 Zeichen lang sein."; + } + + if (country is { Length: > 100 }) + { + return $"{prefix}Country darf maximal 100 Zeichen lang sein."; + } + + return null; + } + + private static FacilityResponse ToResponse(Facility facility) + => new( + facility.Id, + facility.Name, + facility.CrmStatus, + facility.FacilityType, + facility.Website, + facility.Street, + facility.PostalCode, + facility.City, + facility.Country, + facility.BillingStreet, + facility.BillingPostalCode, + facility.BillingCity, + facility.BillingCountry); +} diff --git a/omsorgCore/src/OmsorgCore.Api/Controllers/FacilityContactsController.cs b/omsorgCore/src/OmsorgCore.Api/Controllers/FacilityContactsController.cs new file mode 100644 index 0000000..40eda21 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Controllers/FacilityContactsController.cs @@ -0,0 +1,148 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using OmsorgCore.Api.Contracts; +using OmsorgCore.Api.Security; +using OmsorgCore.Application.Services; +using OmsorgCore.Domain.Entities; +using OmsorgCore.Domain.Enums; + +namespace OmsorgCore.Api.Controllers; + +/// +/// Ansprechpartner sind eine 1:n-Unterressource von Facility (REQUIREMENTS.md FR-EIN-2) — kein +/// eigenständiges Core-Objekt, daher unter /api/facilities/{facilityId}/contacts und mit den +/// gleichen Facilities-Rechten gegated statt einem eigenen ModuleType. +/// +[ApiController] +[Authorize] +[Route("api/facilities/{facilityId:guid}/contacts")] +public class FacilityContactsController : ControllerBase +{ + private readonly IFacilityService _facilityService; + private readonly IFacilityContactService _facilityContactService; + + public FacilityContactsController(IFacilityService facilityService, IFacilityContactService facilityContactService) + { + _facilityService = facilityService; + _facilityContactService = facilityContactService; + } + + [HttpGet] + [RequirePermission(ModuleType.Facilities, PermissionAction.View)] + public async Task>> GetAll(Guid facilityId, CancellationToken cancellationToken) + { + if (await _facilityService.GetByIdAsync(facilityId, cancellationToken) is null) + { + return NotFound(); + } + + var contacts = await _facilityContactService.GetByFacilityIdAsync(facilityId, cancellationToken); + return Ok(contacts.Select(ToResponse).ToList()); + } + + [HttpPost] + [RequirePermission(ModuleType.Facilities, PermissionAction.Create)] + public async Task> Create(Guid facilityId, CreateFacilityContactRequest request, CancellationToken cancellationToken) + { + if (await _facilityService.GetByIdAsync(facilityId, cancellationToken) is null) + { + return NotFound(); + } + + var fieldError = ValidateRequest(request.Name, request.Role, request.Department, request.PhoneNumber, request.Email, request.Notes); + if (fieldError is not null) + { + return BadRequest(fieldError); + } + + var contact = new FacilityContact + { + FacilityId = facilityId, + Name = request.Name, + Role = request.Role, + Department = request.Department, + PhoneNumber = request.PhoneNumber, + Email = request.Email, + Notes = request.Notes + }; + + var created = await _facilityContactService.CreateAsync(contact, cancellationToken); + return CreatedAtAction(nameof(GetAll), new { facilityId }, ToResponse(created)); + } + + [HttpPut("{id:guid}")] + [RequirePermission(ModuleType.Facilities, PermissionAction.Edit)] + public async Task> Update(Guid facilityId, Guid id, UpdateFacilityContactRequest request, CancellationToken cancellationToken) + { + var existing = await _facilityContactService.GetByIdAsync(id, cancellationToken); + if (existing is null || existing.FacilityId != facilityId) + { + return NotFound(); + } + + var fieldError = ValidateRequest(request.Name, request.Role, request.Department, request.PhoneNumber, request.Email, request.Notes); + if (fieldError is not null) + { + return BadRequest(fieldError); + } + + var updates = new FacilityContact + { + Name = request.Name, + Role = request.Role, + Department = request.Department, + PhoneNumber = request.PhoneNumber, + Email = request.Email, + Notes = request.Notes + }; + + var updated = await _facilityContactService.UpdateAsync(id, updates, cancellationToken); + return updated is null ? NotFound() : Ok(ToResponse(updated)); + } + + private static string? ValidateRequest(string name, string? role, string? department, string? phoneNumber, string? email, string? notes) + { + if (string.IsNullOrWhiteSpace(name) || name.Length > 200) + { + return "Name ist erforderlich und darf maximal 200 Zeichen lang sein."; + } + + if (role is { Length: > 100 }) + { + return "Role darf maximal 100 Zeichen lang sein."; + } + + if (department is { Length: > 100 }) + { + return "Department darf maximal 100 Zeichen lang sein."; + } + + if (phoneNumber is { Length: > 50 }) + { + return "PhoneNumber darf maximal 50 Zeichen lang sein."; + } + + if (email is { Length: > 200 }) + { + return "Email darf maximal 200 Zeichen lang sein."; + } + + if (notes is { Length: > 1000 }) + { + return "Notes darf maximal 1000 Zeichen lang sein."; + } + + return null; + } + + private static FacilityContactResponse ToResponse(FacilityContact contact) + => new( + contact.Id, + contact.FacilityId, + contact.Name, + contact.Role, + contact.Department, + contact.PhoneNumber, + contact.Email, + contact.Notes); +} diff --git a/omsorgCore/src/OmsorgCore.Api/Controllers/HealthController.cs b/omsorgCore/src/OmsorgCore.Api/Controllers/HealthController.cs index 09d3d06..af65af1 100644 --- a/omsorgCore/src/OmsorgCore.Api/Controllers/HealthController.cs +++ b/omsorgCore/src/OmsorgCore.Api/Controllers/HealthController.cs @@ -1,6 +1,5 @@ using Microsoft.AspNetCore.Mvc; -using Microsoft.EntityFrameworkCore; -using OmsorgCore.Infrastructure.Persistence; +using OmsorgCore.Application.Abstractions; namespace OmsorgCore.Api.Controllers; @@ -8,26 +7,17 @@ namespace OmsorgCore.Api.Controllers; [Route("api/health")] public class HealthController : ControllerBase { - private readonly OmsorgCoreDbContext _db; + private readonly IDatabaseConnectivityChecker _databaseConnectivityChecker; - public HealthController(OmsorgCoreDbContext db) + public HealthController(IDatabaseConnectivityChecker databaseConnectivityChecker) { - _db = db; + _databaseConnectivityChecker = databaseConnectivityChecker; } [HttpGet] public async Task Get(CancellationToken cancellationToken) { - bool databaseReachable; - try - { - databaseReachable = await _db.Database.CanConnectAsync(cancellationToken); - } - catch - { - databaseReachable = false; - } - + var databaseReachable = await _databaseConnectivityChecker.CanConnectAsync(cancellationToken); return Ok(new { status = "ok", databaseReachable }); } } diff --git a/omsorgCore/src/OmsorgCore.Api/Controllers/OrdersController.cs b/omsorgCore/src/OmsorgCore.Api/Controllers/OrdersController.cs new file mode 100644 index 0000000..18d37ea --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Controllers/OrdersController.cs @@ -0,0 +1,246 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using OmsorgCore.Api.Contracts; +using OmsorgCore.Api.Security; +using OmsorgCore.Application.Services; +using OmsorgCore.Domain.Entities; +using OmsorgCore.Domain.Enums; +using OmsorgCore.Engine.Events; + +namespace OmsorgCore.Api.Controllers; + +[ApiController] +[Authorize] +[Route("api/orders")] +public class OrdersController : ControllerBase +{ + private const string StatusListKey = "OrderStatus"; + + private readonly IOrderService _orderService; + private readonly IFacilityContactService _facilityContactService; + private readonly IValueListService _valueListService; + private readonly IDomainEventDispatcher _dispatcher; + + public OrdersController( + IOrderService orderService, + IFacilityContactService facilityContactService, + IValueListService valueListService, + IDomainEventDispatcher dispatcher) + { + _orderService = orderService; + _facilityContactService = facilityContactService; + _valueListService = valueListService; + _dispatcher = dispatcher; + } + + [HttpGet] + [RequirePermission(ModuleType.Orders, PermissionAction.View)] + public async Task>> GetAll( + [FromQuery] string? search, + [FromQuery] Guid? statusId, + [FromQuery] Guid? facilityId, + [FromQuery] int page = 1, + [FromQuery] int pageSize = 20, + CancellationToken cancellationToken = default) + { + page = Math.Max(page, 1); + pageSize = Math.Clamp(pageSize, 1, 100); + + var (items, totalCount) = await _orderService.GetPagedAsync(search, statusId, facilityId, page, pageSize, cancellationToken); + return Ok(new PagedResponse(items.Select(ToResponse).ToList(), totalCount, page, pageSize)); + } + + [HttpGet("{id:guid}")] + [RequirePermission(ModuleType.Orders, PermissionAction.View)] + public async Task> GetById(Guid id, CancellationToken cancellationToken) + { + var order = await _orderService.GetByIdAsync(id, cancellationToken); + return order is null ? NotFound() : Ok(ToResponse(order)); + } + + [HttpPost] + [RequirePermission(ModuleType.Orders, PermissionAction.Create)] + public async Task> Create(CreateOrderRequest request, CancellationToken cancellationToken) + { + var fieldError = ValidateFields( + request.FacilityId, + request.StartDate, + request.EndDate, + request.RequiredQualification, + request.ShiftType, + request.RequiredHeadcount, + request.Conditions, + request.Priority); + if (fieldError is not null) + { + return BadRequest(fieldError); + } + + var contactError = await ValidateFacilityContactAsync(request.FacilityContactId, request.FacilityId, cancellationToken); + if (contactError is not null) + { + return BadRequest(contactError); + } + + var order = new Order + { + FacilityId = request.FacilityId, + FacilityContactId = request.FacilityContactId, + StartDate = request.StartDate, + EndDate = request.EndDate, + RequiredQualification = request.RequiredQualification, + ShiftType = request.ShiftType, + RequiredHeadcount = request.RequiredHeadcount, + Conditions = request.Conditions, + Priority = request.Priority + }; + + var created = await _orderService.CreateAsync(order, cancellationToken); + await _dispatcher.DispatchAsync(new OrderCreatedEvent(created.Id), cancellationToken); + + var reloaded = await _orderService.GetByIdAsync(created.Id, cancellationToken) ?? created; + return CreatedAtAction(nameof(GetById), new { id = created.Id }, ToResponse(reloaded)); + } + + [HttpPut("{id:guid}")] + [RequirePermission(ModuleType.Orders, PermissionAction.Edit)] + public async Task> Update(Guid id, UpdateOrderRequest request, CancellationToken cancellationToken) + { + var fieldError = ValidateFields( + request.FacilityId, + request.StartDate, + request.EndDate, + request.RequiredQualification, + request.ShiftType, + request.RequiredHeadcount, + request.Conditions, + request.Priority); + if (fieldError is not null) + { + return BadRequest(fieldError); + } + + var contactError = await ValidateFacilityContactAsync(request.FacilityContactId, request.FacilityId, cancellationToken); + if (contactError is not null) + { + return BadRequest(contactError); + } + + var statusItems = await _valueListService.GetItemsAsync(StatusListKey, cancellationToken); + if (!statusItems.Any(s => s.Id == request.StatusId)) + { + return BadRequest("StatusId verweist auf keinen bekannten Auftragsstatus."); + } + + var updates = new Order + { + FacilityId = request.FacilityId, + FacilityContactId = request.FacilityContactId, + StartDate = request.StartDate, + EndDate = request.EndDate, + RequiredQualification = request.RequiredQualification, + ShiftType = request.ShiftType, + RequiredHeadcount = request.RequiredHeadcount, + Conditions = request.Conditions, + Priority = request.Priority, + StatusId = request.StatusId + }; + + var result = await _orderService.UpdateAsync(id, updates, cancellationToken); + if (!result.Success) + { + return result.FailureReason switch + { + UpdateOrderFailureReason.OrderNotFound => NotFound(), + UpdateOrderFailureReason.InvalidStatusTransition => BadRequest("Der Statuswechsel ist nicht zulässig."), + _ => BadRequest() + }; + } + + return Ok(ToResponse(result.Order!)); + } + + private async Task ValidateFacilityContactAsync(Guid? facilityContactId, Guid facilityId, CancellationToken cancellationToken) + { + if (facilityContactId is null) + { + return null; + } + + var contact = await _facilityContactService.GetByIdAsync(facilityContactId.Value, cancellationToken); + if (contact is null || contact.FacilityId != facilityId) + { + return "Der Ansprechpartner gehört nicht zur angegebenen Einrichtung."; + } + + return null; + } + + private static string? ValidateFields( + Guid facilityId, + DateOnly startDate, + DateOnly? endDate, + string? requiredQualification, + string? shiftType, + int requiredHeadcount, + string? conditions, + string priority) + { + if (facilityId == Guid.Empty) + { + return "FacilityId ist erforderlich."; + } + + if (startDate == default) + { + return "StartDate ist erforderlich."; + } + + if (endDate.HasValue && endDate.Value < startDate) + { + return "EndDate darf nicht vor StartDate liegen."; + } + + if (requiredHeadcount < 1) + { + return "RequiredHeadcount muss mindestens 1 sein."; + } + + if (string.IsNullOrWhiteSpace(priority) || priority.Length > 50) + { + return "Priority ist erforderlich und darf maximal 50 Zeichen lang sein."; + } + + if (requiredQualification is { Length: > 200 }) + { + return "RequiredQualification darf maximal 200 Zeichen lang sein."; + } + + if (shiftType is { Length: > 100 }) + { + return "ShiftType darf maximal 100 Zeichen lang sein."; + } + + if (conditions is { Length: > 500 }) + { + return "Conditions darf maximal 500 Zeichen lang sein."; + } + + return null; + } + + private static OrderResponse ToResponse(Order order) + => new( + order.Id, + order.FacilityId, + order.FacilityContactId, + order.StartDate, + order.EndDate, + order.RequiredQualification, + order.ShiftType, + order.RequiredHeadcount, + order.Conditions, + order.Priority, + order.StatusId, + order.Status?.Value ?? string.Empty); +} diff --git a/omsorgCore/src/OmsorgCore.Api/Controllers/RolesController.cs b/omsorgCore/src/OmsorgCore.Api/Controllers/RolesController.cs index b733744..811eb86 100644 --- a/omsorgCore/src/OmsorgCore.Api/Controllers/RolesController.cs +++ b/omsorgCore/src/OmsorgCore.Api/Controllers/RolesController.cs @@ -48,4 +48,40 @@ public class RolesController : ControllerBase return CreatedAtAction(nameof(GetAll), new RoleResponse(result.Role!.Id, result.Role.Name)); } + + [HttpGet("{id:guid}")] + [RequirePermission(ModuleType.UserManagement, PermissionAction.View)] + public async Task> GetById(Guid id, CancellationToken cancellationToken) + { + var role = await _roleService.GetByIdWithPermissionsAsync(id, cancellationToken); + if (role is null) + { + return NotFound("Rolle nicht gefunden."); + } + + var permissions = role.RolePermissions + .Select(rp => new PermissionDto(rp.Module, rp.Action)) + .ToList(); + + return Ok(new RolePermissionsResponse(role.Id, role.Name, permissions)); + } + + [HttpPut("{id:guid}/permissions")] + [RequirePermission(ModuleType.UserManagement, PermissionAction.Edit)] + public async Task UpdatePermissions(Guid id, UpdateRolePermissionsRequest request, CancellationToken cancellationToken) + { + var parsed = request.Permissions.Select(dto => (dto.Module, dto.Action)).ToList(); + + var result = await _roleService.UpdatePermissionsAsync(id, parsed, cancellationToken); + if (!result.Success) + { + return result.FailureReason switch + { + UpdateRolePermissionsFailureReason.RoleNotFound => NotFound("Rolle nicht gefunden."), + _ => BadRequest() + }; + } + + return NoContent(); + } } diff --git a/omsorgCore/src/OmsorgCore.Api/Controllers/UsersController.cs b/omsorgCore/src/OmsorgCore.Api/Controllers/UsersController.cs index a7af347..289f012 100644 --- a/omsorgCore/src/OmsorgCore.Api/Controllers/UsersController.cs +++ b/omsorgCore/src/OmsorgCore.Api/Controllers/UsersController.cs @@ -1,11 +1,13 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Microsoft.Extensions.Options; using OmsorgCore.Api.Contracts; using OmsorgCore.Api.Security; using OmsorgCore.Application.Abstractions; using OmsorgCore.Application.Services; using OmsorgCore.Domain.Enums; using OmsorgCore.Engine.Events; +using OmsorgCore.Infrastructure.Security; namespace OmsorgCore.Api.Controllers; @@ -14,18 +16,19 @@ namespace OmsorgCore.Api.Controllers; [Route("api/users")] public class UsersController : ControllerBase { - private const int MinInitialPasswordLength = 8; private const int DefaultPinValidityDays = 7; private const int MinPinValidityDays = 1; private const int MaxPinValidityDays = 30; private readonly IUserService _userService; private readonly IDomainEventDispatcher _dispatcher; + private readonly PasswordPolicyOptions _passwordPolicyOptions; - public UsersController(IUserService userService, IDomainEventDispatcher dispatcher) + public UsersController(IUserService userService, IDomainEventDispatcher dispatcher, IOptions passwordPolicyOptions) { _userService = userService; _dispatcher = dispatcher; + _passwordPolicyOptions = passwordPolicyOptions.Value; } [HttpGet] @@ -65,6 +68,7 @@ public class UsersController : ControllerBase CreateUserFailureReason.UsernameTaken => Conflict("Dieser Username ist bereits vergeben."), CreateUserFailureReason.EmployeeEmailMissing => BadRequest("Für den Einladungs-Modus braucht der Mitarbeiter eine hinterlegte E-Mail-Adresse."), CreateUserFailureReason.InitialPasswordRequired => BadRequest("InitialPassword ist im Direct-Modus erforderlich."), + CreateUserFailureReason.PasswordTooShort => BadRequest($"InitialPassword muss mindestens {_passwordPolicyOptions.MinLength} Zeichen lang sein."), _ => BadRequest() }; } @@ -100,6 +104,7 @@ public class UsersController : ControllerBase AdminResetPasswordFailureReason.UserNotFound => NotFound("User nicht gefunden."), AdminResetPasswordFailureReason.EmployeeEmailMissing => BadRequest("Für den Einladungs-Modus braucht der Mitarbeiter eine hinterlegte E-Mail-Adresse."), AdminResetPasswordFailureReason.InitialPasswordRequired => BadRequest("InitialPassword ist im Direct-Modus erforderlich."), + AdminResetPasswordFailureReason.PasswordTooShort => BadRequest($"InitialPassword muss mindestens {_passwordPolicyOptions.MinLength} Zeichen lang sein."), _ => BadRequest() }; } @@ -153,15 +158,65 @@ public class UsersController : ControllerBase pinValidity = TimeSpan.FromDays(days); } - if (mode == UserCreationMode.Direct - && (initialPassword is null || initialPassword.Length < MinInitialPasswordLength)) + if (mode == UserCreationMode.Direct && initialPassword is null) { - return ($"InitialPassword ist im Direct-Modus erforderlich und muss mindestens {MinInitialPasswordLength} Zeichen lang sein.", mode, null); + return ("InitialPassword ist im Direct-Modus erforderlich.", mode, null); } return (null, mode, pinValidity); } + [HttpGet("{id:guid}/permission-overrides")] + [RequirePermission(ModuleType.UserManagement, PermissionAction.View)] + public async Task>> GetPermissionOverrides(Guid id, CancellationToken cancellationToken) + { + var overrides = await _userService.GetPermissionOverridesAsync(id, cancellationToken); + if (overrides is null) + { + return NotFound("User nicht gefunden."); + } + + return Ok(overrides.Select(o => new UserPermissionOverrideResponse( + o.Id, o.Module, o.Action, o.Effect)).ToList()); + } + + [HttpPost("{id:guid}/permission-overrides")] + [RequirePermission(ModuleType.UserManagement, PermissionAction.Edit)] + public async Task> AddPermissionOverride( + Guid id, AddUserPermissionOverrideRequest request, CancellationToken cancellationToken) + { + var result = await _userService.AddPermissionOverrideAsync(id, request.Module, request.Action, request.Effect, cancellationToken); + if (!result.Success) + { + return result.FailureReason switch + { + AddPermissionOverrideFailureReason.UserNotFound => NotFound("User nicht gefunden."), + _ => BadRequest() + }; + } + + var o = result.Override!; + return Ok(new UserPermissionOverrideResponse(o.Id, o.Module, o.Action, o.Effect)); + } + + [HttpDelete("{id:guid}/permission-overrides/{overrideId:guid}")] + [RequirePermission(ModuleType.UserManagement, PermissionAction.Edit)] + public async Task RemovePermissionOverride(Guid id, Guid overrideId, CancellationToken cancellationToken) + { + var result = await _userService.RemovePermissionOverrideAsync(id, overrideId, cancellationToken); + if (!result.Success) + { + return result.FailureReason switch + { + RemovePermissionOverrideFailureReason.UserNotFound => NotFound("User nicht gefunden."), + RemovePermissionOverrideFailureReason.OverrideNotFound => NotFound("Override nicht gefunden."), + _ => BadRequest() + }; + } + + return NoContent(); + } + private static UserResponse ToResponse(UserSummary summary) => new(summary.Id, summary.Username, summary.EmployeeId, summary.RoleName, summary.IsActive, summary.MustChangePassword); } diff --git a/omsorgCore/src/OmsorgCore.Api/Controllers/ValueListsController.cs b/omsorgCore/src/OmsorgCore.Api/Controllers/ValueListsController.cs new file mode 100644 index 0000000..68242a5 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Api/Controllers/ValueListsController.cs @@ -0,0 +1,124 @@ +using Microsoft.AspNetCore.Authorization; +using Microsoft.AspNetCore.Mvc; +using OmsorgCore.Api.Contracts; +using OmsorgCore.Api.Security; +using OmsorgCore.Application.Services; +using OmsorgCore.Domain.Entities; +using OmsorgCore.Domain.Enums; + +namespace OmsorgCore.Api.Controllers; + +/// +/// Verwaltet die konfigurierbaren Auswahllisten (Mitarbeiterstatus, Beschäftigungsart, CRM-Status, +/// Einrichtungstyp, Vertragstyp/-status, Auftragsstatus) — siehe omsorgCore/CLAUDE.md, Abschnitt +/// "Konfigurierbare Auswahllisten". Lesen ist für jeden eingeloggten Nutzer erlaubt (die aufrufenden +/// Formulare gehören zu unterschiedlichen Modulen), Schreiben ist eine Admin-Funktion und läuft über +/// dasselbe Recht wie die übrige "Einstellungen"-Seite (). +/// +[ApiController] +[Authorize] +[Route("api/value-lists")] +public class ValueListsController : ControllerBase +{ + private readonly IValueListService _valueListService; + + public ValueListsController(IValueListService valueListService) + { + _valueListService = valueListService; + } + + [HttpGet] + public async Task>> GetLists(CancellationToken cancellationToken) + { + var lists = await _valueListService.GetListsAsync(cancellationToken); + return Ok(lists.Select(l => new ValueListResponse(l.Id, l.Key, l.DisplayName)).ToList()); + } + + [HttpGet("{key}/items")] + public async Task>> GetItems(string key, CancellationToken cancellationToken) + { + var items = await _valueListService.GetItemsAsync(key, cancellationToken); + return Ok(items.Select(ToResponse).ToList()); + } + + [HttpPost("{key}/items")] + [RequirePermission(ModuleType.UserManagement, PermissionAction.Edit)] + public async Task> CreateItem(string key, CreateValueListItemRequest request, CancellationToken cancellationToken) + { + if (string.IsNullOrWhiteSpace(request.Value) || request.Value.Length > 100) + { + return BadRequest("Value ist erforderlich und darf maximal 100 Zeichen lang sein."); + } + + try + { + var item = await _valueListService.CreateItemAsync( + key, request.Value, request.SortOrder, request.IsDefault, request.IsInitial, request.IsTerminal, cancellationToken); + return Ok(ToResponse(item)); + } + catch (InvalidOperationException ex) + { + return BadRequest(ex.Message); + } + } + + [HttpPut("{key}/items/{id:guid}")] + [RequirePermission(ModuleType.UserManagement, PermissionAction.Edit)] + public async Task> UpdateItem(string key, Guid id, UpdateValueListItemRequest request, CancellationToken cancellationToken) + { + if (string.IsNullOrWhiteSpace(request.Value) || request.Value.Length > 100) + { + return BadRequest("Value ist erforderlich und darf maximal 100 Zeichen lang sein."); + } + + var item = await _valueListService.UpdateItemAsync( + id, request.Value, request.SortOrder, request.IsDefault, request.IsInitial, request.IsTerminal, cancellationToken); + return item is null ? NotFound() : Ok(ToResponse(item)); + } + + [HttpDelete("{key}/items/{id:guid}")] + [RequirePermission(ModuleType.UserManagement, PermissionAction.Edit)] + public async Task DeleteItem(string key, Guid id, CancellationToken cancellationToken) + { + var result = await _valueListService.DeleteItemAsync(id, cancellationToken); + if (result.Success) + { + return NoContent(); + } + + return result.FailureReason switch + { + DeleteValueListItemFailureReason.ItemNotFound => NotFound(), + DeleteValueListItemFailureReason.InUse => Conflict(result.Usages + .Select(u => new ValueListUsageResponse(u.EntityType, u.EntityId, u.DisplayLabel)) + .ToList()), + _ => Conflict() + }; + } + + [HttpGet("{key}/items/{id:guid}/usages")] + [RequirePermission(ModuleType.UserManagement, PermissionAction.Edit)] + public async Task>> GetUsages(string key, Guid id, CancellationToken cancellationToken) + { + var usages = await _valueListService.GetUsagesAsync(id, cancellationToken); + return Ok(usages.Select(u => new ValueListUsageResponse(u.EntityType, u.EntityId, u.DisplayLabel)).ToList()); + } + + [HttpGet("{key}/transitions")] + public async Task>> GetTransitions(string key, CancellationToken cancellationToken) + { + var transitions = await _valueListService.GetTransitionsAsync(key, cancellationToken); + return Ok(transitions.Select(t => new ValueListTransitionResponse(t.Id, t.FromItemId, t.ToItemId)).ToList()); + } + + [HttpPut("{key}/transitions")] + [RequirePermission(ModuleType.UserManagement, PermissionAction.Edit)] + public async Task ReplaceTransitions(string key, List request, CancellationToken cancellationToken) + { + await _valueListService.ReplaceTransitionsAsync(key, request.Select(t => (t.FromItemId, t.ToItemId)), cancellationToken); + return NoContent(); + } + + private static ValueListItemResponse ToResponse(ValueListItem item) + => new(item.Id, item.Value, item.SortOrder, item.IsDefault, item.IsInitial, item.IsTerminal); +} diff --git a/omsorgCore/src/OmsorgCore.Api/Program.cs b/omsorgCore/src/OmsorgCore.Api/Program.cs index 9cbfcf0..adbdaa4 100644 --- a/omsorgCore/src/OmsorgCore.Api/Program.cs +++ b/omsorgCore/src/OmsorgCore.Api/Program.cs @@ -1,6 +1,7 @@ using System.IdentityModel.Tokens.Jwt; using System.Security.Claims; using System.Text; +using System.Text.Json.Serialization; using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Options; @@ -17,7 +18,8 @@ using OmsorgCore.Infrastructure.Security; var builder = WebApplication.CreateBuilder(args); -builder.Services.AddControllers(); +builder.Services.AddControllers() + .AddJsonOptions(options => options.JsonSerializerOptions.Converters.Add(new JsonStringEnumConverter())); builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(options => { @@ -132,6 +134,34 @@ using (var migrationScope = app.Services.CreateScope()) await db.Database.MigrateAsync(); } +// Basis-Rollen (Geschäftsführung/Disposition/Recruiting/Außendienst, siehe REQUIREMENTS.md Abschnitt 3/7) +// in jeder Umgebung anlegen - reine Rollen-Stammdaten ohne Zugangsdaten, anders als der +// Development-only-Admin-Seed unten. Nicht fatal bei Fehlern, analog zum Admin-Seed. +try +{ + using var baseRolesScope = app.Services.CreateScope(); + var db = baseRolesScope.ServiceProvider.GetRequiredService(); + await DbSeeder.SeedBaseRolesAsync(db); +} +catch (Exception ex) +{ + app.Logger.LogWarning(ex, "Seed der Basis-Rollen fehlgeschlagen (z.B. Datenbank nicht erreichbar)."); +} + +// Konfigurierbare Auswahllisten (Mitarbeiterstatus, Beschäftigungsart, CRM-Status, Einrichtungstyp, +// Vertragstyp/-status, Auftragsstatus inkl. Übergangsregeln, FR-EM-2) - reine Stammdaten, jede +// Umgebung, nicht fatal. +try +{ + using var valueListScope = app.Services.CreateScope(); + var db = valueListScope.ServiceProvider.GetRequiredService(); + await DbSeeder.SeedValueListsAsync(db); +} +catch (Exception ex) +{ + app.Logger.LogWarning(ex, "Seed der Auswahllisten fehlgeschlagen (z.B. Datenbank nicht erreichbar)."); +} + if (app.Environment.IsDevelopment()) { app.UseSwagger(); diff --git a/omsorgCore/src/OmsorgCore.Api/Security/CurrentUserService.cs b/omsorgCore/src/OmsorgCore.Api/Security/CurrentUserService.cs index a796a35..a21b394 100644 --- a/omsorgCore/src/OmsorgCore.Api/Security/CurrentUserService.cs +++ b/omsorgCore/src/OmsorgCore.Api/Security/CurrentUserService.cs @@ -24,4 +24,10 @@ public class CurrentUserService : ICurrentUserService return Guid.TryParse(value, out var id) ? id : null; } } + + public string? Username => _httpContextAccessor.HttpContext?.User.FindFirstValue(ClaimTypes.Name); + + public string? RoleName => _httpContextAccessor.HttpContext?.User.FindFirstValue(ClaimTypes.Role); + + public string? IpAddress => _httpContextAccessor.HttpContext?.Connection.RemoteIpAddress?.ToString(); } diff --git a/omsorgCore/src/OmsorgCore.Api/appsettings.json b/omsorgCore/src/OmsorgCore.Api/appsettings.json index de720a9..23ba850 100644 --- a/omsorgCore/src/OmsorgCore.Api/appsettings.json +++ b/omsorgCore/src/OmsorgCore.Api/appsettings.json @@ -14,6 +14,9 @@ "RefreshToken": { "ExpiryDays": 60 }, + "PasswordPolicy": { + "MinLength": 8 + }, "Auth": { "MaxLoginFailures": 5, "LoginLockoutMinutes": 10 diff --git a/omsorgCore/src/OmsorgCore.Application/Abstractions/IAuditLogRepository.cs b/omsorgCore/src/OmsorgCore.Application/Abstractions/IAuditLogRepository.cs new file mode 100644 index 0000000..a8c8bf6 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Abstractions/IAuditLogRepository.cs @@ -0,0 +1,22 @@ +using OmsorgCore.Domain.Entities; +using OmsorgCore.Domain.Enums; + +namespace OmsorgCore.Application.Abstractions; + +public interface IAuditLogRepository +{ + Task AddAsync(AuditLogEntry entry, CancellationToken cancellationToken = default); + + Task<(IReadOnlyList Items, int TotalCount)> GetPagedAsync( + string? entityType, + Guid? entityId, + Guid? actorUserId, + AuditEventCategory? category, + DateTime? fromUtc, + DateTime? toUtc, + int page, + int pageSize, + CancellationToken cancellationToken = default); + + Task SaveChangesAsync(CancellationToken cancellationToken = default); +} diff --git a/omsorgCore/src/OmsorgCore.Application/Abstractions/IAuditLogService.cs b/omsorgCore/src/OmsorgCore.Application/Abstractions/IAuditLogService.cs new file mode 100644 index 0000000..f7eaecc --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Abstractions/IAuditLogService.cs @@ -0,0 +1,18 @@ +using OmsorgCore.Domain.Entities; +using OmsorgCore.Domain.Enums; + +namespace OmsorgCore.Application.Abstractions; + +public interface IAuditLogService +{ + Task<(IReadOnlyList Items, int TotalCount)> GetPagedAsync( + string? entityType, + Guid? entityId, + Guid? actorUserId, + AuditEventCategory? category, + DateTime? fromUtc, + DateTime? toUtc, + int page, + int pageSize, + CancellationToken cancellationToken = default); +} diff --git a/omsorgCore/src/OmsorgCore.Application/Abstractions/IContractRepository.cs b/omsorgCore/src/OmsorgCore.Application/Abstractions/IContractRepository.cs new file mode 100644 index 0000000..a04d7aa --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Abstractions/IContractRepository.cs @@ -0,0 +1,20 @@ +using OmsorgCore.Domain.Entities; + +namespace OmsorgCore.Application.Abstractions; + +public interface IContractRepository +{ + Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default); + Task> GetAllAsync(CancellationToken cancellationToken = default); + Task<(IReadOnlyList Items, int TotalCount)> GetPagedAsync( + string? search, + string? status, + Guid? employeeId, + Guid? facilityId, + int page, + int pageSize, + CancellationToken cancellationToken = default); + Task AddAsync(Contract contract, CancellationToken cancellationToken = default); + Task UpdateAsync(Contract contract, CancellationToken cancellationToken = default); + Task SaveChangesAsync(CancellationToken cancellationToken = default); +} diff --git a/omsorgCore/src/OmsorgCore.Application/Abstractions/ICurrentUserService.cs b/omsorgCore/src/OmsorgCore.Application/Abstractions/ICurrentUserService.cs index 727b611..7ffee1f 100644 --- a/omsorgCore/src/OmsorgCore.Application/Abstractions/ICurrentUserService.cs +++ b/omsorgCore/src/OmsorgCore.Application/Abstractions/ICurrentUserService.cs @@ -9,4 +9,7 @@ public interface ICurrentUserService { Guid? UserId { get; } bool IsAuthenticated { get; } + string? Username { get; } + string? RoleName { get; } + string? IpAddress { get; } } diff --git a/omsorgCore/src/OmsorgCore.Application/Abstractions/IDatabaseConnectivityChecker.cs b/omsorgCore/src/OmsorgCore.Application/Abstractions/IDatabaseConnectivityChecker.cs new file mode 100644 index 0000000..16790ab --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Abstractions/IDatabaseConnectivityChecker.cs @@ -0,0 +1,10 @@ +namespace OmsorgCore.Application.Abstractions; + +/// +/// Prüft, ob die Datenbank erreichbar ist, ohne dass Api-Controller dafür direkt an +/// EF Core/DbContext koppeln müssen (siehe Health-Check). +/// +public interface IDatabaseConnectivityChecker +{ + Task CanConnectAsync(CancellationToken cancellationToken); +} diff --git a/omsorgCore/src/OmsorgCore.Application/Abstractions/IFacilityContactRepository.cs b/omsorgCore/src/OmsorgCore.Application/Abstractions/IFacilityContactRepository.cs new file mode 100644 index 0000000..0511264 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Abstractions/IFacilityContactRepository.cs @@ -0,0 +1,12 @@ +using OmsorgCore.Domain.Entities; + +namespace OmsorgCore.Application.Abstractions; + +public interface IFacilityContactRepository +{ + Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default); + Task> GetByFacilityIdAsync(Guid facilityId, CancellationToken cancellationToken = default); + Task AddAsync(FacilityContact contact, CancellationToken cancellationToken = default); + Task UpdateAsync(FacilityContact contact, CancellationToken cancellationToken = default); + Task SaveChangesAsync(CancellationToken cancellationToken = default); +} diff --git a/omsorgCore/src/OmsorgCore.Application/Abstractions/IFacilityRepository.cs b/omsorgCore/src/OmsorgCore.Application/Abstractions/IFacilityRepository.cs new file mode 100644 index 0000000..c84b80e --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Abstractions/IFacilityRepository.cs @@ -0,0 +1,18 @@ +using OmsorgCore.Domain.Entities; + +namespace OmsorgCore.Application.Abstractions; + +public interface IFacilityRepository +{ + Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default); + Task> GetAllAsync(CancellationToken cancellationToken = default); + Task<(IReadOnlyList Items, int TotalCount)> GetPagedAsync( + string? search, + string? crmStatus, + int page, + int pageSize, + CancellationToken cancellationToken = default); + Task AddAsync(Facility facility, CancellationToken cancellationToken = default); + Task UpdateAsync(Facility facility, CancellationToken cancellationToken = default); + Task SaveChangesAsync(CancellationToken cancellationToken = default); +} diff --git a/omsorgCore/src/OmsorgCore.Application/Abstractions/IOrderRepository.cs b/omsorgCore/src/OmsorgCore.Application/Abstractions/IOrderRepository.cs new file mode 100644 index 0000000..2116a42 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Abstractions/IOrderRepository.cs @@ -0,0 +1,19 @@ +using OmsorgCore.Domain.Entities; + +namespace OmsorgCore.Application.Abstractions; + +public interface IOrderRepository +{ + Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default); + Task> GetAllAsync(CancellationToken cancellationToken = default); + Task<(IReadOnlyList Items, int TotalCount)> GetPagedAsync( + string? search, + Guid? statusId, + Guid? facilityId, + int page, + int pageSize, + CancellationToken cancellationToken = default); + Task AddAsync(Order order, CancellationToken cancellationToken = default); + Task UpdateAsync(Order order, CancellationToken cancellationToken = default); + Task SaveChangesAsync(CancellationToken cancellationToken = default); +} diff --git a/omsorgCore/src/OmsorgCore.Application/Abstractions/IPasswordPolicy.cs b/omsorgCore/src/OmsorgCore.Application/Abstractions/IPasswordPolicy.cs new file mode 100644 index 0000000..81e76a4 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Abstractions/IPasswordPolicy.cs @@ -0,0 +1,13 @@ +namespace OmsorgCore.Application.Abstractions; + +/// +/// Einzige Stelle, die entscheidet, ob ein Passwort die konfigurierte Mindestlänge erfüllt - +/// wird von jedem Application-Service injiziert, der ein Passwort entgegennimmt (UserService, +/// PasswordResetService), damit die Regel nicht mehrfach/inkonsistent dupliziert wird. +/// +public interface IPasswordPolicy +{ + int MinLength { get; } + + bool IsValid(string? password); +} diff --git a/omsorgCore/src/OmsorgCore.Application/Abstractions/IRoleRepository.cs b/omsorgCore/src/OmsorgCore.Application/Abstractions/IRoleRepository.cs index 024b8b1..dc76caa 100644 --- a/omsorgCore/src/OmsorgCore.Application/Abstractions/IRoleRepository.cs +++ b/omsorgCore/src/OmsorgCore.Application/Abstractions/IRoleRepository.cs @@ -6,6 +6,16 @@ public interface IRoleRepository { Task> GetAllAsync(CancellationToken cancellationToken = default); Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default); + + /// Inklusive RolePermissions - für das Lesen/Bearbeiten der Rechte-Matrix einer Rolle. + Task GetByIdWithPermissionsAsync(Guid id, CancellationToken cancellationToken = default); + + /// + /// Explizit über das DbSet statt über role.RolePermissions.Add(...) - sonst behandelt EF Core neue + /// Kind-Entitäten mit bereits client-seitig gesetzter Guid-Id fälschlich als "existiert schon" und + /// generiert ein UPDATE statt INSERT (0 betroffene Zeilen, DbUpdateConcurrencyException). + /// + Task AddPermissionRangeAsync(IEnumerable permissions, CancellationToken cancellationToken = default); Task ExistsByNameAsync(string name, CancellationToken cancellationToken = default); Task AddAsync(Role role, CancellationToken cancellationToken = default); Task SaveChangesAsync(CancellationToken cancellationToken = default); diff --git a/omsorgCore/src/OmsorgCore.Application/Abstractions/IUserRepository.cs b/omsorgCore/src/OmsorgCore.Application/Abstractions/IUserRepository.cs index 1502690..8f69062 100644 --- a/omsorgCore/src/OmsorgCore.Application/Abstractions/IUserRepository.cs +++ b/omsorgCore/src/OmsorgCore.Application/Abstractions/IUserRepository.cs @@ -23,5 +23,12 @@ public interface IUserRepository Task AddAsync(User user, CancellationToken cancellationToken = default); + /// + /// Explizit über das DbSet statt über user.PermissionOverrides.Add(...) - sonst behandelt EF Core + /// die neue Kind-Entität mit bereits client-seitig gesetzter Guid-Id fälschlich als "existiert schon" + /// und generiert ein UPDATE statt INSERT (0 betroffene Zeilen, DbUpdateConcurrencyException). + /// + Task AddPermissionOverrideAsync(UserPermissionOverride @override, CancellationToken cancellationToken = default); + Task SaveChangesAsync(CancellationToken cancellationToken = default); } diff --git a/omsorgCore/src/OmsorgCore.Application/Abstractions/IValueListRepository.cs b/omsorgCore/src/OmsorgCore.Application/Abstractions/IValueListRepository.cs new file mode 100644 index 0000000..36560a8 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Abstractions/IValueListRepository.cs @@ -0,0 +1,24 @@ +using OmsorgCore.Domain.Entities; + +namespace OmsorgCore.Application.Abstractions; + +public interface IValueListRepository +{ + Task> GetAllListsAsync(CancellationToken cancellationToken = default); + Task GetListByKeyAsync(string key, CancellationToken cancellationToken = default); + + Task> GetItemsAsync(string key, CancellationToken cancellationToken = default); + Task> GetActiveValuesAsync(string key, CancellationToken cancellationToken = default); + Task GetItemByIdAsync(Guid id, CancellationToken cancellationToken = default); + Task GetInitialItemAsync(string key, CancellationToken cancellationToken = default); + + Task AddItemAsync(ValueListItem item, CancellationToken cancellationToken = default); + Task UpdateItemAsync(ValueListItem item, CancellationToken cancellationToken = default); + Task RemoveItemAsync(ValueListItem item, CancellationToken cancellationToken = default); + + Task CanTransitionAsync(Guid fromItemId, Guid toItemId, CancellationToken cancellationToken = default); + Task> GetTransitionsAsync(string key, CancellationToken cancellationToken = default); + Task ReplaceTransitionsAsync(string key, IEnumerable<(Guid FromItemId, Guid ToItemId)> transitions, CancellationToken cancellationToken = default); + + Task SaveChangesAsync(CancellationToken cancellationToken = default); +} diff --git a/omsorgCore/src/OmsorgCore.Application/Abstractions/IValueListUsageChecker.cs b/omsorgCore/src/OmsorgCore.Application/Abstractions/IValueListUsageChecker.cs new file mode 100644 index 0000000..50376ee --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Abstractions/IValueListUsageChecker.cs @@ -0,0 +1,16 @@ +namespace OmsorgCore.Application.Abstractions; + +public record ValueListUsageEntry(string EntityType, Guid EntityId, string DisplayLabel); + +/// +/// Prüft, ob ein bestimmter ValueListItem-Wert (identifiziert über den Key seiner +/// Liste) noch irgendwo verwendet wird — Voraussetzung dafür, dass ValueListService.DeleteItemAsync +/// das Löschen verweigert, solange Treffer existieren (Nutzeranforderung: "erst überall entfernen"). +/// Eine Implementierung je Liste, registriert in Infrastructure/DependencyInjection.cs. +/// +public interface IValueListUsageChecker +{ + string Key { get; } + + Task> FindUsagesAsync(Guid itemId, string itemValue, CancellationToken cancellationToken = default); +} diff --git a/omsorgCore/src/OmsorgCore.Application/DependencyInjection.cs b/omsorgCore/src/OmsorgCore.Application/DependencyInjection.cs index a41b5f1..7444a6b 100644 --- a/omsorgCore/src/OmsorgCore.Application/DependencyInjection.cs +++ b/omsorgCore/src/OmsorgCore.Application/DependencyInjection.cs @@ -11,10 +11,16 @@ public static class DependencyInjection services.AddScoped(); services.AddScoped(); services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); services.AddScoped(); + services.AddScoped(); return services; } diff --git a/omsorgCore/src/OmsorgCore.Application/Models/PermissionOverrideSummary.cs b/omsorgCore/src/OmsorgCore.Application/Models/PermissionOverrideSummary.cs new file mode 100644 index 0000000..b7dbbc1 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Models/PermissionOverrideSummary.cs @@ -0,0 +1,6 @@ +using OmsorgCore.Domain.Enums; + +namespace OmsorgCore.Application.Models; + +/// Ein einzelner UserPermissionOverride-Eintrag für die Admin-Ansicht/-Bearbeitung. +public record PermissionOverrideSummary(Guid Id, ModuleType Module, PermissionAction Action, PermissionEffect Effect); diff --git a/omsorgCore/src/OmsorgCore.Application/Services/AddPermissionOverrideResult.cs b/omsorgCore/src/OmsorgCore.Application/Services/AddPermissionOverrideResult.cs new file mode 100644 index 0000000..2c10320 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Services/AddPermissionOverrideResult.cs @@ -0,0 +1,27 @@ +using OmsorgCore.Application.Models; + +namespace OmsorgCore.Application.Services; + +public enum AddPermissionOverrideFailureReason +{ + UserNotFound +} + +public class AddPermissionOverrideResult +{ + public bool Success { get; init; } + public AddPermissionOverrideFailureReason? FailureReason { get; init; } + public PermissionOverrideSummary? Override { get; init; } + + public static AddPermissionOverrideResult Fail(AddPermissionOverrideFailureReason reason) => new() + { + Success = false, + FailureReason = reason + }; + + public static AddPermissionOverrideResult Ok(PermissionOverrideSummary @override) => new() + { + Success = true, + Override = @override + }; +} diff --git a/omsorgCore/src/OmsorgCore.Application/Services/AdminResetPasswordResult.cs b/omsorgCore/src/OmsorgCore.Application/Services/AdminResetPasswordResult.cs index 102fe30..d89ec72 100644 --- a/omsorgCore/src/OmsorgCore.Application/Services/AdminResetPasswordResult.cs +++ b/omsorgCore/src/OmsorgCore.Application/Services/AdminResetPasswordResult.cs @@ -4,7 +4,8 @@ public enum AdminResetPasswordFailureReason { UserNotFound, EmployeeEmailMissing, - InitialPasswordRequired + InitialPasswordRequired, + PasswordTooShort } public class AdminResetPasswordResult diff --git a/omsorgCore/src/OmsorgCore.Application/Services/AuditLogService.cs b/omsorgCore/src/OmsorgCore.Application/Services/AuditLogService.cs new file mode 100644 index 0000000..4e928b9 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Services/AuditLogService.cs @@ -0,0 +1,27 @@ +using OmsorgCore.Application.Abstractions; +using OmsorgCore.Domain.Entities; +using OmsorgCore.Domain.Enums; + +namespace OmsorgCore.Application.Services; + +public class AuditLogService : IAuditLogService +{ + private readonly IAuditLogRepository _auditLogRepository; + + public AuditLogService(IAuditLogRepository auditLogRepository) + { + _auditLogRepository = auditLogRepository; + } + + public Task<(IReadOnlyList Items, int TotalCount)> GetPagedAsync( + string? entityType, + Guid? entityId, + Guid? actorUserId, + AuditEventCategory? category, + DateTime? fromUtc, + DateTime? toUtc, + int page, + int pageSize, + CancellationToken cancellationToken = default) + => _auditLogRepository.GetPagedAsync(entityType, entityId, actorUserId, category, fromUtc, toUtc, page, pageSize, cancellationToken); +} diff --git a/omsorgCore/src/OmsorgCore.Application/Services/AuthResult.cs b/omsorgCore/src/OmsorgCore.Application/Services/AuthResult.cs index 2c66eb5..144f416 100644 --- a/omsorgCore/src/OmsorgCore.Application/Services/AuthResult.cs +++ b/omsorgCore/src/OmsorgCore.Application/Services/AuthResult.cs @@ -3,6 +3,8 @@ namespace OmsorgCore.Application.Services; public class AuthResult { public bool Success { get; init; } + public Guid? UserId { get; init; } + public string? Username { get; init; } public string? Token { get; init; } public string? RefreshToken { get; init; } public DateTime? ExpiresAt { get; init; } @@ -13,9 +15,11 @@ public class AuthResult public static AuthResult LockedOut() => new() { Success = false, IsLockedOut = true }; - public static AuthResult Ok(string token, string refreshToken, DateTime expiresAt, bool mustChangePassword) => new() + public static AuthResult Ok(Guid userId, string username, string token, string refreshToken, DateTime expiresAt, bool mustChangePassword) => new() { Success = true, + UserId = userId, + Username = username, Token = token, RefreshToken = refreshToken, ExpiresAt = expiresAt, diff --git a/omsorgCore/src/OmsorgCore.Application/Services/AuthService.cs b/omsorgCore/src/OmsorgCore.Application/Services/AuthService.cs index d2d6db3..e856a35 100644 --- a/omsorgCore/src/OmsorgCore.Application/Services/AuthService.cs +++ b/omsorgCore/src/OmsorgCore.Application/Services/AuthService.cs @@ -150,6 +150,6 @@ public class AuthService : IAuthService await _refreshTokenRepository.SaveChangesAsync(cancellationToken); - return AuthResult.Ok(accessToken, rawRefreshToken, accessTokenExpiresAt, user.MustChangePassword); + return AuthResult.Ok(user.Id, user.Username, accessToken, rawRefreshToken, accessTokenExpiresAt, user.MustChangePassword); } } diff --git a/omsorgCore/src/OmsorgCore.Application/Services/ChangeOwnPasswordResult.cs b/omsorgCore/src/OmsorgCore.Application/Services/ChangeOwnPasswordResult.cs new file mode 100644 index 0000000..9cebe14 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Services/ChangeOwnPasswordResult.cs @@ -0,0 +1,8 @@ +namespace OmsorgCore.Application.Services; + +public enum ChangeOwnPasswordResult +{ + Success, + InvalidCurrentPassword, + PasswordTooShort +} diff --git a/omsorgCore/src/OmsorgCore.Application/Services/ContractService.cs b/omsorgCore/src/OmsorgCore.Application/Services/ContractService.cs new file mode 100644 index 0000000..d18d9e3 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Services/ContractService.cs @@ -0,0 +1,64 @@ +using OmsorgCore.Application.Abstractions; +using OmsorgCore.Domain.Entities; + +namespace OmsorgCore.Application.Services; + +public class ContractService : IContractService +{ + private readonly IContractRepository _contractRepository; + + public ContractService(IContractRepository contractRepository) + { + _contractRepository = contractRepository; + } + + public Task> GetAllAsync(CancellationToken cancellationToken = default) + => _contractRepository.GetAllAsync(cancellationToken); + + public Task<(IReadOnlyList Items, int TotalCount)> GetPagedAsync( + string? search, + string? status, + Guid? employeeId, + Guid? facilityId, + int page, + int pageSize, + CancellationToken cancellationToken = default) + => _contractRepository.GetPagedAsync(search, status, employeeId, facilityId, page, pageSize, cancellationToken); + + public Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default) + => _contractRepository.GetByIdAsync(id, cancellationToken); + + public async Task CreateAsync(Contract contract, CancellationToken cancellationToken = default) + { + await _contractRepository.AddAsync(contract, cancellationToken); + await _contractRepository.SaveChangesAsync(cancellationToken); + return contract; + } + + public async Task UpdateAsync(Guid id, Contract updates, CancellationToken cancellationToken = default) + { + var contract = await _contractRepository.GetByIdAsync(id, cancellationToken); + if (contract is null) + { + return null; + } + + contract.ContractType = updates.ContractType; + contract.EmployeeId = updates.EmployeeId; + contract.FacilityId = updates.FacilityId; + contract.StartDate = updates.StartDate; + contract.EndDate = updates.EndDate; + contract.Status = updates.Status; + contract.WeeklyHours = updates.WeeklyHours; + contract.HourlyWage = updates.HourlyWage; + contract.AllowancesDescription = updates.AllowancesDescription; + contract.OvertimeRules = updates.OvertimeRules; + contract.VacationDaysPerYear = updates.VacationDaysPerYear; + contract.ProbationPeriodMonths = updates.ProbationPeriodMonths; + contract.UpdatedAt = DateTime.UtcNow; + + await _contractRepository.UpdateAsync(contract, cancellationToken); + await _contractRepository.SaveChangesAsync(cancellationToken); + return contract; + } +} diff --git a/omsorgCore/src/OmsorgCore.Application/Services/CreateUserResult.cs b/omsorgCore/src/OmsorgCore.Application/Services/CreateUserResult.cs index b718eda..eb78d08 100644 --- a/omsorgCore/src/OmsorgCore.Application/Services/CreateUserResult.cs +++ b/omsorgCore/src/OmsorgCore.Application/Services/CreateUserResult.cs @@ -7,7 +7,8 @@ public enum CreateUserFailureReason EmployeeEmailMissing, UsernameTaken, RoleNotFound, - InitialPasswordRequired + InitialPasswordRequired, + PasswordTooShort } public class CreateUserResult diff --git a/omsorgCore/src/OmsorgCore.Application/Services/DeleteValueListItemResult.cs b/omsorgCore/src/OmsorgCore.Application/Services/DeleteValueListItemResult.cs new file mode 100644 index 0000000..95c5b83 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Services/DeleteValueListItemResult.cs @@ -0,0 +1,25 @@ +using OmsorgCore.Application.Abstractions; + +namespace OmsorgCore.Application.Services; + +public enum DeleteValueListItemFailureReason +{ + ItemNotFound, + InUse +} + +public class DeleteValueListItemResult +{ + public bool Success { get; init; } + public DeleteValueListItemFailureReason? FailureReason { get; init; } + public IReadOnlyList Usages { get; init; } = Array.Empty(); + + public static DeleteValueListItemResult Ok() => new() { Success = true }; + + public static DeleteValueListItemResult Fail(DeleteValueListItemFailureReason reason, IReadOnlyList? usages = null) => new() + { + Success = false, + FailureReason = reason, + Usages = usages ?? Array.Empty() + }; +} diff --git a/omsorgCore/src/OmsorgCore.Application/Services/FacilityContactService.cs b/omsorgCore/src/OmsorgCore.Application/Services/FacilityContactService.cs new file mode 100644 index 0000000..bbda233 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Services/FacilityContactService.cs @@ -0,0 +1,48 @@ +using OmsorgCore.Application.Abstractions; +using OmsorgCore.Domain.Entities; + +namespace OmsorgCore.Application.Services; + +public class FacilityContactService : IFacilityContactService +{ + private readonly IFacilityContactRepository _facilityContactRepository; + + public FacilityContactService(IFacilityContactRepository facilityContactRepository) + { + _facilityContactRepository = facilityContactRepository; + } + + public Task> GetByFacilityIdAsync(Guid facilityId, CancellationToken cancellationToken = default) + => _facilityContactRepository.GetByFacilityIdAsync(facilityId, cancellationToken); + + public Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default) + => _facilityContactRepository.GetByIdAsync(id, cancellationToken); + + public async Task CreateAsync(FacilityContact contact, CancellationToken cancellationToken = default) + { + await _facilityContactRepository.AddAsync(contact, cancellationToken); + await _facilityContactRepository.SaveChangesAsync(cancellationToken); + return contact; + } + + public async Task UpdateAsync(Guid id, FacilityContact updates, CancellationToken cancellationToken = default) + { + var contact = await _facilityContactRepository.GetByIdAsync(id, cancellationToken); + if (contact is null) + { + return null; + } + + contact.Name = updates.Name; + contact.Role = updates.Role; + contact.Department = updates.Department; + contact.PhoneNumber = updates.PhoneNumber; + contact.Email = updates.Email; + contact.Notes = updates.Notes; + contact.UpdatedAt = DateTime.UtcNow; + + await _facilityContactRepository.UpdateAsync(contact, cancellationToken); + await _facilityContactRepository.SaveChangesAsync(cancellationToken); + return contact; + } +} diff --git a/omsorgCore/src/OmsorgCore.Application/Services/FacilityService.cs b/omsorgCore/src/OmsorgCore.Application/Services/FacilityService.cs new file mode 100644 index 0000000..99bd3a1 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Services/FacilityService.cs @@ -0,0 +1,62 @@ +using OmsorgCore.Application.Abstractions; +using OmsorgCore.Domain.Entities; + +namespace OmsorgCore.Application.Services; + +public class FacilityService : IFacilityService +{ + private readonly IFacilityRepository _facilityRepository; + + public FacilityService(IFacilityRepository facilityRepository) + { + _facilityRepository = facilityRepository; + } + + public Task> GetAllAsync(CancellationToken cancellationToken = default) + => _facilityRepository.GetAllAsync(cancellationToken); + + public Task<(IReadOnlyList Items, int TotalCount)> GetPagedAsync( + string? search, + string? crmStatus, + int page, + int pageSize, + CancellationToken cancellationToken = default) + => _facilityRepository.GetPagedAsync(search, crmStatus, page, pageSize, cancellationToken); + + public Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default) + => _facilityRepository.GetByIdAsync(id, cancellationToken); + + public async Task CreateAsync(Facility facility, CancellationToken cancellationToken = default) + { + await _facilityRepository.AddAsync(facility, cancellationToken); + await _facilityRepository.SaveChangesAsync(cancellationToken); + return facility; + } + + public async Task UpdateAsync(Guid id, Facility updates, CancellationToken cancellationToken = default) + { + var facility = await _facilityRepository.GetByIdAsync(id, cancellationToken); + if (facility is null) + { + return null; + } + + facility.Name = updates.Name; + facility.FacilityType = updates.FacilityType; + facility.Website = updates.Website; + facility.Street = updates.Street; + facility.PostalCode = updates.PostalCode; + facility.City = updates.City; + facility.Country = updates.Country; + facility.BillingStreet = updates.BillingStreet; + facility.BillingPostalCode = updates.BillingPostalCode; + facility.BillingCity = updates.BillingCity; + facility.BillingCountry = updates.BillingCountry; + facility.CrmStatus = updates.CrmStatus; + facility.UpdatedAt = DateTime.UtcNow; + + await _facilityRepository.UpdateAsync(facility, cancellationToken); + await _facilityRepository.SaveChangesAsync(cancellationToken); + return facility; + } +} diff --git a/omsorgCore/src/OmsorgCore.Application/Services/IContractService.cs b/omsorgCore/src/OmsorgCore.Application/Services/IContractService.cs new file mode 100644 index 0000000..1dd7aed --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Services/IContractService.cs @@ -0,0 +1,19 @@ +using OmsorgCore.Domain.Entities; + +namespace OmsorgCore.Application.Services; + +public interface IContractService +{ + Task> GetAllAsync(CancellationToken cancellationToken = default); + Task<(IReadOnlyList Items, int TotalCount)> GetPagedAsync( + string? search, + string? status, + Guid? employeeId, + Guid? facilityId, + int page, + int pageSize, + CancellationToken cancellationToken = default); + Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default); + Task CreateAsync(Contract contract, CancellationToken cancellationToken = default); + Task UpdateAsync(Guid id, Contract updates, CancellationToken cancellationToken = default); +} diff --git a/omsorgCore/src/OmsorgCore.Application/Services/IFacilityContactService.cs b/omsorgCore/src/OmsorgCore.Application/Services/IFacilityContactService.cs new file mode 100644 index 0000000..db14499 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Services/IFacilityContactService.cs @@ -0,0 +1,11 @@ +using OmsorgCore.Domain.Entities; + +namespace OmsorgCore.Application.Services; + +public interface IFacilityContactService +{ + Task> GetByFacilityIdAsync(Guid facilityId, CancellationToken cancellationToken = default); + Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default); + Task CreateAsync(FacilityContact contact, CancellationToken cancellationToken = default); + Task UpdateAsync(Guid id, FacilityContact updates, CancellationToken cancellationToken = default); +} diff --git a/omsorgCore/src/OmsorgCore.Application/Services/IFacilityService.cs b/omsorgCore/src/OmsorgCore.Application/Services/IFacilityService.cs new file mode 100644 index 0000000..71a3cfc --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Services/IFacilityService.cs @@ -0,0 +1,17 @@ +using OmsorgCore.Domain.Entities; + +namespace OmsorgCore.Application.Services; + +public interface IFacilityService +{ + Task> GetAllAsync(CancellationToken cancellationToken = default); + Task<(IReadOnlyList Items, int TotalCount)> GetPagedAsync( + string? search, + string? crmStatus, + int page, + int pageSize, + CancellationToken cancellationToken = default); + Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default); + Task CreateAsync(Facility facility, CancellationToken cancellationToken = default); + Task UpdateAsync(Guid id, Facility updates, CancellationToken cancellationToken = default); +} diff --git a/omsorgCore/src/OmsorgCore.Application/Services/IOrderService.cs b/omsorgCore/src/OmsorgCore.Application/Services/IOrderService.cs new file mode 100644 index 0000000..967e281 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Services/IOrderService.cs @@ -0,0 +1,18 @@ +using OmsorgCore.Domain.Entities; + +namespace OmsorgCore.Application.Services; + +public interface IOrderService +{ + Task> GetAllAsync(CancellationToken cancellationToken = default); + Task<(IReadOnlyList Items, int TotalCount)> GetPagedAsync( + string? search, + Guid? statusId, + Guid? facilityId, + int page, + int pageSize, + CancellationToken cancellationToken = default); + Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default); + Task CreateAsync(Order order, CancellationToken cancellationToken = default); + Task UpdateAsync(Guid id, Order updates, CancellationToken cancellationToken = default); +} diff --git a/omsorgCore/src/OmsorgCore.Application/Services/IPasswordResetService.cs b/omsorgCore/src/OmsorgCore.Application/Services/IPasswordResetService.cs index c71cfd8..0a31d35 100644 --- a/omsorgCore/src/OmsorgCore.Application/Services/IPasswordResetService.cs +++ b/omsorgCore/src/OmsorgCore.Application/Services/IPasswordResetService.cs @@ -6,7 +6,7 @@ public interface IPasswordResetService Task VerifyCodeAsync(string username, string pin, CancellationToken cancellationToken = default); - Task ResetPasswordAsync(string resetToken, string newPassword, CancellationToken cancellationToken = default); + Task ResetPasswordAsync(string resetToken, string newPassword, CancellationToken cancellationToken = default); /// /// Stellt einen PIN für eine Account-Einladung aus (admin-ausgelöst, kein Self-Service-Request des Users diff --git a/omsorgCore/src/OmsorgCore.Application/Services/IRoleService.cs b/omsorgCore/src/OmsorgCore.Application/Services/IRoleService.cs index 1e89678..32023f2 100644 --- a/omsorgCore/src/OmsorgCore.Application/Services/IRoleService.cs +++ b/omsorgCore/src/OmsorgCore.Application/Services/IRoleService.cs @@ -1,4 +1,5 @@ using OmsorgCore.Domain.Entities; +using OmsorgCore.Domain.Enums; namespace OmsorgCore.Application.Services; @@ -6,4 +7,13 @@ public interface IRoleService { Task> GetAllAsync(CancellationToken cancellationToken = default); Task CreateAsync(string name, CancellationToken cancellationToken = default); + + /// Inklusive RolePermissions - für die Rechte-Matrix-Ansicht/-Bearbeitung einer Rolle. + Task GetByIdWithPermissionsAsync(Guid id, CancellationToken cancellationToken = default); + + /// Ersetzt die komplette RolePermission-Menge der Rolle durch die übergebene Menge (kein inkrementelles Patchen). + Task UpdatePermissionsAsync( + Guid roleId, + IReadOnlyList<(ModuleType Module, PermissionAction Action)> permissions, + CancellationToken cancellationToken = default); } diff --git a/omsorgCore/src/OmsorgCore.Application/Services/IUserService.cs b/omsorgCore/src/OmsorgCore.Application/Services/IUserService.cs index ed63a04..ff8e5d9 100644 --- a/omsorgCore/src/OmsorgCore.Application/Services/IUserService.cs +++ b/omsorgCore/src/OmsorgCore.Application/Services/IUserService.cs @@ -1,3 +1,6 @@ +using OmsorgCore.Application.Models; +using OmsorgCore.Domain.Enums; + namespace OmsorgCore.Application.Services; public interface IUserService @@ -13,7 +16,7 @@ public interface IUserService TimeSpan? invitePinValidity, CancellationToken cancellationToken = default); - Task ChangeOwnPasswordAsync( + Task ChangeOwnPasswordAsync( Guid userId, string currentPassword, string newPassword, @@ -33,4 +36,22 @@ public interface IUserService Guid roleId, bool isActive, CancellationToken cancellationToken = default); + + /// Individuelle Rechte-Ausnahmen eines Users (überschreiben den Rollen-Default, siehe PermissionService). + Task?> GetPermissionOverridesAsync( + Guid userId, + CancellationToken cancellationToken = default); + + /// Upsert: existiert bereits ein Override für (module, action) bei diesem User, wird dessen Effect aktualisiert statt dupliziert. + Task AddPermissionOverrideAsync( + Guid userId, + ModuleType module, + PermissionAction action, + PermissionEffect effect, + CancellationToken cancellationToken = default); + + Task RemovePermissionOverrideAsync( + Guid userId, + Guid overrideId, + CancellationToken cancellationToken = default); } diff --git a/omsorgCore/src/OmsorgCore.Application/Services/IValueListService.cs b/omsorgCore/src/OmsorgCore.Application/Services/IValueListService.cs new file mode 100644 index 0000000..76690f0 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Services/IValueListService.cs @@ -0,0 +1,19 @@ +using OmsorgCore.Application.Abstractions; +using OmsorgCore.Domain.Entities; + +namespace OmsorgCore.Application.Services; + +public interface IValueListService +{ + Task> GetListsAsync(CancellationToken cancellationToken = default); + Task> GetItemsAsync(string key, CancellationToken cancellationToken = default); + + Task CreateItemAsync(string key, string value, int sortOrder, bool isDefault, bool isInitial, bool isTerminal, CancellationToken cancellationToken = default); + Task UpdateItemAsync(Guid id, string value, int sortOrder, bool isDefault, bool isInitial, bool isTerminal, CancellationToken cancellationToken = default); + Task DeleteItemAsync(Guid id, CancellationToken cancellationToken = default); + + Task> GetUsagesAsync(Guid id, CancellationToken cancellationToken = default); + + Task> GetTransitionsAsync(string key, CancellationToken cancellationToken = default); + Task ReplaceTransitionsAsync(string key, IEnumerable<(Guid FromItemId, Guid ToItemId)> transitions, CancellationToken cancellationToken = default); +} diff --git a/omsorgCore/src/OmsorgCore.Application/Services/OrderService.cs b/omsorgCore/src/OmsorgCore.Application/Services/OrderService.cs new file mode 100644 index 0000000..1a6c1f6 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Services/OrderService.cs @@ -0,0 +1,74 @@ +using OmsorgCore.Application.Abstractions; +using OmsorgCore.Domain.Entities; + +namespace OmsorgCore.Application.Services; + +public class OrderService : IOrderService +{ + private const string StatusListKey = "OrderStatus"; + + private readonly IOrderRepository _orderRepository; + private readonly IValueListRepository _valueListRepository; + + public OrderService(IOrderRepository orderRepository, IValueListRepository valueListRepository) + { + _orderRepository = orderRepository; + _valueListRepository = valueListRepository; + } + + public Task> GetAllAsync(CancellationToken cancellationToken = default) + => _orderRepository.GetAllAsync(cancellationToken); + + public Task<(IReadOnlyList Items, int TotalCount)> GetPagedAsync( + string? search, + Guid? statusId, + Guid? facilityId, + int page, + int pageSize, + CancellationToken cancellationToken = default) + => _orderRepository.GetPagedAsync(search, statusId, facilityId, page, pageSize, cancellationToken); + + public Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default) + => _orderRepository.GetByIdAsync(id, cancellationToken); + + public async Task CreateAsync(Order order, CancellationToken cancellationToken = default) + { + var initialStatus = await _valueListRepository.GetInitialItemAsync(StatusListKey, cancellationToken) + ?? throw new InvalidOperationException("Kein initialer Auftragsstatus konfiguriert (DbSeeder.SeedValueListsAsync fehlt)."); + order.StatusId = initialStatus.Id; + + await _orderRepository.AddAsync(order, cancellationToken); + await _orderRepository.SaveChangesAsync(cancellationToken); + return order; + } + + public async Task UpdateAsync(Guid id, Order updates, CancellationToken cancellationToken = default) + { + var order = await _orderRepository.GetByIdAsync(id, cancellationToken); + if (order is null) + { + return UpdateOrderResult.Fail(UpdateOrderFailureReason.OrderNotFound); + } + + if (!await _valueListRepository.CanTransitionAsync(order.StatusId, updates.StatusId, cancellationToken)) + { + return UpdateOrderResult.Fail(UpdateOrderFailureReason.InvalidStatusTransition); + } + + order.FacilityId = updates.FacilityId; + order.FacilityContactId = updates.FacilityContactId; + order.StartDate = updates.StartDate; + order.EndDate = updates.EndDate; + order.RequiredQualification = updates.RequiredQualification; + order.ShiftType = updates.ShiftType; + order.RequiredHeadcount = updates.RequiredHeadcount; + order.Conditions = updates.Conditions; + order.Priority = updates.Priority; + order.StatusId = updates.StatusId; + order.UpdatedAt = DateTime.UtcNow; + + await _orderRepository.UpdateAsync(order, cancellationToken); + await _orderRepository.SaveChangesAsync(cancellationToken); + return UpdateOrderResult.Ok(order); + } +} diff --git a/omsorgCore/src/OmsorgCore.Application/Services/PasswordResetService.cs b/omsorgCore/src/OmsorgCore.Application/Services/PasswordResetService.cs index fd50497..945e560 100644 --- a/omsorgCore/src/OmsorgCore.Application/Services/PasswordResetService.cs +++ b/omsorgCore/src/OmsorgCore.Application/Services/PasswordResetService.cs @@ -10,19 +10,22 @@ public class PasswordResetService : IPasswordResetService private readonly IPasswordResetCodeGenerator _codeGenerator; private readonly IPasswordHasher _passwordHasher; private readonly IRefreshTokenRepository _refreshTokenRepository; + private readonly IPasswordPolicy _passwordPolicy; public PasswordResetService( IUserRepository userRepository, IPasswordResetCodeRepository codeRepository, IPasswordResetCodeGenerator codeGenerator, IPasswordHasher passwordHasher, - IRefreshTokenRepository refreshTokenRepository) + IRefreshTokenRepository refreshTokenRepository, + IPasswordPolicy passwordPolicy) { _userRepository = userRepository; _codeRepository = codeRepository; _codeGenerator = codeGenerator; _passwordHasher = passwordHasher; _refreshTokenRepository = refreshTokenRepository; + _passwordPolicy = passwordPolicy; } public async Task RequestResetAsync(string username, CancellationToken cancellationToken = default) @@ -111,13 +114,18 @@ public class PasswordResetService : IPasswordResetService return rawPin; } - public async Task ResetPasswordAsync(string resetToken, string newPassword, CancellationToken cancellationToken = default) + public async Task ResetPasswordAsync(string resetToken, string newPassword, CancellationToken cancellationToken = default) { var resetTokenHash = _codeGenerator.HashResetToken(resetToken); var code = await _codeRepository.GetByResetTokenHashAsync(resetTokenHash, cancellationToken); if (code is null || !code.IsResetTokenActive) { - return false; + return ResetPasswordResult.InvalidOrExpiredToken; + } + + if (!_passwordPolicy.IsValid(newPassword)) + { + return ResetPasswordResult.PasswordTooShort; } code.ResetTokenUsedAt = DateTime.UtcNow; @@ -134,6 +142,6 @@ public class PasswordResetService : IPasswordResetService await _codeRepository.SaveChangesAsync(cancellationToken); await _refreshTokenRepository.SaveChangesAsync(cancellationToken); - return true; + return ResetPasswordResult.Success; } } diff --git a/omsorgCore/src/OmsorgCore.Application/Services/RemovePermissionOverrideResult.cs b/omsorgCore/src/OmsorgCore.Application/Services/RemovePermissionOverrideResult.cs new file mode 100644 index 0000000..d4ce002 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Services/RemovePermissionOverrideResult.cs @@ -0,0 +1,21 @@ +namespace OmsorgCore.Application.Services; + +public enum RemovePermissionOverrideFailureReason +{ + UserNotFound, + OverrideNotFound +} + +public class RemovePermissionOverrideResult +{ + public bool Success { get; init; } + public RemovePermissionOverrideFailureReason? FailureReason { get; init; } + + public static RemovePermissionOverrideResult Fail(RemovePermissionOverrideFailureReason reason) => new() + { + Success = false, + FailureReason = reason + }; + + public static RemovePermissionOverrideResult Ok() => new() { Success = true }; +} diff --git a/omsorgCore/src/OmsorgCore.Application/Services/ResetPasswordResult.cs b/omsorgCore/src/OmsorgCore.Application/Services/ResetPasswordResult.cs new file mode 100644 index 0000000..b60a507 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Services/ResetPasswordResult.cs @@ -0,0 +1,8 @@ +namespace OmsorgCore.Application.Services; + +public enum ResetPasswordResult +{ + Success, + InvalidOrExpiredToken, + PasswordTooShort +} diff --git a/omsorgCore/src/OmsorgCore.Application/Services/RoleService.cs b/omsorgCore/src/OmsorgCore.Application/Services/RoleService.cs index 30d4aec..c536e0d 100644 --- a/omsorgCore/src/OmsorgCore.Application/Services/RoleService.cs +++ b/omsorgCore/src/OmsorgCore.Application/Services/RoleService.cs @@ -1,5 +1,6 @@ using OmsorgCore.Application.Abstractions; using OmsorgCore.Domain.Entities; +using OmsorgCore.Domain.Enums; namespace OmsorgCore.Application.Services; @@ -33,4 +34,29 @@ public class RoleService : IRoleService return CreateRoleResult.Ok(role); } + + public Task GetByIdWithPermissionsAsync(Guid id, CancellationToken cancellationToken = default) + => _roleRepository.GetByIdWithPermissionsAsync(id, cancellationToken); + + public async Task UpdatePermissionsAsync( + Guid roleId, + IReadOnlyList<(ModuleType Module, PermissionAction Action)> permissions, + CancellationToken cancellationToken = default) + { + var role = await _roleRepository.GetByIdWithPermissionsAsync(roleId, cancellationToken); + if (role is null) + { + return UpdateRolePermissionsResult.Fail(UpdateRolePermissionsFailureReason.RoleNotFound); + } + + role.RolePermissions.Clear(); + await _roleRepository.SaveChangesAsync(cancellationToken); + + var newPermissions = permissions.Distinct() + .Select(p => new RolePermission { RoleId = role.Id, Module = p.Module, Action = p.Action }) + .ToList(); + await _roleRepository.AddPermissionRangeAsync(newPermissions, cancellationToken); + await _roleRepository.SaveChangesAsync(cancellationToken); + return UpdateRolePermissionsResult.Ok(); + } } diff --git a/omsorgCore/src/OmsorgCore.Application/Services/UpdateOrderResult.cs b/omsorgCore/src/OmsorgCore.Application/Services/UpdateOrderResult.cs new file mode 100644 index 0000000..3907568 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Services/UpdateOrderResult.cs @@ -0,0 +1,28 @@ +using OmsorgCore.Domain.Entities; + +namespace OmsorgCore.Application.Services; + +public enum UpdateOrderFailureReason +{ + OrderNotFound, + InvalidStatusTransition +} + +public class UpdateOrderResult +{ + public bool Success { get; init; } + public UpdateOrderFailureReason? FailureReason { get; init; } + public Order? Order { get; init; } + + public static UpdateOrderResult Fail(UpdateOrderFailureReason reason) => new() + { + Success = false, + FailureReason = reason + }; + + public static UpdateOrderResult Ok(Order order) => new() + { + Success = true, + Order = order + }; +} diff --git a/omsorgCore/src/OmsorgCore.Application/Services/UpdateRolePermissionsResult.cs b/omsorgCore/src/OmsorgCore.Application/Services/UpdateRolePermissionsResult.cs new file mode 100644 index 0000000..9be2b13 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Services/UpdateRolePermissionsResult.cs @@ -0,0 +1,20 @@ +namespace OmsorgCore.Application.Services; + +public enum UpdateRolePermissionsFailureReason +{ + RoleNotFound +} + +public class UpdateRolePermissionsResult +{ + public bool Success { get; init; } + public UpdateRolePermissionsFailureReason? FailureReason { get; init; } + + public static UpdateRolePermissionsResult Fail(UpdateRolePermissionsFailureReason reason) => new() + { + Success = false, + FailureReason = reason + }; + + public static UpdateRolePermissionsResult Ok() => new() { Success = true }; +} diff --git a/omsorgCore/src/OmsorgCore.Application/Services/UserService.cs b/omsorgCore/src/OmsorgCore.Application/Services/UserService.cs index 0a7520a..fae765e 100644 --- a/omsorgCore/src/OmsorgCore.Application/Services/UserService.cs +++ b/omsorgCore/src/OmsorgCore.Application/Services/UserService.cs @@ -1,5 +1,7 @@ using OmsorgCore.Application.Abstractions; +using OmsorgCore.Application.Models; using OmsorgCore.Domain.Entities; +using OmsorgCore.Domain.Enums; namespace OmsorgCore.Application.Services; @@ -11,6 +13,7 @@ public class UserService : IUserService private readonly IPasswordHasher _passwordHasher; private readonly IPasswordResetService _passwordResetService; private readonly IRefreshTokenRepository _refreshTokenRepository; + private readonly IPasswordPolicy _passwordPolicy; public UserService( IUserRepository userRepository, @@ -18,7 +21,8 @@ public class UserService : IUserService IRoleRepository roleRepository, IPasswordHasher passwordHasher, IPasswordResetService passwordResetService, - IRefreshTokenRepository refreshTokenRepository) + IRefreshTokenRepository refreshTokenRepository, + IPasswordPolicy passwordPolicy) { _userRepository = userRepository; _employeeRepository = employeeRepository; @@ -26,6 +30,7 @@ public class UserService : IUserService _passwordHasher = passwordHasher; _passwordResetService = passwordResetService; _refreshTokenRepository = refreshTokenRepository; + _passwordPolicy = passwordPolicy; } public async Task> GetAllAsync(CancellationToken cancellationToken = default) @@ -73,6 +78,11 @@ public class UserService : IUserService return CreateUserResult.Fail(CreateUserFailureReason.InitialPasswordRequired); } + if (mode == UserCreationMode.Direct && !_passwordPolicy.IsValid(initialPassword)) + { + return CreateUserResult.Fail(CreateUserFailureReason.PasswordTooShort); + } + if (mode == UserCreationMode.Invite && string.IsNullOrWhiteSpace(employee.Email)) { return CreateUserResult.Fail(CreateUserFailureReason.EmployeeEmailMissing); @@ -104,7 +114,7 @@ public class UserService : IUserService return CreateUserResult.Ok(user.Id, role.Name); } - public async Task ChangeOwnPasswordAsync( + public async Task ChangeOwnPasswordAsync( Guid userId, string currentPassword, string newPassword, @@ -113,7 +123,12 @@ public class UserService : IUserService var user = await _userRepository.GetByIdAsync(userId, cancellationToken); if (user is null || !_passwordHasher.Verify(currentPassword, user.PasswordHash)) { - return false; + return ChangeOwnPasswordResult.InvalidCurrentPassword; + } + + if (!_passwordPolicy.IsValid(newPassword)) + { + return ChangeOwnPasswordResult.PasswordTooShort; } user.PasswordHash = _passwordHasher.Hash(newPassword); @@ -131,7 +146,7 @@ public class UserService : IUserService await _userRepository.SaveChangesAsync(cancellationToken); await _refreshTokenRepository.SaveChangesAsync(cancellationToken); - return true; + return ChangeOwnPasswordResult.Success; } public async Task AdminResetPasswordAsync( @@ -152,6 +167,11 @@ public class UserService : IUserService return AdminResetPasswordResult.Fail(AdminResetPasswordFailureReason.InitialPasswordRequired); } + if (mode == UserCreationMode.Direct && !_passwordPolicy.IsValid(initialPassword)) + { + return AdminResetPasswordResult.Fail(AdminResetPasswordFailureReason.PasswordTooShort); + } + if (mode == UserCreationMode.Invite && string.IsNullOrWhiteSpace(user.Employee?.Email)) { return AdminResetPasswordResult.Fail(AdminResetPasswordFailureReason.EmployeeEmailMissing); @@ -219,4 +239,68 @@ public class UserService : IUserService await _userRepository.SaveChangesAsync(cancellationToken); return UpdateUserResult.Ok(); } + + public async Task?> GetPermissionOverridesAsync( + Guid userId, CancellationToken cancellationToken = default) + { + var user = await _userRepository.GetByIdWithPermissionsAsync(userId, cancellationToken); + if (user is null) + { + return null; + } + + return user.PermissionOverrides + .Select(o => new PermissionOverrideSummary(o.Id, o.Module, o.Action, o.Effect)) + .ToList(); + } + + public async Task AddPermissionOverrideAsync( + Guid userId, + ModuleType module, + PermissionAction action, + PermissionEffect effect, + CancellationToken cancellationToken = default) + { + var user = await _userRepository.GetByIdWithPermissionsAsync(userId, cancellationToken); + if (user is null) + { + return AddPermissionOverrideResult.Fail(AddPermissionOverrideFailureReason.UserNotFound); + } + + var existing = user.PermissionOverrides + .FirstOrDefault(o => o.Module == module && o.Action == action); + + if (existing is not null) + { + existing.Effect = effect; + } + else + { + existing = new UserPermissionOverride { UserId = user.Id, Module = module, Action = action, Effect = effect }; + await _userRepository.AddPermissionOverrideAsync(existing, cancellationToken); + } + + await _userRepository.SaveChangesAsync(cancellationToken); + return AddPermissionOverrideResult.Ok(new PermissionOverrideSummary(existing.Id, module, action, effect)); + } + + public async Task RemovePermissionOverrideAsync( + Guid userId, Guid overrideId, CancellationToken cancellationToken = default) + { + var user = await _userRepository.GetByIdWithPermissionsAsync(userId, cancellationToken); + if (user is null) + { + return RemovePermissionOverrideResult.Fail(RemovePermissionOverrideFailureReason.UserNotFound); + } + + var existing = user.PermissionOverrides.FirstOrDefault(o => o.Id == overrideId); + if (existing is null) + { + return RemovePermissionOverrideResult.Fail(RemovePermissionOverrideFailureReason.OverrideNotFound); + } + + user.PermissionOverrides.Remove(existing); + await _userRepository.SaveChangesAsync(cancellationToken); + return RemovePermissionOverrideResult.Ok(); + } } diff --git a/omsorgCore/src/OmsorgCore.Application/Services/ValueListService.cs b/omsorgCore/src/OmsorgCore.Application/Services/ValueListService.cs new file mode 100644 index 0000000..6b0572e --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Application/Services/ValueListService.cs @@ -0,0 +1,103 @@ +using OmsorgCore.Application.Abstractions; +using OmsorgCore.Domain.Entities; + +namespace OmsorgCore.Application.Services; + +public class ValueListService : IValueListService +{ + private readonly IValueListRepository _valueListRepository; + private readonly IEnumerable _usageCheckers; + + public ValueListService(IValueListRepository valueListRepository, IEnumerable usageCheckers) + { + _valueListRepository = valueListRepository; + _usageCheckers = usageCheckers; + } + + public Task> GetListsAsync(CancellationToken cancellationToken = default) + => _valueListRepository.GetAllListsAsync(cancellationToken); + + public Task> GetItemsAsync(string key, CancellationToken cancellationToken = default) + => _valueListRepository.GetItemsAsync(key, cancellationToken); + + public async Task CreateItemAsync(string key, string value, int sortOrder, bool isDefault, bool isInitial, bool isTerminal, CancellationToken cancellationToken = default) + { + var list = await _valueListRepository.GetListByKeyAsync(key, cancellationToken) + ?? throw new InvalidOperationException($"Unbekannte Auswahlliste '{key}'."); + + var item = new ValueListItem + { + ValueListId = list.Id, + Value = value, + SortOrder = sortOrder, + IsDefault = isDefault, + IsInitial = isInitial, + IsTerminal = isTerminal + }; + + await _valueListRepository.AddItemAsync(item, cancellationToken); + await _valueListRepository.SaveChangesAsync(cancellationToken); + return item; + } + + public async Task UpdateItemAsync(Guid id, string value, int sortOrder, bool isDefault, bool isInitial, bool isTerminal, CancellationToken cancellationToken = default) + { + var item = await _valueListRepository.GetItemByIdAsync(id, cancellationToken); + if (item is null) + { + return null; + } + + item.Value = value; + item.SortOrder = sortOrder; + item.IsDefault = isDefault; + item.IsInitial = isInitial; + item.IsTerminal = isTerminal; + + await _valueListRepository.UpdateItemAsync(item, cancellationToken); + await _valueListRepository.SaveChangesAsync(cancellationToken); + return item; + } + + public async Task DeleteItemAsync(Guid id, CancellationToken cancellationToken = default) + { + var item = await _valueListRepository.GetItemByIdAsync(id, cancellationToken); + if (item is null) + { + return DeleteValueListItemResult.Fail(DeleteValueListItemFailureReason.ItemNotFound); + } + + var usages = await FindUsagesAsync(item, cancellationToken); + if (usages.Count > 0) + { + return DeleteValueListItemResult.Fail(DeleteValueListItemFailureReason.InUse, usages); + } + + await _valueListRepository.RemoveItemAsync(item, cancellationToken); + await _valueListRepository.SaveChangesAsync(cancellationToken); + return DeleteValueListItemResult.Ok(); + } + + public async Task> GetUsagesAsync(Guid id, CancellationToken cancellationToken = default) + { + var item = await _valueListRepository.GetItemByIdAsync(id, cancellationToken); + return item is null ? Array.Empty() : await FindUsagesAsync(item, cancellationToken); + } + + public Task> GetTransitionsAsync(string key, CancellationToken cancellationToken = default) + => _valueListRepository.GetTransitionsAsync(key, cancellationToken); + + public async Task ReplaceTransitionsAsync(string key, IEnumerable<(Guid FromItemId, Guid ToItemId)> transitions, CancellationToken cancellationToken = default) + { + await _valueListRepository.ReplaceTransitionsAsync(key, transitions, cancellationToken); + await _valueListRepository.SaveChangesAsync(cancellationToken); + } + + private async Task> FindUsagesAsync(ValueListItem item, CancellationToken cancellationToken) + { + var checker = _usageCheckers.FirstOrDefault(c => c.Key == item.ValueList.Key); + return checker is null + ? Array.Empty() + : await checker.FindUsagesAsync(item.Id, item.Value, cancellationToken); + } +} diff --git a/omsorgCore/src/OmsorgCore.Domain/Common/AuditRedactedAttribute.cs b/omsorgCore/src/OmsorgCore.Domain/Common/AuditRedactedAttribute.cs new file mode 100644 index 0000000..5d6d831 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Domain/Common/AuditRedactedAttribute.cs @@ -0,0 +1,11 @@ +namespace OmsorgCore.Domain.Common; + +/// +/// Markiert eine Property als sensibel - der SaveChanges-Interceptor nimmt ihren Feld-Diff zwar als +/// "geändert" auf, ersetzt den tatsächlichen Wert im Audit-Log aber durch einen Platzhalter (kein +/// Klartext-/Hash-Leck von Secrets in eine für Geschäftsführung lesbare Tabelle). +/// +[AttributeUsage(AttributeTargets.Property)] +public class AuditRedactedAttribute : Attribute +{ +} diff --git a/omsorgCore/src/OmsorgCore.Domain/Entities/AuditLogEntry.cs b/omsorgCore/src/OmsorgCore.Domain/Entities/AuditLogEntry.cs new file mode 100644 index 0000000..41c28ce --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Domain/Entities/AuditLogEntry.cs @@ -0,0 +1,36 @@ +using OmsorgCore.Domain.Common; +using OmsorgCore.Domain.Enums; + +namespace OmsorgCore.Domain.Entities; + +/// +/// Ein Eintrag im generischen Audit-Log: "wer hat wann was verändert" (Entity-Changes, per +/// SaveChanges-Interceptor automatisch erfasst) bzw. "wer hat wann was getan" (nicht-Entity-Aktionen +/// wie Login/Logout/Session-Kill, per AuditEvent explizit gemeldet). Nicht zu verwechseln mit +/// (reine Brute-Force-Sperr-Historie). +/// Erbt bewusst von , nicht - ein Audit-Eintrag ist +/// selbst unveränderlich und braucht kein CreatedAt/UpdatedAt/Soft-Delete. +/// +public class AuditLogEntry : Entity +{ + public DateTime OccurredAtUtc { get; set; } = DateTime.UtcNow; + + public Guid? ActorUserId { get; set; } + + /// Snapshot, bleibt lesbar auch wenn der User später umbenannt oder gelöscht wird. + public string? ActorUsername { get; set; } + + public string? IpAddress { get; set; } + + public AuditEventCategory Category { get; set; } + + /// Z. B. "Created"/"Updated"/"Deleted"/"Login"/"LoginFailed"/"Logout"/"SessionRevoked"/"AllSessionsRevoked". + public string Action { get; set; } = string.Empty; + + /// Nur bei Category = EntityChange gesetzt, z. B. "Employee". + public string? EntityType { get; set; } + public Guid? EntityId { get; set; } + + /// JSON: Feld-Diff bei EntityChange, freier Kontext bei BehavioralEvent. + public string? Details { get; set; } +} diff --git a/omsorgCore/src/OmsorgCore.Domain/Entities/Contract.cs b/omsorgCore/src/OmsorgCore.Domain/Entities/Contract.cs index d848d86..c82bfbd 100644 --- a/omsorgCore/src/OmsorgCore.Domain/Entities/Contract.cs +++ b/omsorgCore/src/OmsorgCore.Domain/Entities/Contract.cs @@ -19,4 +19,11 @@ public class Contract : AuditableEntity public DateOnly StartDate { get; set; } public DateOnly? EndDate { get; set; } public string Status { get; set; } = "Entwurf"; + + public decimal? WeeklyHours { get; set; } + public decimal? HourlyWage { get; set; } + public string? AllowancesDescription { get; set; } + public string? OvertimeRules { get; set; } + public int? VacationDaysPerYear { get; set; } + public int? ProbationPeriodMonths { get; set; } } diff --git a/omsorgCore/src/OmsorgCore.Domain/Entities/Facility.cs b/omsorgCore/src/OmsorgCore.Domain/Entities/Facility.cs index 8e8d98b..aa16ba9 100644 --- a/omsorgCore/src/OmsorgCore.Domain/Entities/Facility.cs +++ b/omsorgCore/src/OmsorgCore.Domain/Entities/Facility.cs @@ -4,14 +4,24 @@ namespace OmsorgCore.Domain.Entities; /// /// Core-Objekt "Einrichtung" — CRM-/Kundendatensatz (REQUIREMENTS.md Abschnitt 6, Blueprint 19.2). +/// Adresse und Rechnungsadresse sind getrennte Adressen (z. B. Einsatzort vs. zentrale Buchhaltung +/// eines Trägers), daher jeweils eigene strukturierte Felder statt eines gemeinsamen Freitextfelds. /// public class Facility : AuditableEntity { public string Name { get; set; } = string.Empty; public string? FacilityType { get; set; } - public string? Address { get; set; } - public string? BillingAddress { get; set; } - public string? PhoneNumber { get; set; } - public string? Email { get; set; } + public string? Website { get; set; } + + public string? Street { get; set; } + public string? PostalCode { get; set; } + public string? City { get; set; } + public string? Country { get; set; } + + public string? BillingStreet { get; set; } + public string? BillingPostalCode { get; set; } + public string? BillingCity { get; set; } + public string? BillingCountry { get; set; } + public string CrmStatus { get; set; } = "Lead"; } diff --git a/omsorgCore/src/OmsorgCore.Domain/Entities/FacilityContact.cs b/omsorgCore/src/OmsorgCore.Domain/Entities/FacilityContact.cs new file mode 100644 index 0000000..df8573e --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Domain/Entities/FacilityContact.cs @@ -0,0 +1,20 @@ +using OmsorgCore.Domain.Common; + +namespace OmsorgCore.Domain.Entities; + +/// +/// Ansprechpartner einer Einrichtung (REQUIREMENTS.md FR-EIN-2, Blueprint 19.2) — 1:n-Beziehung +/// zu , da eine Einrichtung mehrere Ansprechpartner haben kann. +/// +public class FacilityContact : AuditableEntity +{ + public Guid FacilityId { get; set; } + public Facility Facility { get; set; } = null!; + + public string Name { get; set; } = string.Empty; + public string? Role { get; set; } + public string? Department { get; set; } + public string? PhoneNumber { get; set; } + public string? Email { get; set; } + public string? Notes { get; set; } +} diff --git a/omsorgCore/src/OmsorgCore.Domain/Entities/Order.cs b/omsorgCore/src/OmsorgCore.Domain/Entities/Order.cs index 4a4c0ef..b85b733 100644 --- a/omsorgCore/src/OmsorgCore.Domain/Entities/Order.cs +++ b/omsorgCore/src/OmsorgCore.Domain/Entities/Order.cs @@ -10,8 +10,17 @@ public class Order : AuditableEntity public Guid FacilityId { get; set; } public Facility Facility { get; set; } = null!; + public Guid? FacilityContactId { get; set; } + public FacilityContact? FacilityContact { get; set; } + public DateOnly StartDate { get; set; } public DateOnly? EndDate { get; set; } public string? RequiredQualification { get; set; } - public string Status { get; set; } = "Anfrage"; + public string? ShiftType { get; set; } + public int RequiredHeadcount { get; set; } = 1; + public string? Conditions { get; set; } + public string Priority { get; set; } = "Normal"; + + public Guid StatusId { get; set; } + public ValueListItem Status { get; set; } = null!; } diff --git a/omsorgCore/src/OmsorgCore.Domain/Entities/User.cs b/omsorgCore/src/OmsorgCore.Domain/Entities/User.cs index dfa91a1..f1ddf8d 100644 --- a/omsorgCore/src/OmsorgCore.Domain/Entities/User.cs +++ b/omsorgCore/src/OmsorgCore.Domain/Entities/User.cs @@ -9,6 +9,8 @@ namespace OmsorgCore.Domain.Entities; public class User : AuditableEntity { public string Username { get; set; } = string.Empty; + + [AuditRedacted] public string PasswordHash { get; set; } = string.Empty; public bool IsActive { get; set; } = true; @@ -17,6 +19,7 @@ public class User : AuditableEntity /// Wird als Claim in jeden Access-Token eingebettet und bei jedem Request dagegen geprüft - /// ein Wechsel invalidiert sofort alle bereits ausgestellten Access-Tokens dieses Users. /// + [AuditRedacted] public Guid SecurityStamp { get; set; } = Guid.NewGuid(); /// diff --git a/omsorgCore/src/OmsorgCore.Domain/Entities/ValueList.cs b/omsorgCore/src/OmsorgCore.Domain/Entities/ValueList.cs new file mode 100644 index 0000000..b3f117a --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Domain/Entities/ValueList.cs @@ -0,0 +1,18 @@ +using OmsorgCore.Domain.Common; + +namespace OmsorgCore.Domain.Entities; + +/// +/// Eine admin-editierbare Auswahlliste (z. B. Mitarbeiterstatus, Beschäftigungsart, CRM-Status, +/// Einrichtungstyp, Vertragstyp/-status, Auftragsstatus) — Stammdaten statt Enum/hartcodiertes +/// Frontend-Array, damit sie über die "Status-Verwaltung" (Einstellungen) ohne Code-Deploy gepflegt +/// werden kann. ist der stabile Bezeichner, über den Backend-Code (Validierung, +/// Verwendungsprüfung) und Frontend (Dropdown-Ladeaufruf) auf eine bestimmte Liste verweisen. +/// +public class ValueList : Entity +{ + public string Key { get; set; } = string.Empty; + public string DisplayName { get; set; } = string.Empty; + + public ICollection Items { get; set; } = new List(); +} diff --git a/omsorgCore/src/OmsorgCore.Domain/Entities/ValueListItem.cs b/omsorgCore/src/OmsorgCore.Domain/Entities/ValueListItem.cs new file mode 100644 index 0000000..4a8e29b --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Domain/Entities/ValueListItem.cs @@ -0,0 +1,21 @@ +using OmsorgCore.Domain.Common; + +namespace OmsorgCore.Domain.Entities; + +/// +/// Ein einzelner Wert innerhalb einer (z. B. "Aktiv" in der Liste +/// "EmployeeStatus"). / sind nur für Listen mit +/// Übergangsregeln relevant (aktuell nur "OrderStatus", siehe ) +/// und bei allen anderen Listen einfach false. +/// +public class ValueListItem : Entity +{ + public Guid ValueListId { get; set; } + public ValueList ValueList { get; set; } = null!; + + public string Value { get; set; } = string.Empty; + public int SortOrder { get; set; } + public bool IsDefault { get; set; } + public bool IsInitial { get; set; } + public bool IsTerminal { get; set; } +} diff --git a/omsorgCore/src/OmsorgCore.Domain/Entities/ValueListItemTransition.cs b/omsorgCore/src/OmsorgCore.Domain/Entities/ValueListItemTransition.cs new file mode 100644 index 0000000..019ecd3 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Domain/Entities/ValueListItemTransition.cs @@ -0,0 +1,17 @@ +using OmsorgCore.Domain.Common; + +namespace OmsorgCore.Domain.Entities; + +/// +/// Ein erlaubter Übergang zwischen zwei n derselben Liste. Wird aktuell +/// nur für die Liste "OrderStatus" befüllt (FR-EM-2) — die meisten Listen brauchen keine +/// Übergangsregeln und lassen diese Tabelle für ihren leer. +/// +public class ValueListItemTransition : Entity +{ + public Guid FromItemId { get; set; } + public ValueListItem FromItem { get; set; } = null!; + + public Guid ToItemId { get; set; } + public ValueListItem ToItem { get; set; } = null!; +} diff --git a/omsorgCore/src/OmsorgCore.Domain/Enums/AuditEventCategory.cs b/omsorgCore/src/OmsorgCore.Domain/Enums/AuditEventCategory.cs new file mode 100644 index 0000000..3d8f2cb --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Domain/Enums/AuditEventCategory.cs @@ -0,0 +1,11 @@ +namespace OmsorgCore.Domain.Enums; + +/// +/// Unterscheidet automatisch vom SaveChanges-Interceptor erfasste Entity-Änderungen von explizit +/// gemeldeten Verhaltens-Ereignissen ohne Entity-Änderung (Login, Logout, Session-Kill, ...). +/// +public enum AuditEventCategory +{ + EntityChange, + BehavioralEvent +} diff --git a/omsorgCore/src/OmsorgCore.Domain/Enums/ModuleType.cs b/omsorgCore/src/OmsorgCore.Domain/Enums/ModuleType.cs index 5741cd8..4c48ef9 100644 --- a/omsorgCore/src/OmsorgCore.Domain/Enums/ModuleType.cs +++ b/omsorgCore/src/OmsorgCore.Domain/Enums/ModuleType.cs @@ -13,5 +13,6 @@ public enum ModuleType Invoices, Recruiting, Controlling, - UserManagement + UserManagement, + AuditLog } diff --git a/omsorgCore/src/OmsorgCore.Engine/DependencyInjection.cs b/omsorgCore/src/OmsorgCore.Engine/DependencyInjection.cs index 49f0590..9d4f498 100644 --- a/omsorgCore/src/OmsorgCore.Engine/DependencyInjection.cs +++ b/omsorgCore/src/OmsorgCore.Engine/DependencyInjection.cs @@ -10,8 +10,12 @@ public static class DependencyInjection { services.AddSingleton(); services.AddScoped, EmployeeCreatedHandler>(); + services.AddScoped, FacilityCreatedHandler>(); + services.AddScoped, ContractCreatedHandler>(); + services.AddScoped, OrderCreatedHandler>(); services.AddScoped, PasswordResetRequestedHandler>(); services.AddScoped, UserInvitedHandler>(); + services.AddScoped, AuditEventHandler>(); return services; } diff --git a/omsorgCore/src/OmsorgCore.Engine/Events/AuditEvent.cs b/omsorgCore/src/OmsorgCore.Engine/Events/AuditEvent.cs new file mode 100644 index 0000000..b0965a0 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Engine/Events/AuditEvent.cs @@ -0,0 +1,26 @@ +namespace OmsorgCore.Engine.Events; + +/// +/// Generisches Ereignis für nicht-Entity-Aktionen (Login/Logout/Session-Kill/...), die der +/// SaveChanges-Interceptor nicht automatisch erfasst, weil keine AuditableEntity verändert wird. +/// Ein Dispatch-Aufruf pro Aktionsstelle im Api-Layer, analog zu . +/// +public class AuditEvent : IDomainEvent +{ + public Guid? ActorUserId { get; } + public string? ActorUsername { get; } + public string? IpAddress { get; } + public string Action { get; } + public string? Details { get; } + public DateTime OccurredAt { get; } + + public AuditEvent(Guid? actorUserId, string? actorUsername, string? ipAddress, string action, string? details = null) + { + ActorUserId = actorUserId; + ActorUsername = actorUsername; + IpAddress = ipAddress; + Action = action; + Details = details; + OccurredAt = DateTime.UtcNow; + } +} diff --git a/omsorgCore/src/OmsorgCore.Engine/Events/ContractCreatedEvent.cs b/omsorgCore/src/OmsorgCore.Engine/Events/ContractCreatedEvent.cs new file mode 100644 index 0000000..fc12ca8 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Engine/Events/ContractCreatedEvent.cs @@ -0,0 +1,16 @@ +namespace OmsorgCore.Engine.Events; + +/// +/// Ereignis für neu angelegte Verträge (Core-Objekt "Vertrag", REQUIREMENTS.md Abschnitt 6). +/// +public class ContractCreatedEvent : IDomainEvent +{ + public Guid ContractId { get; } + public DateTime OccurredAt { get; } + + public ContractCreatedEvent(Guid contractId) + { + ContractId = contractId; + OccurredAt = DateTime.UtcNow; + } +} diff --git a/omsorgCore/src/OmsorgCore.Engine/Events/FacilityCreatedEvent.cs b/omsorgCore/src/OmsorgCore.Engine/Events/FacilityCreatedEvent.cs new file mode 100644 index 0000000..c77201d --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Engine/Events/FacilityCreatedEvent.cs @@ -0,0 +1,16 @@ +namespace OmsorgCore.Engine.Events; + +/// +/// Ereignis für neu angelegte Einrichtungen (Core-Objekt "Einrichtung", REQUIREMENTS.md Abschnitt 6). +/// +public class FacilityCreatedEvent : IDomainEvent +{ + public Guid FacilityId { get; } + public DateTime OccurredAt { get; } + + public FacilityCreatedEvent(Guid facilityId) + { + FacilityId = facilityId; + OccurredAt = DateTime.UtcNow; + } +} diff --git a/omsorgCore/src/OmsorgCore.Engine/Events/OrderCreatedEvent.cs b/omsorgCore/src/OmsorgCore.Engine/Events/OrderCreatedEvent.cs new file mode 100644 index 0000000..ad18dbe --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Engine/Events/OrderCreatedEvent.cs @@ -0,0 +1,16 @@ +namespace OmsorgCore.Engine.Events; + +/// +/// Ereignis für neu angelegte Aufträge (Core-Objekt "Auftrag", REQUIREMENTS.md Abschnitt 6). +/// +public class OrderCreatedEvent : IDomainEvent +{ + public Guid OrderId { get; } + public DateTime OccurredAt { get; } + + public OrderCreatedEvent(Guid orderId) + { + OrderId = orderId; + OccurredAt = DateTime.UtcNow; + } +} diff --git a/omsorgCore/src/OmsorgCore.Engine/Handlers/AuditEventHandler.cs b/omsorgCore/src/OmsorgCore.Engine/Handlers/AuditEventHandler.cs new file mode 100644 index 0000000..892c35f --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Engine/Handlers/AuditEventHandler.cs @@ -0,0 +1,37 @@ +using OmsorgCore.Application.Abstractions; +using OmsorgCore.Domain.Entities; +using OmsorgCore.Domain.Enums; +using OmsorgCore.Engine.Events; + +namespace OmsorgCore.Engine.Handlers; + +/// +/// Persistiert jedes dispatchte als AuditLogEntry mit +/// Category = BehavioralEvent. Geht ausschließlich über IAuditLogRepository (Application-Abstraktion) - +/// Engine kennt Infrastructure/OmsorgCoreDbContext nicht. +/// +public class AuditEventHandler : IDomainEventHandler +{ + private readonly IAuditLogRepository _auditLogRepository; + + public AuditEventHandler(IAuditLogRepository auditLogRepository) + { + _auditLogRepository = auditLogRepository; + } + + public async Task HandleAsync(AuditEvent domainEvent, CancellationToken cancellationToken = default) + { + await _auditLogRepository.AddAsync(new AuditLogEntry + { + OccurredAtUtc = domainEvent.OccurredAt, + ActorUserId = domainEvent.ActorUserId, + ActorUsername = domainEvent.ActorUsername, + IpAddress = domainEvent.IpAddress, + Category = AuditEventCategory.BehavioralEvent, + Action = domainEvent.Action, + Details = domainEvent.Details + }, cancellationToken); + + await _auditLogRepository.SaveChangesAsync(cancellationToken); + } +} diff --git a/omsorgCore/src/OmsorgCore.Engine/Handlers/ContractCreatedHandler.cs b/omsorgCore/src/OmsorgCore.Engine/Handlers/ContractCreatedHandler.cs new file mode 100644 index 0000000..4be7ff6 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Engine/Handlers/ContractCreatedHandler.cs @@ -0,0 +1,28 @@ +using Microsoft.Extensions.Logging; +using OmsorgCore.Engine.Events; + +namespace OmsorgCore.Engine.Handlers; + +/// +/// Reagiert auf . Protokolliert bislang nur — weitere Aktionen +/// (z. B. Vertragsende-Erinnerung, Dashboard-Hinweis) folgen mit FR-MA-4/Abschnitt 4.10. +/// +public class ContractCreatedHandler : IDomainEventHandler +{ + private readonly ILogger _logger; + + public ContractCreatedHandler(ILogger logger) + { + _logger = logger; + } + + public Task HandleAsync(ContractCreatedEvent domainEvent, CancellationToken cancellationToken = default) + { + _logger.LogInformation( + "Engine: Vertrag {ContractId} wurde angelegt ({OccurredAt}).", + domainEvent.ContractId, + domainEvent.OccurredAt); + + return Task.CompletedTask; + } +} diff --git a/omsorgCore/src/OmsorgCore.Engine/Handlers/FacilityCreatedHandler.cs b/omsorgCore/src/OmsorgCore.Engine/Handlers/FacilityCreatedHandler.cs new file mode 100644 index 0000000..bef8a68 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Engine/Handlers/FacilityCreatedHandler.cs @@ -0,0 +1,28 @@ +using Microsoft.Extensions.Logging; +using OmsorgCore.Engine.Events; + +namespace OmsorgCore.Engine.Handlers; + +/// +/// Reagiert auf . Protokolliert bislang nur — weitere Aktionen +/// (z. B. CRM-Wiedervorlage, Dashboard-Hinweis) folgen, sobald FR-EIN-3 umgesetzt wird. +/// +public class FacilityCreatedHandler : IDomainEventHandler +{ + private readonly ILogger _logger; + + public FacilityCreatedHandler(ILogger logger) + { + _logger = logger; + } + + public Task HandleAsync(FacilityCreatedEvent domainEvent, CancellationToken cancellationToken = default) + { + _logger.LogInformation( + "Engine: Einrichtung {FacilityId} wurde angelegt ({OccurredAt}).", + domainEvent.FacilityId, + domainEvent.OccurredAt); + + return Task.CompletedTask; + } +} diff --git a/omsorgCore/src/OmsorgCore.Engine/Handlers/OrderCreatedHandler.cs b/omsorgCore/src/OmsorgCore.Engine/Handlers/OrderCreatedHandler.cs new file mode 100644 index 0000000..2d3181c --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Engine/Handlers/OrderCreatedHandler.cs @@ -0,0 +1,28 @@ +using Microsoft.Extensions.Logging; +using OmsorgCore.Engine.Events; + +namespace OmsorgCore.Engine.Handlers; + +/// +/// Reagiert auf . Protokolliert bislang nur — Dashboard-Sichtbarkeit +/// (FR-EM-2) und weitere Automatisierung folgen als späterer Schritt. +/// +public class OrderCreatedHandler : IDomainEventHandler +{ + private readonly ILogger _logger; + + public OrderCreatedHandler(ILogger logger) + { + _logger = logger; + } + + public Task HandleAsync(OrderCreatedEvent domainEvent, CancellationToken cancellationToken = default) + { + _logger.LogInformation( + "Engine: Auftrag {OrderId} wurde angelegt ({OccurredAt}).", + domainEvent.OrderId, + domainEvent.OccurredAt); + + return Task.CompletedTask; + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/DependencyInjection.cs b/omsorgCore/src/OmsorgCore.Infrastructure/DependencyInjection.cs index e7d104d..9525780 100644 --- a/omsorgCore/src/OmsorgCore.Infrastructure/DependencyInjection.cs +++ b/omsorgCore/src/OmsorgCore.Infrastructure/DependencyInjection.cs @@ -16,16 +16,26 @@ public static class DependencyInjection { public static IServiceCollection AddInfrastructure(this IServiceCollection services, IConfiguration configuration) { - services.AddDbContext(options => - options.UseNpgsql(configuration.GetConnectionString("OmsorgCore"))); + services.AddScoped(); + + services.AddDbContext((sp, options) => + options.UseNpgsql(configuration.GetConnectionString("OmsorgCore")) + .AddInterceptors(sp.GetRequiredService())); services.Configure(configuration.GetSection(JwtOptions.SectionName)); services.Configure(configuration.GetSection(RefreshTokenOptions.SectionName)); services.Configure(configuration.GetSection(PasswordResetOptions.SectionName)); services.Configure(configuration.GetSection(SeedOptions.SectionName)); services.Configure(configuration.GetSection(LoginAttemptOptions.SectionName)); + services.Configure(configuration.GetSection(PasswordPolicyOptions.SectionName)); services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + RegisterValueListUsageCheckers(services); services.AddScoped(); services.AddScoped(); services.AddScoped(); @@ -36,7 +46,50 @@ public static class DependencyInjection services.AddScoped(); services.AddScoped(); services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); return services; } + + /// + /// Eine -Instanz je String-Feld-Liste (siehe dortige + /// Doku), plus die FK-basierte Prüfung für "OrderStatus" — Reihenfolge/Vollständigkeit dieser Liste + /// muss zur Seed-Liste in DbSeeder.SeedValueListsAsync passen. + /// + private static void RegisterValueListUsageCheckers(IServiceCollection services) + { + services.AddScoped(sp => new StringFieldValueListUsageChecker( + sp.GetRequiredService(), "EmployeeStatus", + (db, value, ct) => db.Employees.AsNoTracking().Where(e => e.Status == value) + .Select(e => new ValueListUsageEntry("Employee", e.Id, $"{e.FirstName} {e.LastName}")).ToListAsync(ct))); + + services.AddScoped(sp => new StringFieldValueListUsageChecker( + sp.GetRequiredService(), "EmploymentType", + (db, value, ct) => db.Employees.AsNoTracking().Where(e => e.EmploymentType == value) + .Select(e => new ValueListUsageEntry("Employee", e.Id, $"{e.FirstName} {e.LastName}")).ToListAsync(ct))); + + services.AddScoped(sp => new StringFieldValueListUsageChecker( + sp.GetRequiredService(), "CrmStatus", + (db, value, ct) => db.Facilities.AsNoTracking().Where(f => f.CrmStatus == value) + .Select(f => new ValueListUsageEntry("Facility", f.Id, f.Name)).ToListAsync(ct))); + + services.AddScoped(sp => new StringFieldValueListUsageChecker( + sp.GetRequiredService(), "FacilityType", + (db, value, ct) => db.Facilities.AsNoTracking().Where(f => f.FacilityType == value) + .Select(f => new ValueListUsageEntry("Facility", f.Id, f.Name)).ToListAsync(ct))); + + services.AddScoped(sp => new StringFieldValueListUsageChecker( + sp.GetRequiredService(), "ContractType", + (db, value, ct) => db.Contracts.AsNoTracking().Where(c => c.ContractType == value) + .Select(c => new ValueListUsageEntry("Contract", c.Id, $"Vertrag {c.Id}")).ToListAsync(ct))); + + services.AddScoped(sp => new StringFieldValueListUsageChecker( + sp.GetRequiredService(), "ContractStatus", + (db, value, ct) => db.Contracts.AsNoTracking().Where(c => c.Status == value) + .Select(c => new ValueListUsageEntry("Contract", c.Id, $"Vertrag {c.Id}")).ToListAsync(ct))); + + services.AddScoped(); + } } diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/AuditSaveChangesInterceptor.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/AuditSaveChangesInterceptor.cs new file mode 100644 index 0000000..c5b0a70 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/AuditSaveChangesInterceptor.cs @@ -0,0 +1,136 @@ +using System.Text.Json; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.ChangeTracking; +using Microsoft.EntityFrameworkCore.Diagnostics; +using OmsorgCore.Application.Abstractions; +using OmsorgCore.Domain.Common; +using OmsorgCore.Domain.Entities; +using OmsorgCore.Domain.Enums; + +namespace OmsorgCore.Infrastructure.Persistence; + +/// +/// Erfasst automatisch jede Create/Update/(Soft-)Delete-Änderung an einer AuditableEntity als +/// AuditLogEntry - läuft im selben SaveChanges-Aufruf/derselben Transaktion wie die eigentliche +/// Änderung (kein separater Commit, kein Risiko einer verlorenen Audit-Spur). Erfasst NICHT +/// Nicht-Entity-Aktionen (Login/Logout/Session-Kill) - dafür AuditEvent (siehe Engine). +/// Neue AuditableEntity-Subklassen (Facility, Contract, ...) werden ohne Codeänderung hier erfasst. +/// +public class AuditSaveChangesInterceptor : SaveChangesInterceptor +{ + private readonly ICurrentUserService _currentUserService; + + public AuditSaveChangesInterceptor(ICurrentUserService currentUserService) + { + _currentUserService = currentUserService; + } + + public override ValueTask> SavingChangesAsync( + DbContextEventData eventData, + InterceptionResult result, + CancellationToken cancellationToken = default) + { + if (eventData.Context is not null) + { + CaptureAuditEntries(eventData.Context); + } + + return base.SavingChangesAsync(eventData, result, cancellationToken); + } + + private void CaptureAuditEntries(DbContext context) + { + var isAuthenticated = _currentUserService.IsAuthenticated; + var actorUserId = isAuthenticated ? _currentUserService.UserId : null; + var actorUsername = isAuthenticated ? _currentUserService.Username : null; + var ipAddress = _currentUserService.IpAddress; + + // ToList(): Add() unten mutiert den ChangeTracker - ohne Materialisierung würde die laufende + // Enumeration von Entries() dadurch invalidiert (InvalidOperationException). + foreach (var entry in context.ChangeTracker.Entries().ToList()) + { + if (entry.State is not (EntityState.Added or EntityState.Modified or EntityState.Deleted)) + { + continue; + } + + var (action, details) = BuildActionAndDiff(entry); + if (details is null) + { + // Modified-Eintrag ohne tatsächlich geänderte Skalar-Property (z.B. nur eine Navigation + // berührt) - keine Rausch-Zeile im Audit-Log. + continue; + } + + context.Set().Add(new AuditLogEntry + { + OccurredAtUtc = DateTime.UtcNow, + ActorUserId = actorUserId, + ActorUsername = actorUsername, + IpAddress = ipAddress, + Category = AuditEventCategory.EntityChange, + Action = action, + EntityType = entry.Entity.GetType().Name, + EntityId = entry.Entity.Id, + Details = details + }); + } + } + + private static (string Action, string? DetailsJson) BuildActionAndDiff(EntityEntry entry) + { + var redactedProperties = entry.Entity.GetType() + .GetProperties() + .Where(p => Attribute.IsDefined(p, typeof(AuditRedactedAttribute))) + .Select(p => p.Name) + .ToHashSet(); + + switch (entry.State) + { + case EntityState.Added: + { + var payload = new Dictionary(); + foreach (var p in entry.Properties) + { + payload[p.Metadata.Name] = redactedProperties.Contains(p.Metadata.Name) ? "***redacted***" : p.CurrentValue; + } + return ("Created", JsonSerializer.Serialize(payload)); + } + case EntityState.Deleted: + { + var payload = new Dictionary(); + foreach (var p in entry.Properties) + { + payload[p.Metadata.Name] = redactedProperties.Contains(p.Metadata.Name) ? "***redacted***" : p.OriginalValue; + } + return ("Deleted", JsonSerializer.Serialize(payload)); + } + default: + { + var changed = entry.Properties + .Where(p => p.IsModified && !Equals(p.OriginalValue, p.CurrentValue)) + .ToList(); + + if (changed.Count == 0) + { + return ("Updated", null); + } + + var isSoftDelete = changed.Any(p => + p.Metadata.Name == nameof(AuditableEntity.IsDeleted) && + p.OriginalValue is false && + p.CurrentValue is true); + + var diff = new Dictionary(); + foreach (var p in changed) + { + diff[p.Metadata.Name] = redactedProperties.Contains(p.Metadata.Name) + ? new { old = "***redacted***", @new = "***redacted***" } + : new { old = p.OriginalValue, @new = p.CurrentValue }; + } + + return (isSoftDelete ? "Deleted" : "Updated", JsonSerializer.Serialize(diff)); + } + } + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/AuditLogEntryConfiguration.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/AuditLogEntryConfiguration.cs new file mode 100644 index 0000000..37efa36 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/AuditLogEntryConfiguration.cs @@ -0,0 +1,26 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using OmsorgCore.Domain.Entities; + +namespace OmsorgCore.Infrastructure.Persistence.Configurations; + +public class AuditLogEntryConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.ToTable("audit_log_entries"); + builder.HasKey(e => e.Id); + builder.Property(e => e.ActorUsername).HasMaxLength(100); + builder.Property(e => e.IpAddress).HasMaxLength(64); + builder.Property(e => e.Action).IsRequired().HasMaxLength(100); + builder.Property(e => e.EntityType).HasMaxLength(200); + builder.Property(e => e.Details).HasColumnType("jsonb"); + + builder.HasIndex(e => new { e.EntityType, e.EntityId }); + builder.HasIndex(e => e.ActorUserId); + builder.HasIndex(e => e.OccurredAtUtc); + + // Bewusst keine FK auf User: ActorUserId ist ein loser Guid, damit Audit-Zeilen auch nach + // einem etwaigen Hard-Delete eines Users lesbar bleiben (Snapshot in ActorUsername). + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/ContractConfiguration.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/ContractConfiguration.cs index f68ad79..a312c5b 100644 --- a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/ContractConfiguration.cs +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/ContractConfiguration.cs @@ -12,6 +12,10 @@ public class ContractConfiguration : IEntityTypeConfiguration builder.HasKey(c => c.Id); builder.Property(c => c.ContractType).IsRequired().HasMaxLength(100); builder.Property(c => c.Status).IsRequired().HasMaxLength(50); + builder.Property(c => c.AllowancesDescription).HasMaxLength(500); + builder.Property(c => c.OvertimeRules).HasMaxLength(500); + builder.Property(c => c.WeeklyHours).HasPrecision(10, 2); + builder.Property(c => c.HourlyWage).HasPrecision(10, 2); builder.HasOne(c => c.Employee) .WithMany() @@ -22,5 +26,7 @@ public class ContractConfiguration : IEntityTypeConfiguration .WithMany() .HasForeignKey(c => c.FacilityId) .OnDelete(DeleteBehavior.Restrict); + + builder.HasQueryFilter(c => !c.IsDeleted); } } diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/FacilityConfiguration.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/FacilityConfiguration.cs index 6654008..450fd9f 100644 --- a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/FacilityConfiguration.cs +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/FacilityConfiguration.cs @@ -11,6 +11,19 @@ public class FacilityConfiguration : IEntityTypeConfiguration builder.ToTable("facilities"); builder.HasKey(f => f.Id); builder.Property(f => f.Name).IsRequired().HasMaxLength(300); + builder.Property(f => f.FacilityType).HasMaxLength(100); + builder.Property(f => f.Website).HasMaxLength(300); + builder.Property(f => f.Street).HasMaxLength(200); + builder.Property(f => f.PostalCode).HasMaxLength(10); + builder.Property(f => f.City).HasMaxLength(100); + builder.Property(f => f.Country).HasMaxLength(100); + builder.Property(f => f.BillingStreet).HasMaxLength(200); + builder.Property(f => f.BillingPostalCode).HasMaxLength(10); + builder.Property(f => f.BillingCity).HasMaxLength(100); + builder.Property(f => f.BillingCountry).HasMaxLength(100); builder.Property(f => f.CrmStatus).IsRequired().HasMaxLength(50); + + // Soft-gelöschte Einrichtungen sind für alle normalen Queries unsichtbar. + builder.HasQueryFilter(f => !f.IsDeleted); } } diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/FacilityContactConfiguration.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/FacilityContactConfiguration.cs new file mode 100644 index 0000000..98d44ce --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/FacilityContactConfiguration.cs @@ -0,0 +1,28 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using OmsorgCore.Domain.Entities; + +namespace OmsorgCore.Infrastructure.Persistence.Configurations; + +public class FacilityContactConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.ToTable("facility_contacts"); + builder.HasKey(c => c.Id); + builder.Property(c => c.Name).IsRequired().HasMaxLength(200); + builder.Property(c => c.Role).HasMaxLength(100); + builder.Property(c => c.Department).HasMaxLength(100); + builder.Property(c => c.PhoneNumber).HasMaxLength(50); + builder.Property(c => c.Email).HasMaxLength(200); + builder.Property(c => c.Notes).HasMaxLength(1000); + + builder.HasOne(c => c.Facility) + .WithMany() + .HasForeignKey(c => c.FacilityId) + .OnDelete(DeleteBehavior.Restrict); + + // Soft-gelöschte Ansprechpartner sind für alle normalen Queries unsichtbar. + builder.HasQueryFilter(c => !c.IsDeleted); + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/OrderConfiguration.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/OrderConfiguration.cs index e98ebb8..362fbc9 100644 --- a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/OrderConfiguration.cs +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/OrderConfiguration.cs @@ -10,11 +10,27 @@ public class OrderConfiguration : IEntityTypeConfiguration { builder.ToTable("orders"); builder.HasKey(o => o.Id); - builder.Property(o => o.Status).IsRequired().HasMaxLength(50); + builder.Property(o => o.RequiredQualification).HasMaxLength(200); + builder.Property(o => o.ShiftType).HasMaxLength(100); + builder.Property(o => o.Conditions).HasMaxLength(500); + builder.Property(o => o.Priority).IsRequired().HasMaxLength(50); builder.HasOne(o => o.Facility) .WithMany() .HasForeignKey(o => o.FacilityId) .OnDelete(DeleteBehavior.Restrict); + + builder.HasOne(o => o.FacilityContact) + .WithMany() + .HasForeignKey(o => o.FacilityContactId) + .OnDelete(DeleteBehavior.Restrict); + + builder.HasOne(o => o.Status) + .WithMany() + .HasForeignKey(o => o.StatusId) + .OnDelete(DeleteBehavior.Restrict); + + // Soft-gelöschte Aufträge sind für alle normalen Queries unsichtbar (analog Facility/Contract). + builder.HasQueryFilter(o => !o.IsDeleted); } } diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/ValueListConfiguration.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/ValueListConfiguration.cs new file mode 100644 index 0000000..1f2f2cb --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/ValueListConfiguration.cs @@ -0,0 +1,17 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using OmsorgCore.Domain.Entities; + +namespace OmsorgCore.Infrastructure.Persistence.Configurations; + +public class ValueListConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.ToTable("value_lists"); + builder.HasKey(l => l.Id); + builder.Property(l => l.Key).IsRequired().HasMaxLength(50); + builder.Property(l => l.DisplayName).IsRequired().HasMaxLength(100); + builder.HasIndex(l => l.Key).IsUnique(); + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/ValueListItemConfiguration.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/ValueListItemConfiguration.cs new file mode 100644 index 0000000..4d6fcf9 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/ValueListItemConfiguration.cs @@ -0,0 +1,21 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using OmsorgCore.Domain.Entities; + +namespace OmsorgCore.Infrastructure.Persistence.Configurations; + +public class ValueListItemConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.ToTable("value_list_items"); + builder.HasKey(i => i.Id); + builder.Property(i => i.Value).IsRequired().HasMaxLength(100); + builder.HasIndex(i => new { i.ValueListId, i.Value }).IsUnique(); + + builder.HasOne(i => i.ValueList) + .WithMany(l => l.Items) + .HasForeignKey(i => i.ValueListId) + .OnDelete(DeleteBehavior.Restrict); + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/ValueListItemTransitionConfiguration.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/ValueListItemTransitionConfiguration.cs new file mode 100644 index 0000000..6138c75 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Configurations/ValueListItemTransitionConfiguration.cs @@ -0,0 +1,25 @@ +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Metadata.Builders; +using OmsorgCore.Domain.Entities; + +namespace OmsorgCore.Infrastructure.Persistence.Configurations; + +public class ValueListItemTransitionConfiguration : IEntityTypeConfiguration +{ + public void Configure(EntityTypeBuilder builder) + { + builder.ToTable("value_list_item_transitions"); + builder.HasKey(t => t.Id); + builder.HasIndex(t => new { t.FromItemId, t.ToItemId }).IsUnique(); + + builder.HasOne(t => t.FromItem) + .WithMany() + .HasForeignKey(t => t.FromItemId) + .OnDelete(DeleteBehavior.Restrict); + + builder.HasOne(t => t.ToItem) + .WithMany() + .HasForeignKey(t => t.ToItemId) + .OnDelete(DeleteBehavior.Restrict); + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/DatabaseConnectivityChecker.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/DatabaseConnectivityChecker.cs new file mode 100644 index 0000000..9a7dd4a --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/DatabaseConnectivityChecker.cs @@ -0,0 +1,26 @@ +using Microsoft.EntityFrameworkCore; +using OmsorgCore.Application.Abstractions; + +namespace OmsorgCore.Infrastructure.Persistence; + +public sealed class DatabaseConnectivityChecker : IDatabaseConnectivityChecker +{ + private readonly OmsorgCoreDbContext _db; + + public DatabaseConnectivityChecker(OmsorgCoreDbContext db) + { + _db = db; + } + + public async Task CanConnectAsync(CancellationToken cancellationToken) + { + try + { + return await _db.Database.CanConnectAsync(cancellationToken); + } + catch + { + return false; + } + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/DbSeeder.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/DbSeeder.cs index 5ef3d8b..1ce7ad0 100644 --- a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/DbSeeder.cs +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/DbSeeder.cs @@ -15,6 +15,8 @@ public static class DbSeeder { private const string AdministratorRoleName = "Administrator"; + private static readonly PermissionAction[] AllActions = Enum.GetValues(); + public static async Task SeedDefaultAdminAsync(OmsorgCoreDbContext db, IPasswordHasher passwordHasher, SeedOptions options, CancellationToken cancellationToken = default) { if (await db.Users.AnyAsync(cancellationToken)) @@ -47,4 +49,205 @@ public static class DbSeeder await db.SaveChangesAsync(cancellationToken); } + + /// + /// Legt die vier in REQUIREMENTS.md Abschnitt 3 ("Akteure & Rollen") und Abschnitt 7 + /// ("Rechtematrix") beschriebenen Basis-Rollen an, falls sie noch nicht existieren. Läuft in + /// JEDER Umgebung (keine Zugangsdaten, nur Rollen-Stammdaten, siehe Program.cs) und ist idempotent + /// pro Rollenname - existiert eine Rolle bereits (z.B. weil sie über die Rechte-Matrix-UI unter + /// "Einstellungen" schon angepasst wurde), wird sie NICHT überschrieben. + /// + /// WICHTIG: Diese Zuordnung überträgt die Rechtematrix aus REQUIREMENTS.md Abschnitt 7 auf die + /// aktuell existierenden ModuleType/PermissionAction-Werte - REQUIREMENTS.md selbst kennt diese + /// Enums nicht, nur die deutschen Modul-/Aktions-Bezeichnungen. Kommt ein neuer ModuleType oder + /// eine neue PermissionAction dazu, oder ändert sich die Rechtematrix, MUSS diese Methode im + /// selben Change aktualisiert werden (siehe Pflegehinweis in omsorgCore/CLAUDE.md, Abschnitt + /// "Rechtesystem"). "Verträge" hat in der Rechtematrix keine eigene Zeile - hier wie + /// Mitarbeiter/Einrichtungen behandelt (siehe FR-MA-2: Vertragsdaten für Sabina/Malik/Sabrina). + /// "Außendienst" bekommt bewusst keine Modul-Rechte: OMSORG Connect spricht noch nicht gegen + /// dieses Backend (eigene MySQL-Datenhaltung, siehe omsorgWeb/CLAUDE.md), und "nur eigene Daten" + /// ist mit dem aktuell rein modulweiten RBAC ohnehin nicht abbildbar (Datenebene, kein Rollen-Recht). + /// "Geschäftsführung" bekommt AuditLog automatisch mit (iteriert alle ModuleType-Werte generisch, + /// siehe unten) - alle anderen Rollen listen ihre Module explizit auf und bekommen AuditLog dadurch + /// bewusst NICHT (Audit-Log ist per Default nur für Geschäftsführung sichtbar). + /// + public static async Task SeedBaseRolesAsync(OmsorgCoreDbContext db, CancellationToken cancellationToken = default) + { + await SeedRoleIfMissingAsync(db, "Geschäftsführung", Enum.GetValues().Select(m => (m, AllActions)), cancellationToken); + + await SeedRoleIfMissingAsync(db, "Disposition/Buchhaltung", new (ModuleType Module, PermissionAction[] Actions)[] + { + (ModuleType.Employees, AllActions), + (ModuleType.Facilities, AllActions), + (ModuleType.Contracts, AllActions), + (ModuleType.Orders, AllActions), + (ModuleType.TimeEntries, new[] { PermissionAction.View, PermissionAction.Approve }), + (ModuleType.Invoices, new[] { PermissionAction.View, PermissionAction.Create, PermissionAction.Approve }), + (ModuleType.Recruiting, new[] { PermissionAction.View, PermissionAction.Create, PermissionAction.Edit }), + (ModuleType.Controlling, new[] { PermissionAction.View }) + }, cancellationToken); + + await SeedRoleIfMissingAsync(db, "Recruiting", new (ModuleType Module, PermissionAction[] Actions)[] + { + (ModuleType.Employees, new[] { PermissionAction.View }), + (ModuleType.Facilities, new[] { PermissionAction.View, PermissionAction.Create, PermissionAction.Edit }), + (ModuleType.Recruiting, AllActions) + }, cancellationToken); + + await SeedRoleIfMissingAsync(db, "Außendienst", Array.Empty<(ModuleType, PermissionAction[])>(), cancellationToken); + } + + /// + /// Legt alle admin-editierbaren Auswahllisten an (Mitarbeiterstatus, Beschäftigungsart, CRM-Status, + /// Einrichtungstyp, Vertragstyp/-status, Auftragsstatus — siehe omsorgCore/CLAUDE.md, Abschnitt + /// "Konfigurierbare Auswahllisten") mit den bisher im Frontend hartcodierten Werten als + /// Startbefüllung. Läuft in JEDER Umgebung (reine Stammdaten) und ist idempotent PRO LISTE + /// (`Key`) - analog zu SeedBaseRolesAsync/SeedRoleIfMissingAsync, NICHT "sobald irgendeine + /// ValueList existiert, alles überspringen": die Migration ReplaceOrderStatusWithValueLists legt + /// die Liste "OrderStatus" bereits direkt per SQL an (übernimmt die bestehende Auftragsstatus- + /// Pipeline mit unveränderten Ids), ein pauschaler "existiert schon eine Liste"-Check hätte damit + /// bei jedem Start sofort abgebrochen und die übrigen sechs Listen nie angelegt. + /// + /// Die Auftragsstatus-Pipeline (Anfrage → Prüfung → offen → teilweise besetzt → vollständig + /// besetzt → aktiv → abgeschlossen, plus Storno aus jedem nicht-terminalen Status, FR-EM-2) + /// bekommt zusätzlich Übergangsregeln () - die einzige der + /// sieben Listen, die das braucht. + /// + public static async Task SeedValueListsAsync(OmsorgCoreDbContext db, CancellationToken cancellationToken = default) + { + await SeedSimpleListIfMissingAsync(db, "EmployeeStatus", "Mitarbeiterstatus", + new (string Value, bool IsDefault)[] { ("Aktiv", true), ("Einsatz", false), ("Urlaub", false), ("Krank", false) }, cancellationToken); + + await SeedSimpleListIfMissingAsync(db, "EmploymentType", "Beschäftigungsart", + new (string Value, bool IsDefault)[] { ("Vollzeit", false), ("Teilzeit", false), ("Minijob", false), ("Aushilfe", false), ("Praktikant", false), ("Freiberuflich", false) }, cancellationToken); + + await SeedSimpleListIfMissingAsync(db, "CrmStatus", "CRM-Status", + new (string Value, bool IsDefault)[] { ("Lead", true), ("Kontaktiert", false), ("Kein Bedarf", false), ("Wiedervorlage", false), ("Interesse", false), ("Angebot", false), ("Kunde", false), ("Bestandskunde", false) }, cancellationToken); + + await SeedSimpleListIfMissingAsync(db, "FacilityType", "Einrichtungstyp", + new (string Value, bool IsDefault)[] { ("Pflegeheim", false), ("Ambulanter Pflegedienst", false), ("Krankenhaus", false), ("Betreutes Wohnen", false), ("Sonstige", false) }, cancellationToken); + + await SeedSimpleListIfMissingAsync(db, "ContractType", "Vertragstyp", + new (string Value, bool IsDefault)[] { ("Arbeitsvertrag", true), ("Dienstleistungsvertrag", false), ("Rahmenvertrag", false) }, cancellationToken); + + await SeedSimpleListIfMissingAsync(db, "ContractStatus", "Vertragsstatus", + new (string Value, bool IsDefault)[] { ("Entwurf", true), ("Aktiv", false), ("Beendet", false) }, cancellationToken); + + await SeedOrderStatusListIfMissingAsync(db, cancellationToken); + + async Task SeedSimpleListIfMissingAsync(OmsorgCoreDbContext context, string key, string displayName, (string Value, bool IsDefault)[] values, CancellationToken ct) + { + if (await context.ValueLists.AnyAsync(l => l.Key == key, ct)) + { + return; + } + + var list = new ValueList { Key = key, DisplayName = displayName }; + context.ValueLists.Add(list); + + for (var index = 0; index < values.Length; index++) + { + context.ValueListItems.Add(new ValueListItem + { + ValueListId = list.Id, + Value = values[index].Value, + SortOrder = index, + IsDefault = values[index].IsDefault + }); + } + + await context.SaveChangesAsync(ct); + } + + async Task SeedOrderStatusListIfMissingAsync(OmsorgCoreDbContext context, CancellationToken ct) + { + // Die Migration ReplaceOrderStatusWithValueLists legt die "OrderStatus"-ValueList IMMER + // an (auch wenn order_status_definitions zuvor leer war, weil SeedOrderStatusesAsync in + // dieser Umgebung nie gelaufen ist) - ein reiner "existiert die Liste schon"-Check würde + // hier fälschlich "ja" sagen und nie Items anlegen. Maßgeblich ist daher, ob die Liste + // bereits Items hat, nicht ob die Liste selbst existiert. + if (await context.ValueListItems.AnyAsync(i => i.ValueList.Key == "OrderStatus", ct)) + { + return; + } + + var list = await context.ValueLists.FirstOrDefaultAsync(l => l.Key == "OrderStatus", ct); + if (list is null) + { + list = new ValueList { Key = "OrderStatus", DisplayName = "Auftragsstatus" }; + context.ValueLists.Add(list); + } + + var definitions = new (string Name, bool IsInitial, bool IsTerminal)[] + { + ("Anfrage", true, false), + ("Prüfung", false, false), + ("offen", false, false), + ("teilweise besetzt", false, false), + ("vollständig besetzt", false, false), + ("aktiv", false, false), + ("abgeschlossen", false, true), + ("storniert", false, true) + }; + + var statuses = definitions + .Select((d, index) => new ValueListItem + { + ValueListId = list.Id, + Value = d.Name, + SortOrder = index, + IsInitial = d.IsInitial, + IsTerminal = d.IsTerminal + }) + .ToList(); + context.ValueListItems.AddRange(statuses); + + Guid IdOf(string name) => statuses.First(s => s.Value == name).Id; + + var forwardPairs = new[] + { + ("Anfrage", "Prüfung"), + ("Prüfung", "offen"), + ("offen", "teilweise besetzt"), + ("offen", "vollständig besetzt"), + ("teilweise besetzt", "vollständig besetzt"), + ("vollständig besetzt", "aktiv"), + ("aktiv", "abgeschlossen") + }; + + // Storno ist aus jedem nicht-terminalen Status möglich (auch aus "aktiv"). + var cancelPairs = statuses.Where(s => !s.IsTerminal).Select(s => (s.Value, "storniert")); + + foreach (var (from, to) in forwardPairs.Concat(cancelPairs)) + { + context.ValueListItemTransitions.Add(new ValueListItemTransition { FromItemId = IdOf(from), ToItemId = IdOf(to) }); + } + + await context.SaveChangesAsync(ct); + } + } + + private static async Task SeedRoleIfMissingAsync( + OmsorgCoreDbContext db, + string roleName, + IEnumerable<(ModuleType Module, PermissionAction[] Actions)> permissions, + CancellationToken cancellationToken) + { + if (await db.Roles.AnyAsync(r => r.Name == roleName, cancellationToken)) + { + return; + } + + var role = new Role { Name = roleName }; + foreach (var (module, actions) in permissions) + { + foreach (var action in actions) + { + role.RolePermissions.Add(new RolePermission { Role = role, Module = module, Action = action }); + } + } + + db.Roles.Add(role); + await db.SaveChangesAsync(cancellationToken); + } } diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807135950_AddAuditLogEntries.Designer.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807135950_AddAuditLogEntries.Designer.cs new file mode 100644 index 0000000..1d4dfe1 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807135950_AddAuditLogEntries.Designer.cs @@ -0,0 +1,792 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using OmsorgCore.Infrastructure.Persistence; + +#nullable disable + +namespace OmsorgCore.Infrastructure.Persistence.Migrations +{ + [DbContext(typeof(OmsorgCoreDbContext))] + [Migration("20260807135950_AddAuditLogEntries")] + partial class AddAuditLogEntries + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.AuditLogEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("ActorUserId") + .HasColumnType("uuid"); + + b.Property("ActorUsername") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Category") + .HasColumnType("integer"); + + b.Property("Details") + .HasColumnType("jsonb"); + + b.Property("EntityId") + .HasColumnType("uuid"); + + b.Property("EntityType") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("IpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("OccurredAtUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("ActorUserId"); + + b.HasIndex("OccurredAtUtc"); + + b.HasIndex("EntityType", "EntityId"); + + b.ToTable("audit_log_entries", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Contract", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ContractType") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("EndDate") + .HasColumnType("date"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("StartDate") + .HasColumnType("date"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("FacilityId"); + + b.ToTable("contracts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Employee", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AvatarFileName") + .HasColumnType("text"); + + b.Property("City") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Country") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DateOfBirth") + .HasColumnType("date"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("EmergencyContactName") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("EmergencyContactPhone") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("EmergencyContactRelation") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("EmploymentType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("EntryDate") + .HasColumnType("date"); + + b.Property("ExitDate") + .HasColumnType("date"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("PhoneNumber") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("PostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("Qualification") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Street") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("employees", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Facility", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Address") + .HasColumnType("text"); + + b.Property("BillingAddress") + .HasColumnType("text"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("CrmStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Email") + .HasColumnType("text"); + + b.Property("FacilityType") + .HasColumnType("text"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(300) + .HasColumnType("character varying(300)"); + + b.Property("PhoneNumber") + .HasColumnType("text"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("facilities", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Invoice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BillingPeriodEnd") + .HasColumnType("date"); + + b.Property("BillingPeriodStart") + .HasColumnType("date"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DueDate") + .HasColumnType("date"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("GrossAmount") + .HasColumnType("numeric(12,2)"); + + b.Property("InvoiceNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("NetAmount") + .HasColumnType("numeric(12,2)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityId"); + + b.HasIndex("InvoiceNumber") + .IsUnique(); + + b.ToTable("invoices", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.LoginAttempt", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("IpAddress") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Succeeded") + .HasColumnType("boolean"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("IpAddress", "AttemptedAt"); + + b.ToTable("login_attempts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EndDate") + .HasColumnType("date"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("RequiredQualification") + .HasColumnType("text"); + + b.Property("StartDate") + .HasColumnType("date"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityId"); + + b.ToTable("orders", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.PasswordResetCode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptCount") + .HasColumnType("integer"); + + b.Property("CodeHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ConsumedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("InvalidatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ResetTokenExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ResetTokenHash") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ResetTokenUsedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ResetTokenHash"); + + b.HasIndex("UserId"); + + b.ToTable("password_reset_codes", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RefreshToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ReplacedByTokenId") + .HasColumnType("uuid"); + + b.Property("RevokedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("TokenHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ReplacedByTokenId"); + + b.HasIndex("TokenHash") + .IsUnique(); + + b.HasIndex("UserId"); + + b.ToTable("refresh_tokens", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("roles", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RolePermission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .HasColumnType("integer"); + + b.Property("Module") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("RoleId", "Module", "Action") + .IsUnique(); + + b.ToTable("role_permissions", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.TimeEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BreakDuration") + .HasColumnType("interval"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("End") + .HasColumnType("time without time zone"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("OrderId") + .HasColumnType("uuid"); + + b.Property("Start") + .HasColumnType("time without time zone"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("OrderId"); + + b.ToTable("time_entries", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("IsActive") + .HasColumnType("boolean"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("MustChangePassword") + .HasColumnType("boolean"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("SecurityStamp") + .HasColumnType("uuid"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("RoleId"); + + b.HasIndex("Username") + .IsUnique(); + + b.ToTable("users", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.UserPermissionOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .HasColumnType("integer"); + + b.Property("Effect") + .HasColumnType("integer"); + + b.Property("Module") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "Module", "Action") + .IsUnique(); + + b.ToTable("user_permission_overrides", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Contract", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Employee"); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Invoice", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Order", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.PasswordResetCode", b => + { + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RefreshToken", b => + { + b.HasOne("OmsorgCore.Domain.Entities.RefreshToken", null) + .WithMany() + .HasForeignKey("ReplacedByTokenId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RolePermission", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Role", "Role") + .WithMany("RolePermissions") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.TimeEntry", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("OmsorgCore.Domain.Entities.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("OmsorgCore.Domain.Entities.Role", "Role") + .WithMany("Users") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.UserPermissionOverride", b => + { + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany("PermissionOverrides") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Role", b => + { + b.Navigation("RolePermissions"); + + b.Navigation("Users"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.Navigation("PermissionOverrides"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807135950_AddAuditLogEntries.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807135950_AddAuditLogEntries.cs new file mode 100644 index 0000000..6b1f82a --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807135950_AddAuditLogEntries.cs @@ -0,0 +1,57 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace OmsorgCore.Infrastructure.Persistence.Migrations +{ + /// + public partial class AddAuditLogEntries : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "audit_log_entries", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + OccurredAtUtc = table.Column(type: "timestamp with time zone", nullable: false), + ActorUserId = table.Column(type: "uuid", nullable: true), + ActorUsername = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), + IpAddress = table.Column(type: "character varying(64)", maxLength: 64, nullable: true), + Category = table.Column(type: "integer", nullable: false), + Action = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), + EntityType = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), + EntityId = table.Column(type: "uuid", nullable: true), + Details = table.Column(type: "jsonb", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_audit_log_entries", x => x.Id); + }); + + migrationBuilder.CreateIndex( + name: "IX_audit_log_entries_ActorUserId", + table: "audit_log_entries", + column: "ActorUserId"); + + migrationBuilder.CreateIndex( + name: "IX_audit_log_entries_EntityType_EntityId", + table: "audit_log_entries", + columns: new[] { "EntityType", "EntityId" }); + + migrationBuilder.CreateIndex( + name: "IX_audit_log_entries_OccurredAtUtc", + table: "audit_log_entries", + column: "OccurredAtUtc"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "audit_log_entries"); + } + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807155357_AddFacilityFieldConstraints.Designer.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807155357_AddFacilityFieldConstraints.Designer.cs new file mode 100644 index 0000000..406bc76 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807155357_AddFacilityFieldConstraints.Designer.cs @@ -0,0 +1,797 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using OmsorgCore.Infrastructure.Persistence; + +#nullable disable + +namespace OmsorgCore.Infrastructure.Persistence.Migrations +{ + [DbContext(typeof(OmsorgCoreDbContext))] + [Migration("20260807155357_AddFacilityFieldConstraints")] + partial class AddFacilityFieldConstraints + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.AuditLogEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("ActorUserId") + .HasColumnType("uuid"); + + b.Property("ActorUsername") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Category") + .HasColumnType("integer"); + + b.Property("Details") + .HasColumnType("jsonb"); + + b.Property("EntityId") + .HasColumnType("uuid"); + + b.Property("EntityType") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("IpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("OccurredAtUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("ActorUserId"); + + b.HasIndex("OccurredAtUtc"); + + b.HasIndex("EntityType", "EntityId"); + + b.ToTable("audit_log_entries", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Contract", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ContractType") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("EndDate") + .HasColumnType("date"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("StartDate") + .HasColumnType("date"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("FacilityId"); + + b.ToTable("contracts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Employee", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AvatarFileName") + .HasColumnType("text"); + + b.Property("City") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Country") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DateOfBirth") + .HasColumnType("date"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("EmergencyContactName") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("EmergencyContactPhone") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("EmergencyContactRelation") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("EmploymentType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("EntryDate") + .HasColumnType("date"); + + b.Property("ExitDate") + .HasColumnType("date"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("PhoneNumber") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("PostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("Qualification") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Street") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("employees", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Facility", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Address") + .HasMaxLength(300) + .HasColumnType("character varying(300)"); + + b.Property("BillingAddress") + .HasMaxLength(300) + .HasColumnType("character varying(300)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("CrmStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("FacilityType") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(300) + .HasColumnType("character varying(300)"); + + b.Property("PhoneNumber") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("facilities", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Invoice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BillingPeriodEnd") + .HasColumnType("date"); + + b.Property("BillingPeriodStart") + .HasColumnType("date"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DueDate") + .HasColumnType("date"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("GrossAmount") + .HasColumnType("numeric(12,2)"); + + b.Property("InvoiceNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("NetAmount") + .HasColumnType("numeric(12,2)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityId"); + + b.HasIndex("InvoiceNumber") + .IsUnique(); + + b.ToTable("invoices", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.LoginAttempt", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("IpAddress") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Succeeded") + .HasColumnType("boolean"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("IpAddress", "AttemptedAt"); + + b.ToTable("login_attempts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EndDate") + .HasColumnType("date"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("RequiredQualification") + .HasColumnType("text"); + + b.Property("StartDate") + .HasColumnType("date"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityId"); + + b.ToTable("orders", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.PasswordResetCode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptCount") + .HasColumnType("integer"); + + b.Property("CodeHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ConsumedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("InvalidatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ResetTokenExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ResetTokenHash") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ResetTokenUsedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ResetTokenHash"); + + b.HasIndex("UserId"); + + b.ToTable("password_reset_codes", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RefreshToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ReplacedByTokenId") + .HasColumnType("uuid"); + + b.Property("RevokedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("TokenHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ReplacedByTokenId"); + + b.HasIndex("TokenHash") + .IsUnique(); + + b.HasIndex("UserId"); + + b.ToTable("refresh_tokens", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("roles", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RolePermission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .HasColumnType("integer"); + + b.Property("Module") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("RoleId", "Module", "Action") + .IsUnique(); + + b.ToTable("role_permissions", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.TimeEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BreakDuration") + .HasColumnType("interval"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("End") + .HasColumnType("time without time zone"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("OrderId") + .HasColumnType("uuid"); + + b.Property("Start") + .HasColumnType("time without time zone"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("OrderId"); + + b.ToTable("time_entries", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("IsActive") + .HasColumnType("boolean"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("MustChangePassword") + .HasColumnType("boolean"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("SecurityStamp") + .HasColumnType("uuid"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("RoleId"); + + b.HasIndex("Username") + .IsUnique(); + + b.ToTable("users", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.UserPermissionOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .HasColumnType("integer"); + + b.Property("Effect") + .HasColumnType("integer"); + + b.Property("Module") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "Module", "Action") + .IsUnique(); + + b.ToTable("user_permission_overrides", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Contract", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Employee"); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Invoice", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Order", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.PasswordResetCode", b => + { + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RefreshToken", b => + { + b.HasOne("OmsorgCore.Domain.Entities.RefreshToken", null) + .WithMany() + .HasForeignKey("ReplacedByTokenId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RolePermission", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Role", "Role") + .WithMany("RolePermissions") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.TimeEntry", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("OmsorgCore.Domain.Entities.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("OmsorgCore.Domain.Entities.Role", "Role") + .WithMany("Users") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.UserPermissionOverride", b => + { + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany("PermissionOverrides") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Role", b => + { + b.Navigation("RolePermissions"); + + b.Navigation("Users"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.Navigation("PermissionOverrides"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807155357_AddFacilityFieldConstraints.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807155357_AddFacilityFieldConstraints.cs new file mode 100644 index 0000000..5298c01 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807155357_AddFacilityFieldConstraints.cs @@ -0,0 +1,118 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace OmsorgCore.Infrastructure.Persistence.Migrations +{ + /// + public partial class AddFacilityFieldConstraints : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "PhoneNumber", + table: "facilities", + type: "character varying(50)", + maxLength: 50, + nullable: true, + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "FacilityType", + table: "facilities", + type: "character varying(100)", + maxLength: 100, + nullable: true, + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Email", + table: "facilities", + type: "character varying(200)", + maxLength: 200, + nullable: true, + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "BillingAddress", + table: "facilities", + type: "character varying(300)", + maxLength: 300, + nullable: true, + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Address", + table: "facilities", + type: "character varying(300)", + maxLength: 300, + nullable: true, + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "PhoneNumber", + table: "facilities", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "character varying(50)", + oldMaxLength: 50, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "FacilityType", + table: "facilities", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "character varying(100)", + oldMaxLength: 100, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Email", + table: "facilities", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "character varying(200)", + oldMaxLength: 200, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "BillingAddress", + table: "facilities", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "character varying(300)", + oldMaxLength: 300, + oldNullable: true); + + migrationBuilder.AlterColumn( + name: "Address", + table: "facilities", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "character varying(300)", + oldMaxLength: 300, + oldNullable: true); + } + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807170645_AddFacilityContacts.Designer.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807170645_AddFacilityContacts.Designer.cs new file mode 100644 index 0000000..b9dc221 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807170645_AddFacilityContacts.Designer.cs @@ -0,0 +1,861 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using OmsorgCore.Infrastructure.Persistence; + +#nullable disable + +namespace OmsorgCore.Infrastructure.Persistence.Migrations +{ + [DbContext(typeof(OmsorgCoreDbContext))] + [Migration("20260807170645_AddFacilityContacts")] + partial class AddFacilityContacts + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.AuditLogEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("ActorUserId") + .HasColumnType("uuid"); + + b.Property("ActorUsername") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Category") + .HasColumnType("integer"); + + b.Property("Details") + .HasColumnType("jsonb"); + + b.Property("EntityId") + .HasColumnType("uuid"); + + b.Property("EntityType") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("IpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("OccurredAtUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("ActorUserId"); + + b.HasIndex("OccurredAtUtc"); + + b.HasIndex("EntityType", "EntityId"); + + b.ToTable("audit_log_entries", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Contract", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ContractType") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("EndDate") + .HasColumnType("date"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("StartDate") + .HasColumnType("date"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("FacilityId"); + + b.ToTable("contracts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Employee", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AvatarFileName") + .HasColumnType("text"); + + b.Property("City") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Country") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DateOfBirth") + .HasColumnType("date"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("EmergencyContactName") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("EmergencyContactPhone") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("EmergencyContactRelation") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("EmploymentType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("EntryDate") + .HasColumnType("date"); + + b.Property("ExitDate") + .HasColumnType("date"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("PhoneNumber") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("PostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("Qualification") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Street") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("employees", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Facility", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Address") + .HasMaxLength(300) + .HasColumnType("character varying(300)"); + + b.Property("BillingAddress") + .HasMaxLength(300) + .HasColumnType("character varying(300)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("CrmStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("FacilityType") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(300) + .HasColumnType("character varying(300)"); + + b.Property("PhoneNumber") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("facilities", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.FacilityContact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Department") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("Notes") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("PhoneNumber") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Role") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityId"); + + b.ToTable("facility_contacts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Invoice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BillingPeriodEnd") + .HasColumnType("date"); + + b.Property("BillingPeriodStart") + .HasColumnType("date"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DueDate") + .HasColumnType("date"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("GrossAmount") + .HasColumnType("numeric(12,2)"); + + b.Property("InvoiceNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("NetAmount") + .HasColumnType("numeric(12,2)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityId"); + + b.HasIndex("InvoiceNumber") + .IsUnique(); + + b.ToTable("invoices", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.LoginAttempt", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("IpAddress") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Succeeded") + .HasColumnType("boolean"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("IpAddress", "AttemptedAt"); + + b.ToTable("login_attempts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EndDate") + .HasColumnType("date"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("RequiredQualification") + .HasColumnType("text"); + + b.Property("StartDate") + .HasColumnType("date"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityId"); + + b.ToTable("orders", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.PasswordResetCode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptCount") + .HasColumnType("integer"); + + b.Property("CodeHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ConsumedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("InvalidatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ResetTokenExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ResetTokenHash") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ResetTokenUsedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ResetTokenHash"); + + b.HasIndex("UserId"); + + b.ToTable("password_reset_codes", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RefreshToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ReplacedByTokenId") + .HasColumnType("uuid"); + + b.Property("RevokedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("TokenHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ReplacedByTokenId"); + + b.HasIndex("TokenHash") + .IsUnique(); + + b.HasIndex("UserId"); + + b.ToTable("refresh_tokens", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("roles", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RolePermission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .HasColumnType("integer"); + + b.Property("Module") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("RoleId", "Module", "Action") + .IsUnique(); + + b.ToTable("role_permissions", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.TimeEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BreakDuration") + .HasColumnType("interval"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("End") + .HasColumnType("time without time zone"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("OrderId") + .HasColumnType("uuid"); + + b.Property("Start") + .HasColumnType("time without time zone"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("OrderId"); + + b.ToTable("time_entries", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("IsActive") + .HasColumnType("boolean"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("MustChangePassword") + .HasColumnType("boolean"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("SecurityStamp") + .HasColumnType("uuid"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("RoleId"); + + b.HasIndex("Username") + .IsUnique(); + + b.ToTable("users", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.UserPermissionOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .HasColumnType("integer"); + + b.Property("Effect") + .HasColumnType("integer"); + + b.Property("Module") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "Module", "Action") + .IsUnique(); + + b.ToTable("user_permission_overrides", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Contract", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Employee"); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.FacilityContact", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Invoice", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Order", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.PasswordResetCode", b => + { + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RefreshToken", b => + { + b.HasOne("OmsorgCore.Domain.Entities.RefreshToken", null) + .WithMany() + .HasForeignKey("ReplacedByTokenId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RolePermission", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Role", "Role") + .WithMany("RolePermissions") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.TimeEntry", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("OmsorgCore.Domain.Entities.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("OmsorgCore.Domain.Entities.Role", "Role") + .WithMany("Users") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.UserPermissionOverride", b => + { + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany("PermissionOverrides") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Role", b => + { + b.Navigation("RolePermissions"); + + b.Navigation("Users"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.Navigation("PermissionOverrides"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807170645_AddFacilityContacts.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807170645_AddFacilityContacts.cs new file mode 100644 index 0000000..2b70bd9 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807170645_AddFacilityContacts.cs @@ -0,0 +1,55 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace OmsorgCore.Infrastructure.Persistence.Migrations +{ + /// + public partial class AddFacilityContacts : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.CreateTable( + name: "facility_contacts", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + FacilityId = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(200)", maxLength: 200, nullable: false), + Role = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), + Department = table.Column(type: "character varying(100)", maxLength: 100, nullable: true), + PhoneNumber = table.Column(type: "character varying(50)", maxLength: 50, nullable: true), + Email = table.Column(type: "character varying(200)", maxLength: 200, nullable: true), + Notes = table.Column(type: "character varying(1000)", maxLength: 1000, nullable: true), + CreatedAt = table.Column(type: "timestamp with time zone", nullable: false), + UpdatedAt = table.Column(type: "timestamp with time zone", nullable: true), + IsDeleted = table.Column(type: "boolean", nullable: false), + DeletedAt = table.Column(type: "timestamp with time zone", nullable: true) + }, + constraints: table => + { + table.PrimaryKey("PK_facility_contacts", x => x.Id); + table.ForeignKey( + name: "FK_facility_contacts_facilities_FacilityId", + column: x => x.FacilityId, + principalTable: "facilities", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateIndex( + name: "IX_facility_contacts_FacilityId", + table: "facility_contacts", + column: "FacilityId"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "facility_contacts"); + } + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807171414_SplitFacilityAddressFields.Designer.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807171414_SplitFacilityAddressFields.Designer.cs new file mode 100644 index 0000000..b581bf7 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807171414_SplitFacilityAddressFields.Designer.cs @@ -0,0 +1,885 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using OmsorgCore.Infrastructure.Persistence; + +#nullable disable + +namespace OmsorgCore.Infrastructure.Persistence.Migrations +{ + [DbContext(typeof(OmsorgCoreDbContext))] + [Migration("20260807171414_SplitFacilityAddressFields")] + partial class SplitFacilityAddressFields + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.AuditLogEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("ActorUserId") + .HasColumnType("uuid"); + + b.Property("ActorUsername") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Category") + .HasColumnType("integer"); + + b.Property("Details") + .HasColumnType("jsonb"); + + b.Property("EntityId") + .HasColumnType("uuid"); + + b.Property("EntityType") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("IpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("OccurredAtUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("ActorUserId"); + + b.HasIndex("OccurredAtUtc"); + + b.HasIndex("EntityType", "EntityId"); + + b.ToTable("audit_log_entries", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Contract", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("ContractType") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("EndDate") + .HasColumnType("date"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("StartDate") + .HasColumnType("date"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("FacilityId"); + + b.ToTable("contracts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Employee", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AvatarFileName") + .HasColumnType("text"); + + b.Property("City") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Country") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DateOfBirth") + .HasColumnType("date"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("EmergencyContactName") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("EmergencyContactPhone") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("EmergencyContactRelation") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("EmploymentType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("EntryDate") + .HasColumnType("date"); + + b.Property("ExitDate") + .HasColumnType("date"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("PhoneNumber") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("PostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("Qualification") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Street") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("employees", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Facility", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BillingCity") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("BillingCountry") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("BillingPostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("BillingStreet") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("City") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Country") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("CrmStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("FacilityType") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(300) + .HasColumnType("character varying(300)"); + + b.Property("PhoneNumber") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("PostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("Street") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("facilities", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.FacilityContact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Department") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("Notes") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("PhoneNumber") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Role") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityId"); + + b.ToTable("facility_contacts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Invoice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BillingPeriodEnd") + .HasColumnType("date"); + + b.Property("BillingPeriodStart") + .HasColumnType("date"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DueDate") + .HasColumnType("date"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("GrossAmount") + .HasColumnType("numeric(12,2)"); + + b.Property("InvoiceNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("NetAmount") + .HasColumnType("numeric(12,2)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityId"); + + b.HasIndex("InvoiceNumber") + .IsUnique(); + + b.ToTable("invoices", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.LoginAttempt", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("IpAddress") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Succeeded") + .HasColumnType("boolean"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("IpAddress", "AttemptedAt"); + + b.ToTable("login_attempts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EndDate") + .HasColumnType("date"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("RequiredQualification") + .HasColumnType("text"); + + b.Property("StartDate") + .HasColumnType("date"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityId"); + + b.ToTable("orders", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.PasswordResetCode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptCount") + .HasColumnType("integer"); + + b.Property("CodeHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ConsumedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("InvalidatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ResetTokenExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ResetTokenHash") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ResetTokenUsedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ResetTokenHash"); + + b.HasIndex("UserId"); + + b.ToTable("password_reset_codes", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RefreshToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ReplacedByTokenId") + .HasColumnType("uuid"); + + b.Property("RevokedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("TokenHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ReplacedByTokenId"); + + b.HasIndex("TokenHash") + .IsUnique(); + + b.HasIndex("UserId"); + + b.ToTable("refresh_tokens", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("roles", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RolePermission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .HasColumnType("integer"); + + b.Property("Module") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("RoleId", "Module", "Action") + .IsUnique(); + + b.ToTable("role_permissions", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.TimeEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BreakDuration") + .HasColumnType("interval"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("End") + .HasColumnType("time without time zone"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("OrderId") + .HasColumnType("uuid"); + + b.Property("Start") + .HasColumnType("time without time zone"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("OrderId"); + + b.ToTable("time_entries", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("IsActive") + .HasColumnType("boolean"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("MustChangePassword") + .HasColumnType("boolean"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("SecurityStamp") + .HasColumnType("uuid"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("RoleId"); + + b.HasIndex("Username") + .IsUnique(); + + b.ToTable("users", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.UserPermissionOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .HasColumnType("integer"); + + b.Property("Effect") + .HasColumnType("integer"); + + b.Property("Module") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "Module", "Action") + .IsUnique(); + + b.ToTable("user_permission_overrides", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Contract", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Employee"); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.FacilityContact", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Invoice", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Order", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.PasswordResetCode", b => + { + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RefreshToken", b => + { + b.HasOne("OmsorgCore.Domain.Entities.RefreshToken", null) + .WithMany() + .HasForeignKey("ReplacedByTokenId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RolePermission", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Role", "Role") + .WithMany("RolePermissions") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.TimeEntry", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("OmsorgCore.Domain.Entities.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("OmsorgCore.Domain.Entities.Role", "Role") + .WithMany("Users") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.UserPermissionOverride", b => + { + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany("PermissionOverrides") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Role", b => + { + b.Navigation("RolePermissions"); + + b.Navigation("Users"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.Navigation("PermissionOverrides"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807171414_SplitFacilityAddressFields.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807171414_SplitFacilityAddressFields.cs new file mode 100644 index 0000000..4e336b4 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807171414_SplitFacilityAddressFields.cs @@ -0,0 +1,128 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace OmsorgCore.Infrastructure.Persistence.Migrations +{ + /// + public partial class SplitFacilityAddressFields : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Address", + table: "facilities"); + + migrationBuilder.DropColumn( + name: "BillingAddress", + table: "facilities"); + + migrationBuilder.AddColumn( + name: "BillingCity", + table: "facilities", + type: "character varying(100)", + maxLength: 100, + nullable: true); + + migrationBuilder.AddColumn( + name: "BillingCountry", + table: "facilities", + type: "character varying(100)", + maxLength: 100, + nullable: true); + + migrationBuilder.AddColumn( + name: "BillingPostalCode", + table: "facilities", + type: "character varying(10)", + maxLength: 10, + nullable: true); + + migrationBuilder.AddColumn( + name: "BillingStreet", + table: "facilities", + type: "character varying(200)", + maxLength: 200, + nullable: true); + + migrationBuilder.AddColumn( + name: "City", + table: "facilities", + type: "character varying(100)", + maxLength: 100, + nullable: true); + + migrationBuilder.AddColumn( + name: "Country", + table: "facilities", + type: "character varying(100)", + maxLength: 100, + nullable: true); + + migrationBuilder.AddColumn( + name: "PostalCode", + table: "facilities", + type: "character varying(10)", + maxLength: 10, + nullable: true); + + migrationBuilder.AddColumn( + name: "Street", + table: "facilities", + type: "character varying(200)", + maxLength: 200, + nullable: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "BillingCity", + table: "facilities"); + + migrationBuilder.DropColumn( + name: "BillingCountry", + table: "facilities"); + + migrationBuilder.DropColumn( + name: "BillingPostalCode", + table: "facilities"); + + migrationBuilder.DropColumn( + name: "BillingStreet", + table: "facilities"); + + migrationBuilder.DropColumn( + name: "City", + table: "facilities"); + + migrationBuilder.DropColumn( + name: "Country", + table: "facilities"); + + migrationBuilder.DropColumn( + name: "PostalCode", + table: "facilities"); + + migrationBuilder.DropColumn( + name: "Street", + table: "facilities"); + + migrationBuilder.AddColumn( + name: "Address", + table: "facilities", + type: "character varying(300)", + maxLength: 300, + nullable: true); + + migrationBuilder.AddColumn( + name: "BillingAddress", + table: "facilities", + type: "character varying(300)", + maxLength: 300, + nullable: true); + } + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807175159_AddContractDetailsAndQueryFilter.Designer.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807175159_AddContractDetailsAndQueryFilter.Designer.cs new file mode 100644 index 0000000..a92c8de --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807175159_AddContractDetailsAndQueryFilter.Designer.cs @@ -0,0 +1,907 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using OmsorgCore.Infrastructure.Persistence; + +#nullable disable + +namespace OmsorgCore.Infrastructure.Persistence.Migrations +{ + [DbContext(typeof(OmsorgCoreDbContext))] + [Migration("20260807175159_AddContractDetailsAndQueryFilter")] + partial class AddContractDetailsAndQueryFilter + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.AuditLogEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("ActorUserId") + .HasColumnType("uuid"); + + b.Property("ActorUsername") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Category") + .HasColumnType("integer"); + + b.Property("Details") + .HasColumnType("jsonb"); + + b.Property("EntityId") + .HasColumnType("uuid"); + + b.Property("EntityType") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("IpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("OccurredAtUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("ActorUserId"); + + b.HasIndex("OccurredAtUtc"); + + b.HasIndex("EntityType", "EntityId"); + + b.ToTable("audit_log_entries", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Contract", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AllowancesDescription") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("ContractType") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("EndDate") + .HasColumnType("date"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("HourlyWage") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("OvertimeRules") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("ProbationPeriodMonths") + .HasColumnType("integer"); + + b.Property("StartDate") + .HasColumnType("date"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("VacationDaysPerYear") + .HasColumnType("integer"); + + b.Property("WeeklyHours") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("FacilityId"); + + b.ToTable("contracts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Employee", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AvatarFileName") + .HasColumnType("text"); + + b.Property("City") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Country") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DateOfBirth") + .HasColumnType("date"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("EmergencyContactName") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("EmergencyContactPhone") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("EmergencyContactRelation") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("EmploymentType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("EntryDate") + .HasColumnType("date"); + + b.Property("ExitDate") + .HasColumnType("date"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("PhoneNumber") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("PostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("Qualification") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Street") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("employees", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Facility", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BillingCity") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("BillingCountry") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("BillingPostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("BillingStreet") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("City") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Country") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("CrmStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("FacilityType") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(300) + .HasColumnType("character varying(300)"); + + b.Property("PhoneNumber") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("PostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("Street") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("facilities", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.FacilityContact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Department") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("Notes") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("PhoneNumber") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Role") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityId"); + + b.ToTable("facility_contacts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Invoice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BillingPeriodEnd") + .HasColumnType("date"); + + b.Property("BillingPeriodStart") + .HasColumnType("date"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DueDate") + .HasColumnType("date"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("GrossAmount") + .HasColumnType("numeric(12,2)"); + + b.Property("InvoiceNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("NetAmount") + .HasColumnType("numeric(12,2)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityId"); + + b.HasIndex("InvoiceNumber") + .IsUnique(); + + b.ToTable("invoices", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.LoginAttempt", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("IpAddress") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Succeeded") + .HasColumnType("boolean"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("IpAddress", "AttemptedAt"); + + b.ToTable("login_attempts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EndDate") + .HasColumnType("date"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("RequiredQualification") + .HasColumnType("text"); + + b.Property("StartDate") + .HasColumnType("date"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityId"); + + b.ToTable("orders", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.PasswordResetCode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptCount") + .HasColumnType("integer"); + + b.Property("CodeHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ConsumedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("InvalidatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ResetTokenExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ResetTokenHash") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ResetTokenUsedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ResetTokenHash"); + + b.HasIndex("UserId"); + + b.ToTable("password_reset_codes", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RefreshToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ReplacedByTokenId") + .HasColumnType("uuid"); + + b.Property("RevokedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("TokenHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ReplacedByTokenId"); + + b.HasIndex("TokenHash") + .IsUnique(); + + b.HasIndex("UserId"); + + b.ToTable("refresh_tokens", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("roles", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RolePermission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .HasColumnType("integer"); + + b.Property("Module") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("RoleId", "Module", "Action") + .IsUnique(); + + b.ToTable("role_permissions", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.TimeEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BreakDuration") + .HasColumnType("interval"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("End") + .HasColumnType("time without time zone"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("OrderId") + .HasColumnType("uuid"); + + b.Property("Start") + .HasColumnType("time without time zone"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("OrderId"); + + b.ToTable("time_entries", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("IsActive") + .HasColumnType("boolean"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("MustChangePassword") + .HasColumnType("boolean"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("SecurityStamp") + .HasColumnType("uuid"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("RoleId"); + + b.HasIndex("Username") + .IsUnique(); + + b.ToTable("users", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.UserPermissionOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .HasColumnType("integer"); + + b.Property("Effect") + .HasColumnType("integer"); + + b.Property("Module") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "Module", "Action") + .IsUnique(); + + b.ToTable("user_permission_overrides", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Contract", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Employee"); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.FacilityContact", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Invoice", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Order", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.PasswordResetCode", b => + { + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RefreshToken", b => + { + b.HasOne("OmsorgCore.Domain.Entities.RefreshToken", null) + .WithMany() + .HasForeignKey("ReplacedByTokenId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RolePermission", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Role", "Role") + .WithMany("RolePermissions") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.TimeEntry", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("OmsorgCore.Domain.Entities.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("OmsorgCore.Domain.Entities.Role", "Role") + .WithMany("Users") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.UserPermissionOverride", b => + { + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany("PermissionOverrides") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Role", b => + { + b.Navigation("RolePermissions"); + + b.Navigation("Users"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.Navigation("PermissionOverrides"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807175159_AddContractDetailsAndQueryFilter.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807175159_AddContractDetailsAndQueryFilter.cs new file mode 100644 index 0000000..5a29d5e --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807175159_AddContractDetailsAndQueryFilter.cs @@ -0,0 +1,84 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace OmsorgCore.Infrastructure.Persistence.Migrations +{ + /// + public partial class AddContractDetailsAndQueryFilter : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "AllowancesDescription", + table: "contracts", + type: "character varying(500)", + maxLength: 500, + nullable: true); + + migrationBuilder.AddColumn( + name: "HourlyWage", + table: "contracts", + type: "numeric(10,2)", + precision: 10, + scale: 2, + nullable: true); + + migrationBuilder.AddColumn( + name: "OvertimeRules", + table: "contracts", + type: "character varying(500)", + maxLength: 500, + nullable: true); + + migrationBuilder.AddColumn( + name: "ProbationPeriodMonths", + table: "contracts", + type: "integer", + nullable: true); + + migrationBuilder.AddColumn( + name: "VacationDaysPerYear", + table: "contracts", + type: "integer", + nullable: true); + + migrationBuilder.AddColumn( + name: "WeeklyHours", + table: "contracts", + type: "numeric(10,2)", + precision: 10, + scale: 2, + nullable: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "AllowancesDescription", + table: "contracts"); + + migrationBuilder.DropColumn( + name: "HourlyWage", + table: "contracts"); + + migrationBuilder.DropColumn( + name: "OvertimeRules", + table: "contracts"); + + migrationBuilder.DropColumn( + name: "ProbationPeriodMonths", + table: "contracts"); + + migrationBuilder.DropColumn( + name: "VacationDaysPerYear", + table: "contracts"); + + migrationBuilder.DropColumn( + name: "WeeklyHours", + table: "contracts"); + } + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807200517_RemoveFacilityPhoneAndEmail.Designer.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807200517_RemoveFacilityPhoneAndEmail.Designer.cs new file mode 100644 index 0000000..884e1bd --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807200517_RemoveFacilityPhoneAndEmail.Designer.cs @@ -0,0 +1,899 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using OmsorgCore.Infrastructure.Persistence; + +#nullable disable + +namespace OmsorgCore.Infrastructure.Persistence.Migrations +{ + [DbContext(typeof(OmsorgCoreDbContext))] + [Migration("20260807200517_RemoveFacilityPhoneAndEmail")] + partial class RemoveFacilityPhoneAndEmail + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.AuditLogEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("ActorUserId") + .HasColumnType("uuid"); + + b.Property("ActorUsername") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Category") + .HasColumnType("integer"); + + b.Property("Details") + .HasColumnType("jsonb"); + + b.Property("EntityId") + .HasColumnType("uuid"); + + b.Property("EntityType") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("IpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("OccurredAtUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("ActorUserId"); + + b.HasIndex("OccurredAtUtc"); + + b.HasIndex("EntityType", "EntityId"); + + b.ToTable("audit_log_entries", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Contract", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AllowancesDescription") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("ContractType") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("EndDate") + .HasColumnType("date"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("HourlyWage") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("OvertimeRules") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("ProbationPeriodMonths") + .HasColumnType("integer"); + + b.Property("StartDate") + .HasColumnType("date"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("VacationDaysPerYear") + .HasColumnType("integer"); + + b.Property("WeeklyHours") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("FacilityId"); + + b.ToTable("contracts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Employee", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AvatarFileName") + .HasColumnType("text"); + + b.Property("City") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Country") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DateOfBirth") + .HasColumnType("date"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("EmergencyContactName") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("EmergencyContactPhone") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("EmergencyContactRelation") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("EmploymentType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("EntryDate") + .HasColumnType("date"); + + b.Property("ExitDate") + .HasColumnType("date"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("PhoneNumber") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("PostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("Qualification") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Street") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("employees", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Facility", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BillingCity") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("BillingCountry") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("BillingPostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("BillingStreet") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("City") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Country") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("CrmStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("FacilityType") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(300) + .HasColumnType("character varying(300)"); + + b.Property("PostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("Street") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("facilities", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.FacilityContact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Department") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("Notes") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("PhoneNumber") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Role") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityId"); + + b.ToTable("facility_contacts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Invoice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BillingPeriodEnd") + .HasColumnType("date"); + + b.Property("BillingPeriodStart") + .HasColumnType("date"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DueDate") + .HasColumnType("date"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("GrossAmount") + .HasColumnType("numeric(12,2)"); + + b.Property("InvoiceNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("NetAmount") + .HasColumnType("numeric(12,2)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityId"); + + b.HasIndex("InvoiceNumber") + .IsUnique(); + + b.ToTable("invoices", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.LoginAttempt", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("IpAddress") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Succeeded") + .HasColumnType("boolean"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("IpAddress", "AttemptedAt"); + + b.ToTable("login_attempts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EndDate") + .HasColumnType("date"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("RequiredQualification") + .HasColumnType("text"); + + b.Property("StartDate") + .HasColumnType("date"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityId"); + + b.ToTable("orders", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.PasswordResetCode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptCount") + .HasColumnType("integer"); + + b.Property("CodeHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ConsumedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("InvalidatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ResetTokenExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ResetTokenHash") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ResetTokenUsedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ResetTokenHash"); + + b.HasIndex("UserId"); + + b.ToTable("password_reset_codes", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RefreshToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ReplacedByTokenId") + .HasColumnType("uuid"); + + b.Property("RevokedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("TokenHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ReplacedByTokenId"); + + b.HasIndex("TokenHash") + .IsUnique(); + + b.HasIndex("UserId"); + + b.ToTable("refresh_tokens", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("roles", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RolePermission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .HasColumnType("integer"); + + b.Property("Module") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("RoleId", "Module", "Action") + .IsUnique(); + + b.ToTable("role_permissions", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.TimeEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BreakDuration") + .HasColumnType("interval"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("End") + .HasColumnType("time without time zone"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("OrderId") + .HasColumnType("uuid"); + + b.Property("Start") + .HasColumnType("time without time zone"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("OrderId"); + + b.ToTable("time_entries", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("IsActive") + .HasColumnType("boolean"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("MustChangePassword") + .HasColumnType("boolean"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("SecurityStamp") + .HasColumnType("uuid"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("RoleId"); + + b.HasIndex("Username") + .IsUnique(); + + b.ToTable("users", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.UserPermissionOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .HasColumnType("integer"); + + b.Property("Effect") + .HasColumnType("integer"); + + b.Property("Module") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "Module", "Action") + .IsUnique(); + + b.ToTable("user_permission_overrides", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Contract", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Employee"); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.FacilityContact", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Invoice", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Order", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.PasswordResetCode", b => + { + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RefreshToken", b => + { + b.HasOne("OmsorgCore.Domain.Entities.RefreshToken", null) + .WithMany() + .HasForeignKey("ReplacedByTokenId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RolePermission", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Role", "Role") + .WithMany("RolePermissions") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.TimeEntry", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("OmsorgCore.Domain.Entities.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("OmsorgCore.Domain.Entities.Role", "Role") + .WithMany("Users") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.UserPermissionOverride", b => + { + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany("PermissionOverrides") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Role", b => + { + b.Navigation("RolePermissions"); + + b.Navigation("Users"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.Navigation("PermissionOverrides"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807200517_RemoveFacilityPhoneAndEmail.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807200517_RemoveFacilityPhoneAndEmail.cs new file mode 100644 index 0000000..fc6ac44 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807200517_RemoveFacilityPhoneAndEmail.cs @@ -0,0 +1,40 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace OmsorgCore.Infrastructure.Persistence.Migrations +{ + /// + public partial class RemoveFacilityPhoneAndEmail : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Email", + table: "facilities"); + + migrationBuilder.DropColumn( + name: "PhoneNumber", + table: "facilities"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Email", + table: "facilities", + type: "character varying(200)", + maxLength: 200, + nullable: true); + + migrationBuilder.AddColumn( + name: "PhoneNumber", + table: "facilities", + type: "character varying(50)", + maxLength: 50, + nullable: true); + } + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807203927_AddOrderDetailsAndConfigurableStatus.Designer.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807203927_AddOrderDetailsAndConfigurableStatus.Designer.cs new file mode 100644 index 0000000..5b29a26 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807203927_AddOrderDetailsAndConfigurableStatus.Designer.cs @@ -0,0 +1,1005 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using OmsorgCore.Infrastructure.Persistence; + +#nullable disable + +namespace OmsorgCore.Infrastructure.Persistence.Migrations +{ + [DbContext(typeof(OmsorgCoreDbContext))] + [Migration("20260807203927_AddOrderDetailsAndConfigurableStatus")] + partial class AddOrderDetailsAndConfigurableStatus + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.AuditLogEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("ActorUserId") + .HasColumnType("uuid"); + + b.Property("ActorUsername") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Category") + .HasColumnType("integer"); + + b.Property("Details") + .HasColumnType("jsonb"); + + b.Property("EntityId") + .HasColumnType("uuid"); + + b.Property("EntityType") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("IpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("OccurredAtUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("ActorUserId"); + + b.HasIndex("OccurredAtUtc"); + + b.HasIndex("EntityType", "EntityId"); + + b.ToTable("audit_log_entries", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Contract", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AllowancesDescription") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("ContractType") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("EndDate") + .HasColumnType("date"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("HourlyWage") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("OvertimeRules") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("ProbationPeriodMonths") + .HasColumnType("integer"); + + b.Property("StartDate") + .HasColumnType("date"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("VacationDaysPerYear") + .HasColumnType("integer"); + + b.Property("WeeklyHours") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("FacilityId"); + + b.ToTable("contracts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Employee", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AvatarFileName") + .HasColumnType("text"); + + b.Property("City") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Country") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DateOfBirth") + .HasColumnType("date"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("EmergencyContactName") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("EmergencyContactPhone") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("EmergencyContactRelation") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("EmploymentType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("EntryDate") + .HasColumnType("date"); + + b.Property("ExitDate") + .HasColumnType("date"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("PhoneNumber") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("PostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("Qualification") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Street") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("employees", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Facility", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BillingCity") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("BillingCountry") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("BillingPostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("BillingStreet") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("City") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Country") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("CrmStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("FacilityType") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(300) + .HasColumnType("character varying(300)"); + + b.Property("PostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("Street") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("facilities", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.FacilityContact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Department") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("Notes") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("PhoneNumber") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Role") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityId"); + + b.ToTable("facility_contacts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Invoice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BillingPeriodEnd") + .HasColumnType("date"); + + b.Property("BillingPeriodStart") + .HasColumnType("date"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DueDate") + .HasColumnType("date"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("GrossAmount") + .HasColumnType("numeric(12,2)"); + + b.Property("InvoiceNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("NetAmount") + .HasColumnType("numeric(12,2)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityId"); + + b.HasIndex("InvoiceNumber") + .IsUnique(); + + b.ToTable("invoices", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.LoginAttempt", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("IpAddress") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Succeeded") + .HasColumnType("boolean"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("IpAddress", "AttemptedAt"); + + b.ToTable("login_attempts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Conditions") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EndDate") + .HasColumnType("date"); + + b.Property("FacilityContactId") + .HasColumnType("uuid"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("Priority") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("RequiredHeadcount") + .HasColumnType("integer"); + + b.Property("RequiredQualification") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ShiftType") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("StartDate") + .HasColumnType("date"); + + b.Property("StatusId") + .HasColumnType("uuid"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityContactId"); + + b.HasIndex("FacilityId"); + + b.HasIndex("StatusId"); + + b.ToTable("orders", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.OrderStatusDefinition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("IsInitial") + .HasColumnType("boolean"); + + b.Property("IsTerminal") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("SortOrder") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("order_status_definitions", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.OrderStatusTransition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("FromStatusId") + .HasColumnType("uuid"); + + b.Property("ToStatusId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ToStatusId"); + + b.HasIndex("FromStatusId", "ToStatusId") + .IsUnique(); + + b.ToTable("order_status_transitions", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.PasswordResetCode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptCount") + .HasColumnType("integer"); + + b.Property("CodeHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ConsumedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("InvalidatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ResetTokenExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ResetTokenHash") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ResetTokenUsedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ResetTokenHash"); + + b.HasIndex("UserId"); + + b.ToTable("password_reset_codes", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RefreshToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ReplacedByTokenId") + .HasColumnType("uuid"); + + b.Property("RevokedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("TokenHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ReplacedByTokenId"); + + b.HasIndex("TokenHash") + .IsUnique(); + + b.HasIndex("UserId"); + + b.ToTable("refresh_tokens", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("roles", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RolePermission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .HasColumnType("integer"); + + b.Property("Module") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("RoleId", "Module", "Action") + .IsUnique(); + + b.ToTable("role_permissions", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.TimeEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BreakDuration") + .HasColumnType("interval"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("End") + .HasColumnType("time without time zone"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("OrderId") + .HasColumnType("uuid"); + + b.Property("Start") + .HasColumnType("time without time zone"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("OrderId"); + + b.ToTable("time_entries", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("IsActive") + .HasColumnType("boolean"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("MustChangePassword") + .HasColumnType("boolean"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("SecurityStamp") + .HasColumnType("uuid"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("RoleId"); + + b.HasIndex("Username") + .IsUnique(); + + b.ToTable("users", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.UserPermissionOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .HasColumnType("integer"); + + b.Property("Effect") + .HasColumnType("integer"); + + b.Property("Module") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "Module", "Action") + .IsUnique(); + + b.ToTable("user_permission_overrides", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Contract", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Employee"); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.FacilityContact", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Invoice", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Order", b => + { + b.HasOne("OmsorgCore.Domain.Entities.FacilityContact", "FacilityContact") + .WithMany() + .HasForeignKey("FacilityContactId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("OmsorgCore.Domain.Entities.OrderStatusDefinition", "Status") + .WithMany() + .HasForeignKey("StatusId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + + b.Navigation("FacilityContact"); + + b.Navigation("Status"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.OrderStatusTransition", b => + { + b.HasOne("OmsorgCore.Domain.Entities.OrderStatusDefinition", "FromStatus") + .WithMany() + .HasForeignKey("FromStatusId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("OmsorgCore.Domain.Entities.OrderStatusDefinition", "ToStatus") + .WithMany() + .HasForeignKey("ToStatusId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("FromStatus"); + + b.Navigation("ToStatus"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.PasswordResetCode", b => + { + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RefreshToken", b => + { + b.HasOne("OmsorgCore.Domain.Entities.RefreshToken", null) + .WithMany() + .HasForeignKey("ReplacedByTokenId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RolePermission", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Role", "Role") + .WithMany("RolePermissions") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.TimeEntry", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("OmsorgCore.Domain.Entities.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("OmsorgCore.Domain.Entities.Role", "Role") + .WithMany("Users") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.UserPermissionOverride", b => + { + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany("PermissionOverrides") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Role", b => + { + b.Navigation("RolePermissions"); + + b.Navigation("Users"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.Navigation("PermissionOverrides"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807203927_AddOrderDetailsAndConfigurableStatus.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807203927_AddOrderDetailsAndConfigurableStatus.cs new file mode 100644 index 0000000..b6fda51 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807203927_AddOrderDetailsAndConfigurableStatus.cs @@ -0,0 +1,208 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace OmsorgCore.Infrastructure.Persistence.Migrations +{ + /// + public partial class AddOrderDetailsAndConfigurableStatus : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.RenameColumn( + name: "Status", + table: "orders", + newName: "Priority"); + + migrationBuilder.AlterColumn( + name: "RequiredQualification", + table: "orders", + type: "character varying(200)", + maxLength: 200, + nullable: true, + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + + migrationBuilder.AddColumn( + name: "Conditions", + table: "orders", + type: "character varying(500)", + maxLength: 500, + nullable: true); + + migrationBuilder.AddColumn( + name: "FacilityContactId", + table: "orders", + type: "uuid", + nullable: true); + + migrationBuilder.AddColumn( + name: "RequiredHeadcount", + table: "orders", + type: "integer", + nullable: false, + defaultValue: 0); + + migrationBuilder.AddColumn( + name: "ShiftType", + table: "orders", + type: "character varying(100)", + maxLength: 100, + nullable: true); + + migrationBuilder.AddColumn( + name: "StatusId", + table: "orders", + type: "uuid", + nullable: false, + defaultValue: new Guid("00000000-0000-0000-0000-000000000000")); + + migrationBuilder.CreateTable( + name: "order_status_definitions", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Name = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), + SortOrder = table.Column(type: "integer", nullable: false), + IsInitial = table.Column(type: "boolean", nullable: false), + IsTerminal = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_order_status_definitions", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "order_status_transitions", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + FromStatusId = table.Column(type: "uuid", nullable: false), + ToStatusId = table.Column(type: "uuid", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_order_status_transitions", x => x.Id); + table.ForeignKey( + name: "FK_order_status_transitions_order_status_definitions_FromStatu~", + column: x => x.FromStatusId, + principalTable: "order_status_definitions", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_order_status_transitions_order_status_definitions_ToStatusId", + column: x => x.ToStatusId, + principalTable: "order_status_definitions", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateIndex( + name: "IX_orders_FacilityContactId", + table: "orders", + column: "FacilityContactId"); + + migrationBuilder.CreateIndex( + name: "IX_orders_StatusId", + table: "orders", + column: "StatusId"); + + migrationBuilder.CreateIndex( + name: "IX_order_status_definitions_Name", + table: "order_status_definitions", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_order_status_transitions_FromStatusId_ToStatusId", + table: "order_status_transitions", + columns: new[] { "FromStatusId", "ToStatusId" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_order_status_transitions_ToStatusId", + table: "order_status_transitions", + column: "ToStatusId"); + + migrationBuilder.AddForeignKey( + name: "FK_orders_facility_contacts_FacilityContactId", + table: "orders", + column: "FacilityContactId", + principalTable: "facility_contacts", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + + migrationBuilder.AddForeignKey( + name: "FK_orders_order_status_definitions_StatusId", + table: "orders", + column: "StatusId", + principalTable: "order_status_definitions", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_orders_facility_contacts_FacilityContactId", + table: "orders"); + + migrationBuilder.DropForeignKey( + name: "FK_orders_order_status_definitions_StatusId", + table: "orders"); + + migrationBuilder.DropTable( + name: "order_status_transitions"); + + migrationBuilder.DropTable( + name: "order_status_definitions"); + + migrationBuilder.DropIndex( + name: "IX_orders_FacilityContactId", + table: "orders"); + + migrationBuilder.DropIndex( + name: "IX_orders_StatusId", + table: "orders"); + + migrationBuilder.DropColumn( + name: "Conditions", + table: "orders"); + + migrationBuilder.DropColumn( + name: "FacilityContactId", + table: "orders"); + + migrationBuilder.DropColumn( + name: "RequiredHeadcount", + table: "orders"); + + migrationBuilder.DropColumn( + name: "ShiftType", + table: "orders"); + + migrationBuilder.DropColumn( + name: "StatusId", + table: "orders"); + + migrationBuilder.RenameColumn( + name: "Priority", + table: "orders", + newName: "Status"); + + migrationBuilder.AlterColumn( + name: "RequiredQualification", + table: "orders", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "character varying(200)", + oldMaxLength: 200, + oldNullable: true); + } + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807210000_ReplaceOrderStatusWithValueLists.Designer.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807210000_ReplaceOrderStatusWithValueLists.Designer.cs new file mode 100644 index 0000000..5094d63 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807210000_ReplaceOrderStatusWithValueLists.Designer.cs @@ -0,0 +1,1051 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using OmsorgCore.Infrastructure.Persistence; + +#nullable disable + +namespace OmsorgCore.Infrastructure.Persistence.Migrations +{ + [DbContext(typeof(OmsorgCoreDbContext))] + [Migration("20260807210000_ReplaceOrderStatusWithValueLists")] + partial class ReplaceOrderStatusWithValueLists + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.AuditLogEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("ActorUserId") + .HasColumnType("uuid"); + + b.Property("ActorUsername") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Category") + .HasColumnType("integer"); + + b.Property("Details") + .HasColumnType("jsonb"); + + b.Property("EntityId") + .HasColumnType("uuid"); + + b.Property("EntityType") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("IpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("OccurredAtUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("ActorUserId"); + + b.HasIndex("OccurredAtUtc"); + + b.HasIndex("EntityType", "EntityId"); + + b.ToTable("audit_log_entries", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Contract", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AllowancesDescription") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("ContractType") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("EndDate") + .HasColumnType("date"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("HourlyWage") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("OvertimeRules") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("ProbationPeriodMonths") + .HasColumnType("integer"); + + b.Property("StartDate") + .HasColumnType("date"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("VacationDaysPerYear") + .HasColumnType("integer"); + + b.Property("WeeklyHours") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("FacilityId"); + + b.ToTable("contracts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Employee", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AvatarFileName") + .HasColumnType("text"); + + b.Property("City") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Country") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DateOfBirth") + .HasColumnType("date"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("EmergencyContactName") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("EmergencyContactPhone") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("EmergencyContactRelation") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("EmploymentType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("EntryDate") + .HasColumnType("date"); + + b.Property("ExitDate") + .HasColumnType("date"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("PhoneNumber") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("PostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("Qualification") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Street") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("employees", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Facility", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BillingCity") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("BillingCountry") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("BillingPostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("BillingStreet") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("City") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Country") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("CrmStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("FacilityType") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(300) + .HasColumnType("character varying(300)"); + + b.Property("PostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("Street") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("facilities", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.FacilityContact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Department") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("Notes") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("PhoneNumber") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Role") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityId"); + + b.ToTable("facility_contacts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Invoice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BillingPeriodEnd") + .HasColumnType("date"); + + b.Property("BillingPeriodStart") + .HasColumnType("date"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DueDate") + .HasColumnType("date"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("GrossAmount") + .HasColumnType("numeric(12,2)"); + + b.Property("InvoiceNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("NetAmount") + .HasColumnType("numeric(12,2)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityId"); + + b.HasIndex("InvoiceNumber") + .IsUnique(); + + b.ToTable("invoices", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.LoginAttempt", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("IpAddress") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Succeeded") + .HasColumnType("boolean"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("IpAddress", "AttemptedAt"); + + b.ToTable("login_attempts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Conditions") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EndDate") + .HasColumnType("date"); + + b.Property("FacilityContactId") + .HasColumnType("uuid"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("Priority") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("RequiredHeadcount") + .HasColumnType("integer"); + + b.Property("RequiredQualification") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ShiftType") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("StartDate") + .HasColumnType("date"); + + b.Property("StatusId") + .HasColumnType("uuid"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityContactId"); + + b.HasIndex("FacilityId"); + + b.HasIndex("StatusId"); + + b.ToTable("orders", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.PasswordResetCode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptCount") + .HasColumnType("integer"); + + b.Property("CodeHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ConsumedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("InvalidatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ResetTokenExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ResetTokenHash") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ResetTokenUsedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ResetTokenHash"); + + b.HasIndex("UserId"); + + b.ToTable("password_reset_codes", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RefreshToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ReplacedByTokenId") + .HasColumnType("uuid"); + + b.Property("RevokedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("TokenHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ReplacedByTokenId"); + + b.HasIndex("TokenHash") + .IsUnique(); + + b.HasIndex("UserId"); + + b.ToTable("refresh_tokens", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("roles", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RolePermission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .HasColumnType("integer"); + + b.Property("Module") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("RoleId", "Module", "Action") + .IsUnique(); + + b.ToTable("role_permissions", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.TimeEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BreakDuration") + .HasColumnType("interval"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("End") + .HasColumnType("time without time zone"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("OrderId") + .HasColumnType("uuid"); + + b.Property("Start") + .HasColumnType("time without time zone"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("OrderId"); + + b.ToTable("time_entries", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("IsActive") + .HasColumnType("boolean"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("MustChangePassword") + .HasColumnType("boolean"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("SecurityStamp") + .HasColumnType("uuid"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("RoleId"); + + b.HasIndex("Username") + .IsUnique(); + + b.ToTable("users", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.UserPermissionOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .HasColumnType("integer"); + + b.Property("Effect") + .HasColumnType("integer"); + + b.Property("Module") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "Module", "Action") + .IsUnique(); + + b.ToTable("user_permission_overrides", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.ValueList", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("value_lists", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.ValueListItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("IsDefault") + .HasColumnType("boolean"); + + b.Property("IsInitial") + .HasColumnType("boolean"); + + b.Property("IsTerminal") + .HasColumnType("boolean"); + + b.Property("SortOrder") + .HasColumnType("integer"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("ValueListId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ValueListId", "Value") + .IsUnique(); + + b.ToTable("value_list_items", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.ValueListItemTransition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("FromItemId") + .HasColumnType("uuid"); + + b.Property("ToItemId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ToItemId"); + + b.HasIndex("FromItemId", "ToItemId") + .IsUnique(); + + b.ToTable("value_list_item_transitions", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Contract", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Employee"); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.FacilityContact", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Invoice", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Order", b => + { + b.HasOne("OmsorgCore.Domain.Entities.FacilityContact", "FacilityContact") + .WithMany() + .HasForeignKey("FacilityContactId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("OmsorgCore.Domain.Entities.ValueListItem", "Status") + .WithMany() + .HasForeignKey("StatusId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + + b.Navigation("FacilityContact"); + + b.Navigation("Status"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.PasswordResetCode", b => + { + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RefreshToken", b => + { + b.HasOne("OmsorgCore.Domain.Entities.RefreshToken", null) + .WithMany() + .HasForeignKey("ReplacedByTokenId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RolePermission", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Role", "Role") + .WithMany("RolePermissions") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.TimeEntry", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("OmsorgCore.Domain.Entities.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("OmsorgCore.Domain.Entities.Role", "Role") + .WithMany("Users") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.UserPermissionOverride", b => + { + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany("PermissionOverrides") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.ValueListItem", b => + { + b.HasOne("OmsorgCore.Domain.Entities.ValueList", "ValueList") + .WithMany("Items") + .HasForeignKey("ValueListId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("ValueList"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.ValueListItemTransition", b => + { + b.HasOne("OmsorgCore.Domain.Entities.ValueListItem", "FromItem") + .WithMany() + .HasForeignKey("FromItemId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("OmsorgCore.Domain.Entities.ValueListItem", "ToItem") + .WithMany() + .HasForeignKey("ToItemId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("FromItem"); + + b.Navigation("ToItem"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Role", b => + { + b.Navigation("RolePermissions"); + + b.Navigation("Users"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.Navigation("PermissionOverrides"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.ValueList", b => + { + b.Navigation("Items"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807210000_ReplaceOrderStatusWithValueLists.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807210000_ReplaceOrderStatusWithValueLists.cs new file mode 100644 index 0000000..2790279 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260807210000_ReplaceOrderStatusWithValueLists.cs @@ -0,0 +1,231 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace OmsorgCore.Infrastructure.Persistence.Migrations +{ + /// + public partial class ReplaceOrderStatusWithValueLists : Migration + { + // Fest verdrahtete Id für die neue "OrderStatus"-Liste, damit Up/Down deterministisch bleiben. + private const string OrderStatusListId = "f5793caf-6f5d-4d20-8d27-f0ae9aa43bf5"; + + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_orders_order_status_definitions_StatusId", + table: "orders"); + + migrationBuilder.CreateTable( + name: "value_lists", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + Key = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), + DisplayName = table.Column(type: "character varying(100)", maxLength: 100, nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_value_lists", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "value_list_items", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + ValueListId = table.Column(type: "uuid", nullable: false), + Value = table.Column(type: "character varying(100)", maxLength: 100, nullable: false), + SortOrder = table.Column(type: "integer", nullable: false), + IsDefault = table.Column(type: "boolean", nullable: false), + IsInitial = table.Column(type: "boolean", nullable: false), + IsTerminal = table.Column(type: "boolean", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_value_list_items", x => x.Id); + table.ForeignKey( + name: "FK_value_list_items_value_lists_ValueListId", + column: x => x.ValueListId, + principalTable: "value_lists", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.CreateTable( + name: "value_list_item_transitions", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + FromItemId = table.Column(type: "uuid", nullable: false), + ToItemId = table.Column(type: "uuid", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_value_list_item_transitions", x => x.Id); + table.ForeignKey( + name: "FK_value_list_item_transitions_value_list_items_FromItemId", + column: x => x.FromItemId, + principalTable: "value_list_items", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_value_list_item_transitions_value_list_items_ToItemId", + column: x => x.ToItemId, + principalTable: "value_list_items", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + // Bestehende Auftragsstatus-Stammdaten 1:1 in die neuen generischen Tabellen übernehmen, + // MIT IDENTISCHEN Ids - damit orders.StatusId (unverändert) weiterhin auf gültige Zeilen + // zeigt, ohne dass ein einziger Order-Datensatz angefasst werden muss. + migrationBuilder.Sql($@" + INSERT INTO value_lists (""Id"", ""Key"", ""DisplayName"") + VALUES ('{OrderStatusListId}', 'OrderStatus', 'Auftragsstatus'); + + INSERT INTO value_list_items (""Id"", ""ValueListId"", ""Value"", ""SortOrder"", ""IsDefault"", ""IsInitial"", ""IsTerminal"") + SELECT ""Id"", '{OrderStatusListId}', ""Name"", ""SortOrder"", false, ""IsInitial"", ""IsTerminal"" + FROM order_status_definitions; + + INSERT INTO value_list_item_transitions (""Id"", ""FromItemId"", ""ToItemId"") + SELECT ""Id"", ""FromStatusId"", ""ToStatusId"" + FROM order_status_transitions; + "); + + migrationBuilder.DropTable( + name: "order_status_transitions"); + + migrationBuilder.DropTable( + name: "order_status_definitions"); + + migrationBuilder.CreateIndex( + name: "IX_value_list_item_transitions_FromItemId_ToItemId", + table: "value_list_item_transitions", + columns: new[] { "FromItemId", "ToItemId" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_value_list_item_transitions_ToItemId", + table: "value_list_item_transitions", + column: "ToItemId"); + + migrationBuilder.CreateIndex( + name: "IX_value_list_items_ValueListId_Value", + table: "value_list_items", + columns: new[] { "ValueListId", "Value" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_value_lists_Key", + table: "value_lists", + column: "Key", + unique: true); + + migrationBuilder.AddForeignKey( + name: "FK_orders_value_list_items_StatusId", + table: "orders", + column: "StatusId", + principalTable: "value_list_items", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_orders_value_list_items_StatusId", + table: "orders"); + + migrationBuilder.CreateTable( + name: "order_status_definitions", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + IsInitial = table.Column(type: "boolean", nullable: false), + IsTerminal = table.Column(type: "boolean", nullable: false), + Name = table.Column(type: "character varying(50)", maxLength: 50, nullable: false), + SortOrder = table.Column(type: "integer", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_order_status_definitions", x => x.Id); + }); + + migrationBuilder.CreateTable( + name: "order_status_transitions", + columns: table => new + { + Id = table.Column(type: "uuid", nullable: false), + FromStatusId = table.Column(type: "uuid", nullable: false), + ToStatusId = table.Column(type: "uuid", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("PK_order_status_transitions", x => x.Id); + table.ForeignKey( + name: "FK_order_status_transitions_order_status_definitions_FromStatu~", + column: x => x.FromStatusId, + principalTable: "order_status_definitions", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + table.ForeignKey( + name: "FK_order_status_transitions_order_status_definitions_ToStatusId", + column: x => x.ToStatusId, + principalTable: "order_status_definitions", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + }); + + migrationBuilder.Sql($@" + INSERT INTO order_status_definitions (""Id"", ""Name"", ""SortOrder"", ""IsInitial"", ""IsTerminal"") + SELECT ""Id"", ""Value"", ""SortOrder"", ""IsInitial"", ""IsTerminal"" + FROM value_list_items + WHERE ""ValueListId"" = '{OrderStatusListId}'; + + INSERT INTO order_status_transitions (""Id"", ""FromStatusId"", ""ToStatusId"") + SELECT t.""Id"", t.""FromItemId"", t.""ToItemId"" + FROM value_list_item_transitions t + INNER JOIN value_list_items i ON i.""Id"" = t.""FromItemId"" + WHERE i.""ValueListId"" = '{OrderStatusListId}'; + "); + + migrationBuilder.DropTable( + name: "value_list_item_transitions"); + + migrationBuilder.DropTable( + name: "value_list_items"); + + migrationBuilder.DropTable( + name: "value_lists"); + + migrationBuilder.CreateIndex( + name: "IX_order_status_definitions_Name", + table: "order_status_definitions", + column: "Name", + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_order_status_transitions_FromStatusId_ToStatusId", + table: "order_status_transitions", + columns: new[] { "FromStatusId", "ToStatusId" }, + unique: true); + + migrationBuilder.CreateIndex( + name: "IX_order_status_transitions_ToStatusId", + table: "order_status_transitions", + column: "ToStatusId"); + + migrationBuilder.AddForeignKey( + name: "FK_orders_order_status_definitions_StatusId", + table: "orders", + column: "StatusId", + principalTable: "order_status_definitions", + principalColumn: "Id", + onDelete: ReferentialAction.Restrict); + } + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260808211434_AddFacilityWebsite.Designer.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260808211434_AddFacilityWebsite.Designer.cs new file mode 100644 index 0000000..94d2642 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260808211434_AddFacilityWebsite.Designer.cs @@ -0,0 +1,1055 @@ +// +using System; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; +using OmsorgCore.Infrastructure.Persistence; + +#nullable disable + +namespace OmsorgCore.Infrastructure.Persistence.Migrations +{ + [DbContext(typeof(OmsorgCoreDbContext))] + [Migration("20260808211434_AddFacilityWebsite")] + partial class AddFacilityWebsite + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "8.0.10") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.AuditLogEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("ActorUserId") + .HasColumnType("uuid"); + + b.Property("ActorUsername") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Category") + .HasColumnType("integer"); + + b.Property("Details") + .HasColumnType("jsonb"); + + b.Property("EntityId") + .HasColumnType("uuid"); + + b.Property("EntityType") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("IpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("OccurredAtUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("ActorUserId"); + + b.HasIndex("OccurredAtUtc"); + + b.HasIndex("EntityType", "EntityId"); + + b.ToTable("audit_log_entries", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Contract", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AllowancesDescription") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("ContractType") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("EndDate") + .HasColumnType("date"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("HourlyWage") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("OvertimeRules") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("ProbationPeriodMonths") + .HasColumnType("integer"); + + b.Property("StartDate") + .HasColumnType("date"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("VacationDaysPerYear") + .HasColumnType("integer"); + + b.Property("WeeklyHours") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("FacilityId"); + + b.ToTable("contracts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Employee", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AvatarFileName") + .HasColumnType("text"); + + b.Property("City") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Country") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DateOfBirth") + .HasColumnType("date"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("EmergencyContactName") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("EmergencyContactPhone") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("EmergencyContactRelation") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("EmploymentType") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("EntryDate") + .HasColumnType("date"); + + b.Property("ExitDate") + .HasColumnType("date"); + + b.Property("FirstName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("LastName") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("PhoneNumber") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("PostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("Qualification") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Street") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.ToTable("employees", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Facility", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BillingCity") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("BillingCountry") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("BillingPostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("BillingStreet") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("City") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Country") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("CrmStatus") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("FacilityType") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(300) + .HasColumnType("character varying(300)"); + + b.Property("PostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("Street") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Website") + .HasMaxLength(300) + .HasColumnType("character varying(300)"); + + b.HasKey("Id"); + + b.ToTable("facilities", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.FacilityContact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Department") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("Notes") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + + b.Property("PhoneNumber") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Role") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityId"); + + b.ToTable("facility_contacts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Invoice", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BillingPeriodEnd") + .HasColumnType("date"); + + b.Property("BillingPeriodStart") + .HasColumnType("date"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DueDate") + .HasColumnType("date"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("GrossAmount") + .HasColumnType("numeric(12,2)"); + + b.Property("InvoiceNumber") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("NetAmount") + .HasColumnType("numeric(12,2)"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityId"); + + b.HasIndex("InvoiceNumber") + .IsUnique(); + + b.ToTable("invoices", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.LoginAttempt", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("IpAddress") + .IsRequired() + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("Succeeded") + .HasColumnType("boolean"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("IpAddress", "AttemptedAt"); + + b.ToTable("login_attempts", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Order", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Conditions") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EndDate") + .HasColumnType("date"); + + b.Property("FacilityContactId") + .HasColumnType("uuid"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("Priority") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("RequiredHeadcount") + .HasColumnType("integer"); + + b.Property("RequiredQualification") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ShiftType") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("StartDate") + .HasColumnType("date"); + + b.Property("StatusId") + .HasColumnType("uuid"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("FacilityContactId"); + + b.HasIndex("FacilityId"); + + b.HasIndex("StatusId"); + + b.ToTable("orders", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.PasswordResetCode", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("AttemptCount") + .HasColumnType("integer"); + + b.Property("CodeHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ConsumedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("InvalidatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ResetTokenExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ResetTokenHash") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("ResetTokenUsedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ResetTokenHash"); + + b.HasIndex("UserId"); + + b.ToTable("password_reset_codes", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RefreshToken", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ExpiresAt") + .HasColumnType("timestamp with time zone"); + + b.Property("ReplacedByTokenId") + .HasColumnType("uuid"); + + b.Property("RevokedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("TokenHash") + .IsRequired() + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ReplacedByTokenId"); + + b.HasIndex("TokenHash") + .IsUnique(); + + b.HasIndex("UserId"); + + b.ToTable("refresh_tokens", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Role", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("Name") + .IsUnique(); + + b.ToTable("roles", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RolePermission", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .HasColumnType("integer"); + + b.Property("Module") + .HasColumnType("integer"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("RoleId", "Module", "Action") + .IsUnique(); + + b.ToTable("role_permissions", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.TimeEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("BreakDuration") + .HasColumnType("interval"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Date") + .HasColumnType("date"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("End") + .HasColumnType("time without time zone"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("OrderId") + .HasColumnType("uuid"); + + b.Property("Start") + .HasColumnType("time without time zone"); + + b.Property("Status") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("OrderId"); + + b.ToTable("time_entries", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("EmployeeId") + .HasColumnType("uuid"); + + b.Property("IsActive") + .HasColumnType("boolean"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("MustChangePassword") + .HasColumnType("boolean"); + + b.Property("PasswordHash") + .IsRequired() + .HasColumnType("text"); + + b.Property("RoleId") + .HasColumnType("uuid"); + + b.Property("SecurityStamp") + .HasColumnType("uuid"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Username") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.HasKey("Id"); + + b.HasIndex("EmployeeId"); + + b.HasIndex("RoleId"); + + b.HasIndex("Username") + .IsUnique(); + + b.ToTable("users", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.UserPermissionOverride", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .HasColumnType("integer"); + + b.Property("Effect") + .HasColumnType("integer"); + + b.Property("Module") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("UserId", "Module", "Action") + .IsUnique(); + + b.ToTable("user_permission_overrides", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.ValueList", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("value_lists", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.ValueListItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("IsDefault") + .HasColumnType("boolean"); + + b.Property("IsInitial") + .HasColumnType("boolean"); + + b.Property("IsTerminal") + .HasColumnType("boolean"); + + b.Property("SortOrder") + .HasColumnType("integer"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("ValueListId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ValueListId", "Value") + .IsUnique(); + + b.ToTable("value_list_items", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.ValueListItemTransition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("FromItemId") + .HasColumnType("uuid"); + + b.Property("ToItemId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ToItemId"); + + b.HasIndex("FromItemId", "ToItemId") + .IsUnique(); + + b.ToTable("value_list_item_transitions", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Contract", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict); + + b.Navigation("Employee"); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.FacilityContact", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Invoice", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Order", b => + { + b.HasOne("OmsorgCore.Domain.Entities.FacilityContact", "FacilityContact") + .WithMany() + .HasForeignKey("FacilityContactId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("OmsorgCore.Domain.Entities.ValueListItem", "Status") + .WithMany() + .HasForeignKey("StatusId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + + b.Navigation("FacilityContact"); + + b.Navigation("Status"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.PasswordResetCode", b => + { + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RefreshToken", b => + { + b.HasOne("OmsorgCore.Domain.Entities.RefreshToken", null) + .WithMany() + .HasForeignKey("ReplacedByTokenId") + .OnDelete(DeleteBehavior.Restrict); + + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.RolePermission", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Role", "Role") + .WithMany("RolePermissions") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.TimeEntry", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("OmsorgCore.Domain.Entities.Order", "Order") + .WithMany() + .HasForeignKey("OrderId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Order"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") + .WithMany() + .HasForeignKey("EmployeeId") + .OnDelete(DeleteBehavior.SetNull); + + b.HasOne("OmsorgCore.Domain.Entities.Role", "Role") + .WithMany("Users") + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Employee"); + + b.Navigation("Role"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.UserPermissionOverride", b => + { + b.HasOne("OmsorgCore.Domain.Entities.User", "User") + .WithMany("PermissionOverrides") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.ValueListItem", b => + { + b.HasOne("OmsorgCore.Domain.Entities.ValueList", "ValueList") + .WithMany("Items") + .HasForeignKey("ValueListId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("ValueList"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.ValueListItemTransition", b => + { + b.HasOne("OmsorgCore.Domain.Entities.ValueListItem", "FromItem") + .WithMany() + .HasForeignKey("FromItemId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("OmsorgCore.Domain.Entities.ValueListItem", "ToItem") + .WithMany() + .HasForeignKey("ToItemId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("FromItem"); + + b.Navigation("ToItem"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.Role", b => + { + b.Navigation("RolePermissions"); + + b.Navigation("Users"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.User", b => + { + b.Navigation("PermissionOverrides"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.ValueList", b => + { + b.Navigation("Items"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260808211434_AddFacilityWebsite.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260808211434_AddFacilityWebsite.cs new file mode 100644 index 0000000..e68020b --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/20260808211434_AddFacilityWebsite.cs @@ -0,0 +1,29 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace OmsorgCore.Infrastructure.Persistence.Migrations +{ + /// + public partial class AddFacilityWebsite : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn( + name: "Website", + table: "facilities", + type: "character varying(300)", + maxLength: 300, + nullable: true); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropColumn( + name: "Website", + table: "facilities"); + } + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/OmsorgCoreDbContextModelSnapshot.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/OmsorgCoreDbContextModelSnapshot.cs index a10997e..156aaa9 100644 --- a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/OmsorgCoreDbContextModelSnapshot.cs +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/Migrations/OmsorgCoreDbContextModelSnapshot.cs @@ -22,12 +22,65 @@ namespace OmsorgCore.Infrastructure.Persistence.Migrations NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + modelBuilder.Entity("OmsorgCore.Domain.Entities.AuditLogEntry", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("Action") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("ActorUserId") + .HasColumnType("uuid"); + + b.Property("ActorUsername") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Category") + .HasColumnType("integer"); + + b.Property("Details") + .HasColumnType("jsonb"); + + b.Property("EntityId") + .HasColumnType("uuid"); + + b.Property("EntityType") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("IpAddress") + .HasMaxLength(64) + .HasColumnType("character varying(64)"); + + b.Property("OccurredAtUtc") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("ActorUserId"); + + b.HasIndex("OccurredAtUtc"); + + b.HasIndex("EntityType", "EntityId"); + + b.ToTable("audit_log_entries", (string)null); + }); + modelBuilder.Entity("OmsorgCore.Domain.Entities.Contract", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid"); + b.Property("AllowancesDescription") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + b.Property("ContractType") .IsRequired() .HasMaxLength(100) @@ -48,9 +101,20 @@ namespace OmsorgCore.Infrastructure.Persistence.Migrations b.Property("FacilityId") .HasColumnType("uuid"); + b.Property("HourlyWage") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)"); + b.Property("IsDeleted") .HasColumnType("boolean"); + b.Property("OvertimeRules") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + + b.Property("ProbationPeriodMonths") + .HasColumnType("integer"); + b.Property("StartDate") .HasColumnType("date"); @@ -62,6 +126,13 @@ namespace OmsorgCore.Infrastructure.Persistence.Migrations b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); + b.Property("VacationDaysPerYear") + .HasColumnType("integer"); + + b.Property("WeeklyHours") + .HasPrecision(10, 2) + .HasColumnType("numeric(10,2)"); + b.HasKey("Id"); b.HasIndex("EmployeeId"); @@ -171,11 +242,29 @@ namespace OmsorgCore.Infrastructure.Persistence.Migrations .ValueGeneratedOnAdd() .HasColumnType("uuid"); - b.Property("Address") - .HasColumnType("text"); + b.Property("BillingCity") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); - b.Property("BillingAddress") - .HasColumnType("text"); + b.Property("BillingCountry") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("BillingPostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("BillingStreet") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("City") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Country") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); @@ -188,11 +277,9 @@ namespace OmsorgCore.Infrastructure.Persistence.Migrations b.Property("DeletedAt") .HasColumnType("timestamp with time zone"); - b.Property("Email") - .HasColumnType("text"); - b.Property("FacilityType") - .HasColumnType("text"); + .HasMaxLength(100) + .HasColumnType("character varying(100)"); b.Property("IsDeleted") .HasColumnType("boolean"); @@ -202,15 +289,77 @@ namespace OmsorgCore.Infrastructure.Persistence.Migrations .HasMaxLength(300) .HasColumnType("character varying(300)"); + b.Property("PostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("Street") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("UpdatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Website") + .HasMaxLength(300) + .HasColumnType("character varying(300)"); + + b.HasKey("Id"); + + b.ToTable("facilities", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.FacilityContact", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreatedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Department") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Email") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("FacilityId") + .HasColumnType("uuid"); + + b.Property("IsDeleted") + .HasColumnType("boolean"); + + b.Property("Name") + .IsRequired() + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("Notes") + .HasMaxLength(1000) + .HasColumnType("character varying(1000)"); + b.Property("PhoneNumber") - .HasColumnType("text"); + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Role") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.HasKey("Id"); - b.ToTable("facilities", (string)null); + b.HasIndex("FacilityId"); + + b.ToTable("facility_contacts", (string)null); }); modelBuilder.Entity("OmsorgCore.Domain.Entities.Invoice", b => @@ -304,6 +453,10 @@ namespace OmsorgCore.Infrastructure.Persistence.Migrations .ValueGeneratedOnAdd() .HasColumnType("uuid"); + b.Property("Conditions") + .HasMaxLength(500) + .HasColumnType("character varying(500)"); + b.Property("CreatedAt") .HasColumnType("timestamp with time zone"); @@ -313,30 +466,48 @@ namespace OmsorgCore.Infrastructure.Persistence.Migrations b.Property("EndDate") .HasColumnType("date"); + b.Property("FacilityContactId") + .HasColumnType("uuid"); + b.Property("FacilityId") .HasColumnType("uuid"); b.Property("IsDeleted") .HasColumnType("boolean"); + b.Property("Priority") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("RequiredHeadcount") + .HasColumnType("integer"); + b.Property("RequiredQualification") - .HasColumnType("text"); + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ShiftType") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); b.Property("StartDate") .HasColumnType("date"); - b.Property("Status") - .IsRequired() - .HasMaxLength(50) - .HasColumnType("character varying(50)"); + b.Property("StatusId") + .HasColumnType("uuid"); b.Property("UpdatedAt") .HasColumnType("timestamp with time zone"); b.HasKey("Id"); + b.HasIndex("FacilityContactId"); + b.HasIndex("FacilityId"); + b.HasIndex("StatusId"); + b.ToTable("orders", (string)null); }); @@ -598,6 +769,86 @@ namespace OmsorgCore.Infrastructure.Persistence.Migrations b.ToTable("user_permission_overrides", (string)null); }); + modelBuilder.Entity("OmsorgCore.Domain.Entities.ValueList", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("DisplayName") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Key") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Id"); + + b.HasIndex("Key") + .IsUnique(); + + b.ToTable("value_lists", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.ValueListItem", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("IsDefault") + .HasColumnType("boolean"); + + b.Property("IsInitial") + .HasColumnType("boolean"); + + b.Property("IsTerminal") + .HasColumnType("boolean"); + + b.Property("SortOrder") + .HasColumnType("integer"); + + b.Property("Value") + .IsRequired() + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("ValueListId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ValueListId", "Value") + .IsUnique(); + + b.ToTable("value_list_items", (string)null); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.ValueListItemTransition", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("FromItemId") + .HasColumnType("uuid"); + + b.Property("ToItemId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ToItemId"); + + b.HasIndex("FromItemId", "ToItemId") + .IsUnique(); + + b.ToTable("value_list_item_transitions", (string)null); + }); + modelBuilder.Entity("OmsorgCore.Domain.Entities.Contract", b => { b.HasOne("OmsorgCore.Domain.Entities.Employee", "Employee") @@ -615,6 +866,17 @@ namespace OmsorgCore.Infrastructure.Persistence.Migrations b.Navigation("Facility"); }); + modelBuilder.Entity("OmsorgCore.Domain.Entities.FacilityContact", b => + { + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") + .WithMany() + .HasForeignKey("FacilityId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("Facility"); + }); + modelBuilder.Entity("OmsorgCore.Domain.Entities.Invoice", b => { b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") @@ -628,13 +890,28 @@ namespace OmsorgCore.Infrastructure.Persistence.Migrations modelBuilder.Entity("OmsorgCore.Domain.Entities.Order", b => { + b.HasOne("OmsorgCore.Domain.Entities.FacilityContact", "FacilityContact") + .WithMany() + .HasForeignKey("FacilityContactId") + .OnDelete(DeleteBehavior.Restrict); + b.HasOne("OmsorgCore.Domain.Entities.Facility", "Facility") .WithMany() .HasForeignKey("FacilityId") .OnDelete(DeleteBehavior.Restrict) .IsRequired(); + b.HasOne("OmsorgCore.Domain.Entities.ValueListItem", "Status") + .WithMany() + .HasForeignKey("StatusId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + b.Navigation("Facility"); + + b.Navigation("FacilityContact"); + + b.Navigation("Status"); }); modelBuilder.Entity("OmsorgCore.Domain.Entities.PasswordResetCode", b => @@ -723,6 +1000,36 @@ namespace OmsorgCore.Infrastructure.Persistence.Migrations b.Navigation("User"); }); + modelBuilder.Entity("OmsorgCore.Domain.Entities.ValueListItem", b => + { + b.HasOne("OmsorgCore.Domain.Entities.ValueList", "ValueList") + .WithMany("Items") + .HasForeignKey("ValueListId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("ValueList"); + }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.ValueListItemTransition", b => + { + b.HasOne("OmsorgCore.Domain.Entities.ValueListItem", "FromItem") + .WithMany() + .HasForeignKey("FromItemId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.HasOne("OmsorgCore.Domain.Entities.ValueListItem", "ToItem") + .WithMany() + .HasForeignKey("ToItemId") + .OnDelete(DeleteBehavior.Restrict) + .IsRequired(); + + b.Navigation("FromItem"); + + b.Navigation("ToItem"); + }); + modelBuilder.Entity("OmsorgCore.Domain.Entities.Role", b => { b.Navigation("RolePermissions"); @@ -734,6 +1041,11 @@ namespace OmsorgCore.Infrastructure.Persistence.Migrations { b.Navigation("PermissionOverrides"); }); + + modelBuilder.Entity("OmsorgCore.Domain.Entities.ValueList", b => + { + b.Navigation("Items"); + }); #pragma warning restore 612, 618 } } diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/OmsorgCoreDbContext.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/OmsorgCoreDbContext.cs index f1eab45..c10187e 100644 --- a/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/OmsorgCoreDbContext.cs +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Persistence/OmsorgCoreDbContext.cs @@ -11,8 +11,12 @@ public class OmsorgCoreDbContext : DbContext public DbSet Employees => Set(); public DbSet Facilities => Set(); + public DbSet FacilityContacts => Set(); public DbSet Contracts => Set(); public DbSet Orders => Set(); + public DbSet ValueLists => Set(); + public DbSet ValueListItems => Set(); + public DbSet ValueListItemTransitions => Set(); public DbSet TimeEntries => Set(); public DbSet Invoices => Set(); @@ -23,6 +27,7 @@ public class OmsorgCoreDbContext : DbContext public DbSet RefreshTokens => Set(); public DbSet PasswordResetCodes => Set(); public DbSet LoginAttempts => Set(); + public DbSet AuditLogEntries => Set(); protected override void OnModelCreating(ModelBuilder modelBuilder) { diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/AuditLogRepository.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/AuditLogRepository.cs new file mode 100644 index 0000000..48411d1 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/AuditLogRepository.cs @@ -0,0 +1,77 @@ +using Microsoft.EntityFrameworkCore; +using OmsorgCore.Application.Abstractions; +using OmsorgCore.Domain.Entities; +using OmsorgCore.Domain.Enums; +using OmsorgCore.Infrastructure.Persistence; + +namespace OmsorgCore.Infrastructure.Repositories; + +public class AuditLogRepository : IAuditLogRepository +{ + private readonly OmsorgCoreDbContext _db; + + public AuditLogRepository(OmsorgCoreDbContext db) + { + _db = db; + } + + public async Task AddAsync(AuditLogEntry entry, CancellationToken cancellationToken = default) + => await _db.AuditLogEntries.AddAsync(entry, cancellationToken); + + public async Task<(IReadOnlyList Items, int TotalCount)> GetPagedAsync( + string? entityType, + Guid? entityId, + Guid? actorUserId, + AuditEventCategory? category, + DateTime? fromUtc, + DateTime? toUtc, + int page, + int pageSize, + CancellationToken cancellationToken = default) + { + var query = _db.AuditLogEntries.AsNoTracking().AsQueryable(); + + if (!string.IsNullOrWhiteSpace(entityType)) + { + query = query.Where(e => e.EntityType == entityType); + } + + if (entityId is not null) + { + query = query.Where(e => e.EntityId == entityId); + } + + if (actorUserId is not null) + { + query = query.Where(e => e.ActorUserId == actorUserId); + } + + if (category is not null) + { + query = query.Where(e => e.Category == category); + } + + if (fromUtc is not null) + { + query = query.Where(e => e.OccurredAtUtc >= fromUtc); + } + + if (toUtc is not null) + { + query = query.Where(e => e.OccurredAtUtc <= toUtc); + } + + var totalCount = await query.CountAsync(cancellationToken); + + var items = await query + .OrderByDescending(e => e.OccurredAtUtc) + .Skip((page - 1) * pageSize) + .Take(pageSize) + .ToListAsync(cancellationToken); + + return (items, totalCount); + } + + public Task SaveChangesAsync(CancellationToken cancellationToken = default) + => _db.SaveChangesAsync(cancellationToken); +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/ContractRepository.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/ContractRepository.cs new file mode 100644 index 0000000..ab7059f --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/ContractRepository.cs @@ -0,0 +1,77 @@ +using Microsoft.EntityFrameworkCore; +using OmsorgCore.Application.Abstractions; +using OmsorgCore.Domain.Entities; +using OmsorgCore.Infrastructure.Persistence; + +namespace OmsorgCore.Infrastructure.Repositories; + +public class ContractRepository : IContractRepository +{ + private readonly OmsorgCoreDbContext _db; + + public ContractRepository(OmsorgCoreDbContext db) + { + _db = db; + } + + public Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default) + => _db.Contracts.FirstOrDefaultAsync(c => c.Id == id, cancellationToken); + + public async Task> GetAllAsync(CancellationToken cancellationToken = default) + => await _db.Contracts.AsNoTracking().ToListAsync(cancellationToken); + + public async Task<(IReadOnlyList Items, int TotalCount)> GetPagedAsync( + string? search, + string? status, + Guid? employeeId, + Guid? facilityId, + int page, + int pageSize, + CancellationToken cancellationToken = default) + { + var query = _db.Contracts.AsNoTracking().Where(c => !c.IsDeleted); + + if (!string.IsNullOrWhiteSpace(search)) + { + var pattern = $"%{search.Trim()}%"; + query = query.Where(c => EF.Functions.ILike(c.ContractType, pattern)); + } + + if (!string.IsNullOrWhiteSpace(status)) + { + query = query.Where(c => c.Status == status); + } + + if (employeeId.HasValue) + { + query = query.Where(c => c.EmployeeId == employeeId.Value); + } + + if (facilityId.HasValue) + { + query = query.Where(c => c.FacilityId == facilityId.Value); + } + + var totalCount = await query.CountAsync(cancellationToken); + + var items = await query + .OrderBy(c => c.StartDate) + .Skip((page - 1) * pageSize) + .Take(pageSize) + .ToListAsync(cancellationToken); + + return (items, totalCount); + } + + public async Task AddAsync(Contract contract, CancellationToken cancellationToken = default) + => await _db.Contracts.AddAsync(contract, cancellationToken); + + public Task UpdateAsync(Contract contract, CancellationToken cancellationToken = default) + { + _db.Contracts.Update(contract); + return Task.CompletedTask; + } + + public Task SaveChangesAsync(CancellationToken cancellationToken = default) + => _db.SaveChangesAsync(cancellationToken); +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/FacilityContactRepository.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/FacilityContactRepository.cs new file mode 100644 index 0000000..153da6c --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/FacilityContactRepository.cs @@ -0,0 +1,38 @@ +using Microsoft.EntityFrameworkCore; +using OmsorgCore.Application.Abstractions; +using OmsorgCore.Domain.Entities; +using OmsorgCore.Infrastructure.Persistence; + +namespace OmsorgCore.Infrastructure.Repositories; + +public class FacilityContactRepository : IFacilityContactRepository +{ + private readonly OmsorgCoreDbContext _db; + + public FacilityContactRepository(OmsorgCoreDbContext db) + { + _db = db; + } + + public Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default) + => _db.FacilityContacts.FirstOrDefaultAsync(c => c.Id == id, cancellationToken); + + public async Task> GetByFacilityIdAsync(Guid facilityId, CancellationToken cancellationToken = default) + => await _db.FacilityContacts + .AsNoTracking() + .Where(c => c.FacilityId == facilityId) + .OrderBy(c => c.Name) + .ToListAsync(cancellationToken); + + public async Task AddAsync(FacilityContact contact, CancellationToken cancellationToken = default) + => await _db.FacilityContacts.AddAsync(contact, cancellationToken); + + public Task UpdateAsync(FacilityContact contact, CancellationToken cancellationToken = default) + { + _db.FacilityContacts.Update(contact); + return Task.CompletedTask; + } + + public Task SaveChangesAsync(CancellationToken cancellationToken = default) + => _db.SaveChangesAsync(cancellationToken); +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/FacilityRepository.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/FacilityRepository.cs new file mode 100644 index 0000000..489e42b --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/FacilityRepository.cs @@ -0,0 +1,65 @@ +using Microsoft.EntityFrameworkCore; +using OmsorgCore.Application.Abstractions; +using OmsorgCore.Domain.Entities; +using OmsorgCore.Infrastructure.Persistence; + +namespace OmsorgCore.Infrastructure.Repositories; + +public class FacilityRepository : IFacilityRepository +{ + private readonly OmsorgCoreDbContext _db; + + public FacilityRepository(OmsorgCoreDbContext db) + { + _db = db; + } + + public Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default) + => _db.Facilities.FirstOrDefaultAsync(f => f.Id == id, cancellationToken); + + public async Task> GetAllAsync(CancellationToken cancellationToken = default) + => await _db.Facilities.AsNoTracking().ToListAsync(cancellationToken); + + public async Task<(IReadOnlyList Items, int TotalCount)> GetPagedAsync( + string? search, + string? crmStatus, + int page, + int pageSize, + CancellationToken cancellationToken = default) + { + var query = _db.Facilities.AsNoTracking().Where(f => !f.IsDeleted); + + if (!string.IsNullOrWhiteSpace(search)) + { + var pattern = $"%{search.Trim()}%"; + query = query.Where(f => EF.Functions.ILike(f.Name, pattern)); + } + + if (!string.IsNullOrWhiteSpace(crmStatus)) + { + query = query.Where(f => f.CrmStatus == crmStatus); + } + + var totalCount = await query.CountAsync(cancellationToken); + + var items = await query + .OrderBy(f => f.Name) + .Skip((page - 1) * pageSize) + .Take(pageSize) + .ToListAsync(cancellationToken); + + return (items, totalCount); + } + + public async Task AddAsync(Facility facility, CancellationToken cancellationToken = default) + => await _db.Facilities.AddAsync(facility, cancellationToken); + + public Task UpdateAsync(Facility facility, CancellationToken cancellationToken = default) + { + _db.Facilities.Update(facility); + return Task.CompletedTask; + } + + public Task SaveChangesAsync(CancellationToken cancellationToken = default) + => _db.SaveChangesAsync(cancellationToken); +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/OrderRepository.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/OrderRepository.cs new file mode 100644 index 0000000..4c82a42 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/OrderRepository.cs @@ -0,0 +1,71 @@ +using Microsoft.EntityFrameworkCore; +using OmsorgCore.Application.Abstractions; +using OmsorgCore.Domain.Entities; +using OmsorgCore.Infrastructure.Persistence; + +namespace OmsorgCore.Infrastructure.Repositories; + +public class OrderRepository : IOrderRepository +{ + private readonly OmsorgCoreDbContext _db; + + public OrderRepository(OmsorgCoreDbContext db) + { + _db = db; + } + + public Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default) + => _db.Orders.Include(o => o.Status).FirstOrDefaultAsync(o => o.Id == id, cancellationToken); + + public async Task> GetAllAsync(CancellationToken cancellationToken = default) + => await _db.Orders.AsNoTracking().Include(o => o.Status).ToListAsync(cancellationToken); + + public async Task<(IReadOnlyList Items, int TotalCount)> GetPagedAsync( + string? search, + Guid? statusId, + Guid? facilityId, + int page, + int pageSize, + CancellationToken cancellationToken = default) + { + var query = _db.Orders.AsNoTracking().Include(o => o.Status).Where(o => !o.IsDeleted); + + if (!string.IsNullOrWhiteSpace(search)) + { + var pattern = $"%{search.Trim()}%"; + query = query.Where(o => o.RequiredQualification != null && EF.Functions.ILike(o.RequiredQualification, pattern)); + } + + if (statusId.HasValue) + { + query = query.Where(o => o.StatusId == statusId.Value); + } + + if (facilityId.HasValue) + { + query = query.Where(o => o.FacilityId == facilityId.Value); + } + + var totalCount = await query.CountAsync(cancellationToken); + + var items = await query + .OrderBy(o => o.StartDate) + .Skip((page - 1) * pageSize) + .Take(pageSize) + .ToListAsync(cancellationToken); + + return (items, totalCount); + } + + public async Task AddAsync(Order order, CancellationToken cancellationToken = default) + => await _db.Orders.AddAsync(order, cancellationToken); + + public Task UpdateAsync(Order order, CancellationToken cancellationToken = default) + { + _db.Orders.Update(order); + return Task.CompletedTask; + } + + public Task SaveChangesAsync(CancellationToken cancellationToken = default) + => _db.SaveChangesAsync(cancellationToken); +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/OrderStatusValueListUsageChecker.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/OrderStatusValueListUsageChecker.cs new file mode 100644 index 0000000..3257b0c --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/OrderStatusValueListUsageChecker.cs @@ -0,0 +1,37 @@ +using Microsoft.EntityFrameworkCore; +using OmsorgCore.Application.Abstractions; +using OmsorgCore.Infrastructure.Persistence; + +namespace OmsorgCore.Infrastructure.Repositories; + +/// +/// Verwendungsprüfung für die Liste "OrderStatus" — anders als die übrigen Listen wird dieser Wert +/// über eine echte Fremdschlüsselbeziehung referenziert (Order.StatusId), zusätzlich können +/// Übergangsregeln (ValueListItemTransition) auf den Status verweisen. +/// +public class OrderStatusValueListUsageChecker : IValueListUsageChecker +{ + private readonly OmsorgCoreDbContext _db; + + public string Key => "OrderStatus"; + + public OrderStatusValueListUsageChecker(OmsorgCoreDbContext db) + { + _db = db; + } + + public async Task> FindUsagesAsync(Guid itemId, string itemValue, CancellationToken cancellationToken = default) + { + var orderUsages = await _db.Orders.AsNoTracking() + .Where(o => o.StatusId == itemId) + .Select(o => new ValueListUsageEntry("Order", o.Id, $"Auftrag {o.Id} ({o.Facility.Name})")) + .ToListAsync(cancellationToken); + + var transitionUsages = await _db.ValueListItemTransitions.AsNoTracking() + .Where(t => t.FromItemId == itemId || t.ToItemId == itemId) + .Select(t => new ValueListUsageEntry("OrderStatusTransition", t.Id, $"Übergang {t.FromItem.Value} → {t.ToItem.Value}")) + .ToListAsync(cancellationToken); + + return orderUsages.Concat(transitionUsages).ToList(); + } +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/RoleRepository.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/RoleRepository.cs index c26f593..ab47931 100644 --- a/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/RoleRepository.cs +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/RoleRepository.cs @@ -20,6 +20,14 @@ public class RoleRepository : IRoleRepository public Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default) => _db.Roles.FirstOrDefaultAsync(r => r.Id == id, cancellationToken); + public Task GetByIdWithPermissionsAsync(Guid id, CancellationToken cancellationToken = default) + => _db.Roles + .Include(r => r.RolePermissions) + .FirstOrDefaultAsync(r => r.Id == id, cancellationToken); + + public async Task AddPermissionRangeAsync(IEnumerable permissions, CancellationToken cancellationToken = default) + => await _db.RolePermissions.AddRangeAsync(permissions, cancellationToken); + public Task ExistsByNameAsync(string name, CancellationToken cancellationToken = default) => _db.Roles.AnyAsync(r => r.Name == name, cancellationToken); diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/StringFieldValueListUsageChecker.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/StringFieldValueListUsageChecker.cs new file mode 100644 index 0000000..c8f6446 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/StringFieldValueListUsageChecker.cs @@ -0,0 +1,32 @@ +using OmsorgCore.Application.Abstractions; +using OmsorgCore.Infrastructure.Persistence; + +namespace OmsorgCore.Infrastructure.Repositories; + +/// +/// Generische Verwendungsprüfung für die Listen, deren Wert als einfaches String-Feld auf einer +/// anderen Entität gespeichert ist (Employee.Status/EmploymentType, Facility.CrmStatus/FacilityType, +/// Contract.ContractType/Status) — die Abfrage ist bei allen identisch ("wer hat dieses Feld == diesem +/// Wert"), nur Tabelle/Feld/Anzeige-Label unterscheiden sich, daher eine Klasse statt sechs fast +/// identischer Dateien. Für OrderStatus (FK statt String) siehe . +/// +public class StringFieldValueListUsageChecker : IValueListUsageChecker +{ + private readonly OmsorgCoreDbContext _db; + private readonly Func>> _query; + + public string Key { get; } + + public StringFieldValueListUsageChecker( + OmsorgCoreDbContext db, + string key, + Func>> query) + { + _db = db; + Key = key; + _query = query; + } + + public async Task> FindUsagesAsync(Guid itemId, string itemValue, CancellationToken cancellationToken = default) + => await _query(_db, itemValue, cancellationToken); +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/UserRepository.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/UserRepository.cs index c3555ac..0df7764 100644 --- a/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/UserRepository.cs +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/UserRepository.cs @@ -49,6 +49,9 @@ public class UserRepository : IUserRepository public async Task AddAsync(User user, CancellationToken cancellationToken = default) => await _db.Users.AddAsync(user, cancellationToken); + public async Task AddPermissionOverrideAsync(UserPermissionOverride @override, CancellationToken cancellationToken = default) + => await _db.UserPermissionOverrides.AddAsync(@override, cancellationToken); + public Task SaveChangesAsync(CancellationToken cancellationToken = default) => _db.SaveChangesAsync(cancellationToken); } diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/ValueListRepository.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/ValueListRepository.cs new file mode 100644 index 0000000..a5d8d67 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Repositories/ValueListRepository.cs @@ -0,0 +1,88 @@ +using Microsoft.EntityFrameworkCore; +using OmsorgCore.Application.Abstractions; +using OmsorgCore.Domain.Entities; +using OmsorgCore.Infrastructure.Persistence; + +namespace OmsorgCore.Infrastructure.Repositories; + +public class ValueListRepository : IValueListRepository +{ + private readonly OmsorgCoreDbContext _db; + + public ValueListRepository(OmsorgCoreDbContext db) + { + _db = db; + } + + public async Task> GetAllListsAsync(CancellationToken cancellationToken = default) + => await _db.ValueLists.AsNoTracking().OrderBy(l => l.DisplayName).ToListAsync(cancellationToken); + + public Task GetListByKeyAsync(string key, CancellationToken cancellationToken = default) + => _db.ValueLists.AsNoTracking().FirstOrDefaultAsync(l => l.Key == key, cancellationToken); + + public async Task> GetItemsAsync(string key, CancellationToken cancellationToken = default) + => await _db.ValueListItems.AsNoTracking() + .Where(i => i.ValueList.Key == key) + .OrderBy(i => i.SortOrder) + .ToListAsync(cancellationToken); + + public async Task> GetActiveValuesAsync(string key, CancellationToken cancellationToken = default) + => await _db.ValueListItems.AsNoTracking() + .Where(i => i.ValueList.Key == key) + .OrderBy(i => i.SortOrder) + .Select(i => i.Value) + .ToListAsync(cancellationToken); + + public Task GetItemByIdAsync(Guid id, CancellationToken cancellationToken = default) + => _db.ValueListItems.Include(i => i.ValueList).FirstOrDefaultAsync(i => i.Id == id, cancellationToken); + + public Task GetInitialItemAsync(string key, CancellationToken cancellationToken = default) + => _db.ValueListItems.AsNoTracking().FirstOrDefaultAsync(i => i.ValueList.Key == key && i.IsInitial, cancellationToken); + + public async Task AddItemAsync(ValueListItem item, CancellationToken cancellationToken = default) + => await _db.ValueListItems.AddAsync(item, cancellationToken); + + public Task UpdateItemAsync(ValueListItem item, CancellationToken cancellationToken = default) + { + _db.ValueListItems.Update(item); + return Task.CompletedTask; + } + + public Task RemoveItemAsync(ValueListItem item, CancellationToken cancellationToken = default) + { + _db.ValueListItems.Remove(item); + return Task.CompletedTask; + } + + public async Task CanTransitionAsync(Guid fromItemId, Guid toItemId, CancellationToken cancellationToken = default) + { + if (fromItemId == toItemId) + { + return true; + } + + return await _db.ValueListItemTransitions.AsNoTracking() + .AnyAsync(t => t.FromItemId == fromItemId && t.ToItemId == toItemId, cancellationToken); + } + + public async Task> GetTransitionsAsync(string key, CancellationToken cancellationToken = default) + => await _db.ValueListItemTransitions.AsNoTracking() + .Where(t => t.FromItem.ValueList.Key == key) + .ToListAsync(cancellationToken); + + public async Task ReplaceTransitionsAsync(string key, IEnumerable<(Guid FromItemId, Guid ToItemId)> transitions, CancellationToken cancellationToken = default) + { + var existing = await _db.ValueListItemTransitions + .Where(t => t.FromItem.ValueList.Key == key) + .ToListAsync(cancellationToken); + _db.ValueListItemTransitions.RemoveRange(existing); + + foreach (var (fromItemId, toItemId) in transitions) + { + _db.ValueListItemTransitions.Add(new ValueListItemTransition { FromItemId = fromItemId, ToItemId = toItemId }); + } + } + + public Task SaveChangesAsync(CancellationToken cancellationToken = default) + => _db.SaveChangesAsync(cancellationToken); +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Security/PasswordPolicy.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Security/PasswordPolicy.cs new file mode 100644 index 0000000..8598f37 --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Security/PasswordPolicy.cs @@ -0,0 +1,18 @@ +using Microsoft.Extensions.Options; +using OmsorgCore.Application.Abstractions; + +namespace OmsorgCore.Infrastructure.Security; + +public class PasswordPolicy : IPasswordPolicy +{ + private readonly PasswordPolicyOptions _options; + + public PasswordPolicy(IOptions options) + { + _options = options.Value; + } + + public int MinLength => _options.MinLength; + + public bool IsValid(string? password) => !string.IsNullOrEmpty(password) && password.Length >= MinLength; +} diff --git a/omsorgCore/src/OmsorgCore.Infrastructure/Security/PasswordPolicyOptions.cs b/omsorgCore/src/OmsorgCore.Infrastructure/Security/PasswordPolicyOptions.cs new file mode 100644 index 0000000..04f928c --- /dev/null +++ b/omsorgCore/src/OmsorgCore.Infrastructure/Security/PasswordPolicyOptions.cs @@ -0,0 +1,13 @@ +namespace OmsorgCore.Infrastructure.Security; + +/// +/// Gebunden an den "PasswordPolicy"-Abschnitt in appsettings.json. Eine einzige, zentral +/// änderbare Mindestlänge für alle Stellen, an denen ein User ein Passwort setzt (siehe +/// IPasswordPolicy) - per Umgebungsvariable (PasswordPolicy__MinLength) überschreibbar. +/// +public class PasswordPolicyOptions +{ + public const string SectionName = "PasswordPolicy"; + + public int MinLength { get; set; } = 8; +} diff --git a/omsorgCore/tests/OmsorgCore.Tests/Engine/AuditEventHandlerTests.cs b/omsorgCore/tests/OmsorgCore.Tests/Engine/AuditEventHandlerTests.cs new file mode 100644 index 0000000..b1c5132 --- /dev/null +++ b/omsorgCore/tests/OmsorgCore.Tests/Engine/AuditEventHandlerTests.cs @@ -0,0 +1,31 @@ +using OmsorgCore.Domain.Enums; +using OmsorgCore.Engine.Events; +using OmsorgCore.Engine.Handlers; +using OmsorgCore.Tests.TestDoubles; + +namespace OmsorgCore.Tests.Engine; + +public class AuditEventHandlerTests +{ + [Fact] + public async Task HandleAsync_PersistsAuditEventAsBehavioralEntry() + { + var repository = new FakeAuditLogRepository(); + var sut = new AuditEventHandler(repository); + var userId = Guid.NewGuid(); + + var domainEvent = new AuditEvent(userId, "sabina", "127.0.0.1", "Login", "{\"foo\":\"bar\"}"); + + await sut.HandleAsync(domainEvent); + + var entry = Assert.Single(repository.Entries); + Assert.Equal(AuditEventCategory.BehavioralEvent, entry.Category); + Assert.Equal(userId, entry.ActorUserId); + Assert.Equal("sabina", entry.ActorUsername); + Assert.Equal("127.0.0.1", entry.IpAddress); + Assert.Equal("Login", entry.Action); + Assert.Equal("{\"foo\":\"bar\"}", entry.Details); + Assert.Null(entry.EntityType); + Assert.Null(entry.EntityId); + } +} diff --git a/omsorgCore/tests/OmsorgCore.Tests/OmsorgCore.Tests.csproj b/omsorgCore/tests/OmsorgCore.Tests/OmsorgCore.Tests.csproj index 598cd47..a36e153 100644 --- a/omsorgCore/tests/OmsorgCore.Tests/OmsorgCore.Tests.csproj +++ b/omsorgCore/tests/OmsorgCore.Tests/OmsorgCore.Tests.csproj @@ -20,12 +20,15 @@ runtime; build; native; contentfiles; analyzers; buildtransitive all + + + diff --git a/omsorgCore/tests/OmsorgCore.Tests/Persistence/AuditSaveChangesInterceptorTests.cs b/omsorgCore/tests/OmsorgCore.Tests/Persistence/AuditSaveChangesInterceptorTests.cs new file mode 100644 index 0000000..9cdcc0d --- /dev/null +++ b/omsorgCore/tests/OmsorgCore.Tests/Persistence/AuditSaveChangesInterceptorTests.cs @@ -0,0 +1,124 @@ +using Microsoft.EntityFrameworkCore; +using OmsorgCore.Application.Abstractions; +using OmsorgCore.Domain.Entities; +using OmsorgCore.Infrastructure.Persistence; + +namespace OmsorgCore.Tests.Persistence; + +public class AuditSaveChangesInterceptorTests +{ + private class FakeCurrentUserService : ICurrentUserService + { + public Guid? UserId { get; set; } + public bool IsAuthenticated { get; set; } + public string? Username { get; set; } + public string? RoleName { get; set; } + public string? IpAddress { get; set; } + } + + private static OmsorgCoreDbContext CreateContext(ICurrentUserService currentUserService) + { + var options = new DbContextOptionsBuilder() + .UseInMemoryDatabase(Guid.NewGuid().ToString()) + .AddInterceptors(new AuditSaveChangesInterceptor(currentUserService)) + .Options; + + return new OmsorgCoreDbContext(options); + } + + private static Employee CreateEmployee() => new() + { + FirstName = "Anna", + LastName = "Muster", + Status = "active", + EmploymentType = "fulltime" + }; + + [Fact] + public async Task SaveChanges_OnAdd_CreatesAuditEntryWithActor() + { + var currentUser = new FakeCurrentUserService { IsAuthenticated = true, UserId = Guid.NewGuid(), Username = "sabina" }; + await using var db = CreateContext(currentUser); + + var employee = CreateEmployee(); + db.Employees.Add(employee); + await db.SaveChangesAsync(); + + var entry = Assert.Single(db.AuditLogEntries.Local); + Assert.Equal("Created", entry.Action); + Assert.Equal(nameof(Employee), entry.EntityType); + Assert.Equal(employee.Id, entry.EntityId); + Assert.Equal(currentUser.UserId, entry.ActorUserId); + Assert.Equal("sabina", entry.ActorUsername); + Assert.Contains("Anna", entry.Details); + } + + [Fact] + public async Task SaveChanges_OnFieldUpdate_CapturesOnlyChangedFieldsAsDiff() + { + var currentUser = new FakeCurrentUserService { IsAuthenticated = true, UserId = Guid.NewGuid(), Username = "sabina" }; + await using var db = CreateContext(currentUser); + + var employee = CreateEmployee(); + db.Employees.Add(employee); + await db.SaveChangesAsync(); + db.AuditLogEntries.RemoveRange(db.AuditLogEntries.Local); + + employee.LastName = "Neu"; + await db.SaveChangesAsync(); + + var entry = Assert.Single(db.AuditLogEntries.Local); + Assert.Equal("Updated", entry.Action); + Assert.Contains("LastName", entry.Details); + Assert.DoesNotContain("FirstName", entry.Details); + } + + [Fact] + public async Task SaveChanges_OnSoftDelete_IsCapturedAsDeletedAction() + { + var currentUser = new FakeCurrentUserService { IsAuthenticated = true, UserId = Guid.NewGuid(), Username = "sabina" }; + await using var db = CreateContext(currentUser); + + var employee = CreateEmployee(); + db.Employees.Add(employee); + await db.SaveChangesAsync(); + db.AuditLogEntries.RemoveRange(db.AuditLogEntries.Local); + + employee.IsDeleted = true; + await db.SaveChangesAsync(); + + var entry = Assert.Single(db.AuditLogEntries.Local); + Assert.Equal("Deleted", entry.Action); + } + + [Fact] + public async Task SaveChanges_OnRedactedField_ReplacesValueWithPlaceholder() + { + var currentUser = new FakeCurrentUserService { IsAuthenticated = true, UserId = Guid.NewGuid(), Username = "admin" }; + await using var db = CreateContext(currentUser); + + var role = new Role { Name = "Administrator" }; + var user = new User { Username = "admin", PasswordHash = "super-secret-hash", Role = role, RoleId = role.Id }; + db.Roles.Add(role); + db.Users.Add(user); + await db.SaveChangesAsync(); + + var entry = Assert.Single(db.AuditLogEntries.Local.Where(e => e.EntityType == nameof(User))); + Assert.DoesNotContain("super-secret-hash", entry.Details); + Assert.Contains("***redacted***", entry.Details); + } + + [Fact] + public async Task SaveChanges_WithoutAuthenticatedActor_LeavesActorFieldsNull() + { + var currentUser = new FakeCurrentUserService { IsAuthenticated = false }; + await using var db = CreateContext(currentUser); + + db.Employees.Add(CreateEmployee()); + await db.SaveChangesAsync(); + + var entry = Assert.Single(db.AuditLogEntries.Local); + Assert.Null(entry.ActorUserId); + Assert.Null(entry.ActorUsername); + } +} diff --git a/omsorgCore/tests/OmsorgCore.Tests/Services/AuthServiceTests.cs b/omsorgCore/tests/OmsorgCore.Tests/Services/AuthServiceTests.cs index 5d99c13..0e2f812 100644 --- a/omsorgCore/tests/OmsorgCore.Tests/Services/AuthServiceTests.cs +++ b/omsorgCore/tests/OmsorgCore.Tests/Services/AuthServiceTests.cs @@ -48,6 +48,8 @@ public class AuthServiceTests Assert.False(string.IsNullOrEmpty(result.Token)); Assert.False(string.IsNullOrEmpty(result.RefreshToken)); Assert.NotNull(result.ExpiresAt); + Assert.Equal(user.Id, result.UserId); + Assert.Equal(user.Username, result.Username); } [Fact] diff --git a/omsorgCore/tests/OmsorgCore.Tests/Services/ContractServiceTests.cs b/omsorgCore/tests/OmsorgCore.Tests/Services/ContractServiceTests.cs new file mode 100644 index 0000000..e2918f2 --- /dev/null +++ b/omsorgCore/tests/OmsorgCore.Tests/Services/ContractServiceTests.cs @@ -0,0 +1,144 @@ +using OmsorgCore.Application.Services; +using OmsorgCore.Domain.Entities; +using OmsorgCore.Tests.TestDoubles; + +namespace OmsorgCore.Tests.Services; + +public class ContractServiceTests +{ + [Fact] + public async Task CreateAsync_PersistsAllFields() + { + var repository = new FakeContractRepository(); + var sut = new ContractService(repository); + var employeeId = Guid.NewGuid(); + + var contract = new Contract + { + ContractType = "Arbeitsvertrag", + EmployeeId = employeeId, + StartDate = new DateOnly(2026, 1, 1), + EndDate = new DateOnly(2026, 12, 31), + WeeklyHours = 38.5m, + HourlyWage = 21.75m, + AllowancesDescription = "Nachtzuschlag 25%", + OvertimeRules = "Abgeltung über Freizeitausgleich", + VacationDaysPerYear = 28, + ProbationPeriodMonths = 6 + }; + + var created = await sut.CreateAsync(contract); + var stored = await sut.GetByIdAsync(created.Id); + + Assert.NotNull(stored); + Assert.Equal("Arbeitsvertrag", stored!.ContractType); + Assert.Equal(employeeId, stored.EmployeeId); + Assert.Equal(new DateOnly(2026, 1, 1), stored.StartDate); + Assert.Equal(new DateOnly(2026, 12, 31), stored.EndDate); + Assert.Equal(38.5m, stored.WeeklyHours); + Assert.Equal(21.75m, stored.HourlyWage); + Assert.Equal("Nachtzuschlag 25%", stored.AllowancesDescription); + Assert.Equal("Abgeltung über Freizeitausgleich", stored.OvertimeRules); + Assert.Equal(28, stored.VacationDaysPerYear); + Assert.Equal(6, stored.ProbationPeriodMonths); + Assert.Equal("Entwurf", stored.Status); + } + + [Fact] + public async Task GetAllAsync_ReturnsCreatedContracts() + { + var repository = new FakeContractRepository(); + var sut = new ContractService(repository); + + await sut.CreateAsync(new Contract { ContractType = "Rahmenvertrag", FacilityId = Guid.NewGuid(), StartDate = new DateOnly(2026, 1, 1) }); + + var all = await sut.GetAllAsync(); + + Assert.Single(all); + } + + [Fact] + public async Task UpdateAsync_UpdatesAllMutableFields_AndReturnsUpdatedContract() + { + var repository = new FakeContractRepository(); + var sut = new ContractService(repository); + var employeeId = Guid.NewGuid(); + var created = await sut.CreateAsync(new Contract + { + ContractType = "Arbeitsvertrag", + EmployeeId = employeeId, + StartDate = new DateOnly(2026, 1, 1) + }); + + var updates = new Contract + { + ContractType = "Arbeitsvertrag", + EmployeeId = employeeId, + StartDate = new DateOnly(2026, 1, 1), + EndDate = new DateOnly(2026, 6, 30), + Status = "Aktiv", + WeeklyHours = 40m, + HourlyWage = 22.5m, + VacationDaysPerYear = 30, + ProbationPeriodMonths = 3 + }; + + var updated = await sut.UpdateAsync(created.Id, updates); + + Assert.NotNull(updated); + Assert.Equal("Aktiv", updated!.Status); + Assert.Equal(new DateOnly(2026, 6, 30), updated.EndDate); + Assert.Equal(40m, updated.WeeklyHours); + Assert.Equal(22.5m, updated.HourlyWage); + Assert.Equal(30, updated.VacationDaysPerYear); + Assert.Equal(3, updated.ProbationPeriodMonths); + Assert.NotNull(updated.UpdatedAt); + } + + [Fact] + public async Task UpdateAsync_UnknownId_ReturnsNull() + { + var repository = new FakeContractRepository(); + var sut = new ContractService(repository); + + var updated = await sut.UpdateAsync(Guid.NewGuid(), new Contract { ContractType = "X", StartDate = new DateOnly(2026, 1, 1) }); + + Assert.Null(updated); + } + + [Fact] + public async Task GetPagedAsync_FiltersByStatusEmployeeAndFacility_AndPaginates() + { + var repository = new FakeContractRepository(); + var sut = new ContractService(repository); + var employeeA = Guid.NewGuid(); + var employeeB = Guid.NewGuid(); + var facility = Guid.NewGuid(); + + await sut.CreateAsync(new Contract { ContractType = "Arbeitsvertrag", EmployeeId = employeeA, StartDate = new DateOnly(2026, 1, 1), Status = "Aktiv" }); + await sut.CreateAsync(new Contract { ContractType = "Arbeitsvertrag", EmployeeId = employeeB, StartDate = new DateOnly(2026, 2, 1), Status = "Aktiv" }); + await sut.CreateAsync(new Contract { ContractType = "Rahmenvertrag", FacilityId = facility, StartDate = new DateOnly(2026, 3, 1), Status = "Entwurf" }); + + var (items, totalCount) = await sut.GetPagedAsync(search: null, status: "Aktiv", employeeId: employeeA, facilityId: null, page: 1, pageSize: 10); + + Assert.Equal(1, totalCount); + Assert.Single(items); + Assert.Equal(employeeA, items[0].EmployeeId); + } + + [Fact] + public async Task GetPagedAsync_PaginatesResults() + { + var repository = new FakeContractRepository(); + var sut = new ContractService(repository); + + await sut.CreateAsync(new Contract { ContractType = "A", StartDate = new DateOnly(2026, 1, 1), EmployeeId = Guid.NewGuid() }); + await sut.CreateAsync(new Contract { ContractType = "B", StartDate = new DateOnly(2026, 2, 1), EmployeeId = Guid.NewGuid() }); + await sut.CreateAsync(new Contract { ContractType = "C", StartDate = new DateOnly(2026, 3, 1), EmployeeId = Guid.NewGuid() }); + + var (items, totalCount) = await sut.GetPagedAsync(search: null, status: null, employeeId: null, facilityId: null, page: 2, pageSize: 2); + + Assert.Equal(3, totalCount); + Assert.Single(items); + } +} diff --git a/omsorgCore/tests/OmsorgCore.Tests/Services/FacilityContactServiceTests.cs b/omsorgCore/tests/OmsorgCore.Tests/Services/FacilityContactServiceTests.cs new file mode 100644 index 0000000..39fa429 --- /dev/null +++ b/omsorgCore/tests/OmsorgCore.Tests/Services/FacilityContactServiceTests.cs @@ -0,0 +1,88 @@ +using OmsorgCore.Application.Services; +using OmsorgCore.Domain.Entities; +using OmsorgCore.Tests.TestDoubles; + +namespace OmsorgCore.Tests.Services; + +public class FacilityContactServiceTests +{ + [Fact] + public async Task CreateAsync_PersistsAllFields() + { + var repository = new FakeFacilityContactRepository(); + var sut = new FacilityContactService(repository); + var facilityId = Guid.NewGuid(); + + var contact = new FacilityContact + { + FacilityId = facilityId, + Name = "Frau Müller", + Role = "Pflegedienstleitung", + Department = "Pflege", + PhoneNumber = "0123 456789", + Email = "mueller@pflegeheim-musterstadt.de", + Notes = "Bevorzugt Kontakt per E-Mail." + }; + + var created = await sut.CreateAsync(contact); + + Assert.Equal("Frau Müller", created.Name); + Assert.Equal("Pflegedienstleitung", created.Role); + Assert.Equal(facilityId, created.FacilityId); + } + + [Fact] + public async Task GetByFacilityIdAsync_ReturnsOnlyContactsOfThatFacility() + { + var repository = new FakeFacilityContactRepository(); + var sut = new FacilityContactService(repository); + var facilityIdA = Guid.NewGuid(); + var facilityIdB = Guid.NewGuid(); + + await sut.CreateAsync(new FacilityContact { FacilityId = facilityIdA, Name = "Kontakt A1" }); + await sut.CreateAsync(new FacilityContact { FacilityId = facilityIdA, Name = "Kontakt A2" }); + await sut.CreateAsync(new FacilityContact { FacilityId = facilityIdB, Name = "Kontakt B1" }); + + var contactsForA = await sut.GetByFacilityIdAsync(facilityIdA); + + Assert.Equal(2, contactsForA.Count); + Assert.All(contactsForA, c => Assert.Equal(facilityIdA, c.FacilityId)); + } + + [Fact] + public async Task UpdateAsync_UpdatesAllMutableFields_AndReturnsUpdatedContact() + { + var repository = new FakeFacilityContactRepository(); + var sut = new FacilityContactService(repository); + var created = await sut.CreateAsync(new FacilityContact { FacilityId = Guid.NewGuid(), Name = "Frau Müller" }); + + var updates = new FacilityContact + { + Name = "Frau Müller-Schmidt", + Role = "Heimleitung", + Department = "Verwaltung", + PhoneNumber = "0170 1111111", + Email = "mueller-schmidt@pflegeheim-musterstadt.de", + Notes = "Neue Position seit 2026." + }; + + var updated = await sut.UpdateAsync(created.Id, updates); + + Assert.NotNull(updated); + Assert.Equal("Frau Müller-Schmidt", updated!.Name); + Assert.Equal("Heimleitung", updated.Role); + Assert.Equal("Verwaltung", updated.Department); + Assert.NotNull(updated.UpdatedAt); + } + + [Fact] + public async Task UpdateAsync_UnknownId_ReturnsNull() + { + var repository = new FakeFacilityContactRepository(); + var sut = new FacilityContactService(repository); + + var updated = await sut.UpdateAsync(Guid.NewGuid(), new FacilityContact { Name = "X" }); + + Assert.Null(updated); + } +} diff --git a/omsorgCore/tests/OmsorgCore.Tests/Services/FacilityServiceTests.cs b/omsorgCore/tests/OmsorgCore.Tests/Services/FacilityServiceTests.cs new file mode 100644 index 0000000..be9d232 --- /dev/null +++ b/omsorgCore/tests/OmsorgCore.Tests/Services/FacilityServiceTests.cs @@ -0,0 +1,130 @@ +using OmsorgCore.Application.Services; +using OmsorgCore.Domain.Entities; +using OmsorgCore.Tests.TestDoubles; + +namespace OmsorgCore.Tests.Services; + +public class FacilityServiceTests +{ + [Fact] + public async Task CreateAsync_PersistsAllStammdatenFields() + { + var repository = new FakeFacilityRepository(); + var sut = new FacilityService(repository); + + var facility = new Facility + { + Name = "Pflegeheim Musterstadt", + FacilityType = "Pflegeheim", + Street = "Musterstraße 1", + PostalCode = "12345", + City = "Musterstadt", + Country = "Deutschland", + BillingStreet = "Zentrale Buchhaltung 9", + BillingPostalCode = "54321", + BillingCity = "Neustadt", + BillingCountry = "Deutschland" + }; + + var created = await sut.CreateAsync(facility); + var stored = await sut.GetByIdAsync(created.Id); + + Assert.NotNull(stored); + Assert.Equal("Pflegeheim Musterstadt", stored!.Name); + Assert.Equal("Pflegeheim", stored.FacilityType); + Assert.Equal("Musterstraße 1", stored.Street); + Assert.Equal("12345", stored.PostalCode); + Assert.Equal("Musterstadt", stored.City); + Assert.Equal("Zentrale Buchhaltung 9", stored.BillingStreet); + Assert.Equal("54321", stored.BillingPostalCode); + Assert.Equal("Neustadt", stored.BillingCity); + Assert.Equal("Lead", stored.CrmStatus); + } + + [Fact] + public async Task GetAllAsync_ReturnsCreatedFacilities() + { + var repository = new FakeFacilityRepository(); + var sut = new FacilityService(repository); + + await sut.CreateAsync(new Facility { Name = "Sozialstation Nord" }); + + var all = await sut.GetAllAsync(); + + Assert.Single(all); + } + + [Fact] + public async Task UpdateAsync_UpdatesAllMutableFields_AndReturnsUpdatedFacility() + { + var repository = new FakeFacilityRepository(); + var sut = new FacilityService(repository); + var created = await sut.CreateAsync(new Facility { Name = "Pflegeheim Musterstadt" }); + + var updates = new Facility + { + Name = "Pflegeheim Musterstadt GmbH", + CrmStatus = "Kunde", + FacilityType = "Pflegeheim", + Street = "Neue Straße 2", + PostalCode = "54321", + City = "Neustadt", + BillingStreet = "Rechnungsstraße 3", + BillingPostalCode = "54321", + BillingCity = "Neustadt" + }; + + var updated = await sut.UpdateAsync(created.Id, updates); + + Assert.NotNull(updated); + Assert.Equal("Pflegeheim Musterstadt GmbH", updated!.Name); + Assert.Equal("Kunde", updated.CrmStatus); + Assert.Equal("Neue Straße 2", updated.Street); + Assert.Equal("Rechnungsstraße 3", updated.BillingStreet); + Assert.NotNull(updated.UpdatedAt); + } + + [Fact] + public async Task UpdateAsync_UnknownId_ReturnsNull() + { + var repository = new FakeFacilityRepository(); + var sut = new FacilityService(repository); + + var updated = await sut.UpdateAsync(Guid.NewGuid(), new Facility { Name = "X" }); + + Assert.Null(updated); + } + + [Fact] + public async Task GetPagedAsync_FiltersBySearchAndCrmStatus_AndPaginates() + { + var repository = new FakeFacilityRepository(); + var sut = new FacilityService(repository); + + await sut.CreateAsync(new Facility { Name = "Anna-Haus", CrmStatus = "Kunde" }); + await sut.CreateAsync(new Facility { Name = "Bernd-Zentrum", CrmStatus = "Lead" }); + await sut.CreateAsync(new Facility { Name = "Anna-Zentrum", CrmStatus = "Lead" }); + + var (items, totalCount) = await sut.GetPagedAsync(search: "anna", crmStatus: "Kunde", page: 1, pageSize: 10); + + Assert.Equal(1, totalCount); + Assert.Single(items); + Assert.Equal("Anna-Haus", items[0].Name); + } + + [Fact] + public async Task GetPagedAsync_PaginatesResults() + { + var repository = new FakeFacilityRepository(); + var sut = new FacilityService(repository); + + await sut.CreateAsync(new Facility { Name = "Eins" }); + await sut.CreateAsync(new Facility { Name = "Zwei" }); + await sut.CreateAsync(new Facility { Name = "Drei" }); + + var (items, totalCount) = await sut.GetPagedAsync(search: null, crmStatus: null, page: 2, pageSize: 2); + + Assert.Equal(3, totalCount); + Assert.Single(items); + } +} diff --git a/omsorgCore/tests/OmsorgCore.Tests/Services/OrderServiceTests.cs b/omsorgCore/tests/OmsorgCore.Tests/Services/OrderServiceTests.cs new file mode 100644 index 0000000..4514fef --- /dev/null +++ b/omsorgCore/tests/OmsorgCore.Tests/Services/OrderServiceTests.cs @@ -0,0 +1,179 @@ +using OmsorgCore.Application.Services; +using OmsorgCore.Domain.Entities; +using OmsorgCore.Tests.TestDoubles; + +namespace OmsorgCore.Tests.Services; + +public class OrderServiceTests +{ + private static (FakeOrderRepository Orders, FakeValueListRepository Statuses, OrderService Sut, ValueListItem Anfrage, ValueListItem Pruefung, ValueListItem Aktiv, ValueListItem Storniert) CreateSut() + { + var orders = new FakeOrderRepository(); + var statuses = new FakeValueListRepository(); + + var anfrage = statuses.AddStatus("Anfrage", isInitial: true); + var pruefung = statuses.AddStatus("Prüfung"); + var aktiv = statuses.AddStatus("aktiv"); + var storniert = statuses.AddStatus("storniert", isTerminal: true); + + statuses.AllowTransition(anfrage.Id, pruefung.Id); + statuses.AllowTransition(anfrage.Id, storniert.Id); + statuses.AllowTransition(pruefung.Id, storniert.Id); + statuses.AllowTransition(aktiv.Id, storniert.Id); + + var sut = new OrderService(orders, statuses); + return (orders, statuses, sut, anfrage, pruefung, aktiv, storniert); + } + + [Fact] + public async Task CreateAsync_SetsInitialStatus_AndPersistsAllFields() + { + var (_, _, sut, anfrage, _, _, _) = CreateSut(); + var facilityId = Guid.NewGuid(); + var contactId = Guid.NewGuid(); + + var order = new Order + { + FacilityId = facilityId, + FacilityContactId = contactId, + StartDate = new DateOnly(2026, 1, 1), + EndDate = new DateOnly(2026, 3, 1), + RequiredQualification = "Pflegefachkraft", + ShiftType = "Nachtdienst", + RequiredHeadcount = 3, + Conditions = "Zuschlag 15%", + Priority = "Hoch" + }; + + var created = await sut.CreateAsync(order); + var stored = await sut.GetByIdAsync(created.Id); + + Assert.NotNull(stored); + Assert.Equal(anfrage.Id, stored!.StatusId); + Assert.Equal(facilityId, stored.FacilityId); + Assert.Equal(contactId, stored.FacilityContactId); + Assert.Equal(3, stored.RequiredHeadcount); + Assert.Equal("Hoch", stored.Priority); + } + + [Fact] + public async Task GetAllAsync_ReturnsCreatedOrders() + { + var (_, _, sut, _, _, _, _) = CreateSut(); + + await sut.CreateAsync(new Order { FacilityId = Guid.NewGuid(), StartDate = new DateOnly(2026, 1, 1), Priority = "Normal" }); + + var all = await sut.GetAllAsync(); + + Assert.Single(all); + } + + [Fact] + public async Task UpdateAsync_ValidTransition_UpdatesFieldsAndReturnsOk() + { + var (_, _, sut, _, pruefung, _, _) = CreateSut(); + var created = await sut.CreateAsync(new Order { FacilityId = Guid.NewGuid(), StartDate = new DateOnly(2026, 1, 1), Priority = "Normal" }); + + var updates = new Order + { + FacilityId = created.FacilityId, + StartDate = created.StartDate, + RequiredHeadcount = 2, + Priority = "Hoch", + StatusId = pruefung.Id + }; + + var result = await sut.UpdateAsync(created.Id, updates); + + Assert.True(result.Success); + Assert.Equal(pruefung.Id, result.Order!.StatusId); + Assert.Equal("Hoch", result.Order.Priority); + Assert.NotNull(result.Order.UpdatedAt); + } + + [Fact] + public async Task UpdateAsync_SameStatus_Succeeds() + { + var (_, _, sut, anfrage, _, _, _) = CreateSut(); + var created = await sut.CreateAsync(new Order { FacilityId = Guid.NewGuid(), StartDate = new DateOnly(2026, 1, 1), Priority = "Normal" }); + + var updates = new Order + { + FacilityId = created.FacilityId, + StartDate = created.StartDate, + RequiredHeadcount = 5, + Priority = "Normal", + StatusId = anfrage.Id + }; + + var result = await sut.UpdateAsync(created.Id, updates); + + Assert.True(result.Success); + Assert.Equal(5, result.Order!.RequiredHeadcount); + } + + [Fact] + public async Task UpdateAsync_InvalidTransition_ReturnsInvalidStatusTransitionFailure_AndLeavesStatusUnchanged() + { + var (_, _, sut, anfrage, _, aktiv, _) = CreateSut(); + var created = await sut.CreateAsync(new Order { FacilityId = Guid.NewGuid(), StartDate = new DateOnly(2026, 1, 1), Priority = "Normal" }); + + var updates = new Order + { + FacilityId = created.FacilityId, + StartDate = created.StartDate, + Priority = "Normal", + StatusId = aktiv.Id + }; + + var result = await sut.UpdateAsync(created.Id, updates); + + Assert.False(result.Success); + Assert.Equal(UpdateOrderFailureReason.InvalidStatusTransition, result.FailureReason); + + var stored = await sut.GetByIdAsync(created.Id); + Assert.Equal(anfrage.Id, stored!.StatusId); + } + + [Fact] + public async Task UpdateAsync_TerminalStatus_RejectsFurtherTransitions() + { + var (_, _, sut, anfrage, _, _, storniert) = CreateSut(); + var created = await sut.CreateAsync(new Order { FacilityId = Guid.NewGuid(), StartDate = new DateOnly(2026, 1, 1), Priority = "Normal" }); + await sut.UpdateAsync(created.Id, new Order { FacilityId = created.FacilityId, StartDate = created.StartDate, Priority = "Normal", StatusId = storniert.Id }); + + var result = await sut.UpdateAsync(created.Id, new Order { FacilityId = created.FacilityId, StartDate = created.StartDate, Priority = "Normal", StatusId = anfrage.Id }); + + Assert.False(result.Success); + Assert.Equal(UpdateOrderFailureReason.InvalidStatusTransition, result.FailureReason); + } + + [Fact] + public async Task UpdateAsync_UnknownId_ReturnsOrderNotFoundFailure() + { + var (_, _, sut, anfrage, _, _, _) = CreateSut(); + + var result = await sut.UpdateAsync(Guid.NewGuid(), new Order { FacilityId = Guid.NewGuid(), StartDate = new DateOnly(2026, 1, 1), Priority = "Normal", StatusId = anfrage.Id }); + + Assert.False(result.Success); + Assert.Equal(UpdateOrderFailureReason.OrderNotFound, result.FailureReason); + } + + [Fact] + public async Task GetPagedAsync_FiltersByStatusAndFacility_AndPaginates() + { + var (_, _, sut, anfrage, pruefung, _, _) = CreateSut(); + var facilityA = Guid.NewGuid(); + var facilityB = Guid.NewGuid(); + + var first = await sut.CreateAsync(new Order { FacilityId = facilityA, StartDate = new DateOnly(2026, 1, 1), Priority = "Normal" }); + await sut.CreateAsync(new Order { FacilityId = facilityB, StartDate = new DateOnly(2026, 2, 1), Priority = "Normal" }); + await sut.UpdateAsync(first.Id, new Order { FacilityId = facilityA, StartDate = first.StartDate, Priority = "Normal", StatusId = pruefung.Id }); + + var (items, totalCount) = await sut.GetPagedAsync(search: null, statusId: pruefung.Id, facilityId: facilityA, page: 1, pageSize: 10); + + Assert.Equal(1, totalCount); + Assert.Single(items); + Assert.Equal(facilityA, items[0].FacilityId); + } +} diff --git a/omsorgCore/tests/OmsorgCore.Tests/Services/PasswordResetServiceTests.cs b/omsorgCore/tests/OmsorgCore.Tests/Services/PasswordResetServiceTests.cs index 40b9b17..43e78b5 100644 --- a/omsorgCore/tests/OmsorgCore.Tests/Services/PasswordResetServiceTests.cs +++ b/omsorgCore/tests/OmsorgCore.Tests/Services/PasswordResetServiceTests.cs @@ -21,14 +21,16 @@ public class PasswordResetServiceTests FakeUserRepository users, FakePasswordResetCodeRepository? codes = null, FakePasswordResetCodeGenerator? generator = null, - FakeRefreshTokenRepository? refreshTokens = null) + FakeRefreshTokenRepository? refreshTokens = null, + FakePasswordPolicy? passwordPolicy = null) { return new PasswordResetService( users, codes ?? new FakePasswordResetCodeRepository(), generator ?? new FakePasswordResetCodeGenerator(), new FakePasswordHasher(), - refreshTokens ?? new FakeRefreshTokenRepository()); + refreshTokens ?? new FakeRefreshTokenRepository(), + passwordPolicy ?? new FakePasswordPolicy()); } [Fact] @@ -156,9 +158,9 @@ public class PasswordResetServiceTests var verified = await sut.VerifyCodeAsync(user.Username, requested.RawPin!); var oldSecurityStamp = user.SecurityStamp; - var success = await sut.ResetPasswordAsync(verified.ResetToken!, "neuesPasswort"); + var result = await sut.ResetPasswordAsync(verified.ResetToken!, "neuesPasswort"); - Assert.True(success); + Assert.Equal(ResetPasswordResult.Success, result); Assert.Equal("hashed:neuesPasswort", user.PasswordHash); Assert.NotEqual(oldSecurityStamp, user.SecurityStamp); @@ -179,8 +181,24 @@ public class PasswordResetServiceTests var first = await sut.ResetPasswordAsync(verified.ResetToken!, "erstesPasswort"); var second = await sut.ResetPasswordAsync(verified.ResetToken!, "zweitesPasswort"); - Assert.True(first); - Assert.False(second); + Assert.Equal(ResetPasswordResult.Success, first); + Assert.Equal(ResetPasswordResult.InvalidOrExpiredToken, second); + } + + [Fact] + public async Task ResetPasswordAsync_NewPasswordTooShort_Fails() + { + var user = CreateUserWithEmployee(); + var codes = new FakePasswordResetCodeRepository(); + var sut = CreateSut(new FakeUserRepository(user), codes); + + var requested = await sut.RequestResetAsync(user.Username); + var verified = await sut.VerifyCodeAsync(user.Username, requested.RawPin!); + + var result = await sut.ResetPasswordAsync(verified.ResetToken!, "kurz"); + + Assert.Equal(ResetPasswordResult.PasswordTooShort, result); + Assert.Equal("hashed:secret", user.PasswordHash); } [Fact] diff --git a/omsorgCore/tests/OmsorgCore.Tests/Services/RoleServiceTests.cs b/omsorgCore/tests/OmsorgCore.Tests/Services/RoleServiceTests.cs index 10aab0a..8747f27 100644 --- a/omsorgCore/tests/OmsorgCore.Tests/Services/RoleServiceTests.cs +++ b/omsorgCore/tests/OmsorgCore.Tests/Services/RoleServiceTests.cs @@ -1,5 +1,6 @@ using OmsorgCore.Application.Services; using OmsorgCore.Domain.Entities; +using OmsorgCore.Domain.Enums; using OmsorgCore.Tests.TestDoubles; namespace OmsorgCore.Tests.Services; @@ -42,4 +43,32 @@ public class RoleServiceTests Assert.False(result.Success); Assert.Equal(CreateRoleFailureReason.NameRequired, result.FailureReason); } + + [Fact] + public async Task UpdatePermissionsAsync_ReplacesExistingPermissions() + { + var role = new Role { Name = "Disposition" }; + role.RolePermissions.Add(new RolePermission { RoleId = role.Id, Role = role, Module = ModuleType.Employees, Action = PermissionAction.View }); + var roles = new FakeRoleRepository(role); + var sut = new RoleService(roles); + + var result = await sut.UpdatePermissionsAsync(role.Id, new[] { (ModuleType.Invoices, PermissionAction.Edit) }); + + Assert.True(result.Success); + var updated = await roles.GetByIdWithPermissionsAsync(role.Id); + var permission = Assert.Single(updated!.RolePermissions); + Assert.Equal(ModuleType.Invoices, permission.Module); + Assert.Equal(PermissionAction.Edit, permission.Action); + } + + [Fact] + public async Task UpdatePermissionsAsync_UnknownRole_Fails() + { + var sut = new RoleService(new FakeRoleRepository()); + + var result = await sut.UpdatePermissionsAsync(Guid.NewGuid(), new[] { (ModuleType.Employees, PermissionAction.View) }); + + Assert.False(result.Success); + Assert.Equal(UpdateRolePermissionsFailureReason.RoleNotFound, result.FailureReason); + } } diff --git a/omsorgCore/tests/OmsorgCore.Tests/Services/UserServiceTests.cs b/omsorgCore/tests/OmsorgCore.Tests/Services/UserServiceTests.cs index d482e27..c2c1f8b 100644 --- a/omsorgCore/tests/OmsorgCore.Tests/Services/UserServiceTests.cs +++ b/omsorgCore/tests/OmsorgCore.Tests/Services/UserServiceTests.cs @@ -1,5 +1,6 @@ using OmsorgCore.Application.Services; using OmsorgCore.Domain.Entities; +using OmsorgCore.Domain.Enums; using OmsorgCore.Tests.TestDoubles; namespace OmsorgCore.Tests.Services; @@ -21,14 +22,15 @@ public class UserServiceTests FakeRefreshTokenRepository? refreshTokens = null) { var actualRefreshTokens = refreshTokens ?? new FakeRefreshTokenRepository(); + var passwordPolicy = new FakePasswordPolicy(); var passwordResetService = new PasswordResetService( users, codes ?? new FakePasswordResetCodeRepository(), new FakePasswordResetCodeGenerator(), new FakePasswordHasher(), - actualRefreshTokens); + actualRefreshTokens, passwordPolicy); return new UserService( users, employees, roles, new FakePasswordHasher(), - passwordResetService, actualRefreshTokens); + passwordResetService, actualRefreshTokens, passwordPolicy); } [Fact] @@ -101,6 +103,26 @@ public class UserServiceTests Assert.Equal(CreateUserFailureReason.InitialPasswordRequired, result.FailureReason); } + [Fact] + public async Task CreateForEmployeeAsync_DirectMode_PasswordTooShort_Fails() + { + var employee = CreateEmployee(); + var employees = new FakeEmployeeRepository(); + await employees.AddAsync(employee); + var role = new Role { Name = "Disposition" }; + var roles = new FakeRoleRepository(role); + var users = new FakeUserRepository(); + + var sut = CreateSut(users, employees, roles); + + var result = await sut.CreateForEmployeeAsync( + employee.Id, "direkt.user", role.Id, UserCreationMode.Direct, + initialPassword: "kurz", invitePinValidity: null); + + Assert.False(result.Success); + Assert.Equal(CreateUserFailureReason.PasswordTooShort, result.FailureReason); + } + [Fact] public async Task CreateForEmployeeAsync_InviteMode_WithoutEmployeeEmail_Fails() { @@ -201,9 +223,9 @@ public class UserServiceTests var sut = CreateSut(users, new FakeEmployeeRepository(), new FakeRoleRepository(), refreshTokens: refreshTokens); var oldStamp = user.SecurityStamp; - var success = await sut.ChangeOwnPasswordAsync(user.Id, "altesPasswort", "neuesPasswort"); + var result = await sut.ChangeOwnPasswordAsync(user.Id, "altesPasswort", "neuesPasswort"); - Assert.True(success); + Assert.Equal(ChangeOwnPasswordResult.Success, result); Assert.False(user.MustChangePassword); Assert.Equal("hashed:neuesPasswort", user.PasswordHash); Assert.NotEqual(oldStamp, user.SecurityStamp); @@ -271,6 +293,30 @@ public class UserServiceTests Assert.Equal(AdminResetPasswordFailureReason.UserNotFound, result.FailureReason); } + [Fact] + public async Task AdminResetPasswordAsync_DirectMode_PasswordTooShort_Fails() + { + var role = new Role { Name = "Disposition" }; + var employee = CreateEmployee(); + var user = new User + { + Username = "bestehender.user", + PasswordHash = "hashed:altesPasswort", + RoleId = role.Id, + Role = role, + Employee = employee, + EmployeeId = employee.Id + }; + var users = new FakeUserRepository(user); + var sut = CreateSut(users, new FakeEmployeeRepository(), new FakeRoleRepository(role)); + + var result = await sut.AdminResetPasswordAsync(user.Id, UserCreationMode.Direct, "kurz", null); + + Assert.False(result.Success); + Assert.Equal(AdminResetPasswordFailureReason.PasswordTooShort, result.FailureReason); + Assert.Equal("hashed:altesPasswort", user.PasswordHash); + } + [Fact] public async Task UpdateAsync_DeactivatingUser_RevokesSessionsImmediately() { @@ -334,9 +380,119 @@ public class UserServiceTests var sut = CreateSut(users, new FakeEmployeeRepository(), new FakeRoleRepository()); - var success = await sut.ChangeOwnPasswordAsync(user.Id, "falschesPasswort", "neuesPasswort"); + var result = await sut.ChangeOwnPasswordAsync(user.Id, "falschesPasswort", "neuesPasswort"); - Assert.False(success); + Assert.Equal(ChangeOwnPasswordResult.InvalidCurrentPassword, result); Assert.True(user.MustChangePassword); } + + [Fact] + public async Task ChangeOwnPasswordAsync_NewPasswordTooShort_Fails() + { + var role = new Role { Name = "Disposition" }; + var user = new User + { + Username = "muss.wechseln", + PasswordHash = "hashed:altesPasswort", + RoleId = role.Id, + Role = role, + MustChangePassword = true + }; + var users = new FakeUserRepository(user); + + var sut = CreateSut(users, new FakeEmployeeRepository(), new FakeRoleRepository()); + + var result = await sut.ChangeOwnPasswordAsync(user.Id, "altesPasswort", "kurz"); + + Assert.Equal(ChangeOwnPasswordResult.PasswordTooShort, result); + Assert.Equal("hashed:altesPasswort", user.PasswordHash); + } + + [Fact] + public async Task AddPermissionOverrideAsync_NewOverride_AddsIt() + { + var role = new Role { Name = "Disposition" }; + var user = new User { Username = "u", PasswordHash = "hashed:x", RoleId = role.Id, Role = role }; + var users = new FakeUserRepository(user); + var sut = CreateSut(users, new FakeEmployeeRepository(), new FakeRoleRepository(role)); + + var result = await sut.AddPermissionOverrideAsync(user.Id, ModuleType.Invoices, PermissionAction.View, PermissionEffect.Grant); + + Assert.True(result.Success); + Assert.Single(user.PermissionOverrides); + Assert.Equal(PermissionEffect.Grant, result.Override!.Effect); + } + + [Fact] + public async Task AddPermissionOverrideAsync_ExistingOverrideForSamePair_UpdatesEffectInsteadOfDuplicating() + { + var role = new Role { Name = "Disposition" }; + var user = new User { Username = "u", PasswordHash = "hashed:x", RoleId = role.Id, Role = role }; + user.PermissionOverrides.Add(new UserPermissionOverride + { + UserId = user.Id, User = user, Module = ModuleType.Invoices, Action = PermissionAction.View, Effect = PermissionEffect.Grant + }); + var users = new FakeUserRepository(user); + var sut = CreateSut(users, new FakeEmployeeRepository(), new FakeRoleRepository(role)); + + var result = await sut.AddPermissionOverrideAsync(user.Id, ModuleType.Invoices, PermissionAction.View, PermissionEffect.Revoke); + + Assert.True(result.Success); + var single = Assert.Single(user.PermissionOverrides); + Assert.Equal(PermissionEffect.Revoke, single.Effect); + } + + [Fact] + public async Task AddPermissionOverrideAsync_UnknownUser_Fails() + { + var sut = CreateSut(new FakeUserRepository(), new FakeEmployeeRepository(), new FakeRoleRepository()); + + var result = await sut.AddPermissionOverrideAsync(Guid.NewGuid(), ModuleType.Invoices, PermissionAction.View, PermissionEffect.Grant); + + Assert.False(result.Success); + Assert.Equal(AddPermissionOverrideFailureReason.UserNotFound, result.FailureReason); + } + + [Fact] + public async Task RemovePermissionOverrideAsync_ExistingOverride_RemovesIt() + { + var role = new Role { Name = "Disposition" }; + var user = new User { Username = "u", PasswordHash = "hashed:x", RoleId = role.Id, Role = role }; + var toRemove = new UserPermissionOverride + { + UserId = user.Id, User = user, Module = ModuleType.Invoices, Action = PermissionAction.View, Effect = PermissionEffect.Grant + }; + user.PermissionOverrides.Add(toRemove); + var users = new FakeUserRepository(user); + var sut = CreateSut(users, new FakeEmployeeRepository(), new FakeRoleRepository(role)); + + var result = await sut.RemovePermissionOverrideAsync(user.Id, toRemove.Id); + + Assert.True(result.Success); + Assert.Empty(user.PermissionOverrides); + } + + [Fact] + public async Task RemovePermissionOverrideAsync_UnknownOverride_Fails() + { + var role = new Role { Name = "Disposition" }; + var user = new User { Username = "u", PasswordHash = "hashed:x", RoleId = role.Id, Role = role }; + var users = new FakeUserRepository(user); + var sut = CreateSut(users, new FakeEmployeeRepository(), new FakeRoleRepository(role)); + + var result = await sut.RemovePermissionOverrideAsync(user.Id, Guid.NewGuid()); + + Assert.False(result.Success); + Assert.Equal(RemovePermissionOverrideFailureReason.OverrideNotFound, result.FailureReason); + } + + [Fact] + public async Task GetPermissionOverridesAsync_UnknownUser_ReturnsNull() + { + var sut = CreateSut(new FakeUserRepository(), new FakeEmployeeRepository(), new FakeRoleRepository()); + + var result = await sut.GetPermissionOverridesAsync(Guid.NewGuid()); + + Assert.Null(result); + } } diff --git a/omsorgCore/tests/OmsorgCore.Tests/Services/ValueListServiceTests.cs b/omsorgCore/tests/OmsorgCore.Tests/Services/ValueListServiceTests.cs new file mode 100644 index 0000000..14044cf --- /dev/null +++ b/omsorgCore/tests/OmsorgCore.Tests/Services/ValueListServiceTests.cs @@ -0,0 +1,87 @@ +using OmsorgCore.Application.Abstractions; +using OmsorgCore.Application.Services; +using OmsorgCore.Tests.TestDoubles; + +namespace OmsorgCore.Tests.Services; + +public class ValueListServiceTests +{ + private class FakeUsageChecker : IValueListUsageChecker + { + private readonly Dictionary> _usagesByItemId = new(); + + public string Key { get; } + + public FakeUsageChecker(string key) + { + Key = key; + } + + public void SetUsages(Guid itemId, params ValueListUsageEntry[] usages) + => _usagesByItemId[itemId] = usages.ToList(); + + public Task> FindUsagesAsync(Guid itemId, string itemValue, CancellationToken cancellationToken = default) + => Task.FromResult>(_usagesByItemId.GetValueOrDefault(itemId, new List())); + } + + private static (FakeValueListRepository Repository, FakeUsageChecker Checker, ValueListService Sut) CreateSut() + { + var repository = new FakeValueListRepository(); + var checker = new FakeUsageChecker("EmployeeStatus"); + var sut = new ValueListService(repository, new[] { checker }); + return (repository, checker, sut); + } + + [Fact] + public async Task DeleteItemAsync_NotInUse_DeletesItem() + { + var (repository, _, sut) = CreateSut(); + var item = repository.AddStatus("Aktiv", key: "EmployeeStatus"); + + var result = await sut.DeleteItemAsync(item.Id); + + Assert.True(result.Success); + Assert.Null(await repository.GetItemByIdAsync(item.Id)); + } + + [Fact] + public async Task DeleteItemAsync_InUse_RefusesDeletionAndReturnsUsages() + { + var (repository, checker, sut) = CreateSut(); + var item = repository.AddStatus("Aktiv", key: "EmployeeStatus"); + var employeeId = Guid.NewGuid(); + checker.SetUsages(item.Id, new ValueListUsageEntry("Employee", employeeId, "Max Mustermann")); + + var result = await sut.DeleteItemAsync(item.Id); + + Assert.False(result.Success); + Assert.Equal(DeleteValueListItemFailureReason.InUse, result.FailureReason); + Assert.Single(result.Usages); + Assert.Equal(employeeId, result.Usages[0].EntityId); + Assert.NotNull(await repository.GetItemByIdAsync(item.Id)); + } + + [Fact] + public async Task DeleteItemAsync_UnknownId_ReturnsItemNotFoundFailure() + { + var (_, _, sut) = CreateSut(); + + var result = await sut.DeleteItemAsync(Guid.NewGuid()); + + Assert.False(result.Success); + Assert.Equal(DeleteValueListItemFailureReason.ItemNotFound, result.FailureReason); + } + + [Fact] + public async Task GetUsagesAsync_ReturnsUsagesWithoutDeleting() + { + var (repository, checker, sut) = CreateSut(); + var item = repository.AddStatus("Aktiv", key: "EmployeeStatus"); + checker.SetUsages(item.Id, new ValueListUsageEntry("Employee", Guid.NewGuid(), "Erika Musterfrau")); + + var usages = await sut.GetUsagesAsync(item.Id); + + Assert.Single(usages); + Assert.NotNull(await repository.GetItemByIdAsync(item.Id)); + } +} diff --git a/omsorgCore/tests/OmsorgCore.Tests/TestDoubles/FakeRepositories.cs b/omsorgCore/tests/OmsorgCore.Tests/TestDoubles/FakeRepositories.cs index 3e009d4..9361c82 100644 --- a/omsorgCore/tests/OmsorgCore.Tests/TestDoubles/FakeRepositories.cs +++ b/omsorgCore/tests/OmsorgCore.Tests/TestDoubles/FakeRepositories.cs @@ -1,5 +1,6 @@ using OmsorgCore.Application.Abstractions; using OmsorgCore.Domain.Entities; +using OmsorgCore.Domain.Enums; namespace OmsorgCore.Tests.TestDoubles; @@ -39,6 +40,13 @@ public class FakeUserRepository : IUserRepository return Task.CompletedTask; } + public Task AddPermissionOverrideAsync(UserPermissionOverride @override, CancellationToken cancellationToken = default) + { + var user = _users.First(u => u.Id == @override.UserId); + user.PermissionOverrides.Add(@override); + return Task.CompletedTask; + } + public Task SaveChangesAsync(CancellationToken cancellationToken = default) => Task.CompletedTask; } @@ -140,6 +148,142 @@ public class FakeEmployeeRepository : IEmployeeRepository => Task.CompletedTask; } +public class FakeFacilityRepository : IFacilityRepository +{ + private readonly List _facilities = new(); + + public Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default) + => Task.FromResult(_facilities.FirstOrDefault(f => f.Id == id)); + + public Task> GetAllAsync(CancellationToken cancellationToken = default) + => Task.FromResult>(_facilities.ToList()); + + public Task<(IReadOnlyList Items, int TotalCount)> GetPagedAsync( + string? search, + string? crmStatus, + int page, + int pageSize, + CancellationToken cancellationToken = default) + { + IEnumerable query = _facilities.Where(f => !f.IsDeleted); + + if (!string.IsNullOrWhiteSpace(search)) + { + var term = search.Trim(); + query = query.Where(f => f.Name.Contains(term, StringComparison.OrdinalIgnoreCase)); + } + + if (!string.IsNullOrWhiteSpace(crmStatus)) + { + query = query.Where(f => f.CrmStatus == crmStatus); + } + + var ordered = query.OrderBy(f => f.Name).ToList(); + var totalCount = ordered.Count; + var items = ordered.Skip((page - 1) * pageSize).Take(pageSize).ToList(); + + return Task.FromResult<(IReadOnlyList Items, int TotalCount)>((items, totalCount)); + } + + public Task AddAsync(Facility facility, CancellationToken cancellationToken = default) + { + _facilities.Add(facility); + return Task.CompletedTask; + } + + public Task UpdateAsync(Facility facility, CancellationToken cancellationToken = default) + => Task.CompletedTask; + + public Task SaveChangesAsync(CancellationToken cancellationToken = default) + => Task.CompletedTask; +} + +public class FakeFacilityContactRepository : IFacilityContactRepository +{ + private readonly List _contacts = new(); + + public Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default) + => Task.FromResult(_contacts.FirstOrDefault(c => c.Id == id)); + + public Task> GetByFacilityIdAsync(Guid facilityId, CancellationToken cancellationToken = default) + => Task.FromResult>( + _contacts.Where(c => c.FacilityId == facilityId).OrderBy(c => c.Name).ToList()); + + public Task AddAsync(FacilityContact contact, CancellationToken cancellationToken = default) + { + _contacts.Add(contact); + return Task.CompletedTask; + } + + public Task UpdateAsync(FacilityContact contact, CancellationToken cancellationToken = default) + => Task.CompletedTask; + + public Task SaveChangesAsync(CancellationToken cancellationToken = default) + => Task.CompletedTask; +} + +public class FakeContractRepository : IContractRepository +{ + private readonly List _contracts = new(); + + public Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default) + => Task.FromResult(_contracts.FirstOrDefault(c => c.Id == id)); + + public Task> GetAllAsync(CancellationToken cancellationToken = default) + => Task.FromResult>(_contracts.ToList()); + + public Task<(IReadOnlyList Items, int TotalCount)> GetPagedAsync( + string? search, + string? status, + Guid? employeeId, + Guid? facilityId, + int page, + int pageSize, + CancellationToken cancellationToken = default) + { + IEnumerable query = _contracts.Where(c => !c.IsDeleted); + + if (!string.IsNullOrWhiteSpace(search)) + { + var term = search.Trim(); + query = query.Where(c => c.ContractType.Contains(term, StringComparison.OrdinalIgnoreCase)); + } + + if (!string.IsNullOrWhiteSpace(status)) + { + query = query.Where(c => c.Status == status); + } + + if (employeeId.HasValue) + { + query = query.Where(c => c.EmployeeId == employeeId.Value); + } + + if (facilityId.HasValue) + { + query = query.Where(c => c.FacilityId == facilityId.Value); + } + + var ordered = query.OrderBy(c => c.StartDate).ToList(); + var totalCount = ordered.Count; + var items = ordered.Skip((page - 1) * pageSize).Take(pageSize).ToList(); + + return Task.FromResult<(IReadOnlyList Items, int TotalCount)>((items, totalCount)); + } + + public Task AddAsync(Contract contract, CancellationToken cancellationToken = default) + { + _contracts.Add(contract); + return Task.CompletedTask; + } + + public Task UpdateAsync(Contract contract, CancellationToken cancellationToken = default) + => Task.CompletedTask; + + public Task SaveChangesAsync(CancellationToken cancellationToken = default) + => Task.CompletedTask; +} + public class FakeRoleRepository : IRoleRepository { private readonly List _roles; @@ -155,6 +299,9 @@ public class FakeRoleRepository : IRoleRepository public Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default) => Task.FromResult(_roles.FirstOrDefault(r => r.Id == id)); + public Task GetByIdWithPermissionsAsync(Guid id, CancellationToken cancellationToken = default) + => Task.FromResult(_roles.FirstOrDefault(r => r.Id == id)); + public Task ExistsByNameAsync(string name, CancellationToken cancellationToken = default) => Task.FromResult(_roles.Any(r => r.Name == name)); @@ -164,6 +311,16 @@ public class FakeRoleRepository : IRoleRepository return Task.CompletedTask; } + public Task AddPermissionRangeAsync(IEnumerable permissions, CancellationToken cancellationToken = default) + { + foreach (var permission in permissions) + { + var role = _roles.First(r => r.Id == permission.RoleId); + role.RolePermissions.Add(permission); + } + return Task.CompletedTask; + } + public Task SaveChangesAsync(CancellationToken cancellationToken = default) => Task.CompletedTask; } @@ -285,3 +442,186 @@ public class FakeLoginLockoutPolicy : ILoginLockoutPolicy public int MaxFailures { get; set; } = 5; public TimeSpan LockoutWindow { get; set; } = TimeSpan.FromMinutes(10); } + +public class FakePasswordPolicy : IPasswordPolicy +{ + public int MinLength { get; set; } = 8; + + public bool IsValid(string? password) => !string.IsNullOrEmpty(password) && password.Length >= MinLength; +} + +public class FakeAuditLogRepository : IAuditLogRepository +{ + public List Entries { get; } = new(); + + public Task AddAsync(AuditLogEntry entry, CancellationToken cancellationToken = default) + { + Entries.Add(entry); + return Task.CompletedTask; + } + + public Task<(IReadOnlyList Items, int TotalCount)> GetPagedAsync( + string? entityType, + Guid? entityId, + Guid? actorUserId, + AuditEventCategory? category, + DateTime? fromUtc, + DateTime? toUtc, + int page, + int pageSize, + CancellationToken cancellationToken = default) + { + IReadOnlyList items = Entries.ToList(); + return Task.FromResult((items, items.Count)); + } + + public Task SaveChangesAsync(CancellationToken cancellationToken = default) + => Task.CompletedTask; +} + +public class FakeOrderRepository : IOrderRepository +{ + private readonly List _orders = new(); + + public Task GetByIdAsync(Guid id, CancellationToken cancellationToken = default) + => Task.FromResult(_orders.FirstOrDefault(o => o.Id == id)); + + public Task> GetAllAsync(CancellationToken cancellationToken = default) + => Task.FromResult>(_orders.ToList()); + + public Task<(IReadOnlyList Items, int TotalCount)> GetPagedAsync( + string? search, + Guid? statusId, + Guid? facilityId, + int page, + int pageSize, + CancellationToken cancellationToken = default) + { + IEnumerable query = _orders.Where(o => !o.IsDeleted); + + if (!string.IsNullOrWhiteSpace(search)) + { + var term = search.Trim(); + query = query.Where(o => o.RequiredQualification != null && o.RequiredQualification.Contains(term, StringComparison.OrdinalIgnoreCase)); + } + + if (statusId.HasValue) + { + query = query.Where(o => o.StatusId == statusId.Value); + } + + if (facilityId.HasValue) + { + query = query.Where(o => o.FacilityId == facilityId.Value); + } + + var ordered = query.OrderBy(o => o.StartDate).ToList(); + var totalCount = ordered.Count; + var items = ordered.Skip((page - 1) * pageSize).Take(pageSize).ToList(); + + return Task.FromResult<(IReadOnlyList Items, int TotalCount)>((items, totalCount)); + } + + public Task AddAsync(Order order, CancellationToken cancellationToken = default) + { + _orders.Add(order); + return Task.CompletedTask; + } + + public Task UpdateAsync(Order order, CancellationToken cancellationToken = default) + => Task.CompletedTask; + + public Task SaveChangesAsync(CancellationToken cancellationToken = default) + => Task.CompletedTask; +} + +public class FakeValueListRepository : IValueListRepository +{ + private readonly List _lists = new(); + private readonly List _items = new(); + private readonly List _transitions = new(); + + public ValueListItem AddStatus(string name, bool isInitial = false, bool isTerminal = false, int? sortOrder = null, string key = "OrderStatus") + { + var list = _lists.FirstOrDefault(l => l.Key == key); + if (list is null) + { + list = new ValueList { Key = key, DisplayName = key }; + _lists.Add(list); + } + + var item = new ValueListItem + { + ValueListId = list.Id, + ValueList = list, + Value = name, + IsInitial = isInitial, + IsTerminal = isTerminal, + SortOrder = sortOrder ?? _items.Count(i => i.ValueListId == list.Id) + }; + _items.Add(item); + return item; + } + + public void AllowTransition(Guid fromItemId, Guid toItemId) + => _transitions.Add(new ValueListItemTransition { FromItemId = fromItemId, ToItemId = toItemId }); + + public Task> GetAllListsAsync(CancellationToken cancellationToken = default) + => Task.FromResult>(_lists.ToList()); + + public Task GetListByKeyAsync(string key, CancellationToken cancellationToken = default) + => Task.FromResult(_lists.FirstOrDefault(l => l.Key == key)); + + public Task> GetItemsAsync(string key, CancellationToken cancellationToken = default) + => Task.FromResult>(_items.Where(i => i.ValueList.Key == key).OrderBy(i => i.SortOrder).ToList()); + + public Task> GetActiveValuesAsync(string key, CancellationToken cancellationToken = default) + => Task.FromResult>(_items.Where(i => i.ValueList.Key == key).OrderBy(i => i.SortOrder).Select(i => i.Value).ToList()); + + public Task GetItemByIdAsync(Guid id, CancellationToken cancellationToken = default) + => Task.FromResult(_items.FirstOrDefault(i => i.Id == id)); + + public Task GetInitialItemAsync(string key, CancellationToken cancellationToken = default) + => Task.FromResult(_items.FirstOrDefault(i => i.ValueList.Key == key && i.IsInitial)); + + public Task AddItemAsync(ValueListItem item, CancellationToken cancellationToken = default) + { + _items.Add(item); + return Task.CompletedTask; + } + + public Task UpdateItemAsync(ValueListItem item, CancellationToken cancellationToken = default) + => Task.CompletedTask; + + public Task RemoveItemAsync(ValueListItem item, CancellationToken cancellationToken = default) + { + _items.Remove(item); + return Task.CompletedTask; + } + + public Task CanTransitionAsync(Guid fromItemId, Guid toItemId, CancellationToken cancellationToken = default) + { + if (fromItemId == toItemId) + { + return Task.FromResult(true); + } + + return Task.FromResult(_transitions.Any(t => t.FromItemId == fromItemId && t.ToItemId == toItemId)); + } + + public Task> GetTransitionsAsync(string key, CancellationToken cancellationToken = default) + => Task.FromResult>(_transitions.Where(t => t.FromItem.ValueList.Key == key).ToList()); + + public Task ReplaceTransitionsAsync(string key, IEnumerable<(Guid FromItemId, Guid ToItemId)> transitions, CancellationToken cancellationToken = default) + { + _transitions.RemoveAll(t => t.FromItem?.ValueList.Key == key); + foreach (var (fromItemId, toItemId) in transitions) + { + _transitions.Add(new ValueListItemTransition { FromItemId = fromItemId, ToItemId = toItemId }); + } + return Task.CompletedTask; + } + + public Task SaveChangesAsync(CancellationToken cancellationToken = default) + => Task.CompletedTask; +} diff --git a/omsorgWeb/CLAUDE.md b/omsorgWeb/CLAUDE.md index 4c96a71..f6c3282 100644 --- a/omsorgWeb/CLAUDE.md +++ b/omsorgWeb/CLAUDE.md @@ -6,11 +6,13 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co This is the OMSORG website plus **OMSORG Connect**, an internal employee web app ("Mitarbeiter-App") for a German nursing care company. There is no build system — everything is plain PHP, HTML, CSS, and vanilla JS deployed directly to a web server (`htdocs`). -**OMSORG Connect wird gerade komplett neu aufgebaut.** `mitarbeiter-app-legacy/` ist die alte, produktiv gelaufene Version — dient nur noch als Referenz/Vorlage, wird nicht mehr weiterentwickelt. Der Rest dieser Datei beschreibt `mitarbeiter-app-legacy/`, nicht den Neuaufbau. Die aktive Entwicklung findet in `mitarbeiter-app/` statt (aktuell: nur Login-Flow gegen `omsorgCore`, siehe unten "Neuaufbau"). Auth in der Legacy-Version läuft **nicht mehr** über lokales bcrypt/Session-Lockout wie unten in "Entry point" beschrieben — das ist bereits auf omsorgCore-JWT-Auth umgestellt (`lib/omsorgCoreClient.php`, `lib/auth.php`), lokales MySQL dient dort nur noch als Read-Cache für Profildaten. +**OMSORG Connect wird gerade komplett neu aufgebaut.** `mitarbeiter-app-legacy/` ist die alte, produktiv gelaufene Version — dient nur noch als Referenz/Vorlage, wird nicht mehr weiterentwickelt. Der Rest dieser Datei beschreibt `mitarbeiter-app-legacy/`, nicht den Neuaufbau. Die aktive Entwicklung findet in `mitarbeiter-app/` statt (aktuell: Login-Flow + eigenes Passwort ändern/zurücksetzen gegen `omsorgCore`, siehe unten "Neuaufbau"). Auth in der Legacy-Version läuft **nicht mehr** über lokales bcrypt/Session-Lockout wie unten in "Entry point" beschrieben — das ist bereits auf omsorgCore-JWT-Auth umgestellt (`lib/omsorgCoreClient.php`, `lib/auth.php`), lokales MySQL dient dort nur noch als Read-Cache für Profildaten. ### Neuaufbau (`mitarbeiter-app/`) Frischer, minimaler PHP-Login-Flow gegen `omsorgCore` — kein Framework, gleiches Deployment-Modell wie die Legacy-App. Bewusst (noch) ohne: Antragsformulare, Dienstplan, Downloads, Admin-Oberfläche, PWA-Assets, MySQL. Admin-/Mitarbeiterverwaltung gehört nicht hierher, sondern exklusiv zu OMSORG Desktop (`omsorgapp`) — Connect zeigt/bearbeitet ausschließlich Daten des eingeloggten Nutzers selbst. +**Passwort ändern/vergessen:** `pages/settings.php` (nach Login, `require_login()`) und `pages/forgot-password.php` (vor Login, 3-stufig: Code anfordern → verifizieren → neues Passwort setzen), beide über die dafür in `lib/omsorgCoreClient.php` ergänzten `omsorgcore_change_password`/`omsorgcore_forgot_password_*`-Wrapper gegen dieselben `omsorgCore`-Endpunkte wie in `mitarbeiter-app-legacy`. Die Mindestlänge kommt nicht hartcodiert, sondern über `omsorgcore_password_policy()` (`GET /api/auth/password-policy`, siehe `omsorgCore/CLAUDE.md` Abschnitt "Passwort-Mindestlänge") — sowohl für das `minlength`-Attribut der Formularfelder als auch für die serverseitige Vorab-Fehlermeldung; die eigentliche Durchsetzung passiert im Backend. Nach erfolgreichem Anlegen/Admin-Reset eines Accounts (`mustChangePassword`-Flag aus der Login-Response, siehe `lib/auth.php`) leitet `pages/dashboard.php` erzwungen zu `settings.php` weiter. + This project is one part of the OMSORG monorepo — see the root `CLAUDE.md` (`../CLAUDE.md`) for the overall platform picture and `../REQUIREMENTS.md` for functional/non-functional requirements with FR-IDs. This app is the reference implementation for **OMSORG Connect**; its MySQL database is expected to eventually move behind the shared `omsorgCore` backend (currently empty, planned as C#/.NET + PostgreSQL) rather than staying a standalone data store. ## Deployment diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/.gitignore b/omsorgWeb/mitarbeiter-app/api-client-php/.gitignore new file mode 100644 index 0000000..9f1681c --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/.gitignore @@ -0,0 +1,15 @@ +# ref: https://github.com/github/gitignore/blob/master/Composer.gitignore + +composer.phar +/vendor/ + +# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control +# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file +# composer.lock + +# php-cs-fixer cache +.php_cs.cache +.php-cs-fixer.cache + +# PHPUnit cache +.phpunit.result.cache diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/.openapi-generator-ignore b/omsorgWeb/mitarbeiter-app/api-client-php/.openapi-generator-ignore new file mode 100644 index 0000000..7484ee5 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/.openapi-generator-ignore @@ -0,0 +1,23 @@ +# OpenAPI Generator Ignore +# Generated by openapi-generator https://github.com/openapitools/openapi-generator + +# Use this file to prevent files from being overwritten by the generator. +# The patterns follow closely to .gitignore or .dockerignore. + +# As an example, the C# client generator defines ApiClient.cs. +# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line: +#ApiClient.cs + +# You can match any string of characters against a directory, file or extension with a single asterisk (*): +#foo/*/qux +# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux + +# You can recursively match patterns against a directory, file or extension with a double asterisk (**): +#foo/**/qux +# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux + +# You can also negate patterns with an exclamation (!). +# For example, you can ignore all files in a docs folder with the file extension .md: +#docs/*.md +# Then explicitly reverse the ignore rule for a single file: +#!docs/README.md diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/.openapi-generator/FILES b/omsorgWeb/mitarbeiter-app/api-client-php/.openapi-generator/FILES new file mode 100644 index 0000000..89c9068 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/.openapi-generator/FILES @@ -0,0 +1,215 @@ +.gitignore +.openapi-generator-ignore +.php-cs-fixer.dist.php +.travis.yml +README.md +composer.json +docs/Api/AdminEmailApi.md +docs/Api/AdminSessionsApi.md +docs/Api/AuditLogApi.md +docs/Api/AuthApi.md +docs/Api/ContractsApi.md +docs/Api/EmployeesApi.md +docs/Api/FacilitiesApi.md +docs/Api/FacilityContactsApi.md +docs/Api/HealthApi.md +docs/Api/OrdersApi.md +docs/Api/RolesApi.md +docs/Api/UsersApi.md +docs/Api/ValueListsApi.md +docs/Model/AddUserPermissionOverrideRequest.md +docs/Model/AuditLogEntryResponse.md +docs/Model/AuditLogEntryResponsePagedResponse.md +docs/Model/ChangePasswordRequest.md +docs/Model/ContractResponse.md +docs/Model/ContractResponsePagedResponse.md +docs/Model/CreateContractRequest.md +docs/Model/CreateEmployeeRequest.md +docs/Model/CreateFacilityContactRequest.md +docs/Model/CreateFacilityRequest.md +docs/Model/CreateOrderRequest.md +docs/Model/CreateRoleRequest.md +docs/Model/CreateUserRequest.md +docs/Model/CreateValueListItemRequest.md +docs/Model/EmployeeResponse.md +docs/Model/EmployeeResponsePagedResponse.md +docs/Model/FacilityContactResponse.md +docs/Model/FacilityResponse.md +docs/Model/FacilityResponsePagedResponse.md +docs/Model/ForgotPasswordRequestRequest.md +docs/Model/ForgotPasswordRequestResponse.md +docs/Model/ForgotPasswordResetRequest.md +docs/Model/ForgotPasswordVerifyRequest.md +docs/Model/ForgotPasswordVerifyResponse.md +docs/Model/LoginRequest.md +docs/Model/LoginResponse.md +docs/Model/LogoutRequest.md +docs/Model/MeResponse.md +docs/Model/OrderResponse.md +docs/Model/OrderResponsePagedResponse.md +docs/Model/PasswordPolicyResponse.md +docs/Model/PasswordResetTemplateResponse.md +docs/Model/PermissionDto.md +docs/Model/RefreshRequest.md +docs/Model/ResetUserPasswordRequest.md +docs/Model/RolePermissionsResponse.md +docs/Model/RoleResponse.md +docs/Model/SendTestEmailRequest.md +docs/Model/SessionResponse.md +docs/Model/UpdateContractRequest.md +docs/Model/UpdateEmployeeRequest.md +docs/Model/UpdateFacilityContactRequest.md +docs/Model/UpdateFacilityRequest.md +docs/Model/UpdateOrderRequest.md +docs/Model/UpdateRolePermissionsRequest.md +docs/Model/UpdateUserRequest.md +docs/Model/UpdateValueListItemRequest.md +docs/Model/UserPermissionOverrideResponse.md +docs/Model/UserResponse.md +docs/Model/ValueListItemResponse.md +docs/Model/ValueListResponse.md +docs/Model/ValueListTransitionRequest.md +docs/Model/ValueListTransitionResponse.md +docs/Model/ValueListUsageResponse.md +git_push.sh +lib/Api/AdminEmailApi.php +lib/Api/AdminSessionsApi.php +lib/Api/AuditLogApi.php +lib/Api/AuthApi.php +lib/Api/ContractsApi.php +lib/Api/EmployeesApi.php +lib/Api/FacilitiesApi.php +lib/Api/FacilityContactsApi.php +lib/Api/HealthApi.php +lib/Api/OrdersApi.php +lib/Api/RolesApi.php +lib/Api/UsersApi.php +lib/Api/ValueListsApi.php +lib/ApiException.php +lib/Configuration.php +lib/FormDataProcessor.php +lib/HeaderSelector.php +lib/Model/AddUserPermissionOverrideRequest.php +lib/Model/AuditLogEntryResponse.php +lib/Model/AuditLogEntryResponsePagedResponse.php +lib/Model/ChangePasswordRequest.php +lib/Model/ContractResponse.php +lib/Model/ContractResponsePagedResponse.php +lib/Model/CreateContractRequest.php +lib/Model/CreateEmployeeRequest.php +lib/Model/CreateFacilityContactRequest.php +lib/Model/CreateFacilityRequest.php +lib/Model/CreateOrderRequest.php +lib/Model/CreateRoleRequest.php +lib/Model/CreateUserRequest.php +lib/Model/CreateValueListItemRequest.php +lib/Model/EmployeeResponse.php +lib/Model/EmployeeResponsePagedResponse.php +lib/Model/FacilityContactResponse.php +lib/Model/FacilityResponse.php +lib/Model/FacilityResponsePagedResponse.php +lib/Model/ForgotPasswordRequestRequest.php +lib/Model/ForgotPasswordRequestResponse.php +lib/Model/ForgotPasswordResetRequest.php +lib/Model/ForgotPasswordVerifyRequest.php +lib/Model/ForgotPasswordVerifyResponse.php +lib/Model/LoginRequest.php +lib/Model/LoginResponse.php +lib/Model/LogoutRequest.php +lib/Model/MeResponse.php +lib/Model/ModelInterface.php +lib/Model/OrderResponse.php +lib/Model/OrderResponsePagedResponse.php +lib/Model/PasswordPolicyResponse.php +lib/Model/PasswordResetTemplateResponse.php +lib/Model/PermissionDto.php +lib/Model/RefreshRequest.php +lib/Model/ResetUserPasswordRequest.php +lib/Model/RolePermissionsResponse.php +lib/Model/RoleResponse.php +lib/Model/SendTestEmailRequest.php +lib/Model/SessionResponse.php +lib/Model/UpdateContractRequest.php +lib/Model/UpdateEmployeeRequest.php +lib/Model/UpdateFacilityContactRequest.php +lib/Model/UpdateFacilityRequest.php +lib/Model/UpdateOrderRequest.php +lib/Model/UpdateRolePermissionsRequest.php +lib/Model/UpdateUserRequest.php +lib/Model/UpdateValueListItemRequest.php +lib/Model/UserPermissionOverrideResponse.php +lib/Model/UserResponse.php +lib/Model/ValueListItemResponse.php +lib/Model/ValueListResponse.php +lib/Model/ValueListTransitionRequest.php +lib/Model/ValueListTransitionResponse.php +lib/Model/ValueListUsageResponse.php +lib/ObjectSerializer.php +phpunit.xml.dist +test/Api/AdminEmailApiTest.php +test/Api/AdminSessionsApiTest.php +test/Api/AuditLogApiTest.php +test/Api/AuthApiTest.php +test/Api/ContractsApiTest.php +test/Api/EmployeesApiTest.php +test/Api/FacilitiesApiTest.php +test/Api/FacilityContactsApiTest.php +test/Api/HealthApiTest.php +test/Api/OrdersApiTest.php +test/Api/RolesApiTest.php +test/Api/UsersApiTest.php +test/Api/ValueListsApiTest.php +test/Model/AddUserPermissionOverrideRequestTest.php +test/Model/AuditLogEntryResponsePagedResponseTest.php +test/Model/AuditLogEntryResponseTest.php +test/Model/ChangePasswordRequestTest.php +test/Model/ContractResponsePagedResponseTest.php +test/Model/ContractResponseTest.php +test/Model/CreateContractRequestTest.php +test/Model/CreateEmployeeRequestTest.php +test/Model/CreateFacilityContactRequestTest.php +test/Model/CreateFacilityRequestTest.php +test/Model/CreateOrderRequestTest.php +test/Model/CreateRoleRequestTest.php +test/Model/CreateUserRequestTest.php +test/Model/CreateValueListItemRequestTest.php +test/Model/EmployeeResponsePagedResponseTest.php +test/Model/EmployeeResponseTest.php +test/Model/FacilityContactResponseTest.php +test/Model/FacilityResponsePagedResponseTest.php +test/Model/FacilityResponseTest.php +test/Model/ForgotPasswordRequestRequestTest.php +test/Model/ForgotPasswordRequestResponseTest.php +test/Model/ForgotPasswordResetRequestTest.php +test/Model/ForgotPasswordVerifyRequestTest.php +test/Model/ForgotPasswordVerifyResponseTest.php +test/Model/LoginRequestTest.php +test/Model/LoginResponseTest.php +test/Model/LogoutRequestTest.php +test/Model/MeResponseTest.php +test/Model/OrderResponsePagedResponseTest.php +test/Model/OrderResponseTest.php +test/Model/PasswordPolicyResponseTest.php +test/Model/PasswordResetTemplateResponseTest.php +test/Model/PermissionDtoTest.php +test/Model/RefreshRequestTest.php +test/Model/ResetUserPasswordRequestTest.php +test/Model/RolePermissionsResponseTest.php +test/Model/RoleResponseTest.php +test/Model/SendTestEmailRequestTest.php +test/Model/SessionResponseTest.php +test/Model/UpdateContractRequestTest.php +test/Model/UpdateEmployeeRequestTest.php +test/Model/UpdateFacilityContactRequestTest.php +test/Model/UpdateFacilityRequestTest.php +test/Model/UpdateOrderRequestTest.php +test/Model/UpdateRolePermissionsRequestTest.php +test/Model/UpdateUserRequestTest.php +test/Model/UpdateValueListItemRequestTest.php +test/Model/UserPermissionOverrideResponseTest.php +test/Model/UserResponseTest.php +test/Model/ValueListItemResponseTest.php +test/Model/ValueListResponseTest.php +test/Model/ValueListTransitionRequestTest.php +test/Model/ValueListTransitionResponseTest.php +test/Model/ValueListUsageResponseTest.php diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/.openapi-generator/VERSION b/omsorgWeb/mitarbeiter-app/api-client-php/.openapi-generator/VERSION new file mode 100644 index 0000000..e465da4 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/.openapi-generator/VERSION @@ -0,0 +1 @@ +7.14.0 diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/.php-cs-fixer.dist.php b/omsorgWeb/mitarbeiter-app/api-client-php/.php-cs-fixer.dist.php new file mode 100644 index 0000000..af9cf39 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/.php-cs-fixer.dist.php @@ -0,0 +1,29 @@ +in(__DIR__) + ->exclude('vendor') + ->exclude('test') + ->exclude('tests') +; + +$config = new PhpCsFixer\Config(); +return $config->setRules([ + '@PSR12' => true, + 'phpdoc_order' => true, + 'array_syntax' => [ 'syntax' => 'short' ], + 'strict_comparison' => true, + 'strict_param' => true, + 'no_trailing_whitespace' => false, + 'no_trailing_whitespace_in_comment' => false, + 'braces' => false, + 'single_blank_line_at_eof' => false, + 'blank_line_after_namespace' => false, + 'no_leading_import_slash' => false, + ]) + ->setFinder($finder) +; diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/.travis.yml b/omsorgWeb/mitarbeiter-app/api-client-php/.travis.yml new file mode 100644 index 0000000..667b815 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/.travis.yml @@ -0,0 +1,8 @@ +language: php +# Bionic environment has preinstalled PHP from 7.1 to 7.4 +# https://docs.travis-ci.com/user/reference/bionic/#php-support +dist: bionic +php: + - 7.4 +before_install: "composer install" +script: "vendor/bin/phpunit" diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/ANLEITUNG.md b/omsorgWeb/mitarbeiter-app/api-client-php/ANLEITUNG.md new file mode 100644 index 0000000..cec2a41 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/ANLEITUNG.md @@ -0,0 +1,63 @@ +# Anleitung — omsorgcore-client-php + +Generierter PHP-Client für die `omsorgCore`-API, erzeugt mit [openapi-generator-cli](https://github.com/OpenAPITools/openapi-generator) aus der Swagger/OpenAPI-JSON des Backends. **Ersetzt (noch) nicht** den handgeschriebenen Wrapper `lib/omsorgCoreClient.php` (reiner cURL-Wrapper, eigenes Rückgabeformat `['ok', 'status', 'data']`) — der bleibt unverändert im Einsatz. Dieser Client ist eine zusätzliche, eigenständige Bibliothek. + +`README.md` in diesem Ordner wird bei jeder Generierung automatisch neu geschrieben (Standard-Output von openapi-generator, dokumentiert die generierten API-Klassen) — diese Datei hier nicht, sie bleibt stabil. + +## Voraussetzungen + +- Node.js + npx (für `openapi-generator-cli`, keine separate Node-Installation im restlichen `omsorgWeb` nötig — nur für die Generierung selbst) +- Java (wird von `openapi-generator-cli` intern benötigt, `java` muss im `PATH` sein) +- **Composer** (für den generierten PHP-Client — im Gegensatz zum Rest von `omsorgWeb`, das bewusst framework-/Composer-frei ist. Installation z. B. `sudo apt install composer` oder offizielles Installer-Skript von [getcomposer.org](https://getcomposer.org/download/)) +- `omsorgCore` muss lokal im **Development-Modus** laufen, da Swagger nur dort aktiv ist + +## API lokal starten (für die Generierung) + +```bash +cd omsorgCore +ASPNETCORE_ENVIRONMENT=Development dotnet run --project src/OmsorgCore.Api +# → Swagger-JSON unter http://localhost:5245/swagger/v1/swagger.json +``` + +## Client neu generieren + +```bash +cd omsorgWeb/mitarbeiter-app/api-client-php +./generate.sh +``` + +Nimmt die Backend-URL aus `OMSORG_CORE_URL` (Default `http://localhost:5245`, dieselbe Konvention wie `OMSORG_CORE_URL` in `omsorgapp` bzw. die Basis-URL in `lib/omsorgCoreClient.php`). Überschreibt `lib/`, `docs/`, `test/`, `README.md`, `composer.json`, `.gitignore` mit dem aktuellen generierten Stand — danach `git diff` prüfen, bevor committet wird. + +## Abhängigkeiten installieren + +```bash +composer install +``` + +Installiert u. a. `guzzlehttp/guzzle` (HTTP-Client, vom generierten Code genutzt) nach `vendor/`. `vendor/` ist `.gitignore`'t — nur der generierte Quellcode unter `lib/` wird eingecheckt. + +## Verwendung (Beispiel) + +```php +setHost(getenv('OMSORG_CORE_URL') ?: 'http://localhost:5245'); + +$authApi = new OmsorgCoreClient\Api\AuthApi(new GuzzleHttp\Client(), $config); + +$loginRequest = new OmsorgCoreClient\Model\LoginRequest([ + 'username' => 'admin', + 'password' => 'abersicher', +]); + +$loginResponse = $authApi->apiAuthLoginPost($loginRequest); +echo $loginResponse->getAccessToken(); +``` + +Jeder Controller aus `omsorgCore` hat eine eigene `Api`-Klasse unter `OmsorgCoreClient\Api\` (`AuthApi`, `EmployeesApi`, `FacilitiesApi`, `ContractsApi`, `OrdersApi`, `RolesApi`, `UsersApi`, `ValueListsApi`, `AuditLogApi`, `AdminSessionsApi`, `AdminEmailApi`, `HealthApi`) — siehe `docs/Api/` für die vollständige Methodenliste je Klasse. (Namespace ist `OmsorgCoreClient`, nicht `OmsorgCore\Client` — das `\\`-Escaping im `invokerPackage`-Parameter von `generate.sh` wurde vom Generator beim ersten Lauf nicht wie erwartet aufgelöst, siehe `composer.json`s `psr-4`-Mapping.) + +## Wichtig: nach Backend-Änderungen + +Sobald sich Controller/DTOs in `omsorgCore` ändern (neue Endpunkte, neue Felder in Requests/Responses), sollte dieser Client neu generiert und der Diff mitcommittet werden — sonst driftet er unbemerkt vom tatsächlichen Backend-Vertrag ab. diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/README.md b/omsorgWeb/mitarbeiter-app/api-client-php/README.md new file mode 100644 index 0000000..35379f0 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/README.md @@ -0,0 +1,215 @@ +# omsorgcore-client-php + +No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) + + +## Installation & Usage + +### Requirements + +PHP 8.1 and later. + +### Composer + +To install the bindings via [Composer](https://getcomposer.org/), add the following to `composer.json`: + +```json +{ + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/GIT_USER_ID/GIT_REPO_ID.git" + } + ], + "require": { + "GIT_USER_ID/GIT_REPO_ID": "*@dev" + } +} +``` + +Then run `composer install` + +### Manual Installation + +Download the files and include `autoload.php`: + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\AdminEmailApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->apiAdminEmailPasswordResetTemplateGet(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AdminEmailApi->apiAdminEmailPasswordResetTemplateGet: ', $e->getMessage(), PHP_EOL; +} + +``` + +## API Endpoints + +All URIs are relative to *http://localhost* + +Class | Method | HTTP request | Description +------------ | ------------- | ------------- | ------------- +*AdminEmailApi* | [**apiAdminEmailPasswordResetTemplateGet**](docs/Api/AdminEmailApi.md#apiadminemailpasswordresettemplateget) | **GET** /api/admin/email/password-reset-template | +*AdminEmailApi* | [**apiAdminEmailTestSendPost**](docs/Api/AdminEmailApi.md#apiadminemailtestsendpost) | **POST** /api/admin/email/test-send | +*AdminSessionsApi* | [**apiAdminSessionsGet**](docs/Api/AdminSessionsApi.md#apiadminsessionsget) | **GET** /api/admin/sessions | +*AdminSessionsApi* | [**apiAdminSessionsIdRevokePost**](docs/Api/AdminSessionsApi.md#apiadminsessionsidrevokepost) | **POST** /api/admin/sessions/{id}/revoke | +*AdminSessionsApi* | [**apiAdminSessionsRevokeAllPost**](docs/Api/AdminSessionsApi.md#apiadminsessionsrevokeallpost) | **POST** /api/admin/sessions/revoke-all | +*AuditLogApi* | [**apiAuditLogGet**](docs/Api/AuditLogApi.md#apiauditlogget) | **GET** /api/audit-log | +*AuthApi* | [**apiAuthChangePasswordPost**](docs/Api/AuthApi.md#apiauthchangepasswordpost) | **POST** /api/auth/change-password | +*AuthApi* | [**apiAuthForgotPasswordRequestPost**](docs/Api/AuthApi.md#apiauthforgotpasswordrequestpost) | **POST** /api/auth/forgot-password/request | +*AuthApi* | [**apiAuthForgotPasswordResetPost**](docs/Api/AuthApi.md#apiauthforgotpasswordresetpost) | **POST** /api/auth/forgot-password/reset | +*AuthApi* | [**apiAuthForgotPasswordVerifyPost**](docs/Api/AuthApi.md#apiauthforgotpasswordverifypost) | **POST** /api/auth/forgot-password/verify | +*AuthApi* | [**apiAuthLoginPost**](docs/Api/AuthApi.md#apiauthloginpost) | **POST** /api/auth/login | +*AuthApi* | [**apiAuthLogoutPost**](docs/Api/AuthApi.md#apiauthlogoutpost) | **POST** /api/auth/logout | +*AuthApi* | [**apiAuthMeGet**](docs/Api/AuthApi.md#apiauthmeget) | **GET** /api/auth/me | +*AuthApi* | [**apiAuthPasswordPolicyGet**](docs/Api/AuthApi.md#apiauthpasswordpolicyget) | **GET** /api/auth/password-policy | +*AuthApi* | [**apiAuthRefreshPost**](docs/Api/AuthApi.md#apiauthrefreshpost) | **POST** /api/auth/refresh | +*ContractsApi* | [**apiContractsGet**](docs/Api/ContractsApi.md#apicontractsget) | **GET** /api/contracts | +*ContractsApi* | [**apiContractsIdGet**](docs/Api/ContractsApi.md#apicontractsidget) | **GET** /api/contracts/{id} | +*ContractsApi* | [**apiContractsIdPut**](docs/Api/ContractsApi.md#apicontractsidput) | **PUT** /api/contracts/{id} | +*ContractsApi* | [**apiContractsPost**](docs/Api/ContractsApi.md#apicontractspost) | **POST** /api/contracts | +*EmployeesApi* | [**apiEmployeesGet**](docs/Api/EmployeesApi.md#apiemployeesget) | **GET** /api/employees | +*EmployeesApi* | [**apiEmployeesIdGet**](docs/Api/EmployeesApi.md#apiemployeesidget) | **GET** /api/employees/{id} | +*EmployeesApi* | [**apiEmployeesIdPut**](docs/Api/EmployeesApi.md#apiemployeesidput) | **PUT** /api/employees/{id} | +*EmployeesApi* | [**apiEmployeesPost**](docs/Api/EmployeesApi.md#apiemployeespost) | **POST** /api/employees | +*FacilitiesApi* | [**apiFacilitiesGet**](docs/Api/FacilitiesApi.md#apifacilitiesget) | **GET** /api/facilities | +*FacilitiesApi* | [**apiFacilitiesIdGet**](docs/Api/FacilitiesApi.md#apifacilitiesidget) | **GET** /api/facilities/{id} | +*FacilitiesApi* | [**apiFacilitiesIdPut**](docs/Api/FacilitiesApi.md#apifacilitiesidput) | **PUT** /api/facilities/{id} | +*FacilitiesApi* | [**apiFacilitiesPost**](docs/Api/FacilitiesApi.md#apifacilitiespost) | **POST** /api/facilities | +*FacilityContactsApi* | [**apiFacilitiesFacilityIdContactsGet**](docs/Api/FacilityContactsApi.md#apifacilitiesfacilityidcontactsget) | **GET** /api/facilities/{facilityId}/contacts | +*FacilityContactsApi* | [**apiFacilitiesFacilityIdContactsIdPut**](docs/Api/FacilityContactsApi.md#apifacilitiesfacilityidcontactsidput) | **PUT** /api/facilities/{facilityId}/contacts/{id} | +*FacilityContactsApi* | [**apiFacilitiesFacilityIdContactsPost**](docs/Api/FacilityContactsApi.md#apifacilitiesfacilityidcontactspost) | **POST** /api/facilities/{facilityId}/contacts | +*HealthApi* | [**apiHealthGet**](docs/Api/HealthApi.md#apihealthget) | **GET** /api/health | +*OrdersApi* | [**apiOrdersGet**](docs/Api/OrdersApi.md#apiordersget) | **GET** /api/orders | +*OrdersApi* | [**apiOrdersIdGet**](docs/Api/OrdersApi.md#apiordersidget) | **GET** /api/orders/{id} | +*OrdersApi* | [**apiOrdersIdPut**](docs/Api/OrdersApi.md#apiordersidput) | **PUT** /api/orders/{id} | +*OrdersApi* | [**apiOrdersPost**](docs/Api/OrdersApi.md#apiorderspost) | **POST** /api/orders | +*RolesApi* | [**apiRolesGet**](docs/Api/RolesApi.md#apirolesget) | **GET** /api/roles | +*RolesApi* | [**apiRolesIdGet**](docs/Api/RolesApi.md#apirolesidget) | **GET** /api/roles/{id} | +*RolesApi* | [**apiRolesIdPermissionsPut**](docs/Api/RolesApi.md#apirolesidpermissionsput) | **PUT** /api/roles/{id}/permissions | +*RolesApi* | [**apiRolesPost**](docs/Api/RolesApi.md#apirolespost) | **POST** /api/roles | +*UsersApi* | [**apiUsersGet**](docs/Api/UsersApi.md#apiusersget) | **GET** /api/users | +*UsersApi* | [**apiUsersIdPermissionOverridesGet**](docs/Api/UsersApi.md#apiusersidpermissionoverridesget) | **GET** /api/users/{id}/permission-overrides | +*UsersApi* | [**apiUsersIdPermissionOverridesOverrideIdDelete**](docs/Api/UsersApi.md#apiusersidpermissionoverridesoverrideiddelete) | **DELETE** /api/users/{id}/permission-overrides/{overrideId} | +*UsersApi* | [**apiUsersIdPermissionOverridesPost**](docs/Api/UsersApi.md#apiusersidpermissionoverridespost) | **POST** /api/users/{id}/permission-overrides | +*UsersApi* | [**apiUsersIdPut**](docs/Api/UsersApi.md#apiusersidput) | **PUT** /api/users/{id} | +*UsersApi* | [**apiUsersIdResetPasswordPost**](docs/Api/UsersApi.md#apiusersidresetpasswordpost) | **POST** /api/users/{id}/reset-password | +*UsersApi* | [**apiUsersPost**](docs/Api/UsersApi.md#apiuserspost) | **POST** /api/users | +*ValueListsApi* | [**apiValueListsGet**](docs/Api/ValueListsApi.md#apivaluelistsget) | **GET** /api/value-lists | +*ValueListsApi* | [**apiValueListsKeyItemsGet**](docs/Api/ValueListsApi.md#apivaluelistskeyitemsget) | **GET** /api/value-lists/{key}/items | +*ValueListsApi* | [**apiValueListsKeyItemsIdDelete**](docs/Api/ValueListsApi.md#apivaluelistskeyitemsiddelete) | **DELETE** /api/value-lists/{key}/items/{id} | +*ValueListsApi* | [**apiValueListsKeyItemsIdPut**](docs/Api/ValueListsApi.md#apivaluelistskeyitemsidput) | **PUT** /api/value-lists/{key}/items/{id} | +*ValueListsApi* | [**apiValueListsKeyItemsIdUsagesGet**](docs/Api/ValueListsApi.md#apivaluelistskeyitemsidusagesget) | **GET** /api/value-lists/{key}/items/{id}/usages | +*ValueListsApi* | [**apiValueListsKeyItemsPost**](docs/Api/ValueListsApi.md#apivaluelistskeyitemspost) | **POST** /api/value-lists/{key}/items | +*ValueListsApi* | [**apiValueListsKeyTransitionsGet**](docs/Api/ValueListsApi.md#apivaluelistskeytransitionsget) | **GET** /api/value-lists/{key}/transitions | +*ValueListsApi* | [**apiValueListsKeyTransitionsPut**](docs/Api/ValueListsApi.md#apivaluelistskeytransitionsput) | **PUT** /api/value-lists/{key}/transitions | + +## Models + +- [AddUserPermissionOverrideRequest](docs/Model/AddUserPermissionOverrideRequest.md) +- [AuditLogEntryResponse](docs/Model/AuditLogEntryResponse.md) +- [AuditLogEntryResponsePagedResponse](docs/Model/AuditLogEntryResponsePagedResponse.md) +- [ChangePasswordRequest](docs/Model/ChangePasswordRequest.md) +- [ContractResponse](docs/Model/ContractResponse.md) +- [ContractResponsePagedResponse](docs/Model/ContractResponsePagedResponse.md) +- [CreateContractRequest](docs/Model/CreateContractRequest.md) +- [CreateEmployeeRequest](docs/Model/CreateEmployeeRequest.md) +- [CreateFacilityContactRequest](docs/Model/CreateFacilityContactRequest.md) +- [CreateFacilityRequest](docs/Model/CreateFacilityRequest.md) +- [CreateOrderRequest](docs/Model/CreateOrderRequest.md) +- [CreateRoleRequest](docs/Model/CreateRoleRequest.md) +- [CreateUserRequest](docs/Model/CreateUserRequest.md) +- [CreateValueListItemRequest](docs/Model/CreateValueListItemRequest.md) +- [EmployeeResponse](docs/Model/EmployeeResponse.md) +- [EmployeeResponsePagedResponse](docs/Model/EmployeeResponsePagedResponse.md) +- [FacilityContactResponse](docs/Model/FacilityContactResponse.md) +- [FacilityResponse](docs/Model/FacilityResponse.md) +- [FacilityResponsePagedResponse](docs/Model/FacilityResponsePagedResponse.md) +- [ForgotPasswordRequestRequest](docs/Model/ForgotPasswordRequestRequest.md) +- [ForgotPasswordRequestResponse](docs/Model/ForgotPasswordRequestResponse.md) +- [ForgotPasswordResetRequest](docs/Model/ForgotPasswordResetRequest.md) +- [ForgotPasswordVerifyRequest](docs/Model/ForgotPasswordVerifyRequest.md) +- [ForgotPasswordVerifyResponse](docs/Model/ForgotPasswordVerifyResponse.md) +- [LoginRequest](docs/Model/LoginRequest.md) +- [LoginResponse](docs/Model/LoginResponse.md) +- [LogoutRequest](docs/Model/LogoutRequest.md) +- [MeResponse](docs/Model/MeResponse.md) +- [OrderResponse](docs/Model/OrderResponse.md) +- [OrderResponsePagedResponse](docs/Model/OrderResponsePagedResponse.md) +- [PasswordPolicyResponse](docs/Model/PasswordPolicyResponse.md) +- [PasswordResetTemplateResponse](docs/Model/PasswordResetTemplateResponse.md) +- [PermissionDto](docs/Model/PermissionDto.md) +- [RefreshRequest](docs/Model/RefreshRequest.md) +- [ResetUserPasswordRequest](docs/Model/ResetUserPasswordRequest.md) +- [RolePermissionsResponse](docs/Model/RolePermissionsResponse.md) +- [RoleResponse](docs/Model/RoleResponse.md) +- [SendTestEmailRequest](docs/Model/SendTestEmailRequest.md) +- [SessionResponse](docs/Model/SessionResponse.md) +- [UpdateContractRequest](docs/Model/UpdateContractRequest.md) +- [UpdateEmployeeRequest](docs/Model/UpdateEmployeeRequest.md) +- [UpdateFacilityContactRequest](docs/Model/UpdateFacilityContactRequest.md) +- [UpdateFacilityRequest](docs/Model/UpdateFacilityRequest.md) +- [UpdateOrderRequest](docs/Model/UpdateOrderRequest.md) +- [UpdateRolePermissionsRequest](docs/Model/UpdateRolePermissionsRequest.md) +- [UpdateUserRequest](docs/Model/UpdateUserRequest.md) +- [UpdateValueListItemRequest](docs/Model/UpdateValueListItemRequest.md) +- [UserPermissionOverrideResponse](docs/Model/UserPermissionOverrideResponse.md) +- [UserResponse](docs/Model/UserResponse.md) +- [ValueListItemResponse](docs/Model/ValueListItemResponse.md) +- [ValueListResponse](docs/Model/ValueListResponse.md) +- [ValueListTransitionRequest](docs/Model/ValueListTransitionRequest.md) +- [ValueListTransitionResponse](docs/Model/ValueListTransitionResponse.md) +- [ValueListUsageResponse](docs/Model/ValueListUsageResponse.md) + +## Authorization + +Authentication schemes defined for the API: +### Bearer + +- **Type**: Bearer authentication (JWT) + +## Tests + +To run the tests, use: + +```bash +composer install +vendor/bin/phpunit +``` + +## Author + + + +## About this package + +This PHP package is automatically generated by the [OpenAPI Generator](https://openapi-generator.tech) project: + +- API version: `1.0` + - Generator version: `7.14.0` +- Build package: `org.openapitools.codegen.languages.PhpClientCodegen` diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/composer.json b/omsorgWeb/mitarbeiter-app/api-client-php/composer.json new file mode 100644 index 0000000..363b83b --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/composer.json @@ -0,0 +1,38 @@ +{ + "description": "No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)", + "keywords": [ + "openapitools", + "openapi-generator", + "openapi", + "php", + "sdk", + "rest", + "api" + ], + "homepage": "https://openapi-generator.tech", + "license": "unlicense", + "authors": [ + { + "name": "OpenAPI", + "homepage": "https://openapi-generator.tech" + } + ], + "require": { + "php": "^8.1", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*", + "guzzlehttp/guzzle": "^7.3", + "guzzlehttp/psr7": "^1.7 || ^2.0" + }, + "require-dev": { + "phpunit/phpunit": "^8.0 || ^9.0", + "friendsofphp/php-cs-fixer": "^3.5" + }, + "autoload": { + "psr-4": { "OmsorgCoreClient\\" : "lib/" } + }, + "autoload-dev": { + "psr-4": { "OmsorgCoreClient\\Test\\" : "test/" } + } +} diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/composer.lock b/omsorgWeb/mitarbeiter-app/api-client-php/composer.lock new file mode 100644 index 0000000..a256ec1 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/composer.lock @@ -0,0 +1,5015 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "3d156d10b574f52a2dfd9a5ced1e76a6", + "packages": [ + { + "name": "guzzlehttp/guzzle", + "version": "7.15.3", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "ae311b8f045ea93ce7b1c9cdb7cec06c53f944bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/ae311b8f045ea93ce7b1c9cdb7cec06c53f944bc", + "reference": "ae311b8f045ea93ce7b1c9cdb7cec06c53f944bc", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^2.5.2", + "guzzlehttp/psr7": "^2.13", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.5 || ^3.0", + "symfony/polyfill-php80": "^1.25" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-curl": "*", + "guzzle/client-integration-tests": "3.0.3", + "guzzlehttp/test-server": "^0.7", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.52 || ^9.6.34", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.15.3" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2026-08-05T19:48:21+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "2.5.2", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "2823687acff28b2dbe67b2508a6b300e2c3fa4ce" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/2823687acff28b2dbe67b2508a6b300e2c3fa4ce", + "reference": "2823687acff28b2dbe67b2508a6b300e2c3fa4ce", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "symfony/deprecation-contracts": "^2.5 || ^3.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.52 || ^9.6.34" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/2.5.2" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2026-08-05T19:30:54+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.13.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "dad89620b7a6edb60c15858442eb2e408b45d8f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/dad89620b7a6edb60c15858442eb2e408b45d8f4", + "reference": "dad89620b7a6edb60c15858442eb2e408b45d8f4", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0", + "symfony/deprecation-contracts": "^2.5 || ^3.0", + "symfony/polyfill-php80": "^1.25" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "1.1.0", + "jshttp/mime-db": "1.54.0.1", + "phpunit/phpunit": "^8.5.52 || ^9.6.34" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.13.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2026-07-16T22:23:49+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory" + }, + "time": "2024-04-15T12:06:14+00:00" + }, + { + "name": "psr/http-message", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, + "time": "2023-04-04T09:54:51+00:00" + }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.7.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "f3202fa1b5097b0af062dc978b32ecf63404e31d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/f3202fa1b5097b0af062dc978b32ecf63404e31d", + "reference": "f3202fa1b5097b0af062dc978b32ecf63404e31d", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.7-dev" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.7.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-06-05T06:23:12+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.37.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/dfb55726c3a76ea3b6459fcfda1ec2d80a682411", + "reference": "dfb55726c3a76ea3b6459fcfda1ec2d80a682411", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.37.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-04-10T16:19:22+00:00" + } + ], + "packages-dev": [ + { + "name": "clue/ndjson-react", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/clue/reactphp-ndjson.git", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/reactphp-ndjson/zipball/392dc165fce93b5bb5c637b67e59619223c931b0", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "react/stream": "^1.2" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35", + "react/event-loop": "^1.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Clue\\React\\NDJson\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + } + ], + "description": "Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.", + "homepage": "https://github.com/clue/reactphp-ndjson", + "keywords": [ + "NDJSON", + "json", + "jsonlines", + "newline", + "reactphp", + "streaming" + ], + "support": { + "issues": "https://github.com/clue/reactphp-ndjson/issues", + "source": "https://github.com/clue/reactphp-ndjson/tree/v1.3.0" + }, + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-12-23T10:58:28+00:00" + }, + { + "name": "composer/pcre", + "version": "3.4.0", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "d5a341b3fb61f3001970940afb1d332968a183ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/d5a341b3fb61f3001970940afb1d332968a183ed", + "reference": "d5a341b3fb61f3001970940afb1d332968a183ed", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<2.2.2" + }, + "require-dev": { + "phpstan/phpstan": "^2", + "phpstan/phpstan-deprecation-rules": "^2", + "phpstan/phpstan-strict-rules": "^2", + "phpunit/phpunit": "^9" + }, + "type": "library", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + }, + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.4.0" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + } + ], + "time": "2026-06-07T11:47:49+00:00" + }, + { + "name": "composer/semver", + "version": "3.4.4", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/198166618906cb2de69b95d7d47e5fa8aa1b2b95", + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.4" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + } + ], + "time": "2025-08-20T19:15:30+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.5", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-05-06T16:37:16+00:00" + }, + { + "name": "doctrine/instantiator", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/doctrine/instantiator.git", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/instantiator/zipball/c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "reference": "c6222283fa3f4ac679f8b9ced9a4e23f163e80d0", + "shasum": "" + }, + "require": { + "php": "^8.1" + }, + "require-dev": { + "doctrine/coding-standard": "^11", + "ext-pdo": "*", + "ext-phar": "*", + "phpbench/phpbench": "^1.2", + "phpstan/phpstan": "^1.9.4", + "phpstan/phpstan-phpunit": "^1.3", + "phpunit/phpunit": "^9.5.27", + "vimeo/psalm": "^5.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Marco Pivetta", + "email": "ocramius@gmail.com", + "homepage": "https://ocramius.github.io/" + } + ], + "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", + "homepage": "https://www.doctrine-project.org/projects/instantiator.html", + "keywords": [ + "constructor", + "instantiate" + ], + "support": { + "issues": "https://github.com/doctrine/instantiator/issues", + "source": "https://github.com/doctrine/instantiator/tree/2.0.0" + }, + "funding": [ + { + "url": "https://www.doctrine-project.org/sponsorship.html", + "type": "custom" + }, + { + "url": "https://www.patreon.com/phpdoctrine", + "type": "patreon" + }, + { + "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", + "type": "tidelift" + } + ], + "time": "2022-12-30T00:23:10+00:00" + }, + { + "name": "ergebnis/agent-detector", + "version": "1.2.0", + "source": { + "type": "git", + "url": "https://github.com/ergebnis/agent-detector.git", + "reference": "e211f17928c8b95a51e06040792d57f5462fb271" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ergebnis/agent-detector/zipball/e211f17928c8b95a51e06040792d57f5462fb271", + "reference": "e211f17928c8b95a51e06040792d57f5462fb271", + "shasum": "" + }, + "require": { + "php": "~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0 || ~8.6.0" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.51.0", + "ergebnis/license": "^2.7.0", + "ergebnis/php-cs-fixer-config": "^6.60.2", + "ergebnis/phpstan-rules": "^2.13.1", + "ergebnis/phpunit-slow-test-detector": "^2.24.0", + "ergebnis/rector-rules": "^1.18.1", + "fakerphp/faker": "^1.24.1", + "infection/infection": "^0.26.6", + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^2.1.54", + "phpstan/phpstan-deprecation-rules": "^2.0.4", + "phpstan/phpstan-phpunit": "^2.0.16", + "phpstan/phpstan-strict-rules": "^2.0.10", + "phpunit/phpunit": "^9.6.34", + "rector/rector": "^2.4.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "1.2-dev" + }, + "composer-normalize": { + "indent-size": 2, + "indent-style": "space" + } + }, + "autoload": { + "psr-4": { + "Ergebnis\\AgentDetector\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Andreas Möller", + "email": "am@localheinz.com", + "homepage": "https://localheinz.com" + } + ], + "description": "Provides a detector for detecting the presence of an agent.", + "homepage": "https://github.com/ergebnis/agent-detector", + "support": { + "issues": "https://github.com/ergebnis/agent-detector/issues", + "security": "https://github.com/ergebnis/agent-detector/blob/main/.github/SECURITY.md", + "source": "https://github.com/ergebnis/agent-detector" + }, + "time": "2026-05-07T08:19:07+00:00" + }, + { + "name": "evenement/evenement", + "version": "v3.0.2", + "source": { + "type": "git", + "url": "https://github.com/igorw/evenement.git", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^9 || ^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Evenement\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + } + ], + "description": "Événement is a very simple event dispatching library for PHP", + "keywords": [ + "event-dispatcher", + "event-emitter" + ], + "support": { + "issues": "https://github.com/igorw/evenement/issues", + "source": "https://github.com/igorw/evenement/tree/v3.0.2" + }, + "time": "2023-08-08T05:53:35+00:00" + }, + { + "name": "fidry/cpu-core-counter", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "db9508f7b1474469d9d3c53b86f817e344732678" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/db9508f7b1474469d9d3c53b86f817e344732678", + "reference": "db9508f7b1474469d9d3c53b86f817e344732678", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "fidry/makefile": "^0.2.0", + "fidry/php-cs-fixer-config": "^1.1.2", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-deprecation-rules": "^2.0.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^8.5.31 || ^9.5.26", + "webmozarts/strict-phpunit": "^7.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Fidry\\CpuCoreCounter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" + } + ], + "description": "Tiny utility to get the number of CPU cores.", + "keywords": [ + "CPU", + "core" + ], + "support": { + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.3.0" + }, + "funding": [ + { + "url": "https://github.com/theofidry", + "type": "github" + } + ], + "time": "2025-08-14T07:29:31+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.95.18", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "a8b4e4216faabf67f4e96110ee99a48c96e4e683" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/a8b4e4216faabf67f4e96110ee99a48c96e4e683", + "reference": "a8b4e4216faabf67f4e96110ee99a48c96e4e683", + "shasum": "" + }, + "require": { + "clue/ndjson-react": "^1.3", + "composer/semver": "^3.4", + "composer/xdebug-handler": "^3.0.5", + "ergebnis/agent-detector": "^1.2", + "ext-filter": "*", + "ext-hash": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "fidry/cpu-core-counter": "^1.3", + "php": "^7.4 || ^8.0", + "react/child-process": "^0.6.6", + "react/event-loop": "^1.5", + "react/socket": "^1.16", + "react/stream": "^1.4", + "sebastian/diff": "^4.0.6 || ^5.1.1 || ^6.0.2 || ^7.0 || ^8.0 || ^9.0", + "symfony/console": "^5.4.47 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/event-dispatcher": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/filesystem": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/finder": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/options-resolver": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/polyfill-mbstring": "^1.37", + "symfony/polyfill-php80": "^1.37", + "symfony/polyfill-php81": "^1.37", + "symfony/polyfill-php84": "^1.37", + "symfony/process": "^5.4.47 || ^6.4.24 || ^7.2 || ^8.0", + "symfony/stopwatch": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0" + }, + "require-dev": { + "facile-it/paraunit": "^1.3.1 || ^2.11.0", + "infection/infection": "^0.32.7", + "justinrainbow/json-schema": "^6.10.0", + "keradus/cli-executor": "^2.3", + "mikey179/vfsstream": "^1.6.12", + "php-coveralls/php-coveralls": "^2.9.1", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.8", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.8", + "phpunit/phpunit": "^9.6.35 || ^10.5.64 || ^11.5.56 || ^12.5.31 || ^13.0.6", + "symfony/polyfill-php85": "^1.38", + "symfony/var-dumper": "^5.4.48 || ^6.4.36 || ^7.4.8 || ^8.1.1", + "symfony/yaml": "^5.4.53 || ^6.4.41 || ^7.4.13 || ^8.1.1" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + }, + "exclude-from-classmap": [ + "src/**/Internal/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.95.18" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2026-07-30T15:46:02+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.13.4", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3 <3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.4" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2025-08-01T08:46:24+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v5.8.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "044a6a392ff8ad0d61f14370a5fbbd0a0107152f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/044a6a392ff8ad0d61f14370a5fbbd0a0107152f", + "reference": "044a6a392ff8ad0d61f14370a5fbbd0a0107152f", + "shasum": "" + }, + "require": { + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.8.0" + }, + "time": "2026-07-04T14:30:18+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "9.2.32", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/85402a822d1ecf1db1096959413d35e1c37cf1a5", + "reference": "85402a822d1ecf1db1096959413d35e1c37cf1a5", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^4.19.1 || ^5.1.0", + "php": ">=7.3", + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-text-template": "^2.0.4", + "sebastian/code-unit-reverse-lookup": "^2.0.3", + "sebastian/complexity": "^2.0.3", + "sebastian/environment": "^5.1.5", + "sebastian/lines-of-code": "^1.0.4", + "sebastian/version": "^3.0.2", + "theseer/tokenizer": "^1.2.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.6" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "9.2.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.32" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-08-22T04:23:01+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "3.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "reference": "cf1c2e7c203ac650e352f4cc675a7021e7d1b3cf", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/3.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2021-12-02T12:48:52+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "3.1.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "reference": "5a10147d0aaf65b58940a0b72f71c9ac0423cc67", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/3.1.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:58:55+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "reference": "5da5f67fc95621df9ff4c4e5a84d6a8a2acf7c28", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T05:33:50+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "5.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "reference": "5a63ce20ed1b5bf577850e2c4e87f4aa902afbd2", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "source": "https://github.com/sebastianbergmann/php-timer/tree/5.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:16:10+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "9.6.35", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "0edba2f3a0c48df3553cb9b640810b30df60302b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0edba2f3a0c48df3553cb9b640810b30df60302b", + "reference": "0edba2f3a0c48df3553cb9b640810b30df60302b", + "shasum": "" + }, + "require": { + "doctrine/instantiator": "^1.5.0 || ^2", + "ext-dom": "*", + "ext-filter": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.13.4", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", + "php": ">=7.3", + "phpunit/php-code-coverage": "^9.2.32", + "phpunit/php-file-iterator": "^3.0.6", + "phpunit/php-invoker": "^3.1.1", + "phpunit/php-text-template": "^2.0.4", + "phpunit/php-timer": "^5.0.3", + "sebastian/cli-parser": "^1.0.2", + "sebastian/code-unit": "^1.0.8", + "sebastian/comparator": "^4.0.10", + "sebastian/diff": "^4.0.6", + "sebastian/environment": "^5.1.5", + "sebastian/exporter": "^4.0.8", + "sebastian/global-state": "^5.0.8", + "sebastian/object-enumerator": "^4.0.4", + "sebastian/resource-operations": "^3.0.4", + "sebastian/type": "^3.2.1", + "sebastian/version": "^3.0.2" + }, + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "9.6-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.35" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsoring.html", + "type": "other" + } + ], + "time": "2026-07-06T14:48:07+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/log", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.2" + }, + "time": "2024-09-11T13:17:53+00:00" + }, + { + "name": "react/cache", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/cache.git", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/promise": "^3.0 || ^2.0 || ^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, Promise-based cache interface for ReactPHP", + "keywords": [ + "cache", + "caching", + "promise", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/cache/issues", + "source": "https://github.com/reactphp/cache/tree/v1.2.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2022-11-30T15:59:55+00:00" + }, + { + "name": "react/child-process", + "version": "v0.6.7", + "source": { + "type": "git", + "url": "https://github.com/reactphp/child-process.git", + "reference": "970f0e71945556422ee4570ccbabaedc3cf04ad3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/child-process/zipball/970f0e71945556422ee4570ccbabaedc3cf04ad3", + "reference": "970f0e71945556422ee4570ccbabaedc3cf04ad3", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/event-loop": "^1.2", + "react/stream": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/socket": "^1.16", + "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\ChildProcess\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven library for executing child processes with ReactPHP.", + "keywords": [ + "event-driven", + "process", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/child-process/issues", + "source": "https://github.com/reactphp/child-process/tree/v0.6.7" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-12-23T15:25:20+00:00" + }, + { + "name": "react/dns", + "version": "v1.14.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/dns.git", + "reference": "7562c05391f42701c1fccf189c8225fece1cd7c3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/dns/zipball/7562c05391f42701c1fccf189c8225fece1cd7c3", + "reference": "7562c05391f42701c1fccf189c8225fece1cd7c3", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/cache": "^1.0 || ^0.6 || ^0.5", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.7 || ^1.2.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3 || ^2", + "react/promise-timer": "^1.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Dns\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async DNS resolver for ReactPHP", + "keywords": [ + "async", + "dns", + "dns-resolver", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/dns/issues", + "source": "https://github.com/reactphp/dns/tree/v1.14.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-11-18T19:34:28+00:00" + }, + { + "name": "react/event-loop", + "version": "v1.6.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/event-loop.git", + "reference": "ba276bda6083df7e0050fd9b33f66ad7a4ac747a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/ba276bda6083df7e0050fd9b33f66ad7a4ac747a", + "reference": "ba276bda6083df7e0050fd9b33f66ad7a4ac747a", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "suggest": { + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\EventLoop\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": [ + "asynchronous", + "event-loop" + ], + "support": { + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.6.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-11-17T20:46:25+00:00" + }, + { + "name": "react/promise", + "version": "v3.3.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "23444f53a813a3296c1368bb104793ce8d88f04a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/23444f53a813a3296c1368bb104793ce8d88f04a", + "reference": "23444f53a813a3296c1368bb104793ce8d88f04a", + "shasum": "" + }, + "require": { + "php": ">=7.1.0" + }, + "require-dev": { + "phpstan/phpstan": "1.12.28 || 1.4.10", + "phpunit/phpunit": "^9.6 || ^7.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v3.3.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-08-19T18:57:03+00:00" + }, + { + "name": "react/socket", + "version": "v1.17.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/socket.git", + "reference": "ef5b17b81f6f60504c539313f94f2d826c5faa08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/socket/zipball/ef5b17b81f6f60504c539313f94f2d826c5faa08", + "reference": "ef5b17b81f6f60504c539313f94f2d826c5faa08", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/dns": "^1.13", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3.3 || ^2", + "react/promise-stream": "^1.4", + "react/promise-timer": "^1.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Socket\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", + "keywords": [ + "Connection", + "Socket", + "async", + "reactphp", + "stream" + ], + "support": { + "issues": "https://github.com/reactphp/socket/issues", + "source": "https://github.com/reactphp/socket/tree/v1.17.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-11-19T20:47:34+00:00" + }, + { + "name": "react/stream", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/stream.git", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.2" + }, + "require-dev": { + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Stream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", + "keywords": [ + "event-driven", + "io", + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" + ], + "support": { + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.4.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-06-11T12:45:25+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "1.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "reference": "2b56bea83a09de3ac06bb18b92f068e60cc6f50b", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/1.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:27:43+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "1.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/1fc9f64c0927627ef78ba436c9b17d967e68e120", + "reference": "1fc9f64c0927627ef78ba436c9b17d967e68e120", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "source": "https://github.com/sebastianbergmann/code-unit/tree/1.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:08:54+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "reference": "ac91f01ccec49fb77bdc6fd1e548bc70f7faa3e5", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T05:30:19+00:00" + }, + { + "name": "sebastian/comparator", + "version": "4.0.10", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "e4df00b9b3571187db2831ae9aada2c6efbd715d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/e4df00b9b3571187db2831ae9aada2c6efbd715d", + "reference": "e4df00b9b3571187db2831ae9aada2c6efbd715d", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/diff": "^4.0", + "sebastian/exporter": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.10" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator", + "type": "tidelift" + } + ], + "time": "2026-01-24T09:22:56+00:00" + }, + { + "name": "sebastian/complexity", + "version": "2.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/25f207c40d62b8b7aa32f5ab026c53561964053a", + "reference": "25f207c40d62b8b7aa32f5ab026c53561964053a", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "source": "https://github.com/sebastianbergmann/complexity/tree/2.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:19:30+00:00" + }, + { + "name": "sebastian/diff", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/ba01945089c3a293b01ba9badc29ad55b106b0bc", + "reference": "ba01945089c3a293b01ba9badc29ad55b106b0bc", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "source": "https://github.com/sebastianbergmann/diff/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-02T06:30:58+00:00" + }, + { + "name": "sebastian/environment", + "version": "5.1.5", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "reference": "830c43a844f1f8d5b7a1f6d6076b784454d8b7ed", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "http://www.github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "source": "https://github.com/sebastianbergmann/environment/tree/5.1.5" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:03:51+00:00" + }, + { + "name": "sebastian/exporter", + "version": "4.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "14c6ba52f95a36c3d27c835d65efc7123c446e8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/14c6ba52f95a36c3d27c835d65efc7123c446e8c", + "reference": "14c6ba52f95a36c3d27c835d65efc7123c446e8c", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-mbstring": "*", + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "source": "https://github.com/sebastianbergmann/exporter/tree/4.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/exporter", + "type": "tidelift" + } + ], + "time": "2025-09-24T06:03:27+00:00" + }, + { + "name": "sebastian/global-state", + "version": "5.0.8", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/b6781316bdcd28260904e7cc18ec983d0d2ef4f6", + "reference": "b6781316bdcd28260904e7cc18ec983d0d2ef4f6", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^9.3" + }, + "suggest": { + "ext-uopz": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "http://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "source": "https://github.com/sebastianbergmann/global-state/tree/5.0.8" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/global-state", + "type": "tidelift" + } + ], + "time": "2025-08-10T07:10:35+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "reference": "e1e4a170560925c26d424b6a03aed157e7dcc5c5", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18 || ^5.0", + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/1.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-12-22T06:20:34+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "4.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/5c9eeac41b290a3712d88851518825ad78f45c71", + "reference": "5c9eeac41b290a3712d88851518825ad78f45c71", + "shasum": "" + }, + "require": { + "php": ">=7.3", + "sebastian/object-reflector": "^2.0", + "sebastian/recursion-context": "^4.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/4.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:12:34+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "reference": "b4f479ebdbf63ac605d183ece17d8d7fe49c15c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-10-26T13:14:26+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "4.0.6", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "539c6691e0623af6dc6f9c20384c120f963465a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/539c6691e0623af6dc6f9c20384c120f963465a0", + "reference": "539c6691e0623af6dc6f9c20384c120f963465a0", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/4.0.6" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context", + "type": "tidelift" + } + ], + "time": "2025-08-10T06:57:39+00:00" + }, + { + "name": "sebastian/resource-operations", + "version": "3.0.4", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "reference": "05d5692a7993ecccd56a03e40cd7e5b09b1d404e", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "support": { + "source": "https://github.com/sebastianbergmann/resource-operations/tree/3.0.4" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-03-14T16:00:52+00:00" + }, + { + "name": "sebastian/type", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "reference": "75e2c2a32f5e0b3aef905b9ed0b179b953b3d7c7", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "source": "https://github.com/sebastianbergmann/type/tree/3.2.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2023-02-03T06:13:03+00:00" + }, + { + "name": "sebastian/version", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c6c1022351a901512170118436c764e473f6de8c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c6c1022351a901512170118436c764e473f6de8c", + "reference": "c6c1022351a901512170118436c764e473f6de8c", + "shasum": "" + }, + "require": { + "php": ">=7.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "source": "https://github.com/sebastianbergmann/version/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2020-09-28T06:39:44+00:00" + }, + { + "name": "symfony/console", + "version": "v7.4.16", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "f4c69c9aed03abf933b294257d618bdd9b30a06d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/f4c69c9aed03abf933b294257d618bdd9b30a06d", + "reference": "f4c69c9aed03abf933b294257d618bdd9b30a06d", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^7.2|^8.0" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0|^8.0", + "symfony/dependency-injection": "^6.4|^7.0|^8.0", + "symfony/event-dispatcher": "^6.4|^7.0|^8.0", + "symfony/http-foundation": "^6.4|^7.0|^8.0", + "symfony/http-kernel": "^6.4|^7.0|^8.0", + "symfony/lock": "^6.4|^7.0|^8.0", + "symfony/messenger": "^6.4|^7.0|^8.0", + "symfony/process": "^6.4|^7.0|^8.0", + "symfony/stopwatch": "^6.4|^7.0|^8.0", + "symfony/var-dumper": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v7.4.16" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-07-31T12:37:14+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v7.4.15", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "336e7f3b9e95aba04f93ea9143920c2186abfbb9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/336e7f3b9e95aba04f93ea9143920c2186abfbb9", + "reference": "336e7f3b9e95aba04f93ea9143920c2186abfbb9", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/event-dispatcher-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/service-contracts": "<2.5" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0|^8.0", + "symfony/dependency-injection": "^6.4|^7.0|^8.0", + "symfony/error-handler": "^6.4|^7.0|^8.0", + "symfony/expression-language": "^6.4|^7.0|^8.0", + "symfony/framework-bundle": "^6.4|^7.0|^8.0", + "symfony/http-foundation": "^6.4|^7.0|^8.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v7.4.15" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-07-21T15:13:06+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v3.7.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "c7de7a00ffb67842132da02ea92988a39ccd9f4e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/c7de7a00ffb67842132da02ea92988a39ccd9f4e", + "reference": "c7de7a00ffb67842132da02ea92988a39ccd9f4e", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/event-dispatcher": "^1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.7.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-06-05T06:23:12+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v7.4.15", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "ff16a16bf87fdf264638b8f6995b3515975e3c79" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/ff16a16bf87fdf264638b8f6995b3515975e3c79", + "reference": "ff16a16bf87fdf264638b8f6995b3515975e3c79", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" + }, + "require-dev": { + "symfony/process": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v7.4.15" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-07-22T07:36:05+00:00" + }, + { + "name": "symfony/finder", + "version": "v7.4.14", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "13b38720174286f55d1761152b575a8d1436fc25" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/13b38720174286f55d1761152b575a8d1436fc25", + "reference": "13b38720174286f55d1761152b575a8d1436fc25", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "symfony/filesystem": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v7.4.14" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-06-27T08:31:18+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v7.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "2888fcdc4dc2fd5f7c7397be78631e8af12e02b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/2888fcdc4dc2fd5f7c7397be78631e8af12e02b4", + "reference": "2888fcdc4dc2fd5f7c7397be78631e8af12e02b4", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v7.4.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-24T13:12:05+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.37.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "141046a8f9477948ff284fa65be2095baafb94f2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/141046a8f9477948ff284fa65be2095baafb94f2", + "reference": "141046a8f9477948ff284fa65be2095baafb94f2", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.37.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-04-10T16:19:22+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.41.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "bb899c1db0aa8127dc3afe8cda4a67eb24915f8d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/bb899c1db0aa8127dc3afe8cda4a67eb24915f8d", + "reference": "bb899c1db0aa8127dc3afe8cda4a67eb24915f8d", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.41.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-07-28T08:25:59+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.38.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "2d446c214bdbe5b71bde5011b060a05fece3ae6b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/2d446c214bdbe5b71bde5011b060a05fece3ae6b", + "reference": "2d446c214bdbe5b71bde5011b060a05fece3ae6b", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.38.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-25T13:48:31+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.38.2", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6", + "reference": "d3d318bad5e7a1bfbd026009c8bfb8d8f99ae6b6", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "php": ">=7.2" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.38.2" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-27T06:59:30+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.38.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "6bfb9c766cacffbc8e118cb87217d08ed84e5cd7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/6bfb9c766cacffbc8e118cb87217d08ed84e5cd7", + "reference": "6bfb9c766cacffbc8e118cb87217d08ed84e5cd7", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.38.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-26T12:45:58+00:00" + }, + { + "name": "symfony/polyfill-php84", + "version": "v1.38.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php84.git", + "reference": "f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa", + "reference": "f4e1dfaee5b74aba5964fe1fd4dfc7ba5e3085fa", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php84\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.4+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php84/tree/v1.38.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-26T12:51:13+00:00" + }, + { + "name": "symfony/process", + "version": "v7.4.13", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "f5804be144caceb570f6747519999636b664f24c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/f5804be144caceb570f6747519999636b664f24c", + "reference": "f5804be144caceb570f6747519999636b664f24c", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v7.4.13" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-05-23T16:05:06+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.7.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "c0a284bab1ed8aa0417e3d69250ab437739563a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/c0a284bab1ed8aa0417e3d69250ab437739563a0", + "reference": "c0a284bab1ed8aa0417e3d69250ab437739563a0", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.7-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.7.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-06-16T09:55:08+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v7.4.8", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "70a852d72fec4d51efb1f48dcd968efcaf5ccb89" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/70a852d72fec4d51efb1f48dcd968efcaf5ccb89", + "reference": "70a852d72fec4d51efb1f48dcd968efcaf5ccb89", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/service-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v7.4.8" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-03-24T13:12:05+00:00" + }, + { + "name": "symfony/string", + "version": "v7.4.15", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "e394af32256bf9e7bf80849d95e589167c10097b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/e394af32256bf9e7bf80849d95e589167c10097b", + "reference": "e394af32256bf9e7bf80849d95e589167c10097b", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3.0", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.33", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/emoji": "^7.1|^8.0", + "symfony/http-client": "^6.4|^7.0|^8.0", + "symfony/intl": "^6.4|^7.0|^8.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v7.4.15" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2026-07-28T07:33:02+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c", + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.3.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2025-11-17T20:03:58+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": [], + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "^8.1", + "ext-curl": "*", + "ext-json": "*", + "ext-mbstring": "*" + }, + "platform-dev": [], + "plugin-api-version": "2.6.0" +} diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/AdminEmailApi.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/AdminEmailApi.md new file mode 100644 index 0000000..c951ac6 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/AdminEmailApi.md @@ -0,0 +1,121 @@ +# OmsorgCoreClient\AdminEmailApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**apiAdminEmailPasswordResetTemplateGet()**](AdminEmailApi.md#apiAdminEmailPasswordResetTemplateGet) | **GET** /api/admin/email/password-reset-template | | +| [**apiAdminEmailTestSendPost()**](AdminEmailApi.md#apiAdminEmailTestSendPost) | **POST** /api/admin/email/test-send | | + + +## `apiAdminEmailPasswordResetTemplateGet()` + +```php +apiAdminEmailPasswordResetTemplateGet(): \OmsorgCoreClient\Model\PasswordResetTemplateResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\AdminEmailApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->apiAdminEmailPasswordResetTemplateGet(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AdminEmailApi->apiAdminEmailPasswordResetTemplateGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\OmsorgCoreClient\Model\PasswordResetTemplateResponse**](../Model/PasswordResetTemplateResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiAdminEmailTestSendPost()` + +```php +apiAdminEmailTestSendPost($send_test_email_request) +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\AdminEmailApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$send_test_email_request = new \OmsorgCoreClient\Model\SendTestEmailRequest(); // \OmsorgCoreClient\Model\SendTestEmailRequest + +try { + $apiInstance->apiAdminEmailTestSendPost($send_test_email_request); +} catch (Exception $e) { + echo 'Exception when calling AdminEmailApi->apiAdminEmailTestSendPost: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **send_test_email_request** | [**\OmsorgCoreClient\Model\SendTestEmailRequest**](../Model/SendTestEmailRequest.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/AdminSessionsApi.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/AdminSessionsApi.md new file mode 100644 index 0000000..83f43a1 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/AdminSessionsApi.md @@ -0,0 +1,176 @@ +# OmsorgCoreClient\AdminSessionsApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**apiAdminSessionsGet()**](AdminSessionsApi.md#apiAdminSessionsGet) | **GET** /api/admin/sessions | | +| [**apiAdminSessionsIdRevokePost()**](AdminSessionsApi.md#apiAdminSessionsIdRevokePost) | **POST** /api/admin/sessions/{id}/revoke | | +| [**apiAdminSessionsRevokeAllPost()**](AdminSessionsApi.md#apiAdminSessionsRevokeAllPost) | **POST** /api/admin/sessions/revoke-all | | + + +## `apiAdminSessionsGet()` + +```php +apiAdminSessionsGet(): \OmsorgCoreClient\Model\SessionResponse[] +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\AdminSessionsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->apiAdminSessionsGet(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AdminSessionsApi->apiAdminSessionsGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\OmsorgCoreClient\Model\SessionResponse[]**](../Model/SessionResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiAdminSessionsIdRevokePost()` + +```php +apiAdminSessionsIdRevokePost($id) +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\AdminSessionsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string + +try { + $apiInstance->apiAdminSessionsIdRevokePost($id); +} catch (Exception $e) { + echo 'Exception when calling AdminSessionsApi->apiAdminSessionsIdRevokePost: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiAdminSessionsRevokeAllPost()` + +```php +apiAdminSessionsRevokeAllPost() +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\AdminSessionsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $apiInstance->apiAdminSessionsRevokeAllPost(); +} catch (Exception $e) { + echo 'Exception when calling AdminSessionsApi->apiAdminSessionsRevokeAllPost: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/AuditLogApi.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/AuditLogApi.md new file mode 100644 index 0000000..e577a44 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/AuditLogApi.md @@ -0,0 +1,78 @@ +# OmsorgCoreClient\AuditLogApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**apiAuditLogGet()**](AuditLogApi.md#apiAuditLogGet) | **GET** /api/audit-log | | + + +## `apiAuditLogGet()` + +```php +apiAuditLogGet($entity_type, $entity_id, $actor_user_id, $from_utc, $to_utc, $page, $page_size): \OmsorgCoreClient\Model\AuditLogEntryResponsePagedResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\AuditLogApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$entity_type = 'entity_type_example'; // string +$entity_id = 'entity_id_example'; // string +$actor_user_id = 'actor_user_id_example'; // string +$from_utc = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$to_utc = new \DateTime('2013-10-20T19:20:30+01:00'); // \DateTime +$page = 1; // int +$page_size = 50; // int + +try { + $result = $apiInstance->apiAuditLogGet($entity_type, $entity_id, $actor_user_id, $from_utc, $to_utc, $page, $page_size); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AuditLogApi->apiAuditLogGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **entity_type** | **string**| | [optional] | +| **entity_id** | **string**| | [optional] | +| **actor_user_id** | **string**| | [optional] | +| **from_utc** | **\DateTime**| | [optional] | +| **to_utc** | **\DateTime**| | [optional] | +| **page** | **int**| | [optional] [default to 1] | +| **page_size** | **int**| | [optional] [default to 50] | + +### Return type + +[**\OmsorgCoreClient\Model\AuditLogEntryResponsePagedResponse**](../Model/AuditLogEntryResponsePagedResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/AuthApi.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/AuthApi.md new file mode 100644 index 0000000..47c23bc --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/AuthApi.md @@ -0,0 +1,529 @@ +# OmsorgCoreClient\AuthApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**apiAuthChangePasswordPost()**](AuthApi.md#apiAuthChangePasswordPost) | **POST** /api/auth/change-password | | +| [**apiAuthForgotPasswordRequestPost()**](AuthApi.md#apiAuthForgotPasswordRequestPost) | **POST** /api/auth/forgot-password/request | | +| [**apiAuthForgotPasswordResetPost()**](AuthApi.md#apiAuthForgotPasswordResetPost) | **POST** /api/auth/forgot-password/reset | | +| [**apiAuthForgotPasswordVerifyPost()**](AuthApi.md#apiAuthForgotPasswordVerifyPost) | **POST** /api/auth/forgot-password/verify | | +| [**apiAuthLoginPost()**](AuthApi.md#apiAuthLoginPost) | **POST** /api/auth/login | | +| [**apiAuthLogoutPost()**](AuthApi.md#apiAuthLogoutPost) | **POST** /api/auth/logout | | +| [**apiAuthMeGet()**](AuthApi.md#apiAuthMeGet) | **GET** /api/auth/me | | +| [**apiAuthPasswordPolicyGet()**](AuthApi.md#apiAuthPasswordPolicyGet) | **GET** /api/auth/password-policy | | +| [**apiAuthRefreshPost()**](AuthApi.md#apiAuthRefreshPost) | **POST** /api/auth/refresh | | + + +## `apiAuthChangePasswordPost()` + +```php +apiAuthChangePasswordPost($change_password_request) +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\AuthApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$change_password_request = new \OmsorgCoreClient\Model\ChangePasswordRequest(); // \OmsorgCoreClient\Model\ChangePasswordRequest + +try { + $apiInstance->apiAuthChangePasswordPost($change_password_request); +} catch (Exception $e) { + echo 'Exception when calling AuthApi->apiAuthChangePasswordPost: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **change_password_request** | [**\OmsorgCoreClient\Model\ChangePasswordRequest**](../Model/ChangePasswordRequest.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiAuthForgotPasswordRequestPost()` + +```php +apiAuthForgotPasswordRequestPost($forgot_password_request_request): \OmsorgCoreClient\Model\ForgotPasswordRequestResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\AuthApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$forgot_password_request_request = new \OmsorgCoreClient\Model\ForgotPasswordRequestRequest(); // \OmsorgCoreClient\Model\ForgotPasswordRequestRequest + +try { + $result = $apiInstance->apiAuthForgotPasswordRequestPost($forgot_password_request_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AuthApi->apiAuthForgotPasswordRequestPost: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **forgot_password_request_request** | [**\OmsorgCoreClient\Model\ForgotPasswordRequestRequest**](../Model/ForgotPasswordRequestRequest.md)| | [optional] | + +### Return type + +[**\OmsorgCoreClient\Model\ForgotPasswordRequestResponse**](../Model/ForgotPasswordRequestResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiAuthForgotPasswordResetPost()` + +```php +apiAuthForgotPasswordResetPost($forgot_password_reset_request) +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\AuthApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$forgot_password_reset_request = new \OmsorgCoreClient\Model\ForgotPasswordResetRequest(); // \OmsorgCoreClient\Model\ForgotPasswordResetRequest + +try { + $apiInstance->apiAuthForgotPasswordResetPost($forgot_password_reset_request); +} catch (Exception $e) { + echo 'Exception when calling AuthApi->apiAuthForgotPasswordResetPost: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **forgot_password_reset_request** | [**\OmsorgCoreClient\Model\ForgotPasswordResetRequest**](../Model/ForgotPasswordResetRequest.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiAuthForgotPasswordVerifyPost()` + +```php +apiAuthForgotPasswordVerifyPost($forgot_password_verify_request): \OmsorgCoreClient\Model\ForgotPasswordVerifyResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\AuthApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$forgot_password_verify_request = new \OmsorgCoreClient\Model\ForgotPasswordVerifyRequest(); // \OmsorgCoreClient\Model\ForgotPasswordVerifyRequest + +try { + $result = $apiInstance->apiAuthForgotPasswordVerifyPost($forgot_password_verify_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AuthApi->apiAuthForgotPasswordVerifyPost: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **forgot_password_verify_request** | [**\OmsorgCoreClient\Model\ForgotPasswordVerifyRequest**](../Model/ForgotPasswordVerifyRequest.md)| | [optional] | + +### Return type + +[**\OmsorgCoreClient\Model\ForgotPasswordVerifyResponse**](../Model/ForgotPasswordVerifyResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiAuthLoginPost()` + +```php +apiAuthLoginPost($login_request): \OmsorgCoreClient\Model\LoginResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\AuthApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$login_request = new \OmsorgCoreClient\Model\LoginRequest(); // \OmsorgCoreClient\Model\LoginRequest + +try { + $result = $apiInstance->apiAuthLoginPost($login_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AuthApi->apiAuthLoginPost: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **login_request** | [**\OmsorgCoreClient\Model\LoginRequest**](../Model/LoginRequest.md)| | [optional] | + +### Return type + +[**\OmsorgCoreClient\Model\LoginResponse**](../Model/LoginResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiAuthLogoutPost()` + +```php +apiAuthLogoutPost($logout_request) +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\AuthApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$logout_request = new \OmsorgCoreClient\Model\LogoutRequest(); // \OmsorgCoreClient\Model\LogoutRequest + +try { + $apiInstance->apiAuthLogoutPost($logout_request); +} catch (Exception $e) { + echo 'Exception when calling AuthApi->apiAuthLogoutPost: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **logout_request** | [**\OmsorgCoreClient\Model\LogoutRequest**](../Model/LogoutRequest.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiAuthMeGet()` + +```php +apiAuthMeGet(): \OmsorgCoreClient\Model\MeResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\AuthApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->apiAuthMeGet(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AuthApi->apiAuthMeGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\OmsorgCoreClient\Model\MeResponse**](../Model/MeResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiAuthPasswordPolicyGet()` + +```php +apiAuthPasswordPolicyGet(): \OmsorgCoreClient\Model\PasswordPolicyResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\AuthApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->apiAuthPasswordPolicyGet(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AuthApi->apiAuthPasswordPolicyGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\OmsorgCoreClient\Model\PasswordPolicyResponse**](../Model/PasswordPolicyResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiAuthRefreshPost()` + +```php +apiAuthRefreshPost($refresh_request): \OmsorgCoreClient\Model\LoginResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\AuthApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$refresh_request = new \OmsorgCoreClient\Model\RefreshRequest(); // \OmsorgCoreClient\Model\RefreshRequest + +try { + $result = $apiInstance->apiAuthRefreshPost($refresh_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling AuthApi->apiAuthRefreshPost: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **refresh_request** | [**\OmsorgCoreClient\Model\RefreshRequest**](../Model/RefreshRequest.md)| | [optional] | + +### Return type + +[**\OmsorgCoreClient\Model\LoginResponse**](../Model/LoginResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/ContractsApi.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/ContractsApi.md new file mode 100644 index 0000000..83e7574 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/ContractsApi.md @@ -0,0 +1,255 @@ +# OmsorgCoreClient\ContractsApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**apiContractsGet()**](ContractsApi.md#apiContractsGet) | **GET** /api/contracts | | +| [**apiContractsIdGet()**](ContractsApi.md#apiContractsIdGet) | **GET** /api/contracts/{id} | | +| [**apiContractsIdPut()**](ContractsApi.md#apiContractsIdPut) | **PUT** /api/contracts/{id} | | +| [**apiContractsPost()**](ContractsApi.md#apiContractsPost) | **POST** /api/contracts | | + + +## `apiContractsGet()` + +```php +apiContractsGet($search, $status, $employee_id, $facility_id, $page, $page_size): \OmsorgCoreClient\Model\ContractResponsePagedResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\ContractsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$search = 'search_example'; // string +$status = 'status_example'; // string +$employee_id = 'employee_id_example'; // string +$facility_id = 'facility_id_example'; // string +$page = 1; // int +$page_size = 20; // int + +try { + $result = $apiInstance->apiContractsGet($search, $status, $employee_id, $facility_id, $page, $page_size); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ContractsApi->apiContractsGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **search** | **string**| | [optional] | +| **status** | **string**| | [optional] | +| **employee_id** | **string**| | [optional] | +| **facility_id** | **string**| | [optional] | +| **page** | **int**| | [optional] [default to 1] | +| **page_size** | **int**| | [optional] [default to 20] | + +### Return type + +[**\OmsorgCoreClient\Model\ContractResponsePagedResponse**](../Model/ContractResponsePagedResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiContractsIdGet()` + +```php +apiContractsIdGet($id): \OmsorgCoreClient\Model\ContractResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\ContractsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string + +try { + $result = $apiInstance->apiContractsIdGet($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ContractsApi->apiContractsIdGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | + +### Return type + +[**\OmsorgCoreClient\Model\ContractResponse**](../Model/ContractResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiContractsIdPut()` + +```php +apiContractsIdPut($id, $update_contract_request): \OmsorgCoreClient\Model\ContractResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\ContractsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string +$update_contract_request = new \OmsorgCoreClient\Model\UpdateContractRequest(); // \OmsorgCoreClient\Model\UpdateContractRequest + +try { + $result = $apiInstance->apiContractsIdPut($id, $update_contract_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ContractsApi->apiContractsIdPut: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | +| **update_contract_request** | [**\OmsorgCoreClient\Model\UpdateContractRequest**](../Model/UpdateContractRequest.md)| | [optional] | + +### Return type + +[**\OmsorgCoreClient\Model\ContractResponse**](../Model/ContractResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiContractsPost()` + +```php +apiContractsPost($create_contract_request): \OmsorgCoreClient\Model\ContractResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\ContractsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$create_contract_request = new \OmsorgCoreClient\Model\CreateContractRequest(); // \OmsorgCoreClient\Model\CreateContractRequest + +try { + $result = $apiInstance->apiContractsPost($create_contract_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ContractsApi->apiContractsPost: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **create_contract_request** | [**\OmsorgCoreClient\Model\CreateContractRequest**](../Model/CreateContractRequest.md)| | [optional] | + +### Return type + +[**\OmsorgCoreClient\Model\ContractResponse**](../Model/ContractResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/EmployeesApi.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/EmployeesApi.md new file mode 100644 index 0000000..5496911 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/EmployeesApi.md @@ -0,0 +1,253 @@ +# OmsorgCoreClient\EmployeesApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**apiEmployeesGet()**](EmployeesApi.md#apiEmployeesGet) | **GET** /api/employees | | +| [**apiEmployeesIdGet()**](EmployeesApi.md#apiEmployeesIdGet) | **GET** /api/employees/{id} | | +| [**apiEmployeesIdPut()**](EmployeesApi.md#apiEmployeesIdPut) | **PUT** /api/employees/{id} | | +| [**apiEmployeesPost()**](EmployeesApi.md#apiEmployeesPost) | **POST** /api/employees | | + + +## `apiEmployeesGet()` + +```php +apiEmployeesGet($search, $status, $employment_type, $page, $page_size): \OmsorgCoreClient\Model\EmployeeResponsePagedResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\EmployeesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$search = 'search_example'; // string +$status = 'status_example'; // string +$employment_type = 'employment_type_example'; // string +$page = 1; // int +$page_size = 20; // int + +try { + $result = $apiInstance->apiEmployeesGet($search, $status, $employment_type, $page, $page_size); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeesApi->apiEmployeesGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **search** | **string**| | [optional] | +| **status** | **string**| | [optional] | +| **employment_type** | **string**| | [optional] | +| **page** | **int**| | [optional] [default to 1] | +| **page_size** | **int**| | [optional] [default to 20] | + +### Return type + +[**\OmsorgCoreClient\Model\EmployeeResponsePagedResponse**](../Model/EmployeeResponsePagedResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiEmployeesIdGet()` + +```php +apiEmployeesIdGet($id): \OmsorgCoreClient\Model\EmployeeResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\EmployeesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string + +try { + $result = $apiInstance->apiEmployeesIdGet($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeesApi->apiEmployeesIdGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | + +### Return type + +[**\OmsorgCoreClient\Model\EmployeeResponse**](../Model/EmployeeResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiEmployeesIdPut()` + +```php +apiEmployeesIdPut($id, $update_employee_request): \OmsorgCoreClient\Model\EmployeeResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\EmployeesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string +$update_employee_request = new \OmsorgCoreClient\Model\UpdateEmployeeRequest(); // \OmsorgCoreClient\Model\UpdateEmployeeRequest + +try { + $result = $apiInstance->apiEmployeesIdPut($id, $update_employee_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeesApi->apiEmployeesIdPut: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | +| **update_employee_request** | [**\OmsorgCoreClient\Model\UpdateEmployeeRequest**](../Model/UpdateEmployeeRequest.md)| | [optional] | + +### Return type + +[**\OmsorgCoreClient\Model\EmployeeResponse**](../Model/EmployeeResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiEmployeesPost()` + +```php +apiEmployeesPost($create_employee_request): \OmsorgCoreClient\Model\EmployeeResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\EmployeesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$create_employee_request = new \OmsorgCoreClient\Model\CreateEmployeeRequest(); // \OmsorgCoreClient\Model\CreateEmployeeRequest + +try { + $result = $apiInstance->apiEmployeesPost($create_employee_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling EmployeesApi->apiEmployeesPost: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **create_employee_request** | [**\OmsorgCoreClient\Model\CreateEmployeeRequest**](../Model/CreateEmployeeRequest.md)| | [optional] | + +### Return type + +[**\OmsorgCoreClient\Model\EmployeeResponse**](../Model/EmployeeResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/FacilitiesApi.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/FacilitiesApi.md new file mode 100644 index 0000000..b1e89b5 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/FacilitiesApi.md @@ -0,0 +1,251 @@ +# OmsorgCoreClient\FacilitiesApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**apiFacilitiesGet()**](FacilitiesApi.md#apiFacilitiesGet) | **GET** /api/facilities | | +| [**apiFacilitiesIdGet()**](FacilitiesApi.md#apiFacilitiesIdGet) | **GET** /api/facilities/{id} | | +| [**apiFacilitiesIdPut()**](FacilitiesApi.md#apiFacilitiesIdPut) | **PUT** /api/facilities/{id} | | +| [**apiFacilitiesPost()**](FacilitiesApi.md#apiFacilitiesPost) | **POST** /api/facilities | | + + +## `apiFacilitiesGet()` + +```php +apiFacilitiesGet($search, $crm_status, $page, $page_size): \OmsorgCoreClient\Model\FacilityResponsePagedResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\FacilitiesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$search = 'search_example'; // string +$crm_status = 'crm_status_example'; // string +$page = 1; // int +$page_size = 20; // int + +try { + $result = $apiInstance->apiFacilitiesGet($search, $crm_status, $page, $page_size); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FacilitiesApi->apiFacilitiesGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **search** | **string**| | [optional] | +| **crm_status** | **string**| | [optional] | +| **page** | **int**| | [optional] [default to 1] | +| **page_size** | **int**| | [optional] [default to 20] | + +### Return type + +[**\OmsorgCoreClient\Model\FacilityResponsePagedResponse**](../Model/FacilityResponsePagedResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiFacilitiesIdGet()` + +```php +apiFacilitiesIdGet($id): \OmsorgCoreClient\Model\FacilityResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\FacilitiesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string + +try { + $result = $apiInstance->apiFacilitiesIdGet($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FacilitiesApi->apiFacilitiesIdGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | + +### Return type + +[**\OmsorgCoreClient\Model\FacilityResponse**](../Model/FacilityResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiFacilitiesIdPut()` + +```php +apiFacilitiesIdPut($id, $update_facility_request): \OmsorgCoreClient\Model\FacilityResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\FacilitiesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string +$update_facility_request = new \OmsorgCoreClient\Model\UpdateFacilityRequest(); // \OmsorgCoreClient\Model\UpdateFacilityRequest + +try { + $result = $apiInstance->apiFacilitiesIdPut($id, $update_facility_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FacilitiesApi->apiFacilitiesIdPut: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | +| **update_facility_request** | [**\OmsorgCoreClient\Model\UpdateFacilityRequest**](../Model/UpdateFacilityRequest.md)| | [optional] | + +### Return type + +[**\OmsorgCoreClient\Model\FacilityResponse**](../Model/FacilityResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiFacilitiesPost()` + +```php +apiFacilitiesPost($create_facility_request): \OmsorgCoreClient\Model\FacilityResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\FacilitiesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$create_facility_request = new \OmsorgCoreClient\Model\CreateFacilityRequest(); // \OmsorgCoreClient\Model\CreateFacilityRequest + +try { + $result = $apiInstance->apiFacilitiesPost($create_facility_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FacilitiesApi->apiFacilitiesPost: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **create_facility_request** | [**\OmsorgCoreClient\Model\CreateFacilityRequest**](../Model/CreateFacilityRequest.md)| | [optional] | + +### Return type + +[**\OmsorgCoreClient\Model\FacilityResponse**](../Model/FacilityResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/FacilityContactsApi.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/FacilityContactsApi.md new file mode 100644 index 0000000..82e5afa --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/FacilityContactsApi.md @@ -0,0 +1,190 @@ +# OmsorgCoreClient\FacilityContactsApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**apiFacilitiesFacilityIdContactsGet()**](FacilityContactsApi.md#apiFacilitiesFacilityIdContactsGet) | **GET** /api/facilities/{facilityId}/contacts | | +| [**apiFacilitiesFacilityIdContactsIdPut()**](FacilityContactsApi.md#apiFacilitiesFacilityIdContactsIdPut) | **PUT** /api/facilities/{facilityId}/contacts/{id} | | +| [**apiFacilitiesFacilityIdContactsPost()**](FacilityContactsApi.md#apiFacilitiesFacilityIdContactsPost) | **POST** /api/facilities/{facilityId}/contacts | | + + +## `apiFacilitiesFacilityIdContactsGet()` + +```php +apiFacilitiesFacilityIdContactsGet($facility_id): \OmsorgCoreClient\Model\FacilityContactResponse[] +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\FacilityContactsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$facility_id = 'facility_id_example'; // string + +try { + $result = $apiInstance->apiFacilitiesFacilityIdContactsGet($facility_id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FacilityContactsApi->apiFacilitiesFacilityIdContactsGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **facility_id** | **string**| | | + +### Return type + +[**\OmsorgCoreClient\Model\FacilityContactResponse[]**](../Model/FacilityContactResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiFacilitiesFacilityIdContactsIdPut()` + +```php +apiFacilitiesFacilityIdContactsIdPut($facility_id, $id, $update_facility_contact_request): \OmsorgCoreClient\Model\FacilityContactResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\FacilityContactsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$facility_id = 'facility_id_example'; // string +$id = 'id_example'; // string +$update_facility_contact_request = new \OmsorgCoreClient\Model\UpdateFacilityContactRequest(); // \OmsorgCoreClient\Model\UpdateFacilityContactRequest + +try { + $result = $apiInstance->apiFacilitiesFacilityIdContactsIdPut($facility_id, $id, $update_facility_contact_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FacilityContactsApi->apiFacilitiesFacilityIdContactsIdPut: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **facility_id** | **string**| | | +| **id** | **string**| | | +| **update_facility_contact_request** | [**\OmsorgCoreClient\Model\UpdateFacilityContactRequest**](../Model/UpdateFacilityContactRequest.md)| | [optional] | + +### Return type + +[**\OmsorgCoreClient\Model\FacilityContactResponse**](../Model/FacilityContactResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiFacilitiesFacilityIdContactsPost()` + +```php +apiFacilitiesFacilityIdContactsPost($facility_id, $create_facility_contact_request): \OmsorgCoreClient\Model\FacilityContactResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\FacilityContactsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$facility_id = 'facility_id_example'; // string +$create_facility_contact_request = new \OmsorgCoreClient\Model\CreateFacilityContactRequest(); // \OmsorgCoreClient\Model\CreateFacilityContactRequest + +try { + $result = $apiInstance->apiFacilitiesFacilityIdContactsPost($facility_id, $create_facility_contact_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling FacilityContactsApi->apiFacilitiesFacilityIdContactsPost: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **facility_id** | **string**| | | +| **create_facility_contact_request** | [**\OmsorgCoreClient\Model\CreateFacilityContactRequest**](../Model/CreateFacilityContactRequest.md)| | [optional] | + +### Return type + +[**\OmsorgCoreClient\Model\FacilityContactResponse**](../Model/FacilityContactResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/HealthApi.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/HealthApi.md new file mode 100644 index 0000000..aed6696 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/HealthApi.md @@ -0,0 +1,62 @@ +# OmsorgCoreClient\HealthApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**apiHealthGet()**](HealthApi.md#apiHealthGet) | **GET** /api/health | | + + +## `apiHealthGet()` + +```php +apiHealthGet() +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\HealthApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $apiInstance->apiHealthGet(); +} catch (Exception $e) { + echo 'Exception when calling HealthApi->apiHealthGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/OrdersApi.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/OrdersApi.md new file mode 100644 index 0000000..386557f --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/OrdersApi.md @@ -0,0 +1,253 @@ +# OmsorgCoreClient\OrdersApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**apiOrdersGet()**](OrdersApi.md#apiOrdersGet) | **GET** /api/orders | | +| [**apiOrdersIdGet()**](OrdersApi.md#apiOrdersIdGet) | **GET** /api/orders/{id} | | +| [**apiOrdersIdPut()**](OrdersApi.md#apiOrdersIdPut) | **PUT** /api/orders/{id} | | +| [**apiOrdersPost()**](OrdersApi.md#apiOrdersPost) | **POST** /api/orders | | + + +## `apiOrdersGet()` + +```php +apiOrdersGet($search, $status_id, $facility_id, $page, $page_size): \OmsorgCoreClient\Model\OrderResponsePagedResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\OrdersApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$search = 'search_example'; // string +$status_id = 'status_id_example'; // string +$facility_id = 'facility_id_example'; // string +$page = 1; // int +$page_size = 20; // int + +try { + $result = $apiInstance->apiOrdersGet($search, $status_id, $facility_id, $page, $page_size); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrdersApi->apiOrdersGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **search** | **string**| | [optional] | +| **status_id** | **string**| | [optional] | +| **facility_id** | **string**| | [optional] | +| **page** | **int**| | [optional] [default to 1] | +| **page_size** | **int**| | [optional] [default to 20] | + +### Return type + +[**\OmsorgCoreClient\Model\OrderResponsePagedResponse**](../Model/OrderResponsePagedResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiOrdersIdGet()` + +```php +apiOrdersIdGet($id): \OmsorgCoreClient\Model\OrderResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\OrdersApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string + +try { + $result = $apiInstance->apiOrdersIdGet($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrdersApi->apiOrdersIdGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | + +### Return type + +[**\OmsorgCoreClient\Model\OrderResponse**](../Model/OrderResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiOrdersIdPut()` + +```php +apiOrdersIdPut($id, $update_order_request): \OmsorgCoreClient\Model\OrderResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\OrdersApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string +$update_order_request = new \OmsorgCoreClient\Model\UpdateOrderRequest(); // \OmsorgCoreClient\Model\UpdateOrderRequest + +try { + $result = $apiInstance->apiOrdersIdPut($id, $update_order_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrdersApi->apiOrdersIdPut: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | +| **update_order_request** | [**\OmsorgCoreClient\Model\UpdateOrderRequest**](../Model/UpdateOrderRequest.md)| | [optional] | + +### Return type + +[**\OmsorgCoreClient\Model\OrderResponse**](../Model/OrderResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiOrdersPost()` + +```php +apiOrdersPost($create_order_request): \OmsorgCoreClient\Model\OrderResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\OrdersApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$create_order_request = new \OmsorgCoreClient\Model\CreateOrderRequest(); // \OmsorgCoreClient\Model\CreateOrderRequest + +try { + $result = $apiInstance->apiOrdersPost($create_order_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling OrdersApi->apiOrdersPost: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **create_order_request** | [**\OmsorgCoreClient\Model\CreateOrderRequest**](../Model/CreateOrderRequest.md)| | [optional] | + +### Return type + +[**\OmsorgCoreClient\Model\OrderResponse**](../Model/OrderResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/RolesApi.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/RolesApi.md new file mode 100644 index 0000000..8300b9e --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/RolesApi.md @@ -0,0 +1,241 @@ +# OmsorgCoreClient\RolesApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**apiRolesGet()**](RolesApi.md#apiRolesGet) | **GET** /api/roles | | +| [**apiRolesIdGet()**](RolesApi.md#apiRolesIdGet) | **GET** /api/roles/{id} | | +| [**apiRolesIdPermissionsPut()**](RolesApi.md#apiRolesIdPermissionsPut) | **PUT** /api/roles/{id}/permissions | | +| [**apiRolesPost()**](RolesApi.md#apiRolesPost) | **POST** /api/roles | | + + +## `apiRolesGet()` + +```php +apiRolesGet(): \OmsorgCoreClient\Model\RoleResponse[] +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\RolesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->apiRolesGet(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RolesApi->apiRolesGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\OmsorgCoreClient\Model\RoleResponse[]**](../Model/RoleResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiRolesIdGet()` + +```php +apiRolesIdGet($id): \OmsorgCoreClient\Model\RolePermissionsResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\RolesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string + +try { + $result = $apiInstance->apiRolesIdGet($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RolesApi->apiRolesIdGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | + +### Return type + +[**\OmsorgCoreClient\Model\RolePermissionsResponse**](../Model/RolePermissionsResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiRolesIdPermissionsPut()` + +```php +apiRolesIdPermissionsPut($id, $update_role_permissions_request) +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\RolesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string +$update_role_permissions_request = new \OmsorgCoreClient\Model\UpdateRolePermissionsRequest(); // \OmsorgCoreClient\Model\UpdateRolePermissionsRequest + +try { + $apiInstance->apiRolesIdPermissionsPut($id, $update_role_permissions_request); +} catch (Exception $e) { + echo 'Exception when calling RolesApi->apiRolesIdPermissionsPut: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | +| **update_role_permissions_request** | [**\OmsorgCoreClient\Model\UpdateRolePermissionsRequest**](../Model/UpdateRolePermissionsRequest.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiRolesPost()` + +```php +apiRolesPost($create_role_request): \OmsorgCoreClient\Model\RoleResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\RolesApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$create_role_request = new \OmsorgCoreClient\Model\CreateRoleRequest(); // \OmsorgCoreClient\Model\CreateRoleRequest + +try { + $result = $apiInstance->apiRolesPost($create_role_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling RolesApi->apiRolesPost: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **create_role_request** | [**\OmsorgCoreClient\Model\CreateRoleRequest**](../Model/CreateRoleRequest.md)| | [optional] | + +### Return type + +[**\OmsorgCoreClient\Model\RoleResponse**](../Model/RoleResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/UsersApi.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/UsersApi.md new file mode 100644 index 0000000..415e0d8 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/UsersApi.md @@ -0,0 +1,422 @@ +# OmsorgCoreClient\UsersApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**apiUsersGet()**](UsersApi.md#apiUsersGet) | **GET** /api/users | | +| [**apiUsersIdPermissionOverridesGet()**](UsersApi.md#apiUsersIdPermissionOverridesGet) | **GET** /api/users/{id}/permission-overrides | | +| [**apiUsersIdPermissionOverridesOverrideIdDelete()**](UsersApi.md#apiUsersIdPermissionOverridesOverrideIdDelete) | **DELETE** /api/users/{id}/permission-overrides/{overrideId} | | +| [**apiUsersIdPermissionOverridesPost()**](UsersApi.md#apiUsersIdPermissionOverridesPost) | **POST** /api/users/{id}/permission-overrides | | +| [**apiUsersIdPut()**](UsersApi.md#apiUsersIdPut) | **PUT** /api/users/{id} | | +| [**apiUsersIdResetPasswordPost()**](UsersApi.md#apiUsersIdResetPasswordPost) | **POST** /api/users/{id}/reset-password | | +| [**apiUsersPost()**](UsersApi.md#apiUsersPost) | **POST** /api/users | | + + +## `apiUsersGet()` + +```php +apiUsersGet(): \OmsorgCoreClient\Model\UserResponse[] +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\UsersApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->apiUsersGet(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling UsersApi->apiUsersGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\OmsorgCoreClient\Model\UserResponse[]**](../Model/UserResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiUsersIdPermissionOverridesGet()` + +```php +apiUsersIdPermissionOverridesGet($id): \OmsorgCoreClient\Model\UserPermissionOverrideResponse[] +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\UsersApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string + +try { + $result = $apiInstance->apiUsersIdPermissionOverridesGet($id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling UsersApi->apiUsersIdPermissionOverridesGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | + +### Return type + +[**\OmsorgCoreClient\Model\UserPermissionOverrideResponse[]**](../Model/UserPermissionOverrideResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiUsersIdPermissionOverridesOverrideIdDelete()` + +```php +apiUsersIdPermissionOverridesOverrideIdDelete($id, $override_id) +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\UsersApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string +$override_id = 'override_id_example'; // string + +try { + $apiInstance->apiUsersIdPermissionOverridesOverrideIdDelete($id, $override_id); +} catch (Exception $e) { + echo 'Exception when calling UsersApi->apiUsersIdPermissionOverridesOverrideIdDelete: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | +| **override_id** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiUsersIdPermissionOverridesPost()` + +```php +apiUsersIdPermissionOverridesPost($id, $add_user_permission_override_request): \OmsorgCoreClient\Model\UserPermissionOverrideResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\UsersApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string +$add_user_permission_override_request = new \OmsorgCoreClient\Model\AddUserPermissionOverrideRequest(); // \OmsorgCoreClient\Model\AddUserPermissionOverrideRequest + +try { + $result = $apiInstance->apiUsersIdPermissionOverridesPost($id, $add_user_permission_override_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling UsersApi->apiUsersIdPermissionOverridesPost: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | +| **add_user_permission_override_request** | [**\OmsorgCoreClient\Model\AddUserPermissionOverrideRequest**](../Model/AddUserPermissionOverrideRequest.md)| | [optional] | + +### Return type + +[**\OmsorgCoreClient\Model\UserPermissionOverrideResponse**](../Model/UserPermissionOverrideResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiUsersIdPut()` + +```php +apiUsersIdPut($id, $update_user_request) +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\UsersApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string +$update_user_request = new \OmsorgCoreClient\Model\UpdateUserRequest(); // \OmsorgCoreClient\Model\UpdateUserRequest + +try { + $apiInstance->apiUsersIdPut($id, $update_user_request); +} catch (Exception $e) { + echo 'Exception when calling UsersApi->apiUsersIdPut: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | +| **update_user_request** | [**\OmsorgCoreClient\Model\UpdateUserRequest**](../Model/UpdateUserRequest.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiUsersIdResetPasswordPost()` + +```php +apiUsersIdResetPasswordPost($id, $reset_user_password_request) +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\UsersApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$id = 'id_example'; // string +$reset_user_password_request = new \OmsorgCoreClient\Model\ResetUserPasswordRequest(); // \OmsorgCoreClient\Model\ResetUserPasswordRequest + +try { + $apiInstance->apiUsersIdResetPasswordPost($id, $reset_user_password_request); +} catch (Exception $e) { + echo 'Exception when calling UsersApi->apiUsersIdResetPasswordPost: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **id** | **string**| | | +| **reset_user_password_request** | [**\OmsorgCoreClient\Model\ResetUserPasswordRequest**](../Model/ResetUserPasswordRequest.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiUsersPost()` + +```php +apiUsersPost($create_user_request): \OmsorgCoreClient\Model\UserResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\UsersApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$create_user_request = new \OmsorgCoreClient\Model\CreateUserRequest(); // \OmsorgCoreClient\Model\CreateUserRequest + +try { + $result = $apiInstance->apiUsersPost($create_user_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling UsersApi->apiUsersPost: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **create_user_request** | [**\OmsorgCoreClient\Model\CreateUserRequest**](../Model/CreateUserRequest.md)| | [optional] | + +### Return type + +[**\OmsorgCoreClient\Model\UserResponse**](../Model/UserResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/ValueListsApi.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/ValueListsApi.md new file mode 100644 index 0000000..d6a5a9a --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Api/ValueListsApi.md @@ -0,0 +1,486 @@ +# OmsorgCoreClient\ValueListsApi + +All URIs are relative to http://localhost, except if the operation defines another base path. + +| Method | HTTP request | Description | +| ------------- | ------------- | ------------- | +| [**apiValueListsGet()**](ValueListsApi.md#apiValueListsGet) | **GET** /api/value-lists | | +| [**apiValueListsKeyItemsGet()**](ValueListsApi.md#apiValueListsKeyItemsGet) | **GET** /api/value-lists/{key}/items | | +| [**apiValueListsKeyItemsIdDelete()**](ValueListsApi.md#apiValueListsKeyItemsIdDelete) | **DELETE** /api/value-lists/{key}/items/{id} | | +| [**apiValueListsKeyItemsIdPut()**](ValueListsApi.md#apiValueListsKeyItemsIdPut) | **PUT** /api/value-lists/{key}/items/{id} | | +| [**apiValueListsKeyItemsIdUsagesGet()**](ValueListsApi.md#apiValueListsKeyItemsIdUsagesGet) | **GET** /api/value-lists/{key}/items/{id}/usages | | +| [**apiValueListsKeyItemsPost()**](ValueListsApi.md#apiValueListsKeyItemsPost) | **POST** /api/value-lists/{key}/items | | +| [**apiValueListsKeyTransitionsGet()**](ValueListsApi.md#apiValueListsKeyTransitionsGet) | **GET** /api/value-lists/{key}/transitions | | +| [**apiValueListsKeyTransitionsPut()**](ValueListsApi.md#apiValueListsKeyTransitionsPut) | **PUT** /api/value-lists/{key}/transitions | | + + +## `apiValueListsGet()` + +```php +apiValueListsGet(): \OmsorgCoreClient\Model\ValueListResponse[] +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\ValueListsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); + +try { + $result = $apiInstance->apiValueListsGet(); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ValueListsApi->apiValueListsGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +This endpoint does not need any parameter. + +### Return type + +[**\OmsorgCoreClient\Model\ValueListResponse[]**](../Model/ValueListResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiValueListsKeyItemsGet()` + +```php +apiValueListsKeyItemsGet($key): \OmsorgCoreClient\Model\ValueListItemResponse[] +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\ValueListsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$key = 'key_example'; // string + +try { + $result = $apiInstance->apiValueListsKeyItemsGet($key); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ValueListsApi->apiValueListsKeyItemsGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **key** | **string**| | | + +### Return type + +[**\OmsorgCoreClient\Model\ValueListItemResponse[]**](../Model/ValueListItemResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiValueListsKeyItemsIdDelete()` + +```php +apiValueListsKeyItemsIdDelete($key, $id) +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\ValueListsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$key = 'key_example'; // string +$id = 'id_example'; // string + +try { + $apiInstance->apiValueListsKeyItemsIdDelete($key, $id); +} catch (Exception $e) { + echo 'Exception when calling ValueListsApi->apiValueListsKeyItemsIdDelete: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **key** | **string**| | | +| **id** | **string**| | | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiValueListsKeyItemsIdPut()` + +```php +apiValueListsKeyItemsIdPut($key, $id, $update_value_list_item_request): \OmsorgCoreClient\Model\ValueListItemResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\ValueListsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$key = 'key_example'; // string +$id = 'id_example'; // string +$update_value_list_item_request = new \OmsorgCoreClient\Model\UpdateValueListItemRequest(); // \OmsorgCoreClient\Model\UpdateValueListItemRequest + +try { + $result = $apiInstance->apiValueListsKeyItemsIdPut($key, $id, $update_value_list_item_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ValueListsApi->apiValueListsKeyItemsIdPut: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **key** | **string**| | | +| **id** | **string**| | | +| **update_value_list_item_request** | [**\OmsorgCoreClient\Model\UpdateValueListItemRequest**](../Model/UpdateValueListItemRequest.md)| | [optional] | + +### Return type + +[**\OmsorgCoreClient\Model\ValueListItemResponse**](../Model/ValueListItemResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiValueListsKeyItemsIdUsagesGet()` + +```php +apiValueListsKeyItemsIdUsagesGet($key, $id): \OmsorgCoreClient\Model\ValueListUsageResponse[] +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\ValueListsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$key = 'key_example'; // string +$id = 'id_example'; // string + +try { + $result = $apiInstance->apiValueListsKeyItemsIdUsagesGet($key, $id); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ValueListsApi->apiValueListsKeyItemsIdUsagesGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **key** | **string**| | | +| **id** | **string**| | | + +### Return type + +[**\OmsorgCoreClient\Model\ValueListUsageResponse[]**](../Model/ValueListUsageResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiValueListsKeyItemsPost()` + +```php +apiValueListsKeyItemsPost($key, $create_value_list_item_request): \OmsorgCoreClient\Model\ValueListItemResponse +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\ValueListsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$key = 'key_example'; // string +$create_value_list_item_request = new \OmsorgCoreClient\Model\CreateValueListItemRequest(); // \OmsorgCoreClient\Model\CreateValueListItemRequest + +try { + $result = $apiInstance->apiValueListsKeyItemsPost($key, $create_value_list_item_request); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ValueListsApi->apiValueListsKeyItemsPost: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **key** | **string**| | | +| **create_value_list_item_request** | [**\OmsorgCoreClient\Model\CreateValueListItemRequest**](../Model/CreateValueListItemRequest.md)| | [optional] | + +### Return type + +[**\OmsorgCoreClient\Model\ValueListItemResponse**](../Model/ValueListItemResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiValueListsKeyTransitionsGet()` + +```php +apiValueListsKeyTransitionsGet($key): \OmsorgCoreClient\Model\ValueListTransitionResponse[] +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\ValueListsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$key = 'key_example'; // string + +try { + $result = $apiInstance->apiValueListsKeyTransitionsGet($key); + print_r($result); +} catch (Exception $e) { + echo 'Exception when calling ValueListsApi->apiValueListsKeyTransitionsGet: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **key** | **string**| | | + +### Return type + +[**\OmsorgCoreClient\Model\ValueListTransitionResponse[]**](../Model/ValueListTransitionResponse.md) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: Not defined +- **Accept**: `text/plain`, `application/json`, `text/json` + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) + +## `apiValueListsKeyTransitionsPut()` + +```php +apiValueListsKeyTransitionsPut($key, $value_list_transition_request) +``` + + + +### Example + +```php +setAccessToken('YOUR_ACCESS_TOKEN'); + + +$apiInstance = new OmsorgCoreClient\Api\ValueListsApi( + // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`. + // This is optional, `GuzzleHttp\Client` will be used as default. + new GuzzleHttp\Client(), + $config +); +$key = 'key_example'; // string +$value_list_transition_request = array(new \OmsorgCoreClient\Model\ValueListTransitionRequest()); // \OmsorgCoreClient\Model\ValueListTransitionRequest[] + +try { + $apiInstance->apiValueListsKeyTransitionsPut($key, $value_list_transition_request); +} catch (Exception $e) { + echo 'Exception when calling ValueListsApi->apiValueListsKeyTransitionsPut: ', $e->getMessage(), PHP_EOL; +} +``` + +### Parameters + +| Name | Type | Description | Notes | +| ------------- | ------------- | ------------- | ------------- | +| **key** | **string**| | | +| **value_list_transition_request** | [**\OmsorgCoreClient\Model\ValueListTransitionRequest[]**](../Model/ValueListTransitionRequest.md)| | [optional] | + +### Return type + +void (empty response body) + +### Authorization + +[Bearer](../../README.md#Bearer) + +### HTTP request headers + +- **Content-Type**: `application/json`, `text/json`, `application/*+json` +- **Accept**: Not defined + +[[Back to top]](#) [[Back to API list]](../../README.md#endpoints) +[[Back to Model list]](../../README.md#models) +[[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/AddUserPermissionOverrideRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/AddUserPermissionOverrideRequest.md new file mode 100644 index 0000000..8f451bd --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/AddUserPermissionOverrideRequest.md @@ -0,0 +1,11 @@ +# # AddUserPermissionOverrideRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**module** | **string** | | [optional] +**action** | **string** | | [optional] +**effect** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/AuditLogEntryResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/AuditLogEntryResponse.md new file mode 100644 index 0000000..046ec1b --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/AuditLogEntryResponse.md @@ -0,0 +1,18 @@ +# # AuditLogEntryResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**occurred_at_utc** | **\DateTime** | | [optional] +**actor_user_id** | **string** | | [optional] +**actor_username** | **string** | | [optional] +**ip_address** | **string** | | [optional] +**category** | **string** | | [optional] +**action** | **string** | | [optional] +**entity_type** | **string** | | [optional] +**entity_id** | **string** | | [optional] +**details** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/AuditLogEntryResponsePagedResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/AuditLogEntryResponsePagedResponse.md new file mode 100644 index 0000000..e9c1ec0 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/AuditLogEntryResponsePagedResponse.md @@ -0,0 +1,12 @@ +# # AuditLogEntryResponsePagedResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**\OmsorgCoreClient\Model\AuditLogEntryResponse[]**](AuditLogEntryResponse.md) | | [optional] +**total_count** | **int** | | [optional] +**page** | **int** | | [optional] +**page_size** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ChangePasswordRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ChangePasswordRequest.md new file mode 100644 index 0000000..83d5770 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ChangePasswordRequest.md @@ -0,0 +1,10 @@ +# # ChangePasswordRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**current_password** | **string** | | [optional] +**new_password** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ContractResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ContractResponse.md new file mode 100644 index 0000000..b5f81aa --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ContractResponse.md @@ -0,0 +1,21 @@ +# # ContractResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**contract_type** | **string** | | [optional] +**employee_id** | **string** | | [optional] +**facility_id** | **string** | | [optional] +**start_date** | **\DateTime** | | [optional] +**end_date** | **\DateTime** | | [optional] +**status** | **string** | | [optional] +**weekly_hours** | **float** | | [optional] +**hourly_wage** | **float** | | [optional] +**allowances_description** | **string** | | [optional] +**overtime_rules** | **string** | | [optional] +**vacation_days_per_year** | **int** | | [optional] +**probation_period_months** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ContractResponsePagedResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ContractResponsePagedResponse.md new file mode 100644 index 0000000..276b7bd --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ContractResponsePagedResponse.md @@ -0,0 +1,12 @@ +# # ContractResponsePagedResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**\OmsorgCoreClient\Model\ContractResponse[]**](ContractResponse.md) | | [optional] +**total_count** | **int** | | [optional] +**page** | **int** | | [optional] +**page_size** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/CreateContractRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/CreateContractRequest.md new file mode 100644 index 0000000..c67f03f --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/CreateContractRequest.md @@ -0,0 +1,19 @@ +# # CreateContractRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contract_type** | **string** | | [optional] +**employee_id** | **string** | | [optional] +**facility_id** | **string** | | [optional] +**start_date** | **\DateTime** | | [optional] +**end_date** | **\DateTime** | | [optional] +**weekly_hours** | **float** | | [optional] +**hourly_wage** | **float** | | [optional] +**allowances_description** | **string** | | [optional] +**overtime_rules** | **string** | | [optional] +**vacation_days_per_year** | **int** | | [optional] +**probation_period_months** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/CreateEmployeeRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/CreateEmployeeRequest.md new file mode 100644 index 0000000..9810985 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/CreateEmployeeRequest.md @@ -0,0 +1,24 @@ +# # CreateEmployeeRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**first_name** | **string** | | [optional] +**last_name** | **string** | | [optional] +**date_of_birth** | **\DateTime** | | [optional] +**street** | **string** | | [optional] +**postal_code** | **string** | | [optional] +**city** | **string** | | [optional] +**country** | **string** | | [optional] +**phone_number** | **string** | | [optional] +**email** | **string** | | [optional] +**entry_date** | **\DateTime** | | [optional] +**exit_date** | **\DateTime** | | [optional] +**emergency_contact_name** | **string** | | [optional] +**emergency_contact_phone** | **string** | | [optional] +**emergency_contact_relation** | **string** | | [optional] +**employment_type** | **string** | | [optional] +**qualification** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/CreateFacilityContactRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/CreateFacilityContactRequest.md new file mode 100644 index 0000000..a00d9ae --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/CreateFacilityContactRequest.md @@ -0,0 +1,14 @@ +# # CreateFacilityContactRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] +**role** | **string** | | [optional] +**department** | **string** | | [optional] +**phone_number** | **string** | | [optional] +**email** | **string** | | [optional] +**notes** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/CreateFacilityRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/CreateFacilityRequest.md new file mode 100644 index 0000000..f9a0fbf --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/CreateFacilityRequest.md @@ -0,0 +1,18 @@ +# # CreateFacilityRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] +**facility_type** | **string** | | [optional] +**street** | **string** | | [optional] +**postal_code** | **string** | | [optional] +**city** | **string** | | [optional] +**country** | **string** | | [optional] +**billing_street** | **string** | | [optional] +**billing_postal_code** | **string** | | [optional] +**billing_city** | **string** | | [optional] +**billing_country** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/CreateOrderRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/CreateOrderRequest.md new file mode 100644 index 0000000..9f553b4 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/CreateOrderRequest.md @@ -0,0 +1,17 @@ +# # CreateOrderRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**facility_id** | **string** | | [optional] +**facility_contact_id** | **string** | | [optional] +**start_date** | **\DateTime** | | [optional] +**end_date** | **\DateTime** | | [optional] +**required_qualification** | **string** | | [optional] +**shift_type** | **string** | | [optional] +**required_headcount** | **int** | | [optional] +**conditions** | **string** | | [optional] +**priority** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/CreateRoleRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/CreateRoleRequest.md new file mode 100644 index 0000000..15c5c29 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/CreateRoleRequest.md @@ -0,0 +1,9 @@ +# # CreateRoleRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/CreateUserRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/CreateUserRequest.md new file mode 100644 index 0000000..84627f1 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/CreateUserRequest.md @@ -0,0 +1,14 @@ +# # CreateUserRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**employee_id** | **string** | | [optional] +**username** | **string** | | [optional] +**role_id** | **string** | | [optional] +**mode** | **string** | | [optional] +**initial_password** | **string** | | [optional] +**pin_validity_days** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/CreateValueListItemRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/CreateValueListItemRequest.md new file mode 100644 index 0000000..cf2c945 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/CreateValueListItemRequest.md @@ -0,0 +1,13 @@ +# # CreateValueListItemRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **string** | | [optional] +**sort_order** | **int** | | [optional] +**is_default** | **bool** | | [optional] +**is_initial** | **bool** | | [optional] +**is_terminal** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/EmployeeResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/EmployeeResponse.md new file mode 100644 index 0000000..492083a --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/EmployeeResponse.md @@ -0,0 +1,27 @@ +# # EmployeeResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**first_name** | **string** | | [optional] +**last_name** | **string** | | [optional] +**status** | **string** | | [optional] +**date_of_birth** | **\DateTime** | | [optional] +**street** | **string** | | [optional] +**postal_code** | **string** | | [optional] +**city** | **string** | | [optional] +**country** | **string** | | [optional] +**phone_number** | **string** | | [optional] +**email** | **string** | | [optional] +**entry_date** | **\DateTime** | | [optional] +**exit_date** | **\DateTime** | | [optional] +**emergency_contact_name** | **string** | | [optional] +**emergency_contact_phone** | **string** | | [optional] +**emergency_contact_relation** | **string** | | [optional] +**employment_type** | **string** | | [optional] +**qualification** | **string** | | [optional] +**avatar_file_name** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/EmployeeResponsePagedResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/EmployeeResponsePagedResponse.md new file mode 100644 index 0000000..669a160 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/EmployeeResponsePagedResponse.md @@ -0,0 +1,12 @@ +# # EmployeeResponsePagedResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**\OmsorgCoreClient\Model\EmployeeResponse[]**](EmployeeResponse.md) | | [optional] +**total_count** | **int** | | [optional] +**page** | **int** | | [optional] +**page_size** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/FacilityContactResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/FacilityContactResponse.md new file mode 100644 index 0000000..84794a8 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/FacilityContactResponse.md @@ -0,0 +1,16 @@ +# # FacilityContactResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**facility_id** | **string** | | [optional] +**name** | **string** | | [optional] +**role** | **string** | | [optional] +**department** | **string** | | [optional] +**phone_number** | **string** | | [optional] +**email** | **string** | | [optional] +**notes** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/FacilityResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/FacilityResponse.md new file mode 100644 index 0000000..3176c54 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/FacilityResponse.md @@ -0,0 +1,20 @@ +# # FacilityResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**name** | **string** | | [optional] +**crm_status** | **string** | | [optional] +**facility_type** | **string** | | [optional] +**street** | **string** | | [optional] +**postal_code** | **string** | | [optional] +**city** | **string** | | [optional] +**country** | **string** | | [optional] +**billing_street** | **string** | | [optional] +**billing_postal_code** | **string** | | [optional] +**billing_city** | **string** | | [optional] +**billing_country** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/FacilityResponsePagedResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/FacilityResponsePagedResponse.md new file mode 100644 index 0000000..0c1884c --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/FacilityResponsePagedResponse.md @@ -0,0 +1,12 @@ +# # FacilityResponsePagedResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**\OmsorgCoreClient\Model\FacilityResponse[]**](FacilityResponse.md) | | [optional] +**total_count** | **int** | | [optional] +**page** | **int** | | [optional] +**page_size** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ForgotPasswordRequestRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ForgotPasswordRequestRequest.md new file mode 100644 index 0000000..a12576e --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ForgotPasswordRequestRequest.md @@ -0,0 +1,9 @@ +# # ForgotPasswordRequestRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ForgotPasswordRequestResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ForgotPasswordRequestResponse.md new file mode 100644 index 0000000..c58e83c --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ForgotPasswordRequestResponse.md @@ -0,0 +1,9 @@ +# # ForgotPasswordRequestResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**status** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ForgotPasswordResetRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ForgotPasswordResetRequest.md new file mode 100644 index 0000000..7578857 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ForgotPasswordResetRequest.md @@ -0,0 +1,10 @@ +# # ForgotPasswordResetRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reset_token** | **string** | | [optional] +**new_password** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ForgotPasswordVerifyRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ForgotPasswordVerifyRequest.md new file mode 100644 index 0000000..4d06982 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ForgotPasswordVerifyRequest.md @@ -0,0 +1,10 @@ +# # ForgotPasswordVerifyRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **string** | | [optional] +**pin** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ForgotPasswordVerifyResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ForgotPasswordVerifyResponse.md new file mode 100644 index 0000000..7ae2e8e --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ForgotPasswordVerifyResponse.md @@ -0,0 +1,9 @@ +# # ForgotPasswordVerifyResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**reset_token** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/LoginRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/LoginRequest.md new file mode 100644 index 0000000..72c7b8c --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/LoginRequest.md @@ -0,0 +1,10 @@ +# # LoginRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**username** | **string** | | [optional] +**password** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/LoginResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/LoginResponse.md new file mode 100644 index 0000000..62fbbfc --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/LoginResponse.md @@ -0,0 +1,12 @@ +# # LoginResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**access_token** | **string** | | [optional] +**refresh_token** | **string** | | [optional] +**expires_at** | **\DateTime** | | [optional] +**must_change_password** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/LogoutRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/LogoutRequest.md new file mode 100644 index 0000000..7456e8a --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/LogoutRequest.md @@ -0,0 +1,9 @@ +# # LogoutRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**refresh_token** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/MeResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/MeResponse.md new file mode 100644 index 0000000..668ff63 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/MeResponse.md @@ -0,0 +1,18 @@ +# # MeResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**user_id** | **string** | | [optional] +**username** | **string** | | [optional] +**role** | **string** | | [optional] +**permissions** | [**\OmsorgCoreClient\Model\PermissionDto[]**](PermissionDto.md) | | [optional] +**employee_id** | **string** | | [optional] +**first_name** | **string** | | [optional] +**last_name** | **string** | | [optional] +**email** | **string** | | [optional] +**phone_number** | **string** | | [optional] +**avatar_file_name** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/OrderResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/OrderResponse.md new file mode 100644 index 0000000..d64854e --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/OrderResponse.md @@ -0,0 +1,20 @@ +# # OrderResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**facility_id** | **string** | | [optional] +**facility_contact_id** | **string** | | [optional] +**start_date** | **\DateTime** | | [optional] +**end_date** | **\DateTime** | | [optional] +**required_qualification** | **string** | | [optional] +**shift_type** | **string** | | [optional] +**required_headcount** | **int** | | [optional] +**conditions** | **string** | | [optional] +**priority** | **string** | | [optional] +**status_id** | **string** | | [optional] +**status_name** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/OrderResponsePagedResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/OrderResponsePagedResponse.md new file mode 100644 index 0000000..74548f7 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/OrderResponsePagedResponse.md @@ -0,0 +1,12 @@ +# # OrderResponsePagedResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**items** | [**\OmsorgCoreClient\Model\OrderResponse[]**](OrderResponse.md) | | [optional] +**total_count** | **int** | | [optional] +**page** | **int** | | [optional] +**page_size** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/PasswordPolicyResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/PasswordPolicyResponse.md new file mode 100644 index 0000000..e3ab390 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/PasswordPolicyResponse.md @@ -0,0 +1,9 @@ +# # PasswordPolicyResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**min_length** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/PasswordResetTemplateResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/PasswordResetTemplateResponse.md new file mode 100644 index 0000000..7388595 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/PasswordResetTemplateResponse.md @@ -0,0 +1,10 @@ +# # PasswordResetTemplateResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**subject** | **string** | | [optional] +**body_template** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/PermissionDto.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/PermissionDto.md new file mode 100644 index 0000000..c6435bb --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/PermissionDto.md @@ -0,0 +1,10 @@ +# # PermissionDto + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**module** | **string** | | [optional] +**action** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/RefreshRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/RefreshRequest.md new file mode 100644 index 0000000..cbb20eb --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/RefreshRequest.md @@ -0,0 +1,9 @@ +# # RefreshRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**refresh_token** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ResetUserPasswordRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ResetUserPasswordRequest.md new file mode 100644 index 0000000..5e83c56 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ResetUserPasswordRequest.md @@ -0,0 +1,11 @@ +# # ResetUserPasswordRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**mode** | **string** | | [optional] +**initial_password** | **string** | | [optional] +**pin_validity_days** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/RolePermissionsResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/RolePermissionsResponse.md new file mode 100644 index 0000000..326f0fa --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/RolePermissionsResponse.md @@ -0,0 +1,11 @@ +# # RolePermissionsResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**name** | **string** | | [optional] +**permissions** | [**\OmsorgCoreClient\Model\PermissionDto[]**](PermissionDto.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/RoleResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/RoleResponse.md new file mode 100644 index 0000000..745b37c --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/RoleResponse.md @@ -0,0 +1,10 @@ +# # RoleResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**name** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/SendTestEmailRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/SendTestEmailRequest.md new file mode 100644 index 0000000..ebac28e --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/SendTestEmailRequest.md @@ -0,0 +1,11 @@ +# # SendTestEmailRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**to_address** | **string** | | [optional] +**subject** | **string** | | [optional] +**body** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/SessionResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/SessionResponse.md new file mode 100644 index 0000000..182ffad --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/SessionResponse.md @@ -0,0 +1,12 @@ +# # SessionResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**username** | **string** | | [optional] +**created_at** | **\DateTime** | | [optional] +**expires_at** | **\DateTime** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UpdateContractRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UpdateContractRequest.md new file mode 100644 index 0000000..10f72fb --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UpdateContractRequest.md @@ -0,0 +1,20 @@ +# # UpdateContractRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**contract_type** | **string** | | [optional] +**employee_id** | **string** | | [optional] +**facility_id** | **string** | | [optional] +**start_date** | **\DateTime** | | [optional] +**end_date** | **\DateTime** | | [optional] +**status** | **string** | | [optional] +**weekly_hours** | **float** | | [optional] +**hourly_wage** | **float** | | [optional] +**allowances_description** | **string** | | [optional] +**overtime_rules** | **string** | | [optional] +**vacation_days_per_year** | **int** | | [optional] +**probation_period_months** | **int** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UpdateEmployeeRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UpdateEmployeeRequest.md new file mode 100644 index 0000000..f9464d8 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UpdateEmployeeRequest.md @@ -0,0 +1,26 @@ +# # UpdateEmployeeRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**first_name** | **string** | | [optional] +**last_name** | **string** | | [optional] +**status** | **string** | | [optional] +**date_of_birth** | **\DateTime** | | [optional] +**street** | **string** | | [optional] +**postal_code** | **string** | | [optional] +**city** | **string** | | [optional] +**country** | **string** | | [optional] +**phone_number** | **string** | | [optional] +**email** | **string** | | [optional] +**entry_date** | **\DateTime** | | [optional] +**exit_date** | **\DateTime** | | [optional] +**emergency_contact_name** | **string** | | [optional] +**emergency_contact_phone** | **string** | | [optional] +**emergency_contact_relation** | **string** | | [optional] +**employment_type** | **string** | | [optional] +**qualification** | **string** | | [optional] +**avatar_file_name** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UpdateFacilityContactRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UpdateFacilityContactRequest.md new file mode 100644 index 0000000..c1cb593 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UpdateFacilityContactRequest.md @@ -0,0 +1,14 @@ +# # UpdateFacilityContactRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] +**role** | **string** | | [optional] +**department** | **string** | | [optional] +**phone_number** | **string** | | [optional] +**email** | **string** | | [optional] +**notes** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UpdateFacilityRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UpdateFacilityRequest.md new file mode 100644 index 0000000..1f48abf --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UpdateFacilityRequest.md @@ -0,0 +1,19 @@ +# # UpdateFacilityRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**name** | **string** | | [optional] +**crm_status** | **string** | | [optional] +**facility_type** | **string** | | [optional] +**street** | **string** | | [optional] +**postal_code** | **string** | | [optional] +**city** | **string** | | [optional] +**country** | **string** | | [optional] +**billing_street** | **string** | | [optional] +**billing_postal_code** | **string** | | [optional] +**billing_city** | **string** | | [optional] +**billing_country** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UpdateOrderRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UpdateOrderRequest.md new file mode 100644 index 0000000..d65b68a --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UpdateOrderRequest.md @@ -0,0 +1,18 @@ +# # UpdateOrderRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**facility_id** | **string** | | [optional] +**facility_contact_id** | **string** | | [optional] +**start_date** | **\DateTime** | | [optional] +**end_date** | **\DateTime** | | [optional] +**required_qualification** | **string** | | [optional] +**shift_type** | **string** | | [optional] +**required_headcount** | **int** | | [optional] +**conditions** | **string** | | [optional] +**priority** | **string** | | [optional] +**status_id** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UpdateRolePermissionsRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UpdateRolePermissionsRequest.md new file mode 100644 index 0000000..c205cdb --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UpdateRolePermissionsRequest.md @@ -0,0 +1,9 @@ +# # UpdateRolePermissionsRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**permissions** | [**\OmsorgCoreClient\Model\PermissionDto[]**](PermissionDto.md) | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UpdateUserRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UpdateUserRequest.md new file mode 100644 index 0000000..3b0940e --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UpdateUserRequest.md @@ -0,0 +1,10 @@ +# # UpdateUserRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**role_id** | **string** | | [optional] +**is_active** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UpdateValueListItemRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UpdateValueListItemRequest.md new file mode 100644 index 0000000..58b10f4 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UpdateValueListItemRequest.md @@ -0,0 +1,13 @@ +# # UpdateValueListItemRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**value** | **string** | | [optional] +**sort_order** | **int** | | [optional] +**is_default** | **bool** | | [optional] +**is_initial** | **bool** | | [optional] +**is_terminal** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UserPermissionOverrideResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UserPermissionOverrideResponse.md new file mode 100644 index 0000000..d7b4fb3 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UserPermissionOverrideResponse.md @@ -0,0 +1,12 @@ +# # UserPermissionOverrideResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**module** | **string** | | [optional] +**action** | **string** | | [optional] +**effect** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UserResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UserResponse.md new file mode 100644 index 0000000..23ae7c2 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/UserResponse.md @@ -0,0 +1,14 @@ +# # UserResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**username** | **string** | | [optional] +**employee_id** | **string** | | [optional] +**role_name** | **string** | | [optional] +**is_active** | **bool** | | [optional] +**must_change_password** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ValueListItemResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ValueListItemResponse.md new file mode 100644 index 0000000..7c0cbdf --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ValueListItemResponse.md @@ -0,0 +1,14 @@ +# # ValueListItemResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**value** | **string** | | [optional] +**sort_order** | **int** | | [optional] +**is_default** | **bool** | | [optional] +**is_initial** | **bool** | | [optional] +**is_terminal** | **bool** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ValueListResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ValueListResponse.md new file mode 100644 index 0000000..5bc4bdb --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ValueListResponse.md @@ -0,0 +1,11 @@ +# # ValueListResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**key** | **string** | | [optional] +**display_name** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ValueListTransitionRequest.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ValueListTransitionRequest.md new file mode 100644 index 0000000..9bf4e31 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ValueListTransitionRequest.md @@ -0,0 +1,10 @@ +# # ValueListTransitionRequest + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**from_item_id** | **string** | | [optional] +**to_item_id** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ValueListTransitionResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ValueListTransitionResponse.md new file mode 100644 index 0000000..79dde6c --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ValueListTransitionResponse.md @@ -0,0 +1,11 @@ +# # ValueListTransitionResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**id** | **string** | | [optional] +**from_item_id** | **string** | | [optional] +**to_item_id** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ValueListUsageResponse.md b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ValueListUsageResponse.md new file mode 100644 index 0000000..d95dc22 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/docs/Model/ValueListUsageResponse.md @@ -0,0 +1,11 @@ +# # ValueListUsageResponse + +## Properties + +Name | Type | Description | Notes +------------ | ------------- | ------------- | ------------- +**entity_type** | **string** | | [optional] +**entity_id** | **string** | | [optional] +**display_label** | **string** | | [optional] + +[[Back to Model list]](../../README.md#models) [[Back to API list]](../../README.md#endpoints) [[Back to README]](../../README.md) diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/generate.sh b/omsorgWeb/mitarbeiter-app/api-client-php/generate.sh new file mode 100755 index 0000000..6c2a2a3 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/generate.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash +set -euo pipefail + +# Generiert den PHP-Client aus der Swagger/OpenAPI-JSON von omsorgCore. +# Voraussetzung: omsorgCore läuft lokal im Development-Modus (siehe README.md). +cd "$(dirname "${BASH_SOURCE[0]}")" + +BASE_URL="${OMSORG_CORE_URL:-http://localhost:5245}" + +npx --yes @openapitools/openapi-generator-cli@2.13.4 generate \ + -g php \ + -i "${BASE_URL}/swagger/v1/swagger.json" \ + -o . \ + --additional-properties=invokerPackage=OmsorgCore\\Client,packageName=omsorgcore-client-php diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/git_push.sh b/omsorgWeb/mitarbeiter-app/api-client-php/git_push.sh new file mode 100644 index 0000000..f53a75d --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/git_push.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ +# +# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com" + +git_user_id=$1 +git_repo_id=$2 +release_note=$3 +git_host=$4 + +if [ "$git_host" = "" ]; then + git_host="github.com" + echo "[INFO] No command line input provided. Set \$git_host to $git_host" +fi + +if [ "$git_user_id" = "" ]; then + git_user_id="GIT_USER_ID" + echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id" +fi + +if [ "$git_repo_id" = "" ]; then + git_repo_id="GIT_REPO_ID" + echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id" +fi + +if [ "$release_note" = "" ]; then + release_note="Minor update" + echo "[INFO] No command line input provided. Set \$release_note to $release_note" +fi + +# Initialize the local directory as a Git repository +git init + +# Adds the files in the local repository and stages them for commit. +git add . + +# Commits the tracked changes and prepares them to be pushed to a remote repository. +git commit -m "$release_note" + +# Sets the new remote +git_remote=$(git remote) +if [ "$git_remote" = "" ]; then # git remote not defined + + if [ "$GIT_TOKEN" = "" ]; then + echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment." + git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git + else + git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git + fi + +fi + +git pull origin master + +# Pushes (Forces) the changes in the local repository up to the remote repository +echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git" +git push origin master 2>&1 | grep -v 'To https' diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/AdminEmailApi.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/AdminEmailApi.php new file mode 100644 index 0000000..ac7720d --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/AdminEmailApi.php @@ -0,0 +1,645 @@ + [ + 'application/json', + ], + 'apiAdminEmailTestSendPost' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation apiAdminEmailPasswordResetTemplateGet + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminEmailPasswordResetTemplateGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\PasswordResetTemplateResponse + */ + public function apiAdminEmailPasswordResetTemplateGet(string $contentType = self::contentTypes['apiAdminEmailPasswordResetTemplateGet'][0]) + { + list($response) = $this->apiAdminEmailPasswordResetTemplateGetWithHttpInfo($contentType); + return $response; + } + + /** + * Operation apiAdminEmailPasswordResetTemplateGetWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminEmailPasswordResetTemplateGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\PasswordResetTemplateResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiAdminEmailPasswordResetTemplateGetWithHttpInfo(string $contentType = self::contentTypes['apiAdminEmailPasswordResetTemplateGet'][0]) + { + $request = $this->apiAdminEmailPasswordResetTemplateGetRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\PasswordResetTemplateResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\PasswordResetTemplateResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\PasswordResetTemplateResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiAdminEmailPasswordResetTemplateGetAsync + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminEmailPasswordResetTemplateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAdminEmailPasswordResetTemplateGetAsync(string $contentType = self::contentTypes['apiAdminEmailPasswordResetTemplateGet'][0]) + { + return $this->apiAdminEmailPasswordResetTemplateGetAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiAdminEmailPasswordResetTemplateGetAsyncWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminEmailPasswordResetTemplateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAdminEmailPasswordResetTemplateGetAsyncWithHttpInfo(string $contentType = self::contentTypes['apiAdminEmailPasswordResetTemplateGet'][0]) + { + $returnType = '\OmsorgCoreClient\Model\PasswordResetTemplateResponse'; + $request = $this->apiAdminEmailPasswordResetTemplateGetRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiAdminEmailPasswordResetTemplateGet' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminEmailPasswordResetTemplateGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiAdminEmailPasswordResetTemplateGetRequest(string $contentType = self::contentTypes['apiAdminEmailPasswordResetTemplateGet'][0]) + { + + + $resourcePath = '/api/admin/email/password-reset-template'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiAdminEmailTestSendPost + * + * @param \OmsorgCoreClient\Model\SendTestEmailRequest|null $send_test_email_request send_test_email_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminEmailTestSendPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function apiAdminEmailTestSendPost($send_test_email_request = null, string $contentType = self::contentTypes['apiAdminEmailTestSendPost'][0]) + { + $this->apiAdminEmailTestSendPostWithHttpInfo($send_test_email_request, $contentType); + } + + /** + * Operation apiAdminEmailTestSendPostWithHttpInfo + * + * @param \OmsorgCoreClient\Model\SendTestEmailRequest|null $send_test_email_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminEmailTestSendPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function apiAdminEmailTestSendPostWithHttpInfo($send_test_email_request = null, string $contentType = self::contentTypes['apiAdminEmailTestSendPost'][0]) + { + $request = $this->apiAdminEmailTestSendPostRequest($send_test_email_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation apiAdminEmailTestSendPostAsync + * + * @param \OmsorgCoreClient\Model\SendTestEmailRequest|null $send_test_email_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminEmailTestSendPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAdminEmailTestSendPostAsync($send_test_email_request = null, string $contentType = self::contentTypes['apiAdminEmailTestSendPost'][0]) + { + return $this->apiAdminEmailTestSendPostAsyncWithHttpInfo($send_test_email_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiAdminEmailTestSendPostAsyncWithHttpInfo + * + * @param \OmsorgCoreClient\Model\SendTestEmailRequest|null $send_test_email_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminEmailTestSendPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAdminEmailTestSendPostAsyncWithHttpInfo($send_test_email_request = null, string $contentType = self::contentTypes['apiAdminEmailTestSendPost'][0]) + { + $returnType = ''; + $request = $this->apiAdminEmailTestSendPostRequest($send_test_email_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiAdminEmailTestSendPost' + * + * @param \OmsorgCoreClient\Model\SendTestEmailRequest|null $send_test_email_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminEmailTestSendPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiAdminEmailTestSendPostRequest($send_test_email_request = null, string $contentType = self::contentTypes['apiAdminEmailTestSendPost'][0]) + { + + + + $resourcePath = '/api/admin/email/test-send'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($send_test_email_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($send_test_email_request)); + } else { + $httpBody = $send_test_email_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/AdminSessionsApi.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/AdminSessionsApi.php new file mode 100644 index 0000000..43621f6 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/AdminSessionsApi.php @@ -0,0 +1,847 @@ + [ + 'application/json', + ], + 'apiAdminSessionsIdRevokePost' => [ + 'application/json', + ], + 'apiAdminSessionsRevokeAllPost' => [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation apiAdminSessionsGet + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminSessionsGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\SessionResponse[] + */ + public function apiAdminSessionsGet(string $contentType = self::contentTypes['apiAdminSessionsGet'][0]) + { + list($response) = $this->apiAdminSessionsGetWithHttpInfo($contentType); + return $response; + } + + /** + * Operation apiAdminSessionsGetWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminSessionsGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\SessionResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function apiAdminSessionsGetWithHttpInfo(string $contentType = self::contentTypes['apiAdminSessionsGet'][0]) + { + $request = $this->apiAdminSessionsGetRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\SessionResponse[]', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\SessionResponse[]', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\SessionResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiAdminSessionsGetAsync + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminSessionsGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAdminSessionsGetAsync(string $contentType = self::contentTypes['apiAdminSessionsGet'][0]) + { + return $this->apiAdminSessionsGetAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiAdminSessionsGetAsyncWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminSessionsGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAdminSessionsGetAsyncWithHttpInfo(string $contentType = self::contentTypes['apiAdminSessionsGet'][0]) + { + $returnType = '\OmsorgCoreClient\Model\SessionResponse[]'; + $request = $this->apiAdminSessionsGetRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiAdminSessionsGet' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminSessionsGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiAdminSessionsGetRequest(string $contentType = self::contentTypes['apiAdminSessionsGet'][0]) + { + + + $resourcePath = '/api/admin/sessions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiAdminSessionsIdRevokePost + * + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminSessionsIdRevokePost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function apiAdminSessionsIdRevokePost($id, string $contentType = self::contentTypes['apiAdminSessionsIdRevokePost'][0]) + { + $this->apiAdminSessionsIdRevokePostWithHttpInfo($id, $contentType); + } + + /** + * Operation apiAdminSessionsIdRevokePostWithHttpInfo + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminSessionsIdRevokePost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function apiAdminSessionsIdRevokePostWithHttpInfo($id, string $contentType = self::contentTypes['apiAdminSessionsIdRevokePost'][0]) + { + $request = $this->apiAdminSessionsIdRevokePostRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation apiAdminSessionsIdRevokePostAsync + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminSessionsIdRevokePost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAdminSessionsIdRevokePostAsync($id, string $contentType = self::contentTypes['apiAdminSessionsIdRevokePost'][0]) + { + return $this->apiAdminSessionsIdRevokePostAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiAdminSessionsIdRevokePostAsyncWithHttpInfo + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminSessionsIdRevokePost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAdminSessionsIdRevokePostAsyncWithHttpInfo($id, string $contentType = self::contentTypes['apiAdminSessionsIdRevokePost'][0]) + { + $returnType = ''; + $request = $this->apiAdminSessionsIdRevokePostRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiAdminSessionsIdRevokePost' + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminSessionsIdRevokePost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiAdminSessionsIdRevokePostRequest($id, string $contentType = self::contentTypes['apiAdminSessionsIdRevokePost'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling apiAdminSessionsIdRevokePost' + ); + } + + + $resourcePath = '/api/admin/sessions/{id}/revoke'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiAdminSessionsRevokeAllPost + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminSessionsRevokeAllPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function apiAdminSessionsRevokeAllPost(string $contentType = self::contentTypes['apiAdminSessionsRevokeAllPost'][0]) + { + $this->apiAdminSessionsRevokeAllPostWithHttpInfo($contentType); + } + + /** + * Operation apiAdminSessionsRevokeAllPostWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminSessionsRevokeAllPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function apiAdminSessionsRevokeAllPostWithHttpInfo(string $contentType = self::contentTypes['apiAdminSessionsRevokeAllPost'][0]) + { + $request = $this->apiAdminSessionsRevokeAllPostRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation apiAdminSessionsRevokeAllPostAsync + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminSessionsRevokeAllPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAdminSessionsRevokeAllPostAsync(string $contentType = self::contentTypes['apiAdminSessionsRevokeAllPost'][0]) + { + return $this->apiAdminSessionsRevokeAllPostAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiAdminSessionsRevokeAllPostAsyncWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminSessionsRevokeAllPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAdminSessionsRevokeAllPostAsyncWithHttpInfo(string $contentType = self::contentTypes['apiAdminSessionsRevokeAllPost'][0]) + { + $returnType = ''; + $request = $this->apiAdminSessionsRevokeAllPostRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiAdminSessionsRevokeAllPost' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAdminSessionsRevokeAllPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiAdminSessionsRevokeAllPostRequest(string $contentType = self::contentTypes['apiAdminSessionsRevokeAllPost'][0]) + { + + + $resourcePath = '/api/admin/sessions/revoke-all'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/AuditLogApi.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/AuditLogApi.php new file mode 100644 index 0000000..4904b6d --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/AuditLogApi.php @@ -0,0 +1,538 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation apiAuditLogGet + * + * @param string|null $entity_type entity_type (optional) + * @param string|null $entity_id entity_id (optional) + * @param string|null $actor_user_id actor_user_id (optional) + * @param \DateTime|null $from_utc from_utc (optional) + * @param \DateTime|null $to_utc to_utc (optional) + * @param int|null $page page (optional, default to 1) + * @param int|null $page_size page_size (optional, default to 50) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuditLogGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\AuditLogEntryResponsePagedResponse + */ + public function apiAuditLogGet($entity_type = null, $entity_id = null, $actor_user_id = null, $from_utc = null, $to_utc = null, $page = 1, $page_size = 50, string $contentType = self::contentTypes['apiAuditLogGet'][0]) + { + list($response) = $this->apiAuditLogGetWithHttpInfo($entity_type, $entity_id, $actor_user_id, $from_utc, $to_utc, $page, $page_size, $contentType); + return $response; + } + + /** + * Operation apiAuditLogGetWithHttpInfo + * + * @param string|null $entity_type (optional) + * @param string|null $entity_id (optional) + * @param string|null $actor_user_id (optional) + * @param \DateTime|null $from_utc (optional) + * @param \DateTime|null $to_utc (optional) + * @param int|null $page (optional, default to 1) + * @param int|null $page_size (optional, default to 50) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuditLogGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\AuditLogEntryResponsePagedResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiAuditLogGetWithHttpInfo($entity_type = null, $entity_id = null, $actor_user_id = null, $from_utc = null, $to_utc = null, $page = 1, $page_size = 50, string $contentType = self::contentTypes['apiAuditLogGet'][0]) + { + $request = $this->apiAuditLogGetRequest($entity_type, $entity_id, $actor_user_id, $from_utc, $to_utc, $page, $page_size, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\AuditLogEntryResponsePagedResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\AuditLogEntryResponsePagedResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\AuditLogEntryResponsePagedResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiAuditLogGetAsync + * + * @param string|null $entity_type (optional) + * @param string|null $entity_id (optional) + * @param string|null $actor_user_id (optional) + * @param \DateTime|null $from_utc (optional) + * @param \DateTime|null $to_utc (optional) + * @param int|null $page (optional, default to 1) + * @param int|null $page_size (optional, default to 50) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuditLogGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAuditLogGetAsync($entity_type = null, $entity_id = null, $actor_user_id = null, $from_utc = null, $to_utc = null, $page = 1, $page_size = 50, string $contentType = self::contentTypes['apiAuditLogGet'][0]) + { + return $this->apiAuditLogGetAsyncWithHttpInfo($entity_type, $entity_id, $actor_user_id, $from_utc, $to_utc, $page, $page_size, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiAuditLogGetAsyncWithHttpInfo + * + * @param string|null $entity_type (optional) + * @param string|null $entity_id (optional) + * @param string|null $actor_user_id (optional) + * @param \DateTime|null $from_utc (optional) + * @param \DateTime|null $to_utc (optional) + * @param int|null $page (optional, default to 1) + * @param int|null $page_size (optional, default to 50) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuditLogGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAuditLogGetAsyncWithHttpInfo($entity_type = null, $entity_id = null, $actor_user_id = null, $from_utc = null, $to_utc = null, $page = 1, $page_size = 50, string $contentType = self::contentTypes['apiAuditLogGet'][0]) + { + $returnType = '\OmsorgCoreClient\Model\AuditLogEntryResponsePagedResponse'; + $request = $this->apiAuditLogGetRequest($entity_type, $entity_id, $actor_user_id, $from_utc, $to_utc, $page, $page_size, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiAuditLogGet' + * + * @param string|null $entity_type (optional) + * @param string|null $entity_id (optional) + * @param string|null $actor_user_id (optional) + * @param \DateTime|null $from_utc (optional) + * @param \DateTime|null $to_utc (optional) + * @param int|null $page (optional, default to 1) + * @param int|null $page_size (optional, default to 50) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuditLogGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiAuditLogGetRequest($entity_type = null, $entity_id = null, $actor_user_id = null, $from_utc = null, $to_utc = null, $page = 1, $page_size = 50, string $contentType = self::contentTypes['apiAuditLogGet'][0]) + { + + + + + + + + + + $resourcePath = '/api/audit-log'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $entity_type, + 'entityType', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $entity_id, + 'entityId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $actor_user_id, + 'actorUserId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $from_utc, + 'fromUtc', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $to_utc, + 'toUtc', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/AuthApi.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/AuthApi.php new file mode 100644 index 0000000..e32249a --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/AuthApi.php @@ -0,0 +1,2364 @@ + [ + 'application/json', + 'text/json', + 'application/*+json', + ], + 'apiAuthForgotPasswordRequestPost' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + 'apiAuthForgotPasswordResetPost' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + 'apiAuthForgotPasswordVerifyPost' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + 'apiAuthLoginPost' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + 'apiAuthLogoutPost' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + 'apiAuthMeGet' => [ + 'application/json', + ], + 'apiAuthPasswordPolicyGet' => [ + 'application/json', + ], + 'apiAuthRefreshPost' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation apiAuthChangePasswordPost + * + * @param \OmsorgCoreClient\Model\ChangePasswordRequest|null $change_password_request change_password_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthChangePasswordPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function apiAuthChangePasswordPost($change_password_request = null, string $contentType = self::contentTypes['apiAuthChangePasswordPost'][0]) + { + $this->apiAuthChangePasswordPostWithHttpInfo($change_password_request, $contentType); + } + + /** + * Operation apiAuthChangePasswordPostWithHttpInfo + * + * @param \OmsorgCoreClient\Model\ChangePasswordRequest|null $change_password_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthChangePasswordPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function apiAuthChangePasswordPostWithHttpInfo($change_password_request = null, string $contentType = self::contentTypes['apiAuthChangePasswordPost'][0]) + { + $request = $this->apiAuthChangePasswordPostRequest($change_password_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation apiAuthChangePasswordPostAsync + * + * @param \OmsorgCoreClient\Model\ChangePasswordRequest|null $change_password_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthChangePasswordPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAuthChangePasswordPostAsync($change_password_request = null, string $contentType = self::contentTypes['apiAuthChangePasswordPost'][0]) + { + return $this->apiAuthChangePasswordPostAsyncWithHttpInfo($change_password_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiAuthChangePasswordPostAsyncWithHttpInfo + * + * @param \OmsorgCoreClient\Model\ChangePasswordRequest|null $change_password_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthChangePasswordPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAuthChangePasswordPostAsyncWithHttpInfo($change_password_request = null, string $contentType = self::contentTypes['apiAuthChangePasswordPost'][0]) + { + $returnType = ''; + $request = $this->apiAuthChangePasswordPostRequest($change_password_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiAuthChangePasswordPost' + * + * @param \OmsorgCoreClient\Model\ChangePasswordRequest|null $change_password_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthChangePasswordPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiAuthChangePasswordPostRequest($change_password_request = null, string $contentType = self::contentTypes['apiAuthChangePasswordPost'][0]) + { + + + + $resourcePath = '/api/auth/change-password'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($change_password_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($change_password_request)); + } else { + $httpBody = $change_password_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiAuthForgotPasswordRequestPost + * + * @param \OmsorgCoreClient\Model\ForgotPasswordRequestRequest|null $forgot_password_request_request forgot_password_request_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthForgotPasswordRequestPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\ForgotPasswordRequestResponse + */ + public function apiAuthForgotPasswordRequestPost($forgot_password_request_request = null, string $contentType = self::contentTypes['apiAuthForgotPasswordRequestPost'][0]) + { + list($response) = $this->apiAuthForgotPasswordRequestPostWithHttpInfo($forgot_password_request_request, $contentType); + return $response; + } + + /** + * Operation apiAuthForgotPasswordRequestPostWithHttpInfo + * + * @param \OmsorgCoreClient\Model\ForgotPasswordRequestRequest|null $forgot_password_request_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthForgotPasswordRequestPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\ForgotPasswordRequestResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiAuthForgotPasswordRequestPostWithHttpInfo($forgot_password_request_request = null, string $contentType = self::contentTypes['apiAuthForgotPasswordRequestPost'][0]) + { + $request = $this->apiAuthForgotPasswordRequestPostRequest($forgot_password_request_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\ForgotPasswordRequestResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\ForgotPasswordRequestResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\ForgotPasswordRequestResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiAuthForgotPasswordRequestPostAsync + * + * @param \OmsorgCoreClient\Model\ForgotPasswordRequestRequest|null $forgot_password_request_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthForgotPasswordRequestPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAuthForgotPasswordRequestPostAsync($forgot_password_request_request = null, string $contentType = self::contentTypes['apiAuthForgotPasswordRequestPost'][0]) + { + return $this->apiAuthForgotPasswordRequestPostAsyncWithHttpInfo($forgot_password_request_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiAuthForgotPasswordRequestPostAsyncWithHttpInfo + * + * @param \OmsorgCoreClient\Model\ForgotPasswordRequestRequest|null $forgot_password_request_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthForgotPasswordRequestPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAuthForgotPasswordRequestPostAsyncWithHttpInfo($forgot_password_request_request = null, string $contentType = self::contentTypes['apiAuthForgotPasswordRequestPost'][0]) + { + $returnType = '\OmsorgCoreClient\Model\ForgotPasswordRequestResponse'; + $request = $this->apiAuthForgotPasswordRequestPostRequest($forgot_password_request_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiAuthForgotPasswordRequestPost' + * + * @param \OmsorgCoreClient\Model\ForgotPasswordRequestRequest|null $forgot_password_request_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthForgotPasswordRequestPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiAuthForgotPasswordRequestPostRequest($forgot_password_request_request = null, string $contentType = self::contentTypes['apiAuthForgotPasswordRequestPost'][0]) + { + + + + $resourcePath = '/api/auth/forgot-password/request'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($forgot_password_request_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($forgot_password_request_request)); + } else { + $httpBody = $forgot_password_request_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiAuthForgotPasswordResetPost + * + * @param \OmsorgCoreClient\Model\ForgotPasswordResetRequest|null $forgot_password_reset_request forgot_password_reset_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthForgotPasswordResetPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function apiAuthForgotPasswordResetPost($forgot_password_reset_request = null, string $contentType = self::contentTypes['apiAuthForgotPasswordResetPost'][0]) + { + $this->apiAuthForgotPasswordResetPostWithHttpInfo($forgot_password_reset_request, $contentType); + } + + /** + * Operation apiAuthForgotPasswordResetPostWithHttpInfo + * + * @param \OmsorgCoreClient\Model\ForgotPasswordResetRequest|null $forgot_password_reset_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthForgotPasswordResetPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function apiAuthForgotPasswordResetPostWithHttpInfo($forgot_password_reset_request = null, string $contentType = self::contentTypes['apiAuthForgotPasswordResetPost'][0]) + { + $request = $this->apiAuthForgotPasswordResetPostRequest($forgot_password_reset_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation apiAuthForgotPasswordResetPostAsync + * + * @param \OmsorgCoreClient\Model\ForgotPasswordResetRequest|null $forgot_password_reset_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthForgotPasswordResetPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAuthForgotPasswordResetPostAsync($forgot_password_reset_request = null, string $contentType = self::contentTypes['apiAuthForgotPasswordResetPost'][0]) + { + return $this->apiAuthForgotPasswordResetPostAsyncWithHttpInfo($forgot_password_reset_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiAuthForgotPasswordResetPostAsyncWithHttpInfo + * + * @param \OmsorgCoreClient\Model\ForgotPasswordResetRequest|null $forgot_password_reset_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthForgotPasswordResetPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAuthForgotPasswordResetPostAsyncWithHttpInfo($forgot_password_reset_request = null, string $contentType = self::contentTypes['apiAuthForgotPasswordResetPost'][0]) + { + $returnType = ''; + $request = $this->apiAuthForgotPasswordResetPostRequest($forgot_password_reset_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiAuthForgotPasswordResetPost' + * + * @param \OmsorgCoreClient\Model\ForgotPasswordResetRequest|null $forgot_password_reset_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthForgotPasswordResetPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiAuthForgotPasswordResetPostRequest($forgot_password_reset_request = null, string $contentType = self::contentTypes['apiAuthForgotPasswordResetPost'][0]) + { + + + + $resourcePath = '/api/auth/forgot-password/reset'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($forgot_password_reset_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($forgot_password_reset_request)); + } else { + $httpBody = $forgot_password_reset_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiAuthForgotPasswordVerifyPost + * + * @param \OmsorgCoreClient\Model\ForgotPasswordVerifyRequest|null $forgot_password_verify_request forgot_password_verify_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthForgotPasswordVerifyPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\ForgotPasswordVerifyResponse + */ + public function apiAuthForgotPasswordVerifyPost($forgot_password_verify_request = null, string $contentType = self::contentTypes['apiAuthForgotPasswordVerifyPost'][0]) + { + list($response) = $this->apiAuthForgotPasswordVerifyPostWithHttpInfo($forgot_password_verify_request, $contentType); + return $response; + } + + /** + * Operation apiAuthForgotPasswordVerifyPostWithHttpInfo + * + * @param \OmsorgCoreClient\Model\ForgotPasswordVerifyRequest|null $forgot_password_verify_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthForgotPasswordVerifyPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\ForgotPasswordVerifyResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiAuthForgotPasswordVerifyPostWithHttpInfo($forgot_password_verify_request = null, string $contentType = self::contentTypes['apiAuthForgotPasswordVerifyPost'][0]) + { + $request = $this->apiAuthForgotPasswordVerifyPostRequest($forgot_password_verify_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\ForgotPasswordVerifyResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\ForgotPasswordVerifyResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\ForgotPasswordVerifyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiAuthForgotPasswordVerifyPostAsync + * + * @param \OmsorgCoreClient\Model\ForgotPasswordVerifyRequest|null $forgot_password_verify_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthForgotPasswordVerifyPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAuthForgotPasswordVerifyPostAsync($forgot_password_verify_request = null, string $contentType = self::contentTypes['apiAuthForgotPasswordVerifyPost'][0]) + { + return $this->apiAuthForgotPasswordVerifyPostAsyncWithHttpInfo($forgot_password_verify_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiAuthForgotPasswordVerifyPostAsyncWithHttpInfo + * + * @param \OmsorgCoreClient\Model\ForgotPasswordVerifyRequest|null $forgot_password_verify_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthForgotPasswordVerifyPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAuthForgotPasswordVerifyPostAsyncWithHttpInfo($forgot_password_verify_request = null, string $contentType = self::contentTypes['apiAuthForgotPasswordVerifyPost'][0]) + { + $returnType = '\OmsorgCoreClient\Model\ForgotPasswordVerifyResponse'; + $request = $this->apiAuthForgotPasswordVerifyPostRequest($forgot_password_verify_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiAuthForgotPasswordVerifyPost' + * + * @param \OmsorgCoreClient\Model\ForgotPasswordVerifyRequest|null $forgot_password_verify_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthForgotPasswordVerifyPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiAuthForgotPasswordVerifyPostRequest($forgot_password_verify_request = null, string $contentType = self::contentTypes['apiAuthForgotPasswordVerifyPost'][0]) + { + + + + $resourcePath = '/api/auth/forgot-password/verify'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($forgot_password_verify_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($forgot_password_verify_request)); + } else { + $httpBody = $forgot_password_verify_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiAuthLoginPost + * + * @param \OmsorgCoreClient\Model\LoginRequest|null $login_request login_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthLoginPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\LoginResponse + */ + public function apiAuthLoginPost($login_request = null, string $contentType = self::contentTypes['apiAuthLoginPost'][0]) + { + list($response) = $this->apiAuthLoginPostWithHttpInfo($login_request, $contentType); + return $response; + } + + /** + * Operation apiAuthLoginPostWithHttpInfo + * + * @param \OmsorgCoreClient\Model\LoginRequest|null $login_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthLoginPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\LoginResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiAuthLoginPostWithHttpInfo($login_request = null, string $contentType = self::contentTypes['apiAuthLoginPost'][0]) + { + $request = $this->apiAuthLoginPostRequest($login_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\LoginResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\LoginResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\LoginResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiAuthLoginPostAsync + * + * @param \OmsorgCoreClient\Model\LoginRequest|null $login_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthLoginPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAuthLoginPostAsync($login_request = null, string $contentType = self::contentTypes['apiAuthLoginPost'][0]) + { + return $this->apiAuthLoginPostAsyncWithHttpInfo($login_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiAuthLoginPostAsyncWithHttpInfo + * + * @param \OmsorgCoreClient\Model\LoginRequest|null $login_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthLoginPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAuthLoginPostAsyncWithHttpInfo($login_request = null, string $contentType = self::contentTypes['apiAuthLoginPost'][0]) + { + $returnType = '\OmsorgCoreClient\Model\LoginResponse'; + $request = $this->apiAuthLoginPostRequest($login_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiAuthLoginPost' + * + * @param \OmsorgCoreClient\Model\LoginRequest|null $login_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthLoginPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiAuthLoginPostRequest($login_request = null, string $contentType = self::contentTypes['apiAuthLoginPost'][0]) + { + + + + $resourcePath = '/api/auth/login'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($login_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($login_request)); + } else { + $httpBody = $login_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiAuthLogoutPost + * + * @param \OmsorgCoreClient\Model\LogoutRequest|null $logout_request logout_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthLogoutPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function apiAuthLogoutPost($logout_request = null, string $contentType = self::contentTypes['apiAuthLogoutPost'][0]) + { + $this->apiAuthLogoutPostWithHttpInfo($logout_request, $contentType); + } + + /** + * Operation apiAuthLogoutPostWithHttpInfo + * + * @param \OmsorgCoreClient\Model\LogoutRequest|null $logout_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthLogoutPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function apiAuthLogoutPostWithHttpInfo($logout_request = null, string $contentType = self::contentTypes['apiAuthLogoutPost'][0]) + { + $request = $this->apiAuthLogoutPostRequest($logout_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation apiAuthLogoutPostAsync + * + * @param \OmsorgCoreClient\Model\LogoutRequest|null $logout_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthLogoutPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAuthLogoutPostAsync($logout_request = null, string $contentType = self::contentTypes['apiAuthLogoutPost'][0]) + { + return $this->apiAuthLogoutPostAsyncWithHttpInfo($logout_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiAuthLogoutPostAsyncWithHttpInfo + * + * @param \OmsorgCoreClient\Model\LogoutRequest|null $logout_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthLogoutPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAuthLogoutPostAsyncWithHttpInfo($logout_request = null, string $contentType = self::contentTypes['apiAuthLogoutPost'][0]) + { + $returnType = ''; + $request = $this->apiAuthLogoutPostRequest($logout_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiAuthLogoutPost' + * + * @param \OmsorgCoreClient\Model\LogoutRequest|null $logout_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthLogoutPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiAuthLogoutPostRequest($logout_request = null, string $contentType = self::contentTypes['apiAuthLogoutPost'][0]) + { + + + + $resourcePath = '/api/auth/logout'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($logout_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($logout_request)); + } else { + $httpBody = $logout_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiAuthMeGet + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthMeGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\MeResponse + */ + public function apiAuthMeGet(string $contentType = self::contentTypes['apiAuthMeGet'][0]) + { + list($response) = $this->apiAuthMeGetWithHttpInfo($contentType); + return $response; + } + + /** + * Operation apiAuthMeGetWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthMeGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\MeResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiAuthMeGetWithHttpInfo(string $contentType = self::contentTypes['apiAuthMeGet'][0]) + { + $request = $this->apiAuthMeGetRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\MeResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\MeResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\MeResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiAuthMeGetAsync + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthMeGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAuthMeGetAsync(string $contentType = self::contentTypes['apiAuthMeGet'][0]) + { + return $this->apiAuthMeGetAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiAuthMeGetAsyncWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthMeGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAuthMeGetAsyncWithHttpInfo(string $contentType = self::contentTypes['apiAuthMeGet'][0]) + { + $returnType = '\OmsorgCoreClient\Model\MeResponse'; + $request = $this->apiAuthMeGetRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiAuthMeGet' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthMeGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiAuthMeGetRequest(string $contentType = self::contentTypes['apiAuthMeGet'][0]) + { + + + $resourcePath = '/api/auth/me'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiAuthPasswordPolicyGet + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthPasswordPolicyGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\PasswordPolicyResponse + */ + public function apiAuthPasswordPolicyGet(string $contentType = self::contentTypes['apiAuthPasswordPolicyGet'][0]) + { + list($response) = $this->apiAuthPasswordPolicyGetWithHttpInfo($contentType); + return $response; + } + + /** + * Operation apiAuthPasswordPolicyGetWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthPasswordPolicyGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\PasswordPolicyResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiAuthPasswordPolicyGetWithHttpInfo(string $contentType = self::contentTypes['apiAuthPasswordPolicyGet'][0]) + { + $request = $this->apiAuthPasswordPolicyGetRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\PasswordPolicyResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\PasswordPolicyResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\PasswordPolicyResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiAuthPasswordPolicyGetAsync + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthPasswordPolicyGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAuthPasswordPolicyGetAsync(string $contentType = self::contentTypes['apiAuthPasswordPolicyGet'][0]) + { + return $this->apiAuthPasswordPolicyGetAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiAuthPasswordPolicyGetAsyncWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthPasswordPolicyGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAuthPasswordPolicyGetAsyncWithHttpInfo(string $contentType = self::contentTypes['apiAuthPasswordPolicyGet'][0]) + { + $returnType = '\OmsorgCoreClient\Model\PasswordPolicyResponse'; + $request = $this->apiAuthPasswordPolicyGetRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiAuthPasswordPolicyGet' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthPasswordPolicyGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiAuthPasswordPolicyGetRequest(string $contentType = self::contentTypes['apiAuthPasswordPolicyGet'][0]) + { + + + $resourcePath = '/api/auth/password-policy'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiAuthRefreshPost + * + * @param \OmsorgCoreClient\Model\RefreshRequest|null $refresh_request refresh_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthRefreshPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\LoginResponse + */ + public function apiAuthRefreshPost($refresh_request = null, string $contentType = self::contentTypes['apiAuthRefreshPost'][0]) + { + list($response) = $this->apiAuthRefreshPostWithHttpInfo($refresh_request, $contentType); + return $response; + } + + /** + * Operation apiAuthRefreshPostWithHttpInfo + * + * @param \OmsorgCoreClient\Model\RefreshRequest|null $refresh_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthRefreshPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\LoginResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiAuthRefreshPostWithHttpInfo($refresh_request = null, string $contentType = self::contentTypes['apiAuthRefreshPost'][0]) + { + $request = $this->apiAuthRefreshPostRequest($refresh_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\LoginResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\LoginResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\LoginResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiAuthRefreshPostAsync + * + * @param \OmsorgCoreClient\Model\RefreshRequest|null $refresh_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthRefreshPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAuthRefreshPostAsync($refresh_request = null, string $contentType = self::contentTypes['apiAuthRefreshPost'][0]) + { + return $this->apiAuthRefreshPostAsyncWithHttpInfo($refresh_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiAuthRefreshPostAsyncWithHttpInfo + * + * @param \OmsorgCoreClient\Model\RefreshRequest|null $refresh_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthRefreshPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiAuthRefreshPostAsyncWithHttpInfo($refresh_request = null, string $contentType = self::contentTypes['apiAuthRefreshPost'][0]) + { + $returnType = '\OmsorgCoreClient\Model\LoginResponse'; + $request = $this->apiAuthRefreshPostRequest($refresh_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiAuthRefreshPost' + * + * @param \OmsorgCoreClient\Model\RefreshRequest|null $refresh_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiAuthRefreshPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiAuthRefreshPostRequest($refresh_request = null, string $contentType = self::contentTypes['apiAuthRefreshPost'][0]) + { + + + + $resourcePath = '/api/auth/refresh'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($refresh_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($refresh_request)); + } else { + $httpBody = $refresh_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/ContractsApi.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/ContractsApi.php new file mode 100644 index 0000000..8c0c432 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/ContractsApi.php @@ -0,0 +1,1334 @@ + [ + 'application/json', + ], + 'apiContractsIdGet' => [ + 'application/json', + ], + 'apiContractsIdPut' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + 'apiContractsPost' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation apiContractsGet + * + * @param string|null $search search (optional) + * @param string|null $status status (optional) + * @param string|null $employee_id employee_id (optional) + * @param string|null $facility_id facility_id (optional) + * @param int|null $page page (optional, default to 1) + * @param int|null $page_size page_size (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiContractsGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\ContractResponsePagedResponse + */ + public function apiContractsGet($search = null, $status = null, $employee_id = null, $facility_id = null, $page = 1, $page_size = 20, string $contentType = self::contentTypes['apiContractsGet'][0]) + { + list($response) = $this->apiContractsGetWithHttpInfo($search, $status, $employee_id, $facility_id, $page, $page_size, $contentType); + return $response; + } + + /** + * Operation apiContractsGetWithHttpInfo + * + * @param string|null $search (optional) + * @param string|null $status (optional) + * @param string|null $employee_id (optional) + * @param string|null $facility_id (optional) + * @param int|null $page (optional, default to 1) + * @param int|null $page_size (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiContractsGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\ContractResponsePagedResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiContractsGetWithHttpInfo($search = null, $status = null, $employee_id = null, $facility_id = null, $page = 1, $page_size = 20, string $contentType = self::contentTypes['apiContractsGet'][0]) + { + $request = $this->apiContractsGetRequest($search, $status, $employee_id, $facility_id, $page, $page_size, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\ContractResponsePagedResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\ContractResponsePagedResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\ContractResponsePagedResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiContractsGetAsync + * + * @param string|null $search (optional) + * @param string|null $status (optional) + * @param string|null $employee_id (optional) + * @param string|null $facility_id (optional) + * @param int|null $page (optional, default to 1) + * @param int|null $page_size (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiContractsGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiContractsGetAsync($search = null, $status = null, $employee_id = null, $facility_id = null, $page = 1, $page_size = 20, string $contentType = self::contentTypes['apiContractsGet'][0]) + { + return $this->apiContractsGetAsyncWithHttpInfo($search, $status, $employee_id, $facility_id, $page, $page_size, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiContractsGetAsyncWithHttpInfo + * + * @param string|null $search (optional) + * @param string|null $status (optional) + * @param string|null $employee_id (optional) + * @param string|null $facility_id (optional) + * @param int|null $page (optional, default to 1) + * @param int|null $page_size (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiContractsGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiContractsGetAsyncWithHttpInfo($search = null, $status = null, $employee_id = null, $facility_id = null, $page = 1, $page_size = 20, string $contentType = self::contentTypes['apiContractsGet'][0]) + { + $returnType = '\OmsorgCoreClient\Model\ContractResponsePagedResponse'; + $request = $this->apiContractsGetRequest($search, $status, $employee_id, $facility_id, $page, $page_size, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiContractsGet' + * + * @param string|null $search (optional) + * @param string|null $status (optional) + * @param string|null $employee_id (optional) + * @param string|null $facility_id (optional) + * @param int|null $page (optional, default to 1) + * @param int|null $page_size (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiContractsGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiContractsGetRequest($search = null, $status = null, $employee_id = null, $facility_id = null, $page = 1, $page_size = 20, string $contentType = self::contentTypes['apiContractsGet'][0]) + { + + + + + + + + + $resourcePath = '/api/contracts'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $search, + 'search', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $status, + 'status', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employee_id, + 'employeeId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $facility_id, + 'facilityId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiContractsIdGet + * + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiContractsIdGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\ContractResponse + */ + public function apiContractsIdGet($id, string $contentType = self::contentTypes['apiContractsIdGet'][0]) + { + list($response) = $this->apiContractsIdGetWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation apiContractsIdGetWithHttpInfo + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiContractsIdGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\ContractResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiContractsIdGetWithHttpInfo($id, string $contentType = self::contentTypes['apiContractsIdGet'][0]) + { + $request = $this->apiContractsIdGetRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\ContractResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\ContractResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\ContractResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiContractsIdGetAsync + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiContractsIdGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiContractsIdGetAsync($id, string $contentType = self::contentTypes['apiContractsIdGet'][0]) + { + return $this->apiContractsIdGetAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiContractsIdGetAsyncWithHttpInfo + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiContractsIdGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiContractsIdGetAsyncWithHttpInfo($id, string $contentType = self::contentTypes['apiContractsIdGet'][0]) + { + $returnType = '\OmsorgCoreClient\Model\ContractResponse'; + $request = $this->apiContractsIdGetRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiContractsIdGet' + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiContractsIdGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiContractsIdGetRequest($id, string $contentType = self::contentTypes['apiContractsIdGet'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling apiContractsIdGet' + ); + } + + + $resourcePath = '/api/contracts/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiContractsIdPut + * + * @param string $id id (required) + * @param \OmsorgCoreClient\Model\UpdateContractRequest|null $update_contract_request update_contract_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiContractsIdPut'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\ContractResponse + */ + public function apiContractsIdPut($id, $update_contract_request = null, string $contentType = self::contentTypes['apiContractsIdPut'][0]) + { + list($response) = $this->apiContractsIdPutWithHttpInfo($id, $update_contract_request, $contentType); + return $response; + } + + /** + * Operation apiContractsIdPutWithHttpInfo + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateContractRequest|null $update_contract_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiContractsIdPut'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\ContractResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiContractsIdPutWithHttpInfo($id, $update_contract_request = null, string $contentType = self::contentTypes['apiContractsIdPut'][0]) + { + $request = $this->apiContractsIdPutRequest($id, $update_contract_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\ContractResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\ContractResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\ContractResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiContractsIdPutAsync + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateContractRequest|null $update_contract_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiContractsIdPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiContractsIdPutAsync($id, $update_contract_request = null, string $contentType = self::contentTypes['apiContractsIdPut'][0]) + { + return $this->apiContractsIdPutAsyncWithHttpInfo($id, $update_contract_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiContractsIdPutAsyncWithHttpInfo + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateContractRequest|null $update_contract_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiContractsIdPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiContractsIdPutAsyncWithHttpInfo($id, $update_contract_request = null, string $contentType = self::contentTypes['apiContractsIdPut'][0]) + { + $returnType = '\OmsorgCoreClient\Model\ContractResponse'; + $request = $this->apiContractsIdPutRequest($id, $update_contract_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiContractsIdPut' + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateContractRequest|null $update_contract_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiContractsIdPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiContractsIdPutRequest($id, $update_contract_request = null, string $contentType = self::contentTypes['apiContractsIdPut'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling apiContractsIdPut' + ); + } + + + + $resourcePath = '/api/contracts/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_contract_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_contract_request)); + } else { + $httpBody = $update_contract_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiContractsPost + * + * @param \OmsorgCoreClient\Model\CreateContractRequest|null $create_contract_request create_contract_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiContractsPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\ContractResponse + */ + public function apiContractsPost($create_contract_request = null, string $contentType = self::contentTypes['apiContractsPost'][0]) + { + list($response) = $this->apiContractsPostWithHttpInfo($create_contract_request, $contentType); + return $response; + } + + /** + * Operation apiContractsPostWithHttpInfo + * + * @param \OmsorgCoreClient\Model\CreateContractRequest|null $create_contract_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiContractsPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\ContractResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiContractsPostWithHttpInfo($create_contract_request = null, string $contentType = self::contentTypes['apiContractsPost'][0]) + { + $request = $this->apiContractsPostRequest($create_contract_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\ContractResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\ContractResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\ContractResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiContractsPostAsync + * + * @param \OmsorgCoreClient\Model\CreateContractRequest|null $create_contract_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiContractsPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiContractsPostAsync($create_contract_request = null, string $contentType = self::contentTypes['apiContractsPost'][0]) + { + return $this->apiContractsPostAsyncWithHttpInfo($create_contract_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiContractsPostAsyncWithHttpInfo + * + * @param \OmsorgCoreClient\Model\CreateContractRequest|null $create_contract_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiContractsPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiContractsPostAsyncWithHttpInfo($create_contract_request = null, string $contentType = self::contentTypes['apiContractsPost'][0]) + { + $returnType = '\OmsorgCoreClient\Model\ContractResponse'; + $request = $this->apiContractsPostRequest($create_contract_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiContractsPost' + * + * @param \OmsorgCoreClient\Model\CreateContractRequest|null $create_contract_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiContractsPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiContractsPostRequest($create_contract_request = null, string $contentType = self::contentTypes['apiContractsPost'][0]) + { + + + + $resourcePath = '/api/contracts'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($create_contract_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_contract_request)); + } else { + $httpBody = $create_contract_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/EmployeesApi.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/EmployeesApi.php new file mode 100644 index 0000000..c9f4f54 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/EmployeesApi.php @@ -0,0 +1,1319 @@ + [ + 'application/json', + ], + 'apiEmployeesIdGet' => [ + 'application/json', + ], + 'apiEmployeesIdPut' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + 'apiEmployeesPost' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation apiEmployeesGet + * + * @param string|null $search search (optional) + * @param string|null $status status (optional) + * @param string|null $employment_type employment_type (optional) + * @param int|null $page page (optional, default to 1) + * @param int|null $page_size page_size (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiEmployeesGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\EmployeeResponsePagedResponse + */ + public function apiEmployeesGet($search = null, $status = null, $employment_type = null, $page = 1, $page_size = 20, string $contentType = self::contentTypes['apiEmployeesGet'][0]) + { + list($response) = $this->apiEmployeesGetWithHttpInfo($search, $status, $employment_type, $page, $page_size, $contentType); + return $response; + } + + /** + * Operation apiEmployeesGetWithHttpInfo + * + * @param string|null $search (optional) + * @param string|null $status (optional) + * @param string|null $employment_type (optional) + * @param int|null $page (optional, default to 1) + * @param int|null $page_size (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiEmployeesGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\EmployeeResponsePagedResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiEmployeesGetWithHttpInfo($search = null, $status = null, $employment_type = null, $page = 1, $page_size = 20, string $contentType = self::contentTypes['apiEmployeesGet'][0]) + { + $request = $this->apiEmployeesGetRequest($search, $status, $employment_type, $page, $page_size, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\EmployeeResponsePagedResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\EmployeeResponsePagedResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\EmployeeResponsePagedResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiEmployeesGetAsync + * + * @param string|null $search (optional) + * @param string|null $status (optional) + * @param string|null $employment_type (optional) + * @param int|null $page (optional, default to 1) + * @param int|null $page_size (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiEmployeesGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiEmployeesGetAsync($search = null, $status = null, $employment_type = null, $page = 1, $page_size = 20, string $contentType = self::contentTypes['apiEmployeesGet'][0]) + { + return $this->apiEmployeesGetAsyncWithHttpInfo($search, $status, $employment_type, $page, $page_size, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiEmployeesGetAsyncWithHttpInfo + * + * @param string|null $search (optional) + * @param string|null $status (optional) + * @param string|null $employment_type (optional) + * @param int|null $page (optional, default to 1) + * @param int|null $page_size (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiEmployeesGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiEmployeesGetAsyncWithHttpInfo($search = null, $status = null, $employment_type = null, $page = 1, $page_size = 20, string $contentType = self::contentTypes['apiEmployeesGet'][0]) + { + $returnType = '\OmsorgCoreClient\Model\EmployeeResponsePagedResponse'; + $request = $this->apiEmployeesGetRequest($search, $status, $employment_type, $page, $page_size, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiEmployeesGet' + * + * @param string|null $search (optional) + * @param string|null $status (optional) + * @param string|null $employment_type (optional) + * @param int|null $page (optional, default to 1) + * @param int|null $page_size (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiEmployeesGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiEmployeesGetRequest($search = null, $status = null, $employment_type = null, $page = 1, $page_size = 20, string $contentType = self::contentTypes['apiEmployeesGet'][0]) + { + + + + + + + + $resourcePath = '/api/employees'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $search, + 'search', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $status, + 'status', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $employment_type, + 'employmentType', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiEmployeesIdGet + * + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiEmployeesIdGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\EmployeeResponse + */ + public function apiEmployeesIdGet($id, string $contentType = self::contentTypes['apiEmployeesIdGet'][0]) + { + list($response) = $this->apiEmployeesIdGetWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation apiEmployeesIdGetWithHttpInfo + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiEmployeesIdGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\EmployeeResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiEmployeesIdGetWithHttpInfo($id, string $contentType = self::contentTypes['apiEmployeesIdGet'][0]) + { + $request = $this->apiEmployeesIdGetRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\EmployeeResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\EmployeeResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\EmployeeResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiEmployeesIdGetAsync + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiEmployeesIdGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiEmployeesIdGetAsync($id, string $contentType = self::contentTypes['apiEmployeesIdGet'][0]) + { + return $this->apiEmployeesIdGetAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiEmployeesIdGetAsyncWithHttpInfo + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiEmployeesIdGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiEmployeesIdGetAsyncWithHttpInfo($id, string $contentType = self::contentTypes['apiEmployeesIdGet'][0]) + { + $returnType = '\OmsorgCoreClient\Model\EmployeeResponse'; + $request = $this->apiEmployeesIdGetRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiEmployeesIdGet' + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiEmployeesIdGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiEmployeesIdGetRequest($id, string $contentType = self::contentTypes['apiEmployeesIdGet'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling apiEmployeesIdGet' + ); + } + + + $resourcePath = '/api/employees/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiEmployeesIdPut + * + * @param string $id id (required) + * @param \OmsorgCoreClient\Model\UpdateEmployeeRequest|null $update_employee_request update_employee_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiEmployeesIdPut'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\EmployeeResponse + */ + public function apiEmployeesIdPut($id, $update_employee_request = null, string $contentType = self::contentTypes['apiEmployeesIdPut'][0]) + { + list($response) = $this->apiEmployeesIdPutWithHttpInfo($id, $update_employee_request, $contentType); + return $response; + } + + /** + * Operation apiEmployeesIdPutWithHttpInfo + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateEmployeeRequest|null $update_employee_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiEmployeesIdPut'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\EmployeeResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiEmployeesIdPutWithHttpInfo($id, $update_employee_request = null, string $contentType = self::contentTypes['apiEmployeesIdPut'][0]) + { + $request = $this->apiEmployeesIdPutRequest($id, $update_employee_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\EmployeeResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\EmployeeResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\EmployeeResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiEmployeesIdPutAsync + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateEmployeeRequest|null $update_employee_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiEmployeesIdPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiEmployeesIdPutAsync($id, $update_employee_request = null, string $contentType = self::contentTypes['apiEmployeesIdPut'][0]) + { + return $this->apiEmployeesIdPutAsyncWithHttpInfo($id, $update_employee_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiEmployeesIdPutAsyncWithHttpInfo + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateEmployeeRequest|null $update_employee_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiEmployeesIdPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiEmployeesIdPutAsyncWithHttpInfo($id, $update_employee_request = null, string $contentType = self::contentTypes['apiEmployeesIdPut'][0]) + { + $returnType = '\OmsorgCoreClient\Model\EmployeeResponse'; + $request = $this->apiEmployeesIdPutRequest($id, $update_employee_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiEmployeesIdPut' + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateEmployeeRequest|null $update_employee_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiEmployeesIdPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiEmployeesIdPutRequest($id, $update_employee_request = null, string $contentType = self::contentTypes['apiEmployeesIdPut'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling apiEmployeesIdPut' + ); + } + + + + $resourcePath = '/api/employees/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_employee_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_employee_request)); + } else { + $httpBody = $update_employee_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiEmployeesPost + * + * @param \OmsorgCoreClient\Model\CreateEmployeeRequest|null $create_employee_request create_employee_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiEmployeesPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\EmployeeResponse + */ + public function apiEmployeesPost($create_employee_request = null, string $contentType = self::contentTypes['apiEmployeesPost'][0]) + { + list($response) = $this->apiEmployeesPostWithHttpInfo($create_employee_request, $contentType); + return $response; + } + + /** + * Operation apiEmployeesPostWithHttpInfo + * + * @param \OmsorgCoreClient\Model\CreateEmployeeRequest|null $create_employee_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiEmployeesPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\EmployeeResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiEmployeesPostWithHttpInfo($create_employee_request = null, string $contentType = self::contentTypes['apiEmployeesPost'][0]) + { + $request = $this->apiEmployeesPostRequest($create_employee_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\EmployeeResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\EmployeeResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\EmployeeResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiEmployeesPostAsync + * + * @param \OmsorgCoreClient\Model\CreateEmployeeRequest|null $create_employee_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiEmployeesPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiEmployeesPostAsync($create_employee_request = null, string $contentType = self::contentTypes['apiEmployeesPost'][0]) + { + return $this->apiEmployeesPostAsyncWithHttpInfo($create_employee_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiEmployeesPostAsyncWithHttpInfo + * + * @param \OmsorgCoreClient\Model\CreateEmployeeRequest|null $create_employee_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiEmployeesPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiEmployeesPostAsyncWithHttpInfo($create_employee_request = null, string $contentType = self::contentTypes['apiEmployeesPost'][0]) + { + $returnType = '\OmsorgCoreClient\Model\EmployeeResponse'; + $request = $this->apiEmployeesPostRequest($create_employee_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiEmployeesPost' + * + * @param \OmsorgCoreClient\Model\CreateEmployeeRequest|null $create_employee_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiEmployeesPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiEmployeesPostRequest($create_employee_request = null, string $contentType = self::contentTypes['apiEmployeesPost'][0]) + { + + + + $resourcePath = '/api/employees'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($create_employee_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_employee_request)); + } else { + $httpBody = $create_employee_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/FacilitiesApi.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/FacilitiesApi.php new file mode 100644 index 0000000..84cf46c --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/FacilitiesApi.php @@ -0,0 +1,1304 @@ + [ + 'application/json', + ], + 'apiFacilitiesIdGet' => [ + 'application/json', + ], + 'apiFacilitiesIdPut' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + 'apiFacilitiesPost' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation apiFacilitiesGet + * + * @param string|null $search search (optional) + * @param string|null $crm_status crm_status (optional) + * @param int|null $page page (optional, default to 1) + * @param int|null $page_size page_size (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\FacilityResponsePagedResponse + */ + public function apiFacilitiesGet($search = null, $crm_status = null, $page = 1, $page_size = 20, string $contentType = self::contentTypes['apiFacilitiesGet'][0]) + { + list($response) = $this->apiFacilitiesGetWithHttpInfo($search, $crm_status, $page, $page_size, $contentType); + return $response; + } + + /** + * Operation apiFacilitiesGetWithHttpInfo + * + * @param string|null $search (optional) + * @param string|null $crm_status (optional) + * @param int|null $page (optional, default to 1) + * @param int|null $page_size (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\FacilityResponsePagedResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiFacilitiesGetWithHttpInfo($search = null, $crm_status = null, $page = 1, $page_size = 20, string $contentType = self::contentTypes['apiFacilitiesGet'][0]) + { + $request = $this->apiFacilitiesGetRequest($search, $crm_status, $page, $page_size, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\FacilityResponsePagedResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\FacilityResponsePagedResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\FacilityResponsePagedResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiFacilitiesGetAsync + * + * @param string|null $search (optional) + * @param string|null $crm_status (optional) + * @param int|null $page (optional, default to 1) + * @param int|null $page_size (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiFacilitiesGetAsync($search = null, $crm_status = null, $page = 1, $page_size = 20, string $contentType = self::contentTypes['apiFacilitiesGet'][0]) + { + return $this->apiFacilitiesGetAsyncWithHttpInfo($search, $crm_status, $page, $page_size, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiFacilitiesGetAsyncWithHttpInfo + * + * @param string|null $search (optional) + * @param string|null $crm_status (optional) + * @param int|null $page (optional, default to 1) + * @param int|null $page_size (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiFacilitiesGetAsyncWithHttpInfo($search = null, $crm_status = null, $page = 1, $page_size = 20, string $contentType = self::contentTypes['apiFacilitiesGet'][0]) + { + $returnType = '\OmsorgCoreClient\Model\FacilityResponsePagedResponse'; + $request = $this->apiFacilitiesGetRequest($search, $crm_status, $page, $page_size, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiFacilitiesGet' + * + * @param string|null $search (optional) + * @param string|null $crm_status (optional) + * @param int|null $page (optional, default to 1) + * @param int|null $page_size (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiFacilitiesGetRequest($search = null, $crm_status = null, $page = 1, $page_size = 20, string $contentType = self::contentTypes['apiFacilitiesGet'][0]) + { + + + + + + + $resourcePath = '/api/facilities'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $search, + 'search', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $crm_status, + 'crmStatus', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiFacilitiesIdGet + * + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesIdGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\FacilityResponse + */ + public function apiFacilitiesIdGet($id, string $contentType = self::contentTypes['apiFacilitiesIdGet'][0]) + { + list($response) = $this->apiFacilitiesIdGetWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation apiFacilitiesIdGetWithHttpInfo + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesIdGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\FacilityResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiFacilitiesIdGetWithHttpInfo($id, string $contentType = self::contentTypes['apiFacilitiesIdGet'][0]) + { + $request = $this->apiFacilitiesIdGetRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\FacilityResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\FacilityResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\FacilityResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiFacilitiesIdGetAsync + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesIdGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiFacilitiesIdGetAsync($id, string $contentType = self::contentTypes['apiFacilitiesIdGet'][0]) + { + return $this->apiFacilitiesIdGetAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiFacilitiesIdGetAsyncWithHttpInfo + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesIdGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiFacilitiesIdGetAsyncWithHttpInfo($id, string $contentType = self::contentTypes['apiFacilitiesIdGet'][0]) + { + $returnType = '\OmsorgCoreClient\Model\FacilityResponse'; + $request = $this->apiFacilitiesIdGetRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiFacilitiesIdGet' + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesIdGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiFacilitiesIdGetRequest($id, string $contentType = self::contentTypes['apiFacilitiesIdGet'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling apiFacilitiesIdGet' + ); + } + + + $resourcePath = '/api/facilities/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiFacilitiesIdPut + * + * @param string $id id (required) + * @param \OmsorgCoreClient\Model\UpdateFacilityRequest|null $update_facility_request update_facility_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesIdPut'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\FacilityResponse + */ + public function apiFacilitiesIdPut($id, $update_facility_request = null, string $contentType = self::contentTypes['apiFacilitiesIdPut'][0]) + { + list($response) = $this->apiFacilitiesIdPutWithHttpInfo($id, $update_facility_request, $contentType); + return $response; + } + + /** + * Operation apiFacilitiesIdPutWithHttpInfo + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateFacilityRequest|null $update_facility_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesIdPut'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\FacilityResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiFacilitiesIdPutWithHttpInfo($id, $update_facility_request = null, string $contentType = self::contentTypes['apiFacilitiesIdPut'][0]) + { + $request = $this->apiFacilitiesIdPutRequest($id, $update_facility_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\FacilityResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\FacilityResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\FacilityResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiFacilitiesIdPutAsync + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateFacilityRequest|null $update_facility_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesIdPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiFacilitiesIdPutAsync($id, $update_facility_request = null, string $contentType = self::contentTypes['apiFacilitiesIdPut'][0]) + { + return $this->apiFacilitiesIdPutAsyncWithHttpInfo($id, $update_facility_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiFacilitiesIdPutAsyncWithHttpInfo + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateFacilityRequest|null $update_facility_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesIdPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiFacilitiesIdPutAsyncWithHttpInfo($id, $update_facility_request = null, string $contentType = self::contentTypes['apiFacilitiesIdPut'][0]) + { + $returnType = '\OmsorgCoreClient\Model\FacilityResponse'; + $request = $this->apiFacilitiesIdPutRequest($id, $update_facility_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiFacilitiesIdPut' + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateFacilityRequest|null $update_facility_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesIdPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiFacilitiesIdPutRequest($id, $update_facility_request = null, string $contentType = self::contentTypes['apiFacilitiesIdPut'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling apiFacilitiesIdPut' + ); + } + + + + $resourcePath = '/api/facilities/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_facility_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_facility_request)); + } else { + $httpBody = $update_facility_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiFacilitiesPost + * + * @param \OmsorgCoreClient\Model\CreateFacilityRequest|null $create_facility_request create_facility_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\FacilityResponse + */ + public function apiFacilitiesPost($create_facility_request = null, string $contentType = self::contentTypes['apiFacilitiesPost'][0]) + { + list($response) = $this->apiFacilitiesPostWithHttpInfo($create_facility_request, $contentType); + return $response; + } + + /** + * Operation apiFacilitiesPostWithHttpInfo + * + * @param \OmsorgCoreClient\Model\CreateFacilityRequest|null $create_facility_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\FacilityResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiFacilitiesPostWithHttpInfo($create_facility_request = null, string $contentType = self::contentTypes['apiFacilitiesPost'][0]) + { + $request = $this->apiFacilitiesPostRequest($create_facility_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\FacilityResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\FacilityResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\FacilityResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiFacilitiesPostAsync + * + * @param \OmsorgCoreClient\Model\CreateFacilityRequest|null $create_facility_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiFacilitiesPostAsync($create_facility_request = null, string $contentType = self::contentTypes['apiFacilitiesPost'][0]) + { + return $this->apiFacilitiesPostAsyncWithHttpInfo($create_facility_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiFacilitiesPostAsyncWithHttpInfo + * + * @param \OmsorgCoreClient\Model\CreateFacilityRequest|null $create_facility_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiFacilitiesPostAsyncWithHttpInfo($create_facility_request = null, string $contentType = self::contentTypes['apiFacilitiesPost'][0]) + { + $returnType = '\OmsorgCoreClient\Model\FacilityResponse'; + $request = $this->apiFacilitiesPostRequest($create_facility_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiFacilitiesPost' + * + * @param \OmsorgCoreClient\Model\CreateFacilityRequest|null $create_facility_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiFacilitiesPostRequest($create_facility_request = null, string $contentType = self::contentTypes['apiFacilitiesPost'][0]) + { + + + + $resourcePath = '/api/facilities'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($create_facility_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_facility_request)); + } else { + $httpBody = $create_facility_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/FacilityContactsApi.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/FacilityContactsApi.php new file mode 100644 index 0000000..5bf8051 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/FacilityContactsApi.php @@ -0,0 +1,1037 @@ + [ + 'application/json', + ], + 'apiFacilitiesFacilityIdContactsIdPut' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + 'apiFacilitiesFacilityIdContactsPost' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation apiFacilitiesFacilityIdContactsGet + * + * @param string $facility_id facility_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesFacilityIdContactsGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\FacilityContactResponse[] + */ + public function apiFacilitiesFacilityIdContactsGet($facility_id, string $contentType = self::contentTypes['apiFacilitiesFacilityIdContactsGet'][0]) + { + list($response) = $this->apiFacilitiesFacilityIdContactsGetWithHttpInfo($facility_id, $contentType); + return $response; + } + + /** + * Operation apiFacilitiesFacilityIdContactsGetWithHttpInfo + * + * @param string $facility_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesFacilityIdContactsGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\FacilityContactResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function apiFacilitiesFacilityIdContactsGetWithHttpInfo($facility_id, string $contentType = self::contentTypes['apiFacilitiesFacilityIdContactsGet'][0]) + { + $request = $this->apiFacilitiesFacilityIdContactsGetRequest($facility_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\FacilityContactResponse[]', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\FacilityContactResponse[]', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\FacilityContactResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiFacilitiesFacilityIdContactsGetAsync + * + * @param string $facility_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesFacilityIdContactsGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiFacilitiesFacilityIdContactsGetAsync($facility_id, string $contentType = self::contentTypes['apiFacilitiesFacilityIdContactsGet'][0]) + { + return $this->apiFacilitiesFacilityIdContactsGetAsyncWithHttpInfo($facility_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiFacilitiesFacilityIdContactsGetAsyncWithHttpInfo + * + * @param string $facility_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesFacilityIdContactsGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiFacilitiesFacilityIdContactsGetAsyncWithHttpInfo($facility_id, string $contentType = self::contentTypes['apiFacilitiesFacilityIdContactsGet'][0]) + { + $returnType = '\OmsorgCoreClient\Model\FacilityContactResponse[]'; + $request = $this->apiFacilitiesFacilityIdContactsGetRequest($facility_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiFacilitiesFacilityIdContactsGet' + * + * @param string $facility_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesFacilityIdContactsGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiFacilitiesFacilityIdContactsGetRequest($facility_id, string $contentType = self::contentTypes['apiFacilitiesFacilityIdContactsGet'][0]) + { + + // verify the required parameter 'facility_id' is set + if ($facility_id === null || (is_array($facility_id) && count($facility_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $facility_id when calling apiFacilitiesFacilityIdContactsGet' + ); + } + + + $resourcePath = '/api/facilities/{facilityId}/contacts'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($facility_id !== null) { + $resourcePath = str_replace( + '{' . 'facilityId' . '}', + ObjectSerializer::toPathValue($facility_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiFacilitiesFacilityIdContactsIdPut + * + * @param string $facility_id facility_id (required) + * @param string $id id (required) + * @param \OmsorgCoreClient\Model\UpdateFacilityContactRequest|null $update_facility_contact_request update_facility_contact_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesFacilityIdContactsIdPut'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\FacilityContactResponse + */ + public function apiFacilitiesFacilityIdContactsIdPut($facility_id, $id, $update_facility_contact_request = null, string $contentType = self::contentTypes['apiFacilitiesFacilityIdContactsIdPut'][0]) + { + list($response) = $this->apiFacilitiesFacilityIdContactsIdPutWithHttpInfo($facility_id, $id, $update_facility_contact_request, $contentType); + return $response; + } + + /** + * Operation apiFacilitiesFacilityIdContactsIdPutWithHttpInfo + * + * @param string $facility_id (required) + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateFacilityContactRequest|null $update_facility_contact_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesFacilityIdContactsIdPut'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\FacilityContactResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiFacilitiesFacilityIdContactsIdPutWithHttpInfo($facility_id, $id, $update_facility_contact_request = null, string $contentType = self::contentTypes['apiFacilitiesFacilityIdContactsIdPut'][0]) + { + $request = $this->apiFacilitiesFacilityIdContactsIdPutRequest($facility_id, $id, $update_facility_contact_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\FacilityContactResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\FacilityContactResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\FacilityContactResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiFacilitiesFacilityIdContactsIdPutAsync + * + * @param string $facility_id (required) + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateFacilityContactRequest|null $update_facility_contact_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesFacilityIdContactsIdPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiFacilitiesFacilityIdContactsIdPutAsync($facility_id, $id, $update_facility_contact_request = null, string $contentType = self::contentTypes['apiFacilitiesFacilityIdContactsIdPut'][0]) + { + return $this->apiFacilitiesFacilityIdContactsIdPutAsyncWithHttpInfo($facility_id, $id, $update_facility_contact_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiFacilitiesFacilityIdContactsIdPutAsyncWithHttpInfo + * + * @param string $facility_id (required) + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateFacilityContactRequest|null $update_facility_contact_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesFacilityIdContactsIdPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiFacilitiesFacilityIdContactsIdPutAsyncWithHttpInfo($facility_id, $id, $update_facility_contact_request = null, string $contentType = self::contentTypes['apiFacilitiesFacilityIdContactsIdPut'][0]) + { + $returnType = '\OmsorgCoreClient\Model\FacilityContactResponse'; + $request = $this->apiFacilitiesFacilityIdContactsIdPutRequest($facility_id, $id, $update_facility_contact_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiFacilitiesFacilityIdContactsIdPut' + * + * @param string $facility_id (required) + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateFacilityContactRequest|null $update_facility_contact_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesFacilityIdContactsIdPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiFacilitiesFacilityIdContactsIdPutRequest($facility_id, $id, $update_facility_contact_request = null, string $contentType = self::contentTypes['apiFacilitiesFacilityIdContactsIdPut'][0]) + { + + // verify the required parameter 'facility_id' is set + if ($facility_id === null || (is_array($facility_id) && count($facility_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $facility_id when calling apiFacilitiesFacilityIdContactsIdPut' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling apiFacilitiesFacilityIdContactsIdPut' + ); + } + + + + $resourcePath = '/api/facilities/{facilityId}/contacts/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($facility_id !== null) { + $resourcePath = str_replace( + '{' . 'facilityId' . '}', + ObjectSerializer::toPathValue($facility_id), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_facility_contact_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_facility_contact_request)); + } else { + $httpBody = $update_facility_contact_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiFacilitiesFacilityIdContactsPost + * + * @param string $facility_id facility_id (required) + * @param \OmsorgCoreClient\Model\CreateFacilityContactRequest|null $create_facility_contact_request create_facility_contact_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesFacilityIdContactsPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\FacilityContactResponse + */ + public function apiFacilitiesFacilityIdContactsPost($facility_id, $create_facility_contact_request = null, string $contentType = self::contentTypes['apiFacilitiesFacilityIdContactsPost'][0]) + { + list($response) = $this->apiFacilitiesFacilityIdContactsPostWithHttpInfo($facility_id, $create_facility_contact_request, $contentType); + return $response; + } + + /** + * Operation apiFacilitiesFacilityIdContactsPostWithHttpInfo + * + * @param string $facility_id (required) + * @param \OmsorgCoreClient\Model\CreateFacilityContactRequest|null $create_facility_contact_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesFacilityIdContactsPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\FacilityContactResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiFacilitiesFacilityIdContactsPostWithHttpInfo($facility_id, $create_facility_contact_request = null, string $contentType = self::contentTypes['apiFacilitiesFacilityIdContactsPost'][0]) + { + $request = $this->apiFacilitiesFacilityIdContactsPostRequest($facility_id, $create_facility_contact_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\FacilityContactResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\FacilityContactResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\FacilityContactResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiFacilitiesFacilityIdContactsPostAsync + * + * @param string $facility_id (required) + * @param \OmsorgCoreClient\Model\CreateFacilityContactRequest|null $create_facility_contact_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesFacilityIdContactsPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiFacilitiesFacilityIdContactsPostAsync($facility_id, $create_facility_contact_request = null, string $contentType = self::contentTypes['apiFacilitiesFacilityIdContactsPost'][0]) + { + return $this->apiFacilitiesFacilityIdContactsPostAsyncWithHttpInfo($facility_id, $create_facility_contact_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiFacilitiesFacilityIdContactsPostAsyncWithHttpInfo + * + * @param string $facility_id (required) + * @param \OmsorgCoreClient\Model\CreateFacilityContactRequest|null $create_facility_contact_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesFacilityIdContactsPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiFacilitiesFacilityIdContactsPostAsyncWithHttpInfo($facility_id, $create_facility_contact_request = null, string $contentType = self::contentTypes['apiFacilitiesFacilityIdContactsPost'][0]) + { + $returnType = '\OmsorgCoreClient\Model\FacilityContactResponse'; + $request = $this->apiFacilitiesFacilityIdContactsPostRequest($facility_id, $create_facility_contact_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiFacilitiesFacilityIdContactsPost' + * + * @param string $facility_id (required) + * @param \OmsorgCoreClient\Model\CreateFacilityContactRequest|null $create_facility_contact_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiFacilitiesFacilityIdContactsPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiFacilitiesFacilityIdContactsPostRequest($facility_id, $create_facility_contact_request = null, string $contentType = self::contentTypes['apiFacilitiesFacilityIdContactsPost'][0]) + { + + // verify the required parameter 'facility_id' is set + if ($facility_id === null || (is_array($facility_id) && count($facility_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $facility_id when calling apiFacilitiesFacilityIdContactsPost' + ); + } + + + + $resourcePath = '/api/facilities/{facilityId}/contacts'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($facility_id !== null) { + $resourcePath = str_replace( + '{' . 'facilityId' . '}', + ObjectSerializer::toPathValue($facility_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($create_facility_contact_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_facility_contact_request)); + } else { + $httpBody = $create_facility_contact_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/HealthApi.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/HealthApi.php new file mode 100644 index 0000000..e8b12ab --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/HealthApi.php @@ -0,0 +1,383 @@ + [ + 'application/json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation apiHealthGet + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiHealthGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function apiHealthGet(string $contentType = self::contentTypes['apiHealthGet'][0]) + { + $this->apiHealthGetWithHttpInfo($contentType); + } + + /** + * Operation apiHealthGetWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiHealthGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function apiHealthGetWithHttpInfo(string $contentType = self::contentTypes['apiHealthGet'][0]) + { + $request = $this->apiHealthGetRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation apiHealthGetAsync + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiHealthGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiHealthGetAsync(string $contentType = self::contentTypes['apiHealthGet'][0]) + { + return $this->apiHealthGetAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiHealthGetAsyncWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiHealthGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiHealthGetAsyncWithHttpInfo(string $contentType = self::contentTypes['apiHealthGet'][0]) + { + $returnType = ''; + $request = $this->apiHealthGetRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiHealthGet' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiHealthGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiHealthGetRequest(string $contentType = self::contentTypes['apiHealthGet'][0]) + { + + + $resourcePath = '/api/health'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/OrdersApi.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/OrdersApi.php new file mode 100644 index 0000000..175428d --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/OrdersApi.php @@ -0,0 +1,1319 @@ + [ + 'application/json', + ], + 'apiOrdersIdGet' => [ + 'application/json', + ], + 'apiOrdersIdPut' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + 'apiOrdersPost' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation apiOrdersGet + * + * @param string|null $search search (optional) + * @param string|null $status_id status_id (optional) + * @param string|null $facility_id facility_id (optional) + * @param int|null $page page (optional, default to 1) + * @param int|null $page_size page_size (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiOrdersGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\OrderResponsePagedResponse + */ + public function apiOrdersGet($search = null, $status_id = null, $facility_id = null, $page = 1, $page_size = 20, string $contentType = self::contentTypes['apiOrdersGet'][0]) + { + list($response) = $this->apiOrdersGetWithHttpInfo($search, $status_id, $facility_id, $page, $page_size, $contentType); + return $response; + } + + /** + * Operation apiOrdersGetWithHttpInfo + * + * @param string|null $search (optional) + * @param string|null $status_id (optional) + * @param string|null $facility_id (optional) + * @param int|null $page (optional, default to 1) + * @param int|null $page_size (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiOrdersGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\OrderResponsePagedResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiOrdersGetWithHttpInfo($search = null, $status_id = null, $facility_id = null, $page = 1, $page_size = 20, string $contentType = self::contentTypes['apiOrdersGet'][0]) + { + $request = $this->apiOrdersGetRequest($search, $status_id, $facility_id, $page, $page_size, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\OrderResponsePagedResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\OrderResponsePagedResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\OrderResponsePagedResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiOrdersGetAsync + * + * @param string|null $search (optional) + * @param string|null $status_id (optional) + * @param string|null $facility_id (optional) + * @param int|null $page (optional, default to 1) + * @param int|null $page_size (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiOrdersGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiOrdersGetAsync($search = null, $status_id = null, $facility_id = null, $page = 1, $page_size = 20, string $contentType = self::contentTypes['apiOrdersGet'][0]) + { + return $this->apiOrdersGetAsyncWithHttpInfo($search, $status_id, $facility_id, $page, $page_size, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiOrdersGetAsyncWithHttpInfo + * + * @param string|null $search (optional) + * @param string|null $status_id (optional) + * @param string|null $facility_id (optional) + * @param int|null $page (optional, default to 1) + * @param int|null $page_size (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiOrdersGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiOrdersGetAsyncWithHttpInfo($search = null, $status_id = null, $facility_id = null, $page = 1, $page_size = 20, string $contentType = self::contentTypes['apiOrdersGet'][0]) + { + $returnType = '\OmsorgCoreClient\Model\OrderResponsePagedResponse'; + $request = $this->apiOrdersGetRequest($search, $status_id, $facility_id, $page, $page_size, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiOrdersGet' + * + * @param string|null $search (optional) + * @param string|null $status_id (optional) + * @param string|null $facility_id (optional) + * @param int|null $page (optional, default to 1) + * @param int|null $page_size (optional, default to 20) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiOrdersGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiOrdersGetRequest($search = null, $status_id = null, $facility_id = null, $page = 1, $page_size = 20, string $contentType = self::contentTypes['apiOrdersGet'][0]) + { + + + + + + + + $resourcePath = '/api/orders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $search, + 'search', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $status_id, + 'statusId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $facility_id, + 'facilityId', // param base name + 'string', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page, + 'page', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + // query params + $queryParams = array_merge($queryParams, ObjectSerializer::toQueryValue( + $page_size, + 'pageSize', // param base name + 'integer', // openApiType + 'form', // style + true, // explode + false // required + ) ?? []); + + + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiOrdersIdGet + * + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiOrdersIdGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\OrderResponse + */ + public function apiOrdersIdGet($id, string $contentType = self::contentTypes['apiOrdersIdGet'][0]) + { + list($response) = $this->apiOrdersIdGetWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation apiOrdersIdGetWithHttpInfo + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiOrdersIdGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\OrderResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiOrdersIdGetWithHttpInfo($id, string $contentType = self::contentTypes['apiOrdersIdGet'][0]) + { + $request = $this->apiOrdersIdGetRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\OrderResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\OrderResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\OrderResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiOrdersIdGetAsync + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiOrdersIdGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiOrdersIdGetAsync($id, string $contentType = self::contentTypes['apiOrdersIdGet'][0]) + { + return $this->apiOrdersIdGetAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiOrdersIdGetAsyncWithHttpInfo + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiOrdersIdGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiOrdersIdGetAsyncWithHttpInfo($id, string $contentType = self::contentTypes['apiOrdersIdGet'][0]) + { + $returnType = '\OmsorgCoreClient\Model\OrderResponse'; + $request = $this->apiOrdersIdGetRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiOrdersIdGet' + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiOrdersIdGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiOrdersIdGetRequest($id, string $contentType = self::contentTypes['apiOrdersIdGet'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling apiOrdersIdGet' + ); + } + + + $resourcePath = '/api/orders/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiOrdersIdPut + * + * @param string $id id (required) + * @param \OmsorgCoreClient\Model\UpdateOrderRequest|null $update_order_request update_order_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiOrdersIdPut'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\OrderResponse + */ + public function apiOrdersIdPut($id, $update_order_request = null, string $contentType = self::contentTypes['apiOrdersIdPut'][0]) + { + list($response) = $this->apiOrdersIdPutWithHttpInfo($id, $update_order_request, $contentType); + return $response; + } + + /** + * Operation apiOrdersIdPutWithHttpInfo + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateOrderRequest|null $update_order_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiOrdersIdPut'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\OrderResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiOrdersIdPutWithHttpInfo($id, $update_order_request = null, string $contentType = self::contentTypes['apiOrdersIdPut'][0]) + { + $request = $this->apiOrdersIdPutRequest($id, $update_order_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\OrderResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\OrderResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\OrderResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiOrdersIdPutAsync + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateOrderRequest|null $update_order_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiOrdersIdPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiOrdersIdPutAsync($id, $update_order_request = null, string $contentType = self::contentTypes['apiOrdersIdPut'][0]) + { + return $this->apiOrdersIdPutAsyncWithHttpInfo($id, $update_order_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiOrdersIdPutAsyncWithHttpInfo + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateOrderRequest|null $update_order_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiOrdersIdPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiOrdersIdPutAsyncWithHttpInfo($id, $update_order_request = null, string $contentType = self::contentTypes['apiOrdersIdPut'][0]) + { + $returnType = '\OmsorgCoreClient\Model\OrderResponse'; + $request = $this->apiOrdersIdPutRequest($id, $update_order_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiOrdersIdPut' + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateOrderRequest|null $update_order_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiOrdersIdPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiOrdersIdPutRequest($id, $update_order_request = null, string $contentType = self::contentTypes['apiOrdersIdPut'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling apiOrdersIdPut' + ); + } + + + + $resourcePath = '/api/orders/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_order_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_order_request)); + } else { + $httpBody = $update_order_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiOrdersPost + * + * @param \OmsorgCoreClient\Model\CreateOrderRequest|null $create_order_request create_order_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiOrdersPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\OrderResponse + */ + public function apiOrdersPost($create_order_request = null, string $contentType = self::contentTypes['apiOrdersPost'][0]) + { + list($response) = $this->apiOrdersPostWithHttpInfo($create_order_request, $contentType); + return $response; + } + + /** + * Operation apiOrdersPostWithHttpInfo + * + * @param \OmsorgCoreClient\Model\CreateOrderRequest|null $create_order_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiOrdersPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\OrderResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiOrdersPostWithHttpInfo($create_order_request = null, string $contentType = self::contentTypes['apiOrdersPost'][0]) + { + $request = $this->apiOrdersPostRequest($create_order_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\OrderResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\OrderResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\OrderResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiOrdersPostAsync + * + * @param \OmsorgCoreClient\Model\CreateOrderRequest|null $create_order_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiOrdersPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiOrdersPostAsync($create_order_request = null, string $contentType = self::contentTypes['apiOrdersPost'][0]) + { + return $this->apiOrdersPostAsyncWithHttpInfo($create_order_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiOrdersPostAsyncWithHttpInfo + * + * @param \OmsorgCoreClient\Model\CreateOrderRequest|null $create_order_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiOrdersPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiOrdersPostAsyncWithHttpInfo($create_order_request = null, string $contentType = self::contentTypes['apiOrdersPost'][0]) + { + $returnType = '\OmsorgCoreClient\Model\OrderResponse'; + $request = $this->apiOrdersPostRequest($create_order_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiOrdersPost' + * + * @param \OmsorgCoreClient\Model\CreateOrderRequest|null $create_order_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiOrdersPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiOrdersPostRequest($create_order_request = null, string $contentType = self::contentTypes['apiOrdersPost'][0]) + { + + + + $resourcePath = '/api/orders'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($create_order_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_order_request)); + } else { + $httpBody = $create_order_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/RolesApi.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/RolesApi.php new file mode 100644 index 0000000..3cab386 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/RolesApi.php @@ -0,0 +1,1194 @@ + [ + 'application/json', + ], + 'apiRolesIdGet' => [ + 'application/json', + ], + 'apiRolesIdPermissionsPut' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + 'apiRolesPost' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation apiRolesGet + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiRolesGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\RoleResponse[] + */ + public function apiRolesGet(string $contentType = self::contentTypes['apiRolesGet'][0]) + { + list($response) = $this->apiRolesGetWithHttpInfo($contentType); + return $response; + } + + /** + * Operation apiRolesGetWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiRolesGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\RoleResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function apiRolesGetWithHttpInfo(string $contentType = self::contentTypes['apiRolesGet'][0]) + { + $request = $this->apiRolesGetRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\RoleResponse[]', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\RoleResponse[]', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\RoleResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiRolesGetAsync + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiRolesGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiRolesGetAsync(string $contentType = self::contentTypes['apiRolesGet'][0]) + { + return $this->apiRolesGetAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiRolesGetAsyncWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiRolesGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiRolesGetAsyncWithHttpInfo(string $contentType = self::contentTypes['apiRolesGet'][0]) + { + $returnType = '\OmsorgCoreClient\Model\RoleResponse[]'; + $request = $this->apiRolesGetRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiRolesGet' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiRolesGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiRolesGetRequest(string $contentType = self::contentTypes['apiRolesGet'][0]) + { + + + $resourcePath = '/api/roles'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiRolesIdGet + * + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiRolesIdGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\RolePermissionsResponse + */ + public function apiRolesIdGet($id, string $contentType = self::contentTypes['apiRolesIdGet'][0]) + { + list($response) = $this->apiRolesIdGetWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation apiRolesIdGetWithHttpInfo + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiRolesIdGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\RolePermissionsResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiRolesIdGetWithHttpInfo($id, string $contentType = self::contentTypes['apiRolesIdGet'][0]) + { + $request = $this->apiRolesIdGetRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\RolePermissionsResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\RolePermissionsResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\RolePermissionsResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiRolesIdGetAsync + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiRolesIdGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiRolesIdGetAsync($id, string $contentType = self::contentTypes['apiRolesIdGet'][0]) + { + return $this->apiRolesIdGetAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiRolesIdGetAsyncWithHttpInfo + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiRolesIdGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiRolesIdGetAsyncWithHttpInfo($id, string $contentType = self::contentTypes['apiRolesIdGet'][0]) + { + $returnType = '\OmsorgCoreClient\Model\RolePermissionsResponse'; + $request = $this->apiRolesIdGetRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiRolesIdGet' + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiRolesIdGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiRolesIdGetRequest($id, string $contentType = self::contentTypes['apiRolesIdGet'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling apiRolesIdGet' + ); + } + + + $resourcePath = '/api/roles/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiRolesIdPermissionsPut + * + * @param string $id id (required) + * @param \OmsorgCoreClient\Model\UpdateRolePermissionsRequest|null $update_role_permissions_request update_role_permissions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiRolesIdPermissionsPut'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function apiRolesIdPermissionsPut($id, $update_role_permissions_request = null, string $contentType = self::contentTypes['apiRolesIdPermissionsPut'][0]) + { + $this->apiRolesIdPermissionsPutWithHttpInfo($id, $update_role_permissions_request, $contentType); + } + + /** + * Operation apiRolesIdPermissionsPutWithHttpInfo + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateRolePermissionsRequest|null $update_role_permissions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiRolesIdPermissionsPut'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function apiRolesIdPermissionsPutWithHttpInfo($id, $update_role_permissions_request = null, string $contentType = self::contentTypes['apiRolesIdPermissionsPut'][0]) + { + $request = $this->apiRolesIdPermissionsPutRequest($id, $update_role_permissions_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation apiRolesIdPermissionsPutAsync + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateRolePermissionsRequest|null $update_role_permissions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiRolesIdPermissionsPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiRolesIdPermissionsPutAsync($id, $update_role_permissions_request = null, string $contentType = self::contentTypes['apiRolesIdPermissionsPut'][0]) + { + return $this->apiRolesIdPermissionsPutAsyncWithHttpInfo($id, $update_role_permissions_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiRolesIdPermissionsPutAsyncWithHttpInfo + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateRolePermissionsRequest|null $update_role_permissions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiRolesIdPermissionsPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiRolesIdPermissionsPutAsyncWithHttpInfo($id, $update_role_permissions_request = null, string $contentType = self::contentTypes['apiRolesIdPermissionsPut'][0]) + { + $returnType = ''; + $request = $this->apiRolesIdPermissionsPutRequest($id, $update_role_permissions_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiRolesIdPermissionsPut' + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateRolePermissionsRequest|null $update_role_permissions_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiRolesIdPermissionsPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiRolesIdPermissionsPutRequest($id, $update_role_permissions_request = null, string $contentType = self::contentTypes['apiRolesIdPermissionsPut'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling apiRolesIdPermissionsPut' + ); + } + + + + $resourcePath = '/api/roles/{id}/permissions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_role_permissions_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_role_permissions_request)); + } else { + $httpBody = $update_role_permissions_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiRolesPost + * + * @param \OmsorgCoreClient\Model\CreateRoleRequest|null $create_role_request create_role_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiRolesPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\RoleResponse + */ + public function apiRolesPost($create_role_request = null, string $contentType = self::contentTypes['apiRolesPost'][0]) + { + list($response) = $this->apiRolesPostWithHttpInfo($create_role_request, $contentType); + return $response; + } + + /** + * Operation apiRolesPostWithHttpInfo + * + * @param \OmsorgCoreClient\Model\CreateRoleRequest|null $create_role_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiRolesPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\RoleResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiRolesPostWithHttpInfo($create_role_request = null, string $contentType = self::contentTypes['apiRolesPost'][0]) + { + $request = $this->apiRolesPostRequest($create_role_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\RoleResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\RoleResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\RoleResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiRolesPostAsync + * + * @param \OmsorgCoreClient\Model\CreateRoleRequest|null $create_role_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiRolesPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiRolesPostAsync($create_role_request = null, string $contentType = self::contentTypes['apiRolesPost'][0]) + { + return $this->apiRolesPostAsyncWithHttpInfo($create_role_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiRolesPostAsyncWithHttpInfo + * + * @param \OmsorgCoreClient\Model\CreateRoleRequest|null $create_role_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiRolesPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiRolesPostAsyncWithHttpInfo($create_role_request = null, string $contentType = self::contentTypes['apiRolesPost'][0]) + { + $returnType = '\OmsorgCoreClient\Model\RoleResponse'; + $request = $this->apiRolesPostRequest($create_role_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiRolesPost' + * + * @param \OmsorgCoreClient\Model\CreateRoleRequest|null $create_role_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiRolesPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiRolesPostRequest($create_role_request = null, string $contentType = self::contentTypes['apiRolesPost'][0]) + { + + + + $resourcePath = '/api/roles'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($create_role_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_role_request)); + } else { + $httpBody = $create_role_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/UsersApi.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/UsersApi.php new file mode 100644 index 0000000..24b94e5 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/UsersApi.php @@ -0,0 +1,1945 @@ + [ + 'application/json', + ], + 'apiUsersIdPermissionOverridesGet' => [ + 'application/json', + ], + 'apiUsersIdPermissionOverridesOverrideIdDelete' => [ + 'application/json', + ], + 'apiUsersIdPermissionOverridesPost' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + 'apiUsersIdPut' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + 'apiUsersIdResetPasswordPost' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + 'apiUsersPost' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation apiUsersGet + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\UserResponse[] + */ + public function apiUsersGet(string $contentType = self::contentTypes['apiUsersGet'][0]) + { + list($response) = $this->apiUsersGetWithHttpInfo($contentType); + return $response; + } + + /** + * Operation apiUsersGetWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\UserResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function apiUsersGetWithHttpInfo(string $contentType = self::contentTypes['apiUsersGet'][0]) + { + $request = $this->apiUsersGetRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\UserResponse[]', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\UserResponse[]', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\UserResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiUsersGetAsync + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiUsersGetAsync(string $contentType = self::contentTypes['apiUsersGet'][0]) + { + return $this->apiUsersGetAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiUsersGetAsyncWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiUsersGetAsyncWithHttpInfo(string $contentType = self::contentTypes['apiUsersGet'][0]) + { + $returnType = '\OmsorgCoreClient\Model\UserResponse[]'; + $request = $this->apiUsersGetRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiUsersGet' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiUsersGetRequest(string $contentType = self::contentTypes['apiUsersGet'][0]) + { + + + $resourcePath = '/api/users'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiUsersIdPermissionOverridesGet + * + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdPermissionOverridesGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\UserPermissionOverrideResponse[] + */ + public function apiUsersIdPermissionOverridesGet($id, string $contentType = self::contentTypes['apiUsersIdPermissionOverridesGet'][0]) + { + list($response) = $this->apiUsersIdPermissionOverridesGetWithHttpInfo($id, $contentType); + return $response; + } + + /** + * Operation apiUsersIdPermissionOverridesGetWithHttpInfo + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdPermissionOverridesGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\UserPermissionOverrideResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function apiUsersIdPermissionOverridesGetWithHttpInfo($id, string $contentType = self::contentTypes['apiUsersIdPermissionOverridesGet'][0]) + { + $request = $this->apiUsersIdPermissionOverridesGetRequest($id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\UserPermissionOverrideResponse[]', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\UserPermissionOverrideResponse[]', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\UserPermissionOverrideResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiUsersIdPermissionOverridesGetAsync + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdPermissionOverridesGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiUsersIdPermissionOverridesGetAsync($id, string $contentType = self::contentTypes['apiUsersIdPermissionOverridesGet'][0]) + { + return $this->apiUsersIdPermissionOverridesGetAsyncWithHttpInfo($id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiUsersIdPermissionOverridesGetAsyncWithHttpInfo + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdPermissionOverridesGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiUsersIdPermissionOverridesGetAsyncWithHttpInfo($id, string $contentType = self::contentTypes['apiUsersIdPermissionOverridesGet'][0]) + { + $returnType = '\OmsorgCoreClient\Model\UserPermissionOverrideResponse[]'; + $request = $this->apiUsersIdPermissionOverridesGetRequest($id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiUsersIdPermissionOverridesGet' + * + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdPermissionOverridesGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiUsersIdPermissionOverridesGetRequest($id, string $contentType = self::contentTypes['apiUsersIdPermissionOverridesGet'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling apiUsersIdPermissionOverridesGet' + ); + } + + + $resourcePath = '/api/users/{id}/permission-overrides'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiUsersIdPermissionOverridesOverrideIdDelete + * + * @param string $id id (required) + * @param string $override_id override_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdPermissionOverridesOverrideIdDelete'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function apiUsersIdPermissionOverridesOverrideIdDelete($id, $override_id, string $contentType = self::contentTypes['apiUsersIdPermissionOverridesOverrideIdDelete'][0]) + { + $this->apiUsersIdPermissionOverridesOverrideIdDeleteWithHttpInfo($id, $override_id, $contentType); + } + + /** + * Operation apiUsersIdPermissionOverridesOverrideIdDeleteWithHttpInfo + * + * @param string $id (required) + * @param string $override_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdPermissionOverridesOverrideIdDelete'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function apiUsersIdPermissionOverridesOverrideIdDeleteWithHttpInfo($id, $override_id, string $contentType = self::contentTypes['apiUsersIdPermissionOverridesOverrideIdDelete'][0]) + { + $request = $this->apiUsersIdPermissionOverridesOverrideIdDeleteRequest($id, $override_id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation apiUsersIdPermissionOverridesOverrideIdDeleteAsync + * + * @param string $id (required) + * @param string $override_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdPermissionOverridesOverrideIdDelete'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiUsersIdPermissionOverridesOverrideIdDeleteAsync($id, $override_id, string $contentType = self::contentTypes['apiUsersIdPermissionOverridesOverrideIdDelete'][0]) + { + return $this->apiUsersIdPermissionOverridesOverrideIdDeleteAsyncWithHttpInfo($id, $override_id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiUsersIdPermissionOverridesOverrideIdDeleteAsyncWithHttpInfo + * + * @param string $id (required) + * @param string $override_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdPermissionOverridesOverrideIdDelete'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiUsersIdPermissionOverridesOverrideIdDeleteAsyncWithHttpInfo($id, $override_id, string $contentType = self::contentTypes['apiUsersIdPermissionOverridesOverrideIdDelete'][0]) + { + $returnType = ''; + $request = $this->apiUsersIdPermissionOverridesOverrideIdDeleteRequest($id, $override_id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiUsersIdPermissionOverridesOverrideIdDelete' + * + * @param string $id (required) + * @param string $override_id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdPermissionOverridesOverrideIdDelete'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiUsersIdPermissionOverridesOverrideIdDeleteRequest($id, $override_id, string $contentType = self::contentTypes['apiUsersIdPermissionOverridesOverrideIdDelete'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling apiUsersIdPermissionOverridesOverrideIdDelete' + ); + } + + // verify the required parameter 'override_id' is set + if ($override_id === null || (is_array($override_id) && count($override_id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $override_id when calling apiUsersIdPermissionOverridesOverrideIdDelete' + ); + } + + + $resourcePath = '/api/users/{id}/permission-overrides/{overrideId}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + // path params + if ($override_id !== null) { + $resourcePath = str_replace( + '{' . 'overrideId' . '}', + ObjectSerializer::toPathValue($override_id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiUsersIdPermissionOverridesPost + * + * @param string $id id (required) + * @param \OmsorgCoreClient\Model\AddUserPermissionOverrideRequest|null $add_user_permission_override_request add_user_permission_override_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdPermissionOverridesPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\UserPermissionOverrideResponse + */ + public function apiUsersIdPermissionOverridesPost($id, $add_user_permission_override_request = null, string $contentType = self::contentTypes['apiUsersIdPermissionOverridesPost'][0]) + { + list($response) = $this->apiUsersIdPermissionOverridesPostWithHttpInfo($id, $add_user_permission_override_request, $contentType); + return $response; + } + + /** + * Operation apiUsersIdPermissionOverridesPostWithHttpInfo + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\AddUserPermissionOverrideRequest|null $add_user_permission_override_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdPermissionOverridesPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\UserPermissionOverrideResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiUsersIdPermissionOverridesPostWithHttpInfo($id, $add_user_permission_override_request = null, string $contentType = self::contentTypes['apiUsersIdPermissionOverridesPost'][0]) + { + $request = $this->apiUsersIdPermissionOverridesPostRequest($id, $add_user_permission_override_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\UserPermissionOverrideResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\UserPermissionOverrideResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\UserPermissionOverrideResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiUsersIdPermissionOverridesPostAsync + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\AddUserPermissionOverrideRequest|null $add_user_permission_override_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdPermissionOverridesPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiUsersIdPermissionOverridesPostAsync($id, $add_user_permission_override_request = null, string $contentType = self::contentTypes['apiUsersIdPermissionOverridesPost'][0]) + { + return $this->apiUsersIdPermissionOverridesPostAsyncWithHttpInfo($id, $add_user_permission_override_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiUsersIdPermissionOverridesPostAsyncWithHttpInfo + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\AddUserPermissionOverrideRequest|null $add_user_permission_override_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdPermissionOverridesPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiUsersIdPermissionOverridesPostAsyncWithHttpInfo($id, $add_user_permission_override_request = null, string $contentType = self::contentTypes['apiUsersIdPermissionOverridesPost'][0]) + { + $returnType = '\OmsorgCoreClient\Model\UserPermissionOverrideResponse'; + $request = $this->apiUsersIdPermissionOverridesPostRequest($id, $add_user_permission_override_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiUsersIdPermissionOverridesPost' + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\AddUserPermissionOverrideRequest|null $add_user_permission_override_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdPermissionOverridesPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiUsersIdPermissionOverridesPostRequest($id, $add_user_permission_override_request = null, string $contentType = self::contentTypes['apiUsersIdPermissionOverridesPost'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling apiUsersIdPermissionOverridesPost' + ); + } + + + + $resourcePath = '/api/users/{id}/permission-overrides'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($add_user_permission_override_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($add_user_permission_override_request)); + } else { + $httpBody = $add_user_permission_override_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiUsersIdPut + * + * @param string $id id (required) + * @param \OmsorgCoreClient\Model\UpdateUserRequest|null $update_user_request update_user_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdPut'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function apiUsersIdPut($id, $update_user_request = null, string $contentType = self::contentTypes['apiUsersIdPut'][0]) + { + $this->apiUsersIdPutWithHttpInfo($id, $update_user_request, $contentType); + } + + /** + * Operation apiUsersIdPutWithHttpInfo + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateUserRequest|null $update_user_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdPut'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function apiUsersIdPutWithHttpInfo($id, $update_user_request = null, string $contentType = self::contentTypes['apiUsersIdPut'][0]) + { + $request = $this->apiUsersIdPutRequest($id, $update_user_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation apiUsersIdPutAsync + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateUserRequest|null $update_user_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiUsersIdPutAsync($id, $update_user_request = null, string $contentType = self::contentTypes['apiUsersIdPut'][0]) + { + return $this->apiUsersIdPutAsyncWithHttpInfo($id, $update_user_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiUsersIdPutAsyncWithHttpInfo + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateUserRequest|null $update_user_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiUsersIdPutAsyncWithHttpInfo($id, $update_user_request = null, string $contentType = self::contentTypes['apiUsersIdPut'][0]) + { + $returnType = ''; + $request = $this->apiUsersIdPutRequest($id, $update_user_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiUsersIdPut' + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateUserRequest|null $update_user_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiUsersIdPutRequest($id, $update_user_request = null, string $contentType = self::contentTypes['apiUsersIdPut'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling apiUsersIdPut' + ); + } + + + + $resourcePath = '/api/users/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_user_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_user_request)); + } else { + $httpBody = $update_user_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiUsersIdResetPasswordPost + * + * @param string $id id (required) + * @param \OmsorgCoreClient\Model\ResetUserPasswordRequest|null $reset_user_password_request reset_user_password_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdResetPasswordPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function apiUsersIdResetPasswordPost($id, $reset_user_password_request = null, string $contentType = self::contentTypes['apiUsersIdResetPasswordPost'][0]) + { + $this->apiUsersIdResetPasswordPostWithHttpInfo($id, $reset_user_password_request, $contentType); + } + + /** + * Operation apiUsersIdResetPasswordPostWithHttpInfo + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\ResetUserPasswordRequest|null $reset_user_password_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdResetPasswordPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function apiUsersIdResetPasswordPostWithHttpInfo($id, $reset_user_password_request = null, string $contentType = self::contentTypes['apiUsersIdResetPasswordPost'][0]) + { + $request = $this->apiUsersIdResetPasswordPostRequest($id, $reset_user_password_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation apiUsersIdResetPasswordPostAsync + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\ResetUserPasswordRequest|null $reset_user_password_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdResetPasswordPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiUsersIdResetPasswordPostAsync($id, $reset_user_password_request = null, string $contentType = self::contentTypes['apiUsersIdResetPasswordPost'][0]) + { + return $this->apiUsersIdResetPasswordPostAsyncWithHttpInfo($id, $reset_user_password_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiUsersIdResetPasswordPostAsyncWithHttpInfo + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\ResetUserPasswordRequest|null $reset_user_password_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdResetPasswordPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiUsersIdResetPasswordPostAsyncWithHttpInfo($id, $reset_user_password_request = null, string $contentType = self::contentTypes['apiUsersIdResetPasswordPost'][0]) + { + $returnType = ''; + $request = $this->apiUsersIdResetPasswordPostRequest($id, $reset_user_password_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiUsersIdResetPasswordPost' + * + * @param string $id (required) + * @param \OmsorgCoreClient\Model\ResetUserPasswordRequest|null $reset_user_password_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersIdResetPasswordPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiUsersIdResetPasswordPostRequest($id, $reset_user_password_request = null, string $contentType = self::contentTypes['apiUsersIdResetPasswordPost'][0]) + { + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling apiUsersIdResetPasswordPost' + ); + } + + + + $resourcePath = '/api/users/{id}/reset-password'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($reset_user_password_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($reset_user_password_request)); + } else { + $httpBody = $reset_user_password_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiUsersPost + * + * @param \OmsorgCoreClient\Model\CreateUserRequest|null $create_user_request create_user_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\UserResponse + */ + public function apiUsersPost($create_user_request = null, string $contentType = self::contentTypes['apiUsersPost'][0]) + { + list($response) = $this->apiUsersPostWithHttpInfo($create_user_request, $contentType); + return $response; + } + + /** + * Operation apiUsersPostWithHttpInfo + * + * @param \OmsorgCoreClient\Model\CreateUserRequest|null $create_user_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\UserResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiUsersPostWithHttpInfo($create_user_request = null, string $contentType = self::contentTypes['apiUsersPost'][0]) + { + $request = $this->apiUsersPostRequest($create_user_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\UserResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\UserResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\UserResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiUsersPostAsync + * + * @param \OmsorgCoreClient\Model\CreateUserRequest|null $create_user_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiUsersPostAsync($create_user_request = null, string $contentType = self::contentTypes['apiUsersPost'][0]) + { + return $this->apiUsersPostAsyncWithHttpInfo($create_user_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiUsersPostAsyncWithHttpInfo + * + * @param \OmsorgCoreClient\Model\CreateUserRequest|null $create_user_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiUsersPostAsyncWithHttpInfo($create_user_request = null, string $contentType = self::contentTypes['apiUsersPost'][0]) + { + $returnType = '\OmsorgCoreClient\Model\UserResponse'; + $request = $this->apiUsersPostRequest($create_user_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiUsersPost' + * + * @param \OmsorgCoreClient\Model\CreateUserRequest|null $create_user_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiUsersPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiUsersPostRequest($create_user_request = null, string $contentType = self::contentTypes['apiUsersPost'][0]) + { + + + + $resourcePath = '/api/users'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($create_user_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_user_request)); + } else { + $httpBody = $create_user_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/ValueListsApi.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/ValueListsApi.php new file mode 100644 index 0000000..2145158 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Api/ValueListsApi.php @@ -0,0 +1,2307 @@ + [ + 'application/json', + ], + 'apiValueListsKeyItemsGet' => [ + 'application/json', + ], + 'apiValueListsKeyItemsIdDelete' => [ + 'application/json', + ], + 'apiValueListsKeyItemsIdPut' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + 'apiValueListsKeyItemsIdUsagesGet' => [ + 'application/json', + ], + 'apiValueListsKeyItemsPost' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + 'apiValueListsKeyTransitionsGet' => [ + 'application/json', + ], + 'apiValueListsKeyTransitionsPut' => [ + 'application/json', + 'text/json', + 'application/*+json', + ], + ]; + + /** + * @param ClientInterface $client + * @param Configuration $config + * @param HeaderSelector $selector + * @param int $hostIndex (Optional) host index to select the list of hosts if defined in the OpenAPI spec + */ + public function __construct( + ?ClientInterface $client = null, + ?Configuration $config = null, + ?HeaderSelector $selector = null, + int $hostIndex = 0 + ) { + $this->client = $client ?: new Client(); + $this->config = $config ?: Configuration::getDefaultConfiguration(); + $this->headerSelector = $selector ?: new HeaderSelector(); + $this->hostIndex = $hostIndex; + } + + /** + * Set the host index + * + * @param int $hostIndex Host index (required) + */ + public function setHostIndex($hostIndex): void + { + $this->hostIndex = $hostIndex; + } + + /** + * Get the host index + * + * @return int Host index + */ + public function getHostIndex() + { + return $this->hostIndex; + } + + /** + * @return Configuration + */ + public function getConfig() + { + return $this->config; + } + + /** + * Operation apiValueListsGet + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\ValueListResponse[] + */ + public function apiValueListsGet(string $contentType = self::contentTypes['apiValueListsGet'][0]) + { + list($response) = $this->apiValueListsGetWithHttpInfo($contentType); + return $response; + } + + /** + * Operation apiValueListsGetWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\ValueListResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function apiValueListsGetWithHttpInfo(string $contentType = self::contentTypes['apiValueListsGet'][0]) + { + $request = $this->apiValueListsGetRequest($contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\ValueListResponse[]', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\ValueListResponse[]', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\ValueListResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiValueListsGetAsync + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiValueListsGetAsync(string $contentType = self::contentTypes['apiValueListsGet'][0]) + { + return $this->apiValueListsGetAsyncWithHttpInfo($contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiValueListsGetAsyncWithHttpInfo + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiValueListsGetAsyncWithHttpInfo(string $contentType = self::contentTypes['apiValueListsGet'][0]) + { + $returnType = '\OmsorgCoreClient\Model\ValueListResponse[]'; + $request = $this->apiValueListsGetRequest($contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiValueListsGet' + * + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiValueListsGetRequest(string $contentType = self::contentTypes['apiValueListsGet'][0]) + { + + + $resourcePath = '/api/value-lists'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiValueListsKeyItemsGet + * + * @param string $key key (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\ValueListItemResponse[] + */ + public function apiValueListsKeyItemsGet($key, string $contentType = self::contentTypes['apiValueListsKeyItemsGet'][0]) + { + list($response) = $this->apiValueListsKeyItemsGetWithHttpInfo($key, $contentType); + return $response; + } + + /** + * Operation apiValueListsKeyItemsGetWithHttpInfo + * + * @param string $key (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\ValueListItemResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function apiValueListsKeyItemsGetWithHttpInfo($key, string $contentType = self::contentTypes['apiValueListsKeyItemsGet'][0]) + { + $request = $this->apiValueListsKeyItemsGetRequest($key, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\ValueListItemResponse[]', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\ValueListItemResponse[]', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\ValueListItemResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiValueListsKeyItemsGetAsync + * + * @param string $key (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiValueListsKeyItemsGetAsync($key, string $contentType = self::contentTypes['apiValueListsKeyItemsGet'][0]) + { + return $this->apiValueListsKeyItemsGetAsyncWithHttpInfo($key, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiValueListsKeyItemsGetAsyncWithHttpInfo + * + * @param string $key (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiValueListsKeyItemsGetAsyncWithHttpInfo($key, string $contentType = self::contentTypes['apiValueListsKeyItemsGet'][0]) + { + $returnType = '\OmsorgCoreClient\Model\ValueListItemResponse[]'; + $request = $this->apiValueListsKeyItemsGetRequest($key, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiValueListsKeyItemsGet' + * + * @param string $key (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiValueListsKeyItemsGetRequest($key, string $contentType = self::contentTypes['apiValueListsKeyItemsGet'][0]) + { + + // verify the required parameter 'key' is set + if ($key === null || (is_array($key) && count($key) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $key when calling apiValueListsKeyItemsGet' + ); + } + + + $resourcePath = '/api/value-lists/{key}/items'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($key !== null) { + $resourcePath = str_replace( + '{' . 'key' . '}', + ObjectSerializer::toPathValue($key), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiValueListsKeyItemsIdDelete + * + * @param string $key key (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsIdDelete'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function apiValueListsKeyItemsIdDelete($key, $id, string $contentType = self::contentTypes['apiValueListsKeyItemsIdDelete'][0]) + { + $this->apiValueListsKeyItemsIdDeleteWithHttpInfo($key, $id, $contentType); + } + + /** + * Operation apiValueListsKeyItemsIdDeleteWithHttpInfo + * + * @param string $key (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsIdDelete'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function apiValueListsKeyItemsIdDeleteWithHttpInfo($key, $id, string $contentType = self::contentTypes['apiValueListsKeyItemsIdDelete'][0]) + { + $request = $this->apiValueListsKeyItemsIdDeleteRequest($key, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation apiValueListsKeyItemsIdDeleteAsync + * + * @param string $key (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsIdDelete'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiValueListsKeyItemsIdDeleteAsync($key, $id, string $contentType = self::contentTypes['apiValueListsKeyItemsIdDelete'][0]) + { + return $this->apiValueListsKeyItemsIdDeleteAsyncWithHttpInfo($key, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiValueListsKeyItemsIdDeleteAsyncWithHttpInfo + * + * @param string $key (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsIdDelete'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiValueListsKeyItemsIdDeleteAsyncWithHttpInfo($key, $id, string $contentType = self::contentTypes['apiValueListsKeyItemsIdDelete'][0]) + { + $returnType = ''; + $request = $this->apiValueListsKeyItemsIdDeleteRequest($key, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiValueListsKeyItemsIdDelete' + * + * @param string $key (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsIdDelete'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiValueListsKeyItemsIdDeleteRequest($key, $id, string $contentType = self::contentTypes['apiValueListsKeyItemsIdDelete'][0]) + { + + // verify the required parameter 'key' is set + if ($key === null || (is_array($key) && count($key) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $key when calling apiValueListsKeyItemsIdDelete' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling apiValueListsKeyItemsIdDelete' + ); + } + + + $resourcePath = '/api/value-lists/{key}/items/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($key !== null) { + $resourcePath = str_replace( + '{' . 'key' . '}', + ObjectSerializer::toPathValue($key), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'DELETE', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiValueListsKeyItemsIdPut + * + * @param string $key key (required) + * @param string $id id (required) + * @param \OmsorgCoreClient\Model\UpdateValueListItemRequest|null $update_value_list_item_request update_value_list_item_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsIdPut'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\ValueListItemResponse + */ + public function apiValueListsKeyItemsIdPut($key, $id, $update_value_list_item_request = null, string $contentType = self::contentTypes['apiValueListsKeyItemsIdPut'][0]) + { + list($response) = $this->apiValueListsKeyItemsIdPutWithHttpInfo($key, $id, $update_value_list_item_request, $contentType); + return $response; + } + + /** + * Operation apiValueListsKeyItemsIdPutWithHttpInfo + * + * @param string $key (required) + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateValueListItemRequest|null $update_value_list_item_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsIdPut'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\ValueListItemResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiValueListsKeyItemsIdPutWithHttpInfo($key, $id, $update_value_list_item_request = null, string $contentType = self::contentTypes['apiValueListsKeyItemsIdPut'][0]) + { + $request = $this->apiValueListsKeyItemsIdPutRequest($key, $id, $update_value_list_item_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\ValueListItemResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\ValueListItemResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\ValueListItemResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiValueListsKeyItemsIdPutAsync + * + * @param string $key (required) + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateValueListItemRequest|null $update_value_list_item_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsIdPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiValueListsKeyItemsIdPutAsync($key, $id, $update_value_list_item_request = null, string $contentType = self::contentTypes['apiValueListsKeyItemsIdPut'][0]) + { + return $this->apiValueListsKeyItemsIdPutAsyncWithHttpInfo($key, $id, $update_value_list_item_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiValueListsKeyItemsIdPutAsyncWithHttpInfo + * + * @param string $key (required) + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateValueListItemRequest|null $update_value_list_item_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsIdPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiValueListsKeyItemsIdPutAsyncWithHttpInfo($key, $id, $update_value_list_item_request = null, string $contentType = self::contentTypes['apiValueListsKeyItemsIdPut'][0]) + { + $returnType = '\OmsorgCoreClient\Model\ValueListItemResponse'; + $request = $this->apiValueListsKeyItemsIdPutRequest($key, $id, $update_value_list_item_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiValueListsKeyItemsIdPut' + * + * @param string $key (required) + * @param string $id (required) + * @param \OmsorgCoreClient\Model\UpdateValueListItemRequest|null $update_value_list_item_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsIdPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiValueListsKeyItemsIdPutRequest($key, $id, $update_value_list_item_request = null, string $contentType = self::contentTypes['apiValueListsKeyItemsIdPut'][0]) + { + + // verify the required parameter 'key' is set + if ($key === null || (is_array($key) && count($key) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $key when calling apiValueListsKeyItemsIdPut' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling apiValueListsKeyItemsIdPut' + ); + } + + + + $resourcePath = '/api/value-lists/{key}/items/{id}'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($key !== null) { + $resourcePath = str_replace( + '{' . 'key' . '}', + ObjectSerializer::toPathValue($key), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($update_value_list_item_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($update_value_list_item_request)); + } else { + $httpBody = $update_value_list_item_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiValueListsKeyItemsIdUsagesGet + * + * @param string $key key (required) + * @param string $id id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsIdUsagesGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\ValueListUsageResponse[] + */ + public function apiValueListsKeyItemsIdUsagesGet($key, $id, string $contentType = self::contentTypes['apiValueListsKeyItemsIdUsagesGet'][0]) + { + list($response) = $this->apiValueListsKeyItemsIdUsagesGetWithHttpInfo($key, $id, $contentType); + return $response; + } + + /** + * Operation apiValueListsKeyItemsIdUsagesGetWithHttpInfo + * + * @param string $key (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsIdUsagesGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\ValueListUsageResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function apiValueListsKeyItemsIdUsagesGetWithHttpInfo($key, $id, string $contentType = self::contentTypes['apiValueListsKeyItemsIdUsagesGet'][0]) + { + $request = $this->apiValueListsKeyItemsIdUsagesGetRequest($key, $id, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\ValueListUsageResponse[]', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\ValueListUsageResponse[]', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\ValueListUsageResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiValueListsKeyItemsIdUsagesGetAsync + * + * @param string $key (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsIdUsagesGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiValueListsKeyItemsIdUsagesGetAsync($key, $id, string $contentType = self::contentTypes['apiValueListsKeyItemsIdUsagesGet'][0]) + { + return $this->apiValueListsKeyItemsIdUsagesGetAsyncWithHttpInfo($key, $id, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiValueListsKeyItemsIdUsagesGetAsyncWithHttpInfo + * + * @param string $key (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsIdUsagesGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiValueListsKeyItemsIdUsagesGetAsyncWithHttpInfo($key, $id, string $contentType = self::contentTypes['apiValueListsKeyItemsIdUsagesGet'][0]) + { + $returnType = '\OmsorgCoreClient\Model\ValueListUsageResponse[]'; + $request = $this->apiValueListsKeyItemsIdUsagesGetRequest($key, $id, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiValueListsKeyItemsIdUsagesGet' + * + * @param string $key (required) + * @param string $id (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsIdUsagesGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiValueListsKeyItemsIdUsagesGetRequest($key, $id, string $contentType = self::contentTypes['apiValueListsKeyItemsIdUsagesGet'][0]) + { + + // verify the required parameter 'key' is set + if ($key === null || (is_array($key) && count($key) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $key when calling apiValueListsKeyItemsIdUsagesGet' + ); + } + + // verify the required parameter 'id' is set + if ($id === null || (is_array($id) && count($id) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $id when calling apiValueListsKeyItemsIdUsagesGet' + ); + } + + + $resourcePath = '/api/value-lists/{key}/items/{id}/usages'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($key !== null) { + $resourcePath = str_replace( + '{' . 'key' . '}', + ObjectSerializer::toPathValue($key), + $resourcePath + ); + } + // path params + if ($id !== null) { + $resourcePath = str_replace( + '{' . 'id' . '}', + ObjectSerializer::toPathValue($id), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiValueListsKeyItemsPost + * + * @param string $key key (required) + * @param \OmsorgCoreClient\Model\CreateValueListItemRequest|null $create_value_list_item_request create_value_list_item_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\ValueListItemResponse + */ + public function apiValueListsKeyItemsPost($key, $create_value_list_item_request = null, string $contentType = self::contentTypes['apiValueListsKeyItemsPost'][0]) + { + list($response) = $this->apiValueListsKeyItemsPostWithHttpInfo($key, $create_value_list_item_request, $contentType); + return $response; + } + + /** + * Operation apiValueListsKeyItemsPostWithHttpInfo + * + * @param string $key (required) + * @param \OmsorgCoreClient\Model\CreateValueListItemRequest|null $create_value_list_item_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsPost'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\ValueListItemResponse, HTTP status code, HTTP response headers (array of strings) + */ + public function apiValueListsKeyItemsPostWithHttpInfo($key, $create_value_list_item_request = null, string $contentType = self::contentTypes['apiValueListsKeyItemsPost'][0]) + { + $request = $this->apiValueListsKeyItemsPostRequest($key, $create_value_list_item_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\ValueListItemResponse', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\ValueListItemResponse', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\ValueListItemResponse', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiValueListsKeyItemsPostAsync + * + * @param string $key (required) + * @param \OmsorgCoreClient\Model\CreateValueListItemRequest|null $create_value_list_item_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiValueListsKeyItemsPostAsync($key, $create_value_list_item_request = null, string $contentType = self::contentTypes['apiValueListsKeyItemsPost'][0]) + { + return $this->apiValueListsKeyItemsPostAsyncWithHttpInfo($key, $create_value_list_item_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiValueListsKeyItemsPostAsyncWithHttpInfo + * + * @param string $key (required) + * @param \OmsorgCoreClient\Model\CreateValueListItemRequest|null $create_value_list_item_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiValueListsKeyItemsPostAsyncWithHttpInfo($key, $create_value_list_item_request = null, string $contentType = self::contentTypes['apiValueListsKeyItemsPost'][0]) + { + $returnType = '\OmsorgCoreClient\Model\ValueListItemResponse'; + $request = $this->apiValueListsKeyItemsPostRequest($key, $create_value_list_item_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiValueListsKeyItemsPost' + * + * @param string $key (required) + * @param \OmsorgCoreClient\Model\CreateValueListItemRequest|null $create_value_list_item_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyItemsPost'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiValueListsKeyItemsPostRequest($key, $create_value_list_item_request = null, string $contentType = self::contentTypes['apiValueListsKeyItemsPost'][0]) + { + + // verify the required parameter 'key' is set + if ($key === null || (is_array($key) && count($key) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $key when calling apiValueListsKeyItemsPost' + ); + } + + + + $resourcePath = '/api/value-lists/{key}/items'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($key !== null) { + $resourcePath = str_replace( + '{' . 'key' . '}', + ObjectSerializer::toPathValue($key), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($create_value_list_item_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($create_value_list_item_request)); + } else { + $httpBody = $create_value_list_item_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'POST', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiValueListsKeyTransitionsGet + * + * @param string $key key (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyTransitionsGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return \OmsorgCoreClient\Model\ValueListTransitionResponse[] + */ + public function apiValueListsKeyTransitionsGet($key, string $contentType = self::contentTypes['apiValueListsKeyTransitionsGet'][0]) + { + list($response) = $this->apiValueListsKeyTransitionsGetWithHttpInfo($key, $contentType); + return $response; + } + + /** + * Operation apiValueListsKeyTransitionsGetWithHttpInfo + * + * @param string $key (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyTransitionsGet'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of \OmsorgCoreClient\Model\ValueListTransitionResponse[], HTTP status code, HTTP response headers (array of strings) + */ + public function apiValueListsKeyTransitionsGetWithHttpInfo($key, string $contentType = self::contentTypes['apiValueListsKeyTransitionsGet'][0]) + { + $request = $this->apiValueListsKeyTransitionsGetRequest($key, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + switch($statusCode) { + case 200: + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\ValueListTransitionResponse[]', + $request, + $response, + ); + } + + + + if ($statusCode < 200 || $statusCode > 299) { + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + (string) $request->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + + return $this->handleResponseWithDataType( + '\OmsorgCoreClient\Model\ValueListTransitionResponse[]', + $request, + $response, + ); + } catch (ApiException $e) { + switch ($e->getCode()) { + case 200: + $data = ObjectSerializer::deserialize( + $e->getResponseBody(), + '\OmsorgCoreClient\Model\ValueListTransitionResponse[]', + $e->getResponseHeaders() + ); + $e->setResponseObject($data); + throw $e; + } + + + throw $e; + } + } + + /** + * Operation apiValueListsKeyTransitionsGetAsync + * + * @param string $key (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyTransitionsGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiValueListsKeyTransitionsGetAsync($key, string $contentType = self::contentTypes['apiValueListsKeyTransitionsGet'][0]) + { + return $this->apiValueListsKeyTransitionsGetAsyncWithHttpInfo($key, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiValueListsKeyTransitionsGetAsyncWithHttpInfo + * + * @param string $key (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyTransitionsGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiValueListsKeyTransitionsGetAsyncWithHttpInfo($key, string $contentType = self::contentTypes['apiValueListsKeyTransitionsGet'][0]) + { + $returnType = '\OmsorgCoreClient\Model\ValueListTransitionResponse[]'; + $request = $this->apiValueListsKeyTransitionsGetRequest($key, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + if ($returnType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($returnType !== 'string') { + $content = json_decode($content); + } + } + + return [ + ObjectSerializer::deserialize($content, $returnType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiValueListsKeyTransitionsGet' + * + * @param string $key (required) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyTransitionsGet'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiValueListsKeyTransitionsGetRequest($key, string $contentType = self::contentTypes['apiValueListsKeyTransitionsGet'][0]) + { + + // verify the required parameter 'key' is set + if ($key === null || (is_array($key) && count($key) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $key when calling apiValueListsKeyTransitionsGet' + ); + } + + + $resourcePath = '/api/value-lists/{key}/transitions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($key !== null) { + $resourcePath = str_replace( + '{' . 'key' . '}', + ObjectSerializer::toPathValue($key), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + ['text/plain', 'application/json', 'text/json', ], + $contentType, + $multipart + ); + + // for model (json/xml) + if (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'GET', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Operation apiValueListsKeyTransitionsPut + * + * @param string $key key (required) + * @param \OmsorgCoreClient\Model\ValueListTransitionRequest[]|null $value_list_transition_request value_list_transition_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyTransitionsPut'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return void + */ + public function apiValueListsKeyTransitionsPut($key, $value_list_transition_request = null, string $contentType = self::contentTypes['apiValueListsKeyTransitionsPut'][0]) + { + $this->apiValueListsKeyTransitionsPutWithHttpInfo($key, $value_list_transition_request, $contentType); + } + + /** + * Operation apiValueListsKeyTransitionsPutWithHttpInfo + * + * @param string $key (required) + * @param \OmsorgCoreClient\Model\ValueListTransitionRequest[]|null $value_list_transition_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyTransitionsPut'] to see the possible values for this operation + * + * @throws \OmsorgCoreClient\ApiException on non-2xx response or if the response body is not in the expected format + * @throws \InvalidArgumentException + * @return array of null, HTTP status code, HTTP response headers (array of strings) + */ + public function apiValueListsKeyTransitionsPutWithHttpInfo($key, $value_list_transition_request = null, string $contentType = self::contentTypes['apiValueListsKeyTransitionsPut'][0]) + { + $request = $this->apiValueListsKeyTransitionsPutRequest($key, $value_list_transition_request, $contentType); + + try { + $options = $this->createHttpClientOption(); + try { + $response = $this->client->send($request, $options); + } catch (RequestException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + $e->getResponse() ? $e->getResponse()->getHeaders() : null, + $e->getResponse() ? (string) $e->getResponse()->getBody() : null + ); + } catch (ConnectException $e) { + throw new ApiException( + "[{$e->getCode()}] {$e->getMessage()}", + (int) $e->getCode(), + null, + null + ); + } + + $statusCode = $response->getStatusCode(); + + + return [null, $statusCode, $response->getHeaders()]; + } catch (ApiException $e) { + switch ($e->getCode()) { + } + + + throw $e; + } + } + + /** + * Operation apiValueListsKeyTransitionsPutAsync + * + * @param string $key (required) + * @param \OmsorgCoreClient\Model\ValueListTransitionRequest[]|null $value_list_transition_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyTransitionsPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiValueListsKeyTransitionsPutAsync($key, $value_list_transition_request = null, string $contentType = self::contentTypes['apiValueListsKeyTransitionsPut'][0]) + { + return $this->apiValueListsKeyTransitionsPutAsyncWithHttpInfo($key, $value_list_transition_request, $contentType) + ->then( + function ($response) { + return $response[0]; + } + ); + } + + /** + * Operation apiValueListsKeyTransitionsPutAsyncWithHttpInfo + * + * @param string $key (required) + * @param \OmsorgCoreClient\Model\ValueListTransitionRequest[]|null $value_list_transition_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyTransitionsPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Promise\PromiseInterface + */ + public function apiValueListsKeyTransitionsPutAsyncWithHttpInfo($key, $value_list_transition_request = null, string $contentType = self::contentTypes['apiValueListsKeyTransitionsPut'][0]) + { + $returnType = ''; + $request = $this->apiValueListsKeyTransitionsPutRequest($key, $value_list_transition_request, $contentType); + + return $this->client + ->sendAsync($request, $this->createHttpClientOption()) + ->then( + function ($response) use ($returnType) { + return [null, $response->getStatusCode(), $response->getHeaders()]; + }, + function ($exception) { + $response = $exception->getResponse(); + $statusCode = $response->getStatusCode(); + throw new ApiException( + sprintf( + '[%d] Error connecting to the API (%s)', + $statusCode, + $exception->getRequest()->getUri() + ), + $statusCode, + $response->getHeaders(), + (string) $response->getBody() + ); + } + ); + } + + /** + * Create request for operation 'apiValueListsKeyTransitionsPut' + * + * @param string $key (required) + * @param \OmsorgCoreClient\Model\ValueListTransitionRequest[]|null $value_list_transition_request (optional) + * @param string $contentType The value for the Content-Type header. Check self::contentTypes['apiValueListsKeyTransitionsPut'] to see the possible values for this operation + * + * @throws \InvalidArgumentException + * @return \GuzzleHttp\Psr7\Request + */ + public function apiValueListsKeyTransitionsPutRequest($key, $value_list_transition_request = null, string $contentType = self::contentTypes['apiValueListsKeyTransitionsPut'][0]) + { + + // verify the required parameter 'key' is set + if ($key === null || (is_array($key) && count($key) === 0)) { + throw new \InvalidArgumentException( + 'Missing the required parameter $key when calling apiValueListsKeyTransitionsPut' + ); + } + + + + $resourcePath = '/api/value-lists/{key}/transitions'; + $formParams = []; + $queryParams = []; + $headerParams = []; + $httpBody = ''; + $multipart = false; + + + + // path params + if ($key !== null) { + $resourcePath = str_replace( + '{' . 'key' . '}', + ObjectSerializer::toPathValue($key), + $resourcePath + ); + } + + + $headers = $this->headerSelector->selectHeaders( + [], + $contentType, + $multipart + ); + + // for model (json/xml) + if (isset($value_list_transition_request)) { + if (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the body + $httpBody = \GuzzleHttp\Utils::jsonEncode(ObjectSerializer::sanitizeForSerialization($value_list_transition_request)); + } else { + $httpBody = $value_list_transition_request; + } + } elseif (count($formParams) > 0) { + if ($multipart) { + $multipartContents = []; + foreach ($formParams as $formParamName => $formParamValue) { + $formParamValueItems = is_array($formParamValue) ? $formParamValue : [$formParamValue]; + foreach ($formParamValueItems as $formParamValueItem) { + $multipartContents[] = [ + 'name' => $formParamName, + 'contents' => $formParamValueItem + ]; + } + } + // for HTTP post (form) + $httpBody = new MultipartStream($multipartContents); + + } elseif (stripos($headers['Content-Type'], 'application/json') !== false) { + # if Content-Type contains "application/json", json_encode the form parameters + $httpBody = \GuzzleHttp\Utils::jsonEncode($formParams); + } else { + // for HTTP post (form) + $httpBody = ObjectSerializer::buildQuery($formParams); + } + } + + // this endpoint requires Bearer (JWT) authentication (access token) + if (!empty($this->config->getAccessToken())) { + $headers['Authorization'] = 'Bearer ' . $this->config->getAccessToken(); + } + + $defaultHeaders = []; + if ($this->config->getUserAgent()) { + $defaultHeaders['User-Agent'] = $this->config->getUserAgent(); + } + + $headers = array_merge( + $defaultHeaders, + $headerParams, + $headers + ); + + $operationHost = $this->config->getHost(); + $query = ObjectSerializer::buildQuery($queryParams); + return new Request( + 'PUT', + $operationHost . $resourcePath . ($query ? "?{$query}" : ''), + $headers, + $httpBody + ); + } + + /** + * Create http client option + * + * @throws \RuntimeException on file opening failure + * @return array of http client options + */ + protected function createHttpClientOption() + { + $options = []; + if ($this->config->getDebug()) { + $options[RequestOptions::DEBUG] = fopen($this->config->getDebugFile(), 'a'); + if (!$options[RequestOptions::DEBUG]) { + throw new \RuntimeException('Failed to open the debug file: ' . $this->config->getDebugFile()); + } + } + + return $options; + } + + private function handleResponseWithDataType( + string $dataType, + RequestInterface $request, + ResponseInterface $response + ): array { + if ($dataType === '\SplFileObject') { + $content = $response->getBody(); //stream goes to serializer + } else { + $content = (string) $response->getBody(); + if ($dataType !== 'string') { + try { + $content = json_decode($content, false, 512, JSON_THROW_ON_ERROR); + } catch (\JsonException $exception) { + throw new ApiException( + sprintf( + 'Error JSON decoding server response (%s)', + $request->getUri() + ), + $response->getStatusCode(), + $response->getHeaders(), + $content + ); + } + } + } + + return [ + ObjectSerializer::deserialize($content, $dataType, []), + $response->getStatusCode(), + $response->getHeaders() + ]; + } + + private function responseWithinRangeCode( + string $rangeCode, + int $statusCode + ): bool { + $left = (int) ($rangeCode[0].'00'); + $right = (int) ($rangeCode[0].'99'); + + return $statusCode >= $left && $statusCode <= $right; + } +} diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/ApiException.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/ApiException.php new file mode 100644 index 0000000..96e26a4 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/ApiException.php @@ -0,0 +1,119 @@ +responseHeaders = $responseHeaders; + $this->responseBody = $responseBody; + } + + /** + * Gets the HTTP response header + * + * @return string[][]|null HTTP response header + */ + public function getResponseHeaders() + { + return $this->responseHeaders; + } + + /** + * Gets the HTTP body of the server response either as Json or string + * + * @return \stdClass|string|null HTTP body of the server response either as \stdClass or string + */ + public function getResponseBody() + { + return $this->responseBody; + } + + /** + * Sets the deserialized response object (during deserialization) + * + * @param mixed $obj Deserialized response object + * + * @return void + */ + public function setResponseObject($obj) + { + $this->responseObject = $obj; + } + + /** + * Gets the deserialized response object (during deserialization) + * + * @return mixed the deserialized response object + */ + public function getResponseObject() + { + return $this->responseObject; + } +} diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Configuration.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Configuration.php new file mode 100644 index 0000000..31503a6 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Configuration.php @@ -0,0 +1,531 @@ +tempFolderPath = sys_get_temp_dir(); + } + + /** + * Sets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $key API key or token + * + * @return $this + */ + public function setApiKey($apiKeyIdentifier, $key) + { + $this->apiKeys[$apiKeyIdentifier] = $key; + return $this; + } + + /** + * Gets API key + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return null|string API key or token + */ + public function getApiKey($apiKeyIdentifier) + { + return isset($this->apiKeys[$apiKeyIdentifier]) ? $this->apiKeys[$apiKeyIdentifier] : null; + } + + /** + * Sets the prefix for API key (e.g. Bearer) + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * @param string $prefix API key prefix, e.g. Bearer + * + * @return $this + */ + public function setApiKeyPrefix($apiKeyIdentifier, $prefix) + { + $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix; + return $this; + } + + /** + * Gets API key prefix + * + * @param string $apiKeyIdentifier API key identifier (authentication scheme) + * + * @return null|string + */ + public function getApiKeyPrefix($apiKeyIdentifier) + { + return isset($this->apiKeyPrefixes[$apiKeyIdentifier]) ? $this->apiKeyPrefixes[$apiKeyIdentifier] : null; + } + + /** + * Sets the access token for OAuth + * + * @param string $accessToken Token for OAuth + * + * @return $this + */ + public function setAccessToken($accessToken) + { + $this->accessToken = $accessToken; + return $this; + } + + /** + * Gets the access token for OAuth + * + * @return string Access token for OAuth + */ + public function getAccessToken() + { + return $this->accessToken; + } + + /** + * Sets boolean format for query string. + * + * @param string $booleanFormat Boolean format for query string + * + * @return $this + */ + public function setBooleanFormatForQueryString(string $booleanFormat) + { + $this->booleanFormatForQueryString = $booleanFormat; + + return $this; + } + + /** + * Gets boolean format for query string. + * + * @return string Boolean format for query string + */ + public function getBooleanFormatForQueryString(): string + { + return $this->booleanFormatForQueryString; + } + + /** + * Sets the username for HTTP basic authentication + * + * @param string $username Username for HTTP basic authentication + * + * @return $this + */ + public function setUsername($username) + { + $this->username = $username; + return $this; + } + + /** + * Gets the username for HTTP basic authentication + * + * @return string Username for HTTP basic authentication + */ + public function getUsername() + { + return $this->username; + } + + /** + * Sets the password for HTTP basic authentication + * + * @param string $password Password for HTTP basic authentication + * + * @return $this + */ + public function setPassword($password) + { + $this->password = $password; + return $this; + } + + /** + * Gets the password for HTTP basic authentication + * + * @return string Password for HTTP basic authentication + */ + public function getPassword() + { + return $this->password; + } + + /** + * Sets the host + * + * @param string $host Host + * + * @return $this + */ + public function setHost($host) + { + $this->host = $host; + return $this; + } + + /** + * Gets the host + * + * @return string Host + */ + public function getHost() + { + return $this->host; + } + + /** + * Sets the user agent of the api client + * + * @param string $userAgent the user agent of the api client + * + * @throws \InvalidArgumentException + * @return $this + */ + public function setUserAgent($userAgent) + { + if (!is_string($userAgent)) { + throw new \InvalidArgumentException('User-agent must be a string.'); + } + + $this->userAgent = $userAgent; + return $this; + } + + /** + * Gets the user agent of the api client + * + * @return string user agent + */ + public function getUserAgent() + { + return $this->userAgent; + } + + /** + * Sets debug flag + * + * @param bool $debug Debug flag + * + * @return $this + */ + public function setDebug($debug) + { + $this->debug = $debug; + return $this; + } + + /** + * Gets the debug flag + * + * @return bool + */ + public function getDebug() + { + return $this->debug; + } + + /** + * Sets the debug file + * + * @param string $debugFile Debug file + * + * @return $this + */ + public function setDebugFile($debugFile) + { + $this->debugFile = $debugFile; + return $this; + } + + /** + * Gets the debug file + * + * @return string + */ + public function getDebugFile() + { + return $this->debugFile; + } + + /** + * Sets the temp folder path + * + * @param string $tempFolderPath Temp folder path + * + * @return $this + */ + public function setTempFolderPath($tempFolderPath) + { + $this->tempFolderPath = $tempFolderPath; + return $this; + } + + /** + * Gets the temp folder path + * + * @return string Temp folder path + */ + public function getTempFolderPath() + { + return $this->tempFolderPath; + } + + /** + * Gets the default configuration instance + * + * @return Configuration + */ + public static function getDefaultConfiguration() + { + if (self::$defaultConfiguration === null) { + self::$defaultConfiguration = new Configuration(); + } + + return self::$defaultConfiguration; + } + + /** + * Sets the default configuration instance + * + * @param Configuration $config An instance of the Configuration Object + * + * @return void + */ + public static function setDefaultConfiguration(Configuration $config) + { + self::$defaultConfiguration = $config; + } + + /** + * Gets the essential information for debugging + * + * @return string The report for debugging + */ + public static function toDebugReport() + { + $report = 'PHP SDK (OmsorgCoreClient) Debug Report:' . PHP_EOL; + $report .= ' OS: ' . php_uname() . PHP_EOL; + $report .= ' PHP Version: ' . PHP_VERSION . PHP_EOL; + $report .= ' The version of the OpenAPI document: 1.0' . PHP_EOL; + $report .= ' Temp Folder Path: ' . self::getDefaultConfiguration()->getTempFolderPath() . PHP_EOL; + + return $report; + } + + /** + * Get API key (with prefix if set) + * + * @param string $apiKeyIdentifier name of apikey + * + * @return null|string API key with the prefix + */ + public function getApiKeyWithPrefix($apiKeyIdentifier) + { + $prefix = $this->getApiKeyPrefix($apiKeyIdentifier); + $apiKey = $this->getApiKey($apiKeyIdentifier); + + if ($apiKey === null) { + return null; + } + + if ($prefix === null) { + $keyWithPrefix = $apiKey; + } else { + $keyWithPrefix = $prefix . ' ' . $apiKey; + } + + return $keyWithPrefix; + } + + /** + * Returns an array of host settings + * + * @return array an array of host settings + */ + public function getHostSettings() + { + return [ + [ + "url" => "", + "description" => "No description provided", + ] + ]; + } + + /** + * Returns URL based on host settings, index and variables + * + * @param array $hostSettings array of host settings, generated from getHostSettings() or equivalent from the API clients + * @param int $hostIndex index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings + */ + public static function getHostString(array $hostSettings, $hostIndex, ?array $variables = null) + { + if (null === $variables) { + $variables = []; + } + + // check array index out of bound + if ($hostIndex < 0 || $hostIndex >= count($hostSettings)) { + throw new \InvalidArgumentException("Invalid index $hostIndex when selecting the host. Must be less than ".count($hostSettings)); + } + + $host = $hostSettings[$hostIndex]; + $url = $host["url"]; + + // go through variable and assign a value + foreach ($host["variables"] ?? [] as $name => $variable) { + if (array_key_exists($name, $variables)) { // check to see if it's in the variables provided by the user + if (!isset($variable['enum_values']) || in_array($variables[$name], $variable["enum_values"], true)) { // check to see if the value is in the enum + $url = str_replace("{".$name."}", $variables[$name], $url); + } else { + throw new \InvalidArgumentException("The variable `$name` in the host URL has invalid value ".$variables[$name].". Must be ".join(',', $variable["enum_values"])."."); + } + } else { + // use default value + $url = str_replace("{".$name."}", $variable["default_value"], $url); + } + } + + return $url; + } + + /** + * Returns URL based on the index and variables + * + * @param int $index index of the host settings + * @param array|null $variables hash of variable and the corresponding value (optional) + * @return string URL based on host settings + */ + public function getHostFromSettings($index, $variables = null) + { + return self::getHostString($this->getHostSettings(), $index, $variables); + } +} diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/FormDataProcessor.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/FormDataProcessor.php new file mode 100644 index 0000000..085f413 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/FormDataProcessor.php @@ -0,0 +1,242 @@ + $values the value of the form parameter + * + * @return array [key => value] of formdata + */ + public function prepare(array $values): array + { + $this->has_file = false; + $result = []; + + foreach ($values as $k => $v) { + if ($v === null) { + continue; + } + + $result[$k] = $this->makeFormSafe($v); + } + + return $result; + } + + /** + * Flattens a multi-level array of data and generates a single-level array + * compatible with formdata - a single-level array where the keys use bracket + * notation to signify nested data. + * + * credit: https://github.com/FranBar1966/FlatPHP + */ + public static function flatten(array $source, string $start = ''): array + { + $opt = [ + 'prefix' => '[', + 'suffix' => ']', + 'suffix-end' => true, + 'prefix-list' => '[', + 'suffix-list' => ']', + 'suffix-list-end' => true, + ]; + + if ($start === '') { + $currentPrefix = ''; + $currentSuffix = ''; + $currentSuffixEnd = false; + } elseif (array_is_list($source)) { + $currentPrefix = $opt['prefix-list']; + $currentSuffix = $opt['suffix-list']; + $currentSuffixEnd = $opt['suffix-list-end']; + } else { + $currentPrefix = $opt['prefix']; + $currentSuffix = $opt['suffix']; + $currentSuffixEnd = $opt['suffix-end']; + } + + $currentName = $start; + $result = []; + + foreach ($source as $key => $val) { + $currentName .= $currentPrefix.$key; + + if (is_array($val) && !empty($val)) { + $currentName .= $currentSuffix; + $result += self::flatten($val, $currentName); + } else { + if ($currentSuffixEnd) { + $currentName .= $currentSuffix; + } + + $result[$currentName] = ObjectSerializer::toString($val); + } + + $currentName = $start; + } + + return $result; + } + + /** + * formdata must be limited to scalars or arrays of scalar values, + * or a resource for a file upload. Here we iterate through all available + * data and identify how to handle each scenario + */ + protected function makeFormSafe($value) + { + if ($value instanceof SplFileObject) { + return $this->processFiles([$value])[0]; + } + + if (is_resource($value)) { + $this->has_file = true; + + return $value; + } + + if ($value instanceof ModelInterface) { + return $this->processModel($value); + } + + if (is_array($value) || (is_object($value) && !$value instanceof \DateTimeInterface)) { + $data = []; + + foreach ($value as $k => $v) { + $data[$k] = $this->makeFormSafe($v); + } + + return $data; + } + + return ObjectSerializer::toString($value); + } + + /** + * We are able to handle nested ModelInterface. We do not simply call + * json_decode(json_encode()) because any given model may have binary data + * or other data that cannot be serialized to a JSON string + */ + protected function processModel(ModelInterface $model): array + { + $result = []; + + foreach ($model::openAPITypes() as $name => $type) { + $value = $model->offsetGet($name); + + if ($value === null) { + continue; + } + + if (strpos($type, '\SplFileObject') !== false) { + $file = is_array($value) ? $value : [$value]; + $result[$name] = $this->processFiles($file); + + continue; + } + + if ($value instanceof ModelInterface) { + $result[$name] = $this->processModel($value); + + continue; + } + + if (is_array($value) || is_object($value)) { + $result[$name] = $this->makeFormSafe($value); + + continue; + } + + $result[$name] = ObjectSerializer::toString($value); + } + + return $result; + } + + /** + * Handle file data + */ + protected function processFiles(array $files): array + { + $this->has_file = true; + + $result = []; + + foreach ($files as $i => $file) { + if (is_array($file)) { + $result[$i] = $this->processFiles($file); + + continue; + } + + if ($file instanceof StreamInterface) { + $result[$i] = $file; + + continue; + } + + if ($file instanceof SplFileObject) { + $result[$i] = $this->tryFopen($file); + } + } + + return $result; + } + + private function tryFopen(SplFileObject $file) + { + return Utils::tryFopen($file->getRealPath(), 'rb'); + } +} diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/HeaderSelector.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/HeaderSelector.php new file mode 100644 index 0000000..b35d12b --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/HeaderSelector.php @@ -0,0 +1,273 @@ +selectAcceptHeader($accept); + if ($accept !== null) { + $headers['Accept'] = $accept; + } + + if (!$isMultipart) { + if($contentType === '') { + $contentType = 'application/json'; + } + + $headers['Content-Type'] = $contentType; + } + + return $headers; + } + + /** + * Return the header 'Accept' based on an array of Accept provided. + * + * @param string[] $accept Array of header + * + * @return null|string Accept (e.g. application/json) + */ + private function selectAcceptHeader(array $accept): ?string + { + # filter out empty entries + $accept = array_filter($accept); + + if (count($accept) === 0) { + return null; + } + + # If there's only one Accept header, just use it + if (count($accept) === 1) { + return reset($accept); + } + + # If none of the available Accept headers is of type "json", then just use all them + $headersWithJson = $this->selectJsonMimeList($accept); + if (count($headersWithJson) === 0) { + return implode(',', $accept); + } + + # If we got here, then we need add quality values (weight), as described in IETF RFC 9110, Items 12.4.2/12.5.1, + # to give the highest priority to json-like headers - recalculating the existing ones, if needed + return $this->getAcceptHeaderWithAdjustedWeight($accept, $headersWithJson); + } + + /** + * Detects whether a string contains a valid JSON mime type + * + * @param string $searchString + * @return bool + */ + public function isJsonMime(string $searchString): bool + { + return preg_match('~^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)~', $searchString) === 1; + } + + /** + * Select all items from a list containing a JSON mime type + * + * @param array $mimeList + * @return array + */ + private function selectJsonMimeList(array $mimeList): array { + $jsonMimeList = []; + foreach ($mimeList as $mime) { + if($this->isJsonMime($mime)) { + $jsonMimeList[] = $mime; + } + } + return $jsonMimeList; + } + + + /** + * Create an Accept header string from the given "Accept" headers array, recalculating all weights + * + * @param string[] $accept Array of Accept Headers + * @param string[] $headersWithJson Array of Accept Headers of type "json" + * + * @return string "Accept" Header (e.g. "application/json, text/html; q=0.9") + */ + private function getAcceptHeaderWithAdjustedWeight(array $accept, array $headersWithJson): string + { + $processedHeaders = [ + 'withApplicationJson' => [], + 'withJson' => [], + 'withoutJson' => [], + ]; + + foreach ($accept as $header) { + + $headerData = $this->getHeaderAndWeight($header); + + if (stripos($headerData['header'], 'application/json') === 0) { + $processedHeaders['withApplicationJson'][] = $headerData; + } elseif (in_array($header, $headersWithJson, true)) { + $processedHeaders['withJson'][] = $headerData; + } else { + $processedHeaders['withoutJson'][] = $headerData; + } + } + + $acceptHeaders = []; + $currentWeight = 1000; + + $hasMoreThan28Headers = count($accept) > 28; + + foreach($processedHeaders as $headers) { + if (count($headers) > 0) { + $acceptHeaders[] = $this->adjustWeight($headers, $currentWeight, $hasMoreThan28Headers); + } + } + + $acceptHeaders = array_merge(...$acceptHeaders); + + return implode(',', $acceptHeaders); + } + + /** + * Given an Accept header, returns an associative array splitting the header and its weight + * + * @param string $header "Accept" Header + * + * @return array with the header and its weight + */ + private function getHeaderAndWeight(string $header): array + { + # matches headers with weight, splitting the header and the weight in $outputArray + if (preg_match('/(.*);\s*q=(1(?:\.0+)?|0\.\d+)$/', $header, $outputArray) === 1) { + $headerData = [ + 'header' => $outputArray[1], + 'weight' => (int)($outputArray[2] * 1000), + ]; + } else { + $headerData = [ + 'header' => trim($header), + 'weight' => 1000, + ]; + } + + return $headerData; + } + + /** + * @param array[] $headers + * @param float $currentWeight + * @param bool $hasMoreThan28Headers + * @return string[] array of adjusted "Accept" headers + */ + private function adjustWeight(array $headers, float &$currentWeight, bool $hasMoreThan28Headers): array + { + usort($headers, function (array $a, array $b) { + return $b['weight'] - $a['weight']; + }); + + $acceptHeaders = []; + foreach ($headers as $index => $header) { + if($index > 0 && $headers[$index - 1]['weight'] > $header['weight']) + { + $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); + } + + $weight = $currentWeight; + + $acceptHeaders[] = $this->buildAcceptHeader($header['header'], $weight); + } + + $currentWeight = $this->getNextWeight($currentWeight, $hasMoreThan28Headers); + + return $acceptHeaders; + } + + /** + * @param string $header + * @param int $weight + * @return string + */ + private function buildAcceptHeader(string $header, int $weight): string + { + if($weight === 1000) { + return $header; + } + + return trim($header, '; ') . ';q=' . rtrim(sprintf('%0.3f', $weight / 1000), '0'); + } + + /** + * Calculate the next weight, based on the current one. + * + * If there are less than 28 "Accept" headers, the weights will be decreased by 1 on its highest significant digit, using the + * following formula: + * + * next weight = current weight - 10 ^ (floor(log(current weight - 1))) + * + * ( current weight minus ( 10 raised to the power of ( floor of (log to the base 10 of ( current weight minus 1 ) ) ) ) ) + * + * Starting from 1000, this generates the following series: + * + * 1000, 900, 800, 700, 600, 500, 400, 300, 200, 100, 90, 80, 70, 60, 50, 40, 30, 20, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1 + * + * The resulting quality codes are closer to the average "normal" usage of them (like "q=0.9", "q=0.8" and so on), but it only works + * if there is a maximum of 28 "Accept" headers. If we have more than that (which is extremely unlikely), then we fall back to a 1-by-1 + * decrement rule, which will result in quality codes like "q=0.999", "q=0.998" etc. + * + * @param int $currentWeight varying from 1 to 1000 (will be divided by 1000 to build the quality value) + * @param bool $hasMoreThan28Headers + * @return int + */ + public function getNextWeight(int $currentWeight, bool $hasMoreThan28Headers): int + { + if ($currentWeight <= 1) { + return 1; + } + + if ($hasMoreThan28Headers) { + return $currentWeight - 1; + } + + return $currentWeight - 10 ** floor( log10($currentWeight - 1) ); + } +} diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/AddUserPermissionOverrideRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/AddUserPermissionOverrideRequest.php new file mode 100644 index 0000000..7b375db --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/AddUserPermissionOverrideRequest.php @@ -0,0 +1,498 @@ + + */ +class AddUserPermissionOverrideRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AddUserPermissionOverrideRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'module' => 'string', + 'action' => 'string', + 'effect' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'module' => null, + 'action' => null, + 'effect' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'module' => true, + 'action' => true, + 'effect' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'module' => 'module', + 'action' => 'action', + 'effect' => 'effect' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'module' => 'setModule', + 'action' => 'setAction', + 'effect' => 'setEffect' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'module' => 'getModule', + 'action' => 'getAction', + 'effect' => 'getEffect' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('module', $data ?? [], null); + $this->setIfExists('action', $data ?? [], null); + $this->setIfExists('effect', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets module + * + * @return string|null + */ + public function getModule() + { + return $this->container['module']; + } + + /** + * Sets module + * + * @param string|null $module module + * + * @return self + */ + public function setModule($module) + { + if (is_null($module)) { + array_push($this->openAPINullablesSetToNull, 'module'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('module', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['module'] = $module; + + return $this; + } + + /** + * Gets action + * + * @return string|null + */ + public function getAction() + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param string|null $action action + * + * @return self + */ + public function setAction($action) + { + if (is_null($action)) { + array_push($this->openAPINullablesSetToNull, 'action'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('action', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets effect + * + * @return string|null + */ + public function getEffect() + { + return $this->container['effect']; + } + + /** + * Sets effect + * + * @param string|null $effect effect + * + * @return self + */ + public function setEffect($effect) + { + if (is_null($effect)) { + array_push($this->openAPINullablesSetToNull, 'effect'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('effect', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['effect'] = $effect; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/AuditLogEntryResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/AuditLogEntryResponse.php new file mode 100644 index 0000000..3f9241d --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/AuditLogEntryResponse.php @@ -0,0 +1,771 @@ + + */ +class AuditLogEntryResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AuditLogEntryResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'occurred_at_utc' => '\DateTime', + 'actor_user_id' => 'string', + 'actor_username' => 'string', + 'ip_address' => 'string', + 'category' => 'string', + 'action' => 'string', + 'entity_type' => 'string', + 'entity_id' => 'string', + 'details' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'uuid', + 'occurred_at_utc' => 'date-time', + 'actor_user_id' => 'uuid', + 'actor_username' => null, + 'ip_address' => null, + 'category' => null, + 'action' => null, + 'entity_type' => null, + 'entity_id' => 'uuid', + 'details' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'occurred_at_utc' => false, + 'actor_user_id' => true, + 'actor_username' => true, + 'ip_address' => true, + 'category' => true, + 'action' => true, + 'entity_type' => true, + 'entity_id' => true, + 'details' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'occurred_at_utc' => 'occurredAtUtc', + 'actor_user_id' => 'actorUserId', + 'actor_username' => 'actorUsername', + 'ip_address' => 'ipAddress', + 'category' => 'category', + 'action' => 'action', + 'entity_type' => 'entityType', + 'entity_id' => 'entityId', + 'details' => 'details' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'occurred_at_utc' => 'setOccurredAtUtc', + 'actor_user_id' => 'setActorUserId', + 'actor_username' => 'setActorUsername', + 'ip_address' => 'setIpAddress', + 'category' => 'setCategory', + 'action' => 'setAction', + 'entity_type' => 'setEntityType', + 'entity_id' => 'setEntityId', + 'details' => 'setDetails' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'occurred_at_utc' => 'getOccurredAtUtc', + 'actor_user_id' => 'getActorUserId', + 'actor_username' => 'getActorUsername', + 'ip_address' => 'getIpAddress', + 'category' => 'getCategory', + 'action' => 'getAction', + 'entity_type' => 'getEntityType', + 'entity_id' => 'getEntityId', + 'details' => 'getDetails' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('occurred_at_utc', $data ?? [], null); + $this->setIfExists('actor_user_id', $data ?? [], null); + $this->setIfExists('actor_username', $data ?? [], null); + $this->setIfExists('ip_address', $data ?? [], null); + $this->setIfExists('category', $data ?? [], null); + $this->setIfExists('action', $data ?? [], null); + $this->setIfExists('entity_type', $data ?? [], null); + $this->setIfExists('entity_id', $data ?? [], null); + $this->setIfExists('details', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets occurred_at_utc + * + * @return \DateTime|null + */ + public function getOccurredAtUtc() + { + return $this->container['occurred_at_utc']; + } + + /** + * Sets occurred_at_utc + * + * @param \DateTime|null $occurred_at_utc occurred_at_utc + * + * @return self + */ + public function setOccurredAtUtc($occurred_at_utc) + { + if (is_null($occurred_at_utc)) { + throw new \InvalidArgumentException('non-nullable occurred_at_utc cannot be null'); + } + $this->container['occurred_at_utc'] = $occurred_at_utc; + + return $this; + } + + /** + * Gets actor_user_id + * + * @return string|null + */ + public function getActorUserId() + { + return $this->container['actor_user_id']; + } + + /** + * Sets actor_user_id + * + * @param string|null $actor_user_id actor_user_id + * + * @return self + */ + public function setActorUserId($actor_user_id) + { + if (is_null($actor_user_id)) { + array_push($this->openAPINullablesSetToNull, 'actor_user_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('actor_user_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['actor_user_id'] = $actor_user_id; + + return $this; + } + + /** + * Gets actor_username + * + * @return string|null + */ + public function getActorUsername() + { + return $this->container['actor_username']; + } + + /** + * Sets actor_username + * + * @param string|null $actor_username actor_username + * + * @return self + */ + public function setActorUsername($actor_username) + { + if (is_null($actor_username)) { + array_push($this->openAPINullablesSetToNull, 'actor_username'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('actor_username', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['actor_username'] = $actor_username; + + return $this; + } + + /** + * Gets ip_address + * + * @return string|null + */ + public function getIpAddress() + { + return $this->container['ip_address']; + } + + /** + * Sets ip_address + * + * @param string|null $ip_address ip_address + * + * @return self + */ + public function setIpAddress($ip_address) + { + if (is_null($ip_address)) { + array_push($this->openAPINullablesSetToNull, 'ip_address'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('ip_address', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['ip_address'] = $ip_address; + + return $this; + } + + /** + * Gets category + * + * @return string|null + */ + public function getCategory() + { + return $this->container['category']; + } + + /** + * Sets category + * + * @param string|null $category category + * + * @return self + */ + public function setCategory($category) + { + if (is_null($category)) { + array_push($this->openAPINullablesSetToNull, 'category'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('category', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['category'] = $category; + + return $this; + } + + /** + * Gets action + * + * @return string|null + */ + public function getAction() + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param string|null $action action + * + * @return self + */ + public function setAction($action) + { + if (is_null($action)) { + array_push($this->openAPINullablesSetToNull, 'action'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('action', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets entity_type + * + * @return string|null + */ + public function getEntityType() + { + return $this->container['entity_type']; + } + + /** + * Sets entity_type + * + * @param string|null $entity_type entity_type + * + * @return self + */ + public function setEntityType($entity_type) + { + if (is_null($entity_type)) { + array_push($this->openAPINullablesSetToNull, 'entity_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('entity_type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['entity_type'] = $entity_type; + + return $this; + } + + /** + * Gets entity_id + * + * @return string|null + */ + public function getEntityId() + { + return $this->container['entity_id']; + } + + /** + * Sets entity_id + * + * @param string|null $entity_id entity_id + * + * @return self + */ + public function setEntityId($entity_id) + { + if (is_null($entity_id)) { + array_push($this->openAPINullablesSetToNull, 'entity_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('entity_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['entity_id'] = $entity_id; + + return $this; + } + + /** + * Gets details + * + * @return string|null + */ + public function getDetails() + { + return $this->container['details']; + } + + /** + * Sets details + * + * @param string|null $details details + * + * @return self + */ + public function setDetails($details) + { + if (is_null($details)) { + array_push($this->openAPINullablesSetToNull, 'details'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('details', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['details'] = $details; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/AuditLogEntryResponsePagedResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/AuditLogEntryResponsePagedResponse.php new file mode 100644 index 0000000..fd93b8a --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/AuditLogEntryResponsePagedResponse.php @@ -0,0 +1,518 @@ + + */ +class AuditLogEntryResponsePagedResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'AuditLogEntryResponsePagedResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'items' => '\OmsorgCoreClient\Model\AuditLogEntryResponse[]', + 'total_count' => 'int', + 'page' => 'int', + 'page_size' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'items' => null, + 'total_count' => 'int32', + 'page' => 'int32', + 'page_size' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'items' => true, + 'total_count' => false, + 'page' => false, + 'page_size' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'items' => 'items', + 'total_count' => 'totalCount', + 'page' => 'page', + 'page_size' => 'pageSize' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'items' => 'setItems', + 'total_count' => 'setTotalCount', + 'page' => 'setPage', + 'page_size' => 'setPageSize' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'items' => 'getItems', + 'total_count' => 'getTotalCount', + 'page' => 'getPage', + 'page_size' => 'getPageSize' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('items', $data ?? [], null); + $this->setIfExists('total_count', $data ?? [], null); + $this->setIfExists('page', $data ?? [], null); + $this->setIfExists('page_size', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets items + * + * @return \OmsorgCoreClient\Model\AuditLogEntryResponse[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \OmsorgCoreClient\Model\AuditLogEntryResponse[]|null $items items + * + * @return self + */ + public function setItems($items) + { + if (is_null($items)) { + array_push($this->openAPINullablesSetToNull, 'items'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('items', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets total_count + * + * @return int|null + */ + public function getTotalCount() + { + return $this->container['total_count']; + } + + /** + * Sets total_count + * + * @param int|null $total_count total_count + * + * @return self + */ + public function setTotalCount($total_count) + { + if (is_null($total_count)) { + throw new \InvalidArgumentException('non-nullable total_count cannot be null'); + } + $this->container['total_count'] = $total_count; + + return $this; + } + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int|null $page page + * + * @return self + */ + public function setPage($page) + { + if (is_null($page)) { + throw new \InvalidArgumentException('non-nullable page cannot be null'); + } + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets page_size + * + * @return int|null + */ + public function getPageSize() + { + return $this->container['page_size']; + } + + /** + * Sets page_size + * + * @param int|null $page_size page_size + * + * @return self + */ + public function setPageSize($page_size) + { + if (is_null($page_size)) { + throw new \InvalidArgumentException('non-nullable page_size cannot be null'); + } + $this->container['page_size'] = $page_size; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ChangePasswordRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ChangePasswordRequest.php new file mode 100644 index 0000000..5e7c464 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ChangePasswordRequest.php @@ -0,0 +1,457 @@ + + */ +class ChangePasswordRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ChangePasswordRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'current_password' => 'string', + 'new_password' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'current_password' => null, + 'new_password' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'current_password' => true, + 'new_password' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'current_password' => 'currentPassword', + 'new_password' => 'newPassword' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'current_password' => 'setCurrentPassword', + 'new_password' => 'setNewPassword' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'current_password' => 'getCurrentPassword', + 'new_password' => 'getNewPassword' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('current_password', $data ?? [], null); + $this->setIfExists('new_password', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets current_password + * + * @return string|null + */ + public function getCurrentPassword() + { + return $this->container['current_password']; + } + + /** + * Sets current_password + * + * @param string|null $current_password current_password + * + * @return self + */ + public function setCurrentPassword($current_password) + { + if (is_null($current_password)) { + array_push($this->openAPINullablesSetToNull, 'current_password'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('current_password', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['current_password'] = $current_password; + + return $this; + } + + /** + * Gets new_password + * + * @return string|null + */ + public function getNewPassword() + { + return $this->container['new_password']; + } + + /** + * Sets new_password + * + * @param string|null $new_password new_password + * + * @return self + */ + public function setNewPassword($new_password) + { + if (is_null($new_password)) { + array_push($this->openAPINullablesSetToNull, 'new_password'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('new_password', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['new_password'] = $new_password; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ContractResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ContractResponse.php new file mode 100644 index 0000000..15986da --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ContractResponse.php @@ -0,0 +1,894 @@ + + */ +class ContractResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ContractResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'contract_type' => 'string', + 'employee_id' => 'string', + 'facility_id' => 'string', + 'start_date' => '\DateTime', + 'end_date' => '\DateTime', + 'status' => 'string', + 'weekly_hours' => 'float', + 'hourly_wage' => 'float', + 'allowances_description' => 'string', + 'overtime_rules' => 'string', + 'vacation_days_per_year' => 'int', + 'probation_period_months' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'uuid', + 'contract_type' => null, + 'employee_id' => 'uuid', + 'facility_id' => 'uuid', + 'start_date' => 'date', + 'end_date' => 'date', + 'status' => null, + 'weekly_hours' => 'double', + 'hourly_wage' => 'double', + 'allowances_description' => null, + 'overtime_rules' => null, + 'vacation_days_per_year' => 'int32', + 'probation_period_months' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'contract_type' => true, + 'employee_id' => true, + 'facility_id' => true, + 'start_date' => false, + 'end_date' => true, + 'status' => true, + 'weekly_hours' => true, + 'hourly_wage' => true, + 'allowances_description' => true, + 'overtime_rules' => true, + 'vacation_days_per_year' => true, + 'probation_period_months' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'contract_type' => 'contractType', + 'employee_id' => 'employeeId', + 'facility_id' => 'facilityId', + 'start_date' => 'startDate', + 'end_date' => 'endDate', + 'status' => 'status', + 'weekly_hours' => 'weeklyHours', + 'hourly_wage' => 'hourlyWage', + 'allowances_description' => 'allowancesDescription', + 'overtime_rules' => 'overtimeRules', + 'vacation_days_per_year' => 'vacationDaysPerYear', + 'probation_period_months' => 'probationPeriodMonths' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'contract_type' => 'setContractType', + 'employee_id' => 'setEmployeeId', + 'facility_id' => 'setFacilityId', + 'start_date' => 'setStartDate', + 'end_date' => 'setEndDate', + 'status' => 'setStatus', + 'weekly_hours' => 'setWeeklyHours', + 'hourly_wage' => 'setHourlyWage', + 'allowances_description' => 'setAllowancesDescription', + 'overtime_rules' => 'setOvertimeRules', + 'vacation_days_per_year' => 'setVacationDaysPerYear', + 'probation_period_months' => 'setProbationPeriodMonths' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'contract_type' => 'getContractType', + 'employee_id' => 'getEmployeeId', + 'facility_id' => 'getFacilityId', + 'start_date' => 'getStartDate', + 'end_date' => 'getEndDate', + 'status' => 'getStatus', + 'weekly_hours' => 'getWeeklyHours', + 'hourly_wage' => 'getHourlyWage', + 'allowances_description' => 'getAllowancesDescription', + 'overtime_rules' => 'getOvertimeRules', + 'vacation_days_per_year' => 'getVacationDaysPerYear', + 'probation_period_months' => 'getProbationPeriodMonths' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('contract_type', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('facility_id', $data ?? [], null); + $this->setIfExists('start_date', $data ?? [], null); + $this->setIfExists('end_date', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('weekly_hours', $data ?? [], null); + $this->setIfExists('hourly_wage', $data ?? [], null); + $this->setIfExists('allowances_description', $data ?? [], null); + $this->setIfExists('overtime_rules', $data ?? [], null); + $this->setIfExists('vacation_days_per_year', $data ?? [], null); + $this->setIfExists('probation_period_months', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets contract_type + * + * @return string|null + */ + public function getContractType() + { + return $this->container['contract_type']; + } + + /** + * Sets contract_type + * + * @param string|null $contract_type contract_type + * + * @return self + */ + public function setContractType($contract_type) + { + if (is_null($contract_type)) { + array_push($this->openAPINullablesSetToNull, 'contract_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('contract_type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['contract_type'] = $contract_type; + + return $this; + } + + /** + * Gets employee_id + * + * @return string|null + */ + public function getEmployeeId() + { + return $this->container['employee_id']; + } + + /** + * Sets employee_id + * + * @param string|null $employee_id employee_id + * + * @return self + */ + public function setEmployeeId($employee_id) + { + if (is_null($employee_id)) { + array_push($this->openAPINullablesSetToNull, 'employee_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employee_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employee_id'] = $employee_id; + + return $this; + } + + /** + * Gets facility_id + * + * @return string|null + */ + public function getFacilityId() + { + return $this->container['facility_id']; + } + + /** + * Sets facility_id + * + * @param string|null $facility_id facility_id + * + * @return self + */ + public function setFacilityId($facility_id) + { + if (is_null($facility_id)) { + array_push($this->openAPINullablesSetToNull, 'facility_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('facility_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['facility_id'] = $facility_id; + + return $this; + } + + /** + * Gets start_date + * + * @return \DateTime|null + */ + public function getStartDate() + { + return $this->container['start_date']; + } + + /** + * Sets start_date + * + * @param \DateTime|null $start_date start_date + * + * @return self + */ + public function setStartDate($start_date) + { + if (is_null($start_date)) { + throw new \InvalidArgumentException('non-nullable start_date cannot be null'); + } + $this->container['start_date'] = $start_date; + + return $this; + } + + /** + * Gets end_date + * + * @return \DateTime|null + */ + public function getEndDate() + { + return $this->container['end_date']; + } + + /** + * Sets end_date + * + * @param \DateTime|null $end_date end_date + * + * @return self + */ + public function setEndDate($end_date) + { + if (is_null($end_date)) { + array_push($this->openAPINullablesSetToNull, 'end_date'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('end_date', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['end_date'] = $end_date; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + array_push($this->openAPINullablesSetToNull, 'status'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('status', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets weekly_hours + * + * @return float|null + */ + public function getWeeklyHours() + { + return $this->container['weekly_hours']; + } + + /** + * Sets weekly_hours + * + * @param float|null $weekly_hours weekly_hours + * + * @return self + */ + public function setWeeklyHours($weekly_hours) + { + if (is_null($weekly_hours)) { + array_push($this->openAPINullablesSetToNull, 'weekly_hours'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('weekly_hours', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['weekly_hours'] = $weekly_hours; + + return $this; + } + + /** + * Gets hourly_wage + * + * @return float|null + */ + public function getHourlyWage() + { + return $this->container['hourly_wage']; + } + + /** + * Sets hourly_wage + * + * @param float|null $hourly_wage hourly_wage + * + * @return self + */ + public function setHourlyWage($hourly_wage) + { + if (is_null($hourly_wage)) { + array_push($this->openAPINullablesSetToNull, 'hourly_wage'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('hourly_wage', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['hourly_wage'] = $hourly_wage; + + return $this; + } + + /** + * Gets allowances_description + * + * @return string|null + */ + public function getAllowancesDescription() + { + return $this->container['allowances_description']; + } + + /** + * Sets allowances_description + * + * @param string|null $allowances_description allowances_description + * + * @return self + */ + public function setAllowancesDescription($allowances_description) + { + if (is_null($allowances_description)) { + array_push($this->openAPINullablesSetToNull, 'allowances_description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('allowances_description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['allowances_description'] = $allowances_description; + + return $this; + } + + /** + * Gets overtime_rules + * + * @return string|null + */ + public function getOvertimeRules() + { + return $this->container['overtime_rules']; + } + + /** + * Sets overtime_rules + * + * @param string|null $overtime_rules overtime_rules + * + * @return self + */ + public function setOvertimeRules($overtime_rules) + { + if (is_null($overtime_rules)) { + array_push($this->openAPINullablesSetToNull, 'overtime_rules'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('overtime_rules', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['overtime_rules'] = $overtime_rules; + + return $this; + } + + /** + * Gets vacation_days_per_year + * + * @return int|null + */ + public function getVacationDaysPerYear() + { + return $this->container['vacation_days_per_year']; + } + + /** + * Sets vacation_days_per_year + * + * @param int|null $vacation_days_per_year vacation_days_per_year + * + * @return self + */ + public function setVacationDaysPerYear($vacation_days_per_year) + { + if (is_null($vacation_days_per_year)) { + array_push($this->openAPINullablesSetToNull, 'vacation_days_per_year'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('vacation_days_per_year', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['vacation_days_per_year'] = $vacation_days_per_year; + + return $this; + } + + /** + * Gets probation_period_months + * + * @return int|null + */ + public function getProbationPeriodMonths() + { + return $this->container['probation_period_months']; + } + + /** + * Sets probation_period_months + * + * @param int|null $probation_period_months probation_period_months + * + * @return self + */ + public function setProbationPeriodMonths($probation_period_months) + { + if (is_null($probation_period_months)) { + array_push($this->openAPINullablesSetToNull, 'probation_period_months'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('probation_period_months', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['probation_period_months'] = $probation_period_months; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ContractResponsePagedResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ContractResponsePagedResponse.php new file mode 100644 index 0000000..5246e8b --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ContractResponsePagedResponse.php @@ -0,0 +1,518 @@ + + */ +class ContractResponsePagedResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ContractResponsePagedResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'items' => '\OmsorgCoreClient\Model\ContractResponse[]', + 'total_count' => 'int', + 'page' => 'int', + 'page_size' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'items' => null, + 'total_count' => 'int32', + 'page' => 'int32', + 'page_size' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'items' => true, + 'total_count' => false, + 'page' => false, + 'page_size' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'items' => 'items', + 'total_count' => 'totalCount', + 'page' => 'page', + 'page_size' => 'pageSize' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'items' => 'setItems', + 'total_count' => 'setTotalCount', + 'page' => 'setPage', + 'page_size' => 'setPageSize' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'items' => 'getItems', + 'total_count' => 'getTotalCount', + 'page' => 'getPage', + 'page_size' => 'getPageSize' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('items', $data ?? [], null); + $this->setIfExists('total_count', $data ?? [], null); + $this->setIfExists('page', $data ?? [], null); + $this->setIfExists('page_size', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets items + * + * @return \OmsorgCoreClient\Model\ContractResponse[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \OmsorgCoreClient\Model\ContractResponse[]|null $items items + * + * @return self + */ + public function setItems($items) + { + if (is_null($items)) { + array_push($this->openAPINullablesSetToNull, 'items'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('items', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets total_count + * + * @return int|null + */ + public function getTotalCount() + { + return $this->container['total_count']; + } + + /** + * Sets total_count + * + * @param int|null $total_count total_count + * + * @return self + */ + public function setTotalCount($total_count) + { + if (is_null($total_count)) { + throw new \InvalidArgumentException('non-nullable total_count cannot be null'); + } + $this->container['total_count'] = $total_count; + + return $this; + } + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int|null $page page + * + * @return self + */ + public function setPage($page) + { + if (is_null($page)) { + throw new \InvalidArgumentException('non-nullable page cannot be null'); + } + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets page_size + * + * @return int|null + */ + public function getPageSize() + { + return $this->container['page_size']; + } + + /** + * Sets page_size + * + * @param int|null $page_size page_size + * + * @return self + */ + public function setPageSize($page_size) + { + if (is_null($page_size)) { + throw new \InvalidArgumentException('non-nullable page_size cannot be null'); + } + $this->container['page_size'] = $page_size; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/CreateContractRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/CreateContractRequest.php new file mode 100644 index 0000000..7a9e2c7 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/CreateContractRequest.php @@ -0,0 +1,819 @@ + + */ +class CreateContractRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateContractRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'contract_type' => 'string', + 'employee_id' => 'string', + 'facility_id' => 'string', + 'start_date' => '\DateTime', + 'end_date' => '\DateTime', + 'weekly_hours' => 'float', + 'hourly_wage' => 'float', + 'allowances_description' => 'string', + 'overtime_rules' => 'string', + 'vacation_days_per_year' => 'int', + 'probation_period_months' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'contract_type' => null, + 'employee_id' => 'uuid', + 'facility_id' => 'uuid', + 'start_date' => 'date', + 'end_date' => 'date', + 'weekly_hours' => 'double', + 'hourly_wage' => 'double', + 'allowances_description' => null, + 'overtime_rules' => null, + 'vacation_days_per_year' => 'int32', + 'probation_period_months' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'contract_type' => true, + 'employee_id' => true, + 'facility_id' => true, + 'start_date' => false, + 'end_date' => true, + 'weekly_hours' => true, + 'hourly_wage' => true, + 'allowances_description' => true, + 'overtime_rules' => true, + 'vacation_days_per_year' => true, + 'probation_period_months' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'contract_type' => 'contractType', + 'employee_id' => 'employeeId', + 'facility_id' => 'facilityId', + 'start_date' => 'startDate', + 'end_date' => 'endDate', + 'weekly_hours' => 'weeklyHours', + 'hourly_wage' => 'hourlyWage', + 'allowances_description' => 'allowancesDescription', + 'overtime_rules' => 'overtimeRules', + 'vacation_days_per_year' => 'vacationDaysPerYear', + 'probation_period_months' => 'probationPeriodMonths' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'contract_type' => 'setContractType', + 'employee_id' => 'setEmployeeId', + 'facility_id' => 'setFacilityId', + 'start_date' => 'setStartDate', + 'end_date' => 'setEndDate', + 'weekly_hours' => 'setWeeklyHours', + 'hourly_wage' => 'setHourlyWage', + 'allowances_description' => 'setAllowancesDescription', + 'overtime_rules' => 'setOvertimeRules', + 'vacation_days_per_year' => 'setVacationDaysPerYear', + 'probation_period_months' => 'setProbationPeriodMonths' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'contract_type' => 'getContractType', + 'employee_id' => 'getEmployeeId', + 'facility_id' => 'getFacilityId', + 'start_date' => 'getStartDate', + 'end_date' => 'getEndDate', + 'weekly_hours' => 'getWeeklyHours', + 'hourly_wage' => 'getHourlyWage', + 'allowances_description' => 'getAllowancesDescription', + 'overtime_rules' => 'getOvertimeRules', + 'vacation_days_per_year' => 'getVacationDaysPerYear', + 'probation_period_months' => 'getProbationPeriodMonths' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('contract_type', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('facility_id', $data ?? [], null); + $this->setIfExists('start_date', $data ?? [], null); + $this->setIfExists('end_date', $data ?? [], null); + $this->setIfExists('weekly_hours', $data ?? [], null); + $this->setIfExists('hourly_wage', $data ?? [], null); + $this->setIfExists('allowances_description', $data ?? [], null); + $this->setIfExists('overtime_rules', $data ?? [], null); + $this->setIfExists('vacation_days_per_year', $data ?? [], null); + $this->setIfExists('probation_period_months', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets contract_type + * + * @return string|null + */ + public function getContractType() + { + return $this->container['contract_type']; + } + + /** + * Sets contract_type + * + * @param string|null $contract_type contract_type + * + * @return self + */ + public function setContractType($contract_type) + { + if (is_null($contract_type)) { + array_push($this->openAPINullablesSetToNull, 'contract_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('contract_type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['contract_type'] = $contract_type; + + return $this; + } + + /** + * Gets employee_id + * + * @return string|null + */ + public function getEmployeeId() + { + return $this->container['employee_id']; + } + + /** + * Sets employee_id + * + * @param string|null $employee_id employee_id + * + * @return self + */ + public function setEmployeeId($employee_id) + { + if (is_null($employee_id)) { + array_push($this->openAPINullablesSetToNull, 'employee_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employee_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employee_id'] = $employee_id; + + return $this; + } + + /** + * Gets facility_id + * + * @return string|null + */ + public function getFacilityId() + { + return $this->container['facility_id']; + } + + /** + * Sets facility_id + * + * @param string|null $facility_id facility_id + * + * @return self + */ + public function setFacilityId($facility_id) + { + if (is_null($facility_id)) { + array_push($this->openAPINullablesSetToNull, 'facility_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('facility_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['facility_id'] = $facility_id; + + return $this; + } + + /** + * Gets start_date + * + * @return \DateTime|null + */ + public function getStartDate() + { + return $this->container['start_date']; + } + + /** + * Sets start_date + * + * @param \DateTime|null $start_date start_date + * + * @return self + */ + public function setStartDate($start_date) + { + if (is_null($start_date)) { + throw new \InvalidArgumentException('non-nullable start_date cannot be null'); + } + $this->container['start_date'] = $start_date; + + return $this; + } + + /** + * Gets end_date + * + * @return \DateTime|null + */ + public function getEndDate() + { + return $this->container['end_date']; + } + + /** + * Sets end_date + * + * @param \DateTime|null $end_date end_date + * + * @return self + */ + public function setEndDate($end_date) + { + if (is_null($end_date)) { + array_push($this->openAPINullablesSetToNull, 'end_date'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('end_date', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['end_date'] = $end_date; + + return $this; + } + + /** + * Gets weekly_hours + * + * @return float|null + */ + public function getWeeklyHours() + { + return $this->container['weekly_hours']; + } + + /** + * Sets weekly_hours + * + * @param float|null $weekly_hours weekly_hours + * + * @return self + */ + public function setWeeklyHours($weekly_hours) + { + if (is_null($weekly_hours)) { + array_push($this->openAPINullablesSetToNull, 'weekly_hours'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('weekly_hours', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['weekly_hours'] = $weekly_hours; + + return $this; + } + + /** + * Gets hourly_wage + * + * @return float|null + */ + public function getHourlyWage() + { + return $this->container['hourly_wage']; + } + + /** + * Sets hourly_wage + * + * @param float|null $hourly_wage hourly_wage + * + * @return self + */ + public function setHourlyWage($hourly_wage) + { + if (is_null($hourly_wage)) { + array_push($this->openAPINullablesSetToNull, 'hourly_wage'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('hourly_wage', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['hourly_wage'] = $hourly_wage; + + return $this; + } + + /** + * Gets allowances_description + * + * @return string|null + */ + public function getAllowancesDescription() + { + return $this->container['allowances_description']; + } + + /** + * Sets allowances_description + * + * @param string|null $allowances_description allowances_description + * + * @return self + */ + public function setAllowancesDescription($allowances_description) + { + if (is_null($allowances_description)) { + array_push($this->openAPINullablesSetToNull, 'allowances_description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('allowances_description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['allowances_description'] = $allowances_description; + + return $this; + } + + /** + * Gets overtime_rules + * + * @return string|null + */ + public function getOvertimeRules() + { + return $this->container['overtime_rules']; + } + + /** + * Sets overtime_rules + * + * @param string|null $overtime_rules overtime_rules + * + * @return self + */ + public function setOvertimeRules($overtime_rules) + { + if (is_null($overtime_rules)) { + array_push($this->openAPINullablesSetToNull, 'overtime_rules'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('overtime_rules', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['overtime_rules'] = $overtime_rules; + + return $this; + } + + /** + * Gets vacation_days_per_year + * + * @return int|null + */ + public function getVacationDaysPerYear() + { + return $this->container['vacation_days_per_year']; + } + + /** + * Sets vacation_days_per_year + * + * @param int|null $vacation_days_per_year vacation_days_per_year + * + * @return self + */ + public function setVacationDaysPerYear($vacation_days_per_year) + { + if (is_null($vacation_days_per_year)) { + array_push($this->openAPINullablesSetToNull, 'vacation_days_per_year'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('vacation_days_per_year', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['vacation_days_per_year'] = $vacation_days_per_year; + + return $this; + } + + /** + * Gets probation_period_months + * + * @return int|null + */ + public function getProbationPeriodMonths() + { + return $this->container['probation_period_months']; + } + + /** + * Sets probation_period_months + * + * @param int|null $probation_period_months probation_period_months + * + * @return self + */ + public function setProbationPeriodMonths($probation_period_months) + { + if (is_null($probation_period_months)) { + array_push($this->openAPINullablesSetToNull, 'probation_period_months'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('probation_period_months', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['probation_period_months'] = $probation_period_months; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/CreateEmployeeRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/CreateEmployeeRequest.php new file mode 100644 index 0000000..cf25728 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/CreateEmployeeRequest.php @@ -0,0 +1,1031 @@ + + */ +class CreateEmployeeRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateEmployeeRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'first_name' => 'string', + 'last_name' => 'string', + 'date_of_birth' => '\DateTime', + 'street' => 'string', + 'postal_code' => 'string', + 'city' => 'string', + 'country' => 'string', + 'phone_number' => 'string', + 'email' => 'string', + 'entry_date' => '\DateTime', + 'exit_date' => '\DateTime', + 'emergency_contact_name' => 'string', + 'emergency_contact_phone' => 'string', + 'emergency_contact_relation' => 'string', + 'employment_type' => 'string', + 'qualification' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'first_name' => null, + 'last_name' => null, + 'date_of_birth' => 'date', + 'street' => null, + 'postal_code' => null, + 'city' => null, + 'country' => null, + 'phone_number' => null, + 'email' => null, + 'entry_date' => 'date', + 'exit_date' => 'date', + 'emergency_contact_name' => null, + 'emergency_contact_phone' => null, + 'emergency_contact_relation' => null, + 'employment_type' => null, + 'qualification' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'first_name' => true, + 'last_name' => true, + 'date_of_birth' => true, + 'street' => true, + 'postal_code' => true, + 'city' => true, + 'country' => true, + 'phone_number' => true, + 'email' => true, + 'entry_date' => true, + 'exit_date' => true, + 'emergency_contact_name' => true, + 'emergency_contact_phone' => true, + 'emergency_contact_relation' => true, + 'employment_type' => true, + 'qualification' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'first_name' => 'firstName', + 'last_name' => 'lastName', + 'date_of_birth' => 'dateOfBirth', + 'street' => 'street', + 'postal_code' => 'postalCode', + 'city' => 'city', + 'country' => 'country', + 'phone_number' => 'phoneNumber', + 'email' => 'email', + 'entry_date' => 'entryDate', + 'exit_date' => 'exitDate', + 'emergency_contact_name' => 'emergencyContactName', + 'emergency_contact_phone' => 'emergencyContactPhone', + 'emergency_contact_relation' => 'emergencyContactRelation', + 'employment_type' => 'employmentType', + 'qualification' => 'qualification' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName', + 'date_of_birth' => 'setDateOfBirth', + 'street' => 'setStreet', + 'postal_code' => 'setPostalCode', + 'city' => 'setCity', + 'country' => 'setCountry', + 'phone_number' => 'setPhoneNumber', + 'email' => 'setEmail', + 'entry_date' => 'setEntryDate', + 'exit_date' => 'setExitDate', + 'emergency_contact_name' => 'setEmergencyContactName', + 'emergency_contact_phone' => 'setEmergencyContactPhone', + 'emergency_contact_relation' => 'setEmergencyContactRelation', + 'employment_type' => 'setEmploymentType', + 'qualification' => 'setQualification' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName', + 'date_of_birth' => 'getDateOfBirth', + 'street' => 'getStreet', + 'postal_code' => 'getPostalCode', + 'city' => 'getCity', + 'country' => 'getCountry', + 'phone_number' => 'getPhoneNumber', + 'email' => 'getEmail', + 'entry_date' => 'getEntryDate', + 'exit_date' => 'getExitDate', + 'emergency_contact_name' => 'getEmergencyContactName', + 'emergency_contact_phone' => 'getEmergencyContactPhone', + 'emergency_contact_relation' => 'getEmergencyContactRelation', + 'employment_type' => 'getEmploymentType', + 'qualification' => 'getQualification' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('date_of_birth', $data ?? [], null); + $this->setIfExists('street', $data ?? [], null); + $this->setIfExists('postal_code', $data ?? [], null); + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('entry_date', $data ?? [], null); + $this->setIfExists('exit_date', $data ?? [], null); + $this->setIfExists('emergency_contact_name', $data ?? [], null); + $this->setIfExists('emergency_contact_phone', $data ?? [], null); + $this->setIfExists('emergency_contact_relation', $data ?? [], null); + $this->setIfExists('employment_type', $data ?? [], null); + $this->setIfExists('qualification', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets first_name + * + * @return string|null + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string|null $first_name first_name + * + * @return self + */ + public function setFirstName($first_name) + { + if (is_null($first_name)) { + array_push($this->openAPINullablesSetToNull, 'first_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('first_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string|null + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string|null $last_name last_name + * + * @return self + */ + public function setLastName($last_name) + { + if (is_null($last_name)) { + array_push($this->openAPINullablesSetToNull, 'last_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('last_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['last_name'] = $last_name; + + return $this; + } + + /** + * Gets date_of_birth + * + * @return \DateTime|null + */ + public function getDateOfBirth() + { + return $this->container['date_of_birth']; + } + + /** + * Sets date_of_birth + * + * @param \DateTime|null $date_of_birth date_of_birth + * + * @return self + */ + public function setDateOfBirth($date_of_birth) + { + if (is_null($date_of_birth)) { + array_push($this->openAPINullablesSetToNull, 'date_of_birth'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('date_of_birth', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['date_of_birth'] = $date_of_birth; + + return $this; + } + + /** + * Gets street + * + * @return string|null + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string|null $street street + * + * @return self + */ + public function setStreet($street) + { + if (is_null($street)) { + array_push($this->openAPINullablesSetToNull, 'street'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('street', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['street'] = $street; + + return $this; + } + + /** + * Gets postal_code + * + * @return string|null + */ + public function getPostalCode() + { + return $this->container['postal_code']; + } + + /** + * Sets postal_code + * + * @param string|null $postal_code postal_code + * + * @return self + */ + public function setPostalCode($postal_code) + { + if (is_null($postal_code)) { + array_push($this->openAPINullablesSetToNull, 'postal_code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('postal_code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['postal_code'] = $postal_code; + + return $this; + } + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city city + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + array_push($this->openAPINullablesSetToNull, 'city'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('city', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country country + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + array_push($this->openAPINullablesSetToNull, 'country'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('country', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets phone_number + * + * @return string|null + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string|null $phone_number phone_number + * + * @return self + */ + public function setPhoneNumber($phone_number) + { + if (is_null($phone_number)) { + array_push($this->openAPINullablesSetToNull, 'phone_number'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('phone_number', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['phone_number'] = $phone_number; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email email + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets entry_date + * + * @return \DateTime|null + */ + public function getEntryDate() + { + return $this->container['entry_date']; + } + + /** + * Sets entry_date + * + * @param \DateTime|null $entry_date entry_date + * + * @return self + */ + public function setEntryDate($entry_date) + { + if (is_null($entry_date)) { + array_push($this->openAPINullablesSetToNull, 'entry_date'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('entry_date', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['entry_date'] = $entry_date; + + return $this; + } + + /** + * Gets exit_date + * + * @return \DateTime|null + */ + public function getExitDate() + { + return $this->container['exit_date']; + } + + /** + * Sets exit_date + * + * @param \DateTime|null $exit_date exit_date + * + * @return self + */ + public function setExitDate($exit_date) + { + if (is_null($exit_date)) { + array_push($this->openAPINullablesSetToNull, 'exit_date'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('exit_date', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['exit_date'] = $exit_date; + + return $this; + } + + /** + * Gets emergency_contact_name + * + * @return string|null + */ + public function getEmergencyContactName() + { + return $this->container['emergency_contact_name']; + } + + /** + * Sets emergency_contact_name + * + * @param string|null $emergency_contact_name emergency_contact_name + * + * @return self + */ + public function setEmergencyContactName($emergency_contact_name) + { + if (is_null($emergency_contact_name)) { + array_push($this->openAPINullablesSetToNull, 'emergency_contact_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('emergency_contact_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['emergency_contact_name'] = $emergency_contact_name; + + return $this; + } + + /** + * Gets emergency_contact_phone + * + * @return string|null + */ + public function getEmergencyContactPhone() + { + return $this->container['emergency_contact_phone']; + } + + /** + * Sets emergency_contact_phone + * + * @param string|null $emergency_contact_phone emergency_contact_phone + * + * @return self + */ + public function setEmergencyContactPhone($emergency_contact_phone) + { + if (is_null($emergency_contact_phone)) { + array_push($this->openAPINullablesSetToNull, 'emergency_contact_phone'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('emergency_contact_phone', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['emergency_contact_phone'] = $emergency_contact_phone; + + return $this; + } + + /** + * Gets emergency_contact_relation + * + * @return string|null + */ + public function getEmergencyContactRelation() + { + return $this->container['emergency_contact_relation']; + } + + /** + * Sets emergency_contact_relation + * + * @param string|null $emergency_contact_relation emergency_contact_relation + * + * @return self + */ + public function setEmergencyContactRelation($emergency_contact_relation) + { + if (is_null($emergency_contact_relation)) { + array_push($this->openAPINullablesSetToNull, 'emergency_contact_relation'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('emergency_contact_relation', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['emergency_contact_relation'] = $emergency_contact_relation; + + return $this; + } + + /** + * Gets employment_type + * + * @return string|null + */ + public function getEmploymentType() + { + return $this->container['employment_type']; + } + + /** + * Sets employment_type + * + * @param string|null $employment_type employment_type + * + * @return self + */ + public function setEmploymentType($employment_type) + { + if (is_null($employment_type)) { + array_push($this->openAPINullablesSetToNull, 'employment_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employment_type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employment_type'] = $employment_type; + + return $this; + } + + /** + * Gets qualification + * + * @return string|null + */ + public function getQualification() + { + return $this->container['qualification']; + } + + /** + * Sets qualification + * + * @param string|null $qualification qualification + * + * @return self + */ + public function setQualification($qualification) + { + if (is_null($qualification)) { + array_push($this->openAPINullablesSetToNull, 'qualification'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('qualification', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['qualification'] = $qualification; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/CreateFacilityContactRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/CreateFacilityContactRequest.php new file mode 100644 index 0000000..4ce84cf --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/CreateFacilityContactRequest.php @@ -0,0 +1,621 @@ + + */ +class CreateFacilityContactRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateFacilityContactRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'role' => 'string', + 'department' => 'string', + 'phone_number' => 'string', + 'email' => 'string', + 'notes' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'role' => null, + 'department' => null, + 'phone_number' => null, + 'email' => null, + 'notes' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => true, + 'role' => true, + 'department' => true, + 'phone_number' => true, + 'email' => true, + 'notes' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'role' => 'role', + 'department' => 'department', + 'phone_number' => 'phoneNumber', + 'email' => 'email', + 'notes' => 'notes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'role' => 'setRole', + 'department' => 'setDepartment', + 'phone_number' => 'setPhoneNumber', + 'email' => 'setEmail', + 'notes' => 'setNotes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'role' => 'getRole', + 'department' => 'getDepartment', + 'phone_number' => 'getPhoneNumber', + 'email' => 'getEmail', + 'notes' => 'getNotes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('role', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('notes', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets role + * + * @return string|null + */ + public function getRole() + { + return $this->container['role']; + } + + /** + * Sets role + * + * @param string|null $role role + * + * @return self + */ + public function setRole($role) + { + if (is_null($role)) { + array_push($this->openAPINullablesSetToNull, 'role'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('role', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['role'] = $role; + + return $this; + } + + /** + * Gets department + * + * @return string|null + */ + public function getDepartment() + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param string|null $department department + * + * @return self + */ + public function setDepartment($department) + { + if (is_null($department)) { + array_push($this->openAPINullablesSetToNull, 'department'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('department', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['department'] = $department; + + return $this; + } + + /** + * Gets phone_number + * + * @return string|null + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string|null $phone_number phone_number + * + * @return self + */ + public function setPhoneNumber($phone_number) + { + if (is_null($phone_number)) { + array_push($this->openAPINullablesSetToNull, 'phone_number'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('phone_number', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['phone_number'] = $phone_number; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email email + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets notes + * + * @return string|null + */ + public function getNotes() + { + return $this->container['notes']; + } + + /** + * Sets notes + * + * @param string|null $notes notes + * + * @return self + */ + public function setNotes($notes) + { + if (is_null($notes)) { + array_push($this->openAPINullablesSetToNull, 'notes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('notes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['notes'] = $notes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/CreateFacilityRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/CreateFacilityRequest.php new file mode 100644 index 0000000..2e36ade --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/CreateFacilityRequest.php @@ -0,0 +1,785 @@ + + */ +class CreateFacilityRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateFacilityRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'facility_type' => 'string', + 'street' => 'string', + 'postal_code' => 'string', + 'city' => 'string', + 'country' => 'string', + 'billing_street' => 'string', + 'billing_postal_code' => 'string', + 'billing_city' => 'string', + 'billing_country' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'facility_type' => null, + 'street' => null, + 'postal_code' => null, + 'city' => null, + 'country' => null, + 'billing_street' => null, + 'billing_postal_code' => null, + 'billing_city' => null, + 'billing_country' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => true, + 'facility_type' => true, + 'street' => true, + 'postal_code' => true, + 'city' => true, + 'country' => true, + 'billing_street' => true, + 'billing_postal_code' => true, + 'billing_city' => true, + 'billing_country' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'facility_type' => 'facilityType', + 'street' => 'street', + 'postal_code' => 'postalCode', + 'city' => 'city', + 'country' => 'country', + 'billing_street' => 'billingStreet', + 'billing_postal_code' => 'billingPostalCode', + 'billing_city' => 'billingCity', + 'billing_country' => 'billingCountry' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'facility_type' => 'setFacilityType', + 'street' => 'setStreet', + 'postal_code' => 'setPostalCode', + 'city' => 'setCity', + 'country' => 'setCountry', + 'billing_street' => 'setBillingStreet', + 'billing_postal_code' => 'setBillingPostalCode', + 'billing_city' => 'setBillingCity', + 'billing_country' => 'setBillingCountry' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'facility_type' => 'getFacilityType', + 'street' => 'getStreet', + 'postal_code' => 'getPostalCode', + 'city' => 'getCity', + 'country' => 'getCountry', + 'billing_street' => 'getBillingStreet', + 'billing_postal_code' => 'getBillingPostalCode', + 'billing_city' => 'getBillingCity', + 'billing_country' => 'getBillingCountry' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('facility_type', $data ?? [], null); + $this->setIfExists('street', $data ?? [], null); + $this->setIfExists('postal_code', $data ?? [], null); + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('billing_street', $data ?? [], null); + $this->setIfExists('billing_postal_code', $data ?? [], null); + $this->setIfExists('billing_city', $data ?? [], null); + $this->setIfExists('billing_country', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets facility_type + * + * @return string|null + */ + public function getFacilityType() + { + return $this->container['facility_type']; + } + + /** + * Sets facility_type + * + * @param string|null $facility_type facility_type + * + * @return self + */ + public function setFacilityType($facility_type) + { + if (is_null($facility_type)) { + array_push($this->openAPINullablesSetToNull, 'facility_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('facility_type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['facility_type'] = $facility_type; + + return $this; + } + + /** + * Gets street + * + * @return string|null + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string|null $street street + * + * @return self + */ + public function setStreet($street) + { + if (is_null($street)) { + array_push($this->openAPINullablesSetToNull, 'street'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('street', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['street'] = $street; + + return $this; + } + + /** + * Gets postal_code + * + * @return string|null + */ + public function getPostalCode() + { + return $this->container['postal_code']; + } + + /** + * Sets postal_code + * + * @param string|null $postal_code postal_code + * + * @return self + */ + public function setPostalCode($postal_code) + { + if (is_null($postal_code)) { + array_push($this->openAPINullablesSetToNull, 'postal_code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('postal_code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['postal_code'] = $postal_code; + + return $this; + } + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city city + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + array_push($this->openAPINullablesSetToNull, 'city'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('city', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country country + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + array_push($this->openAPINullablesSetToNull, 'country'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('country', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets billing_street + * + * @return string|null + */ + public function getBillingStreet() + { + return $this->container['billing_street']; + } + + /** + * Sets billing_street + * + * @param string|null $billing_street billing_street + * + * @return self + */ + public function setBillingStreet($billing_street) + { + if (is_null($billing_street)) { + array_push($this->openAPINullablesSetToNull, 'billing_street'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('billing_street', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['billing_street'] = $billing_street; + + return $this; + } + + /** + * Gets billing_postal_code + * + * @return string|null + */ + public function getBillingPostalCode() + { + return $this->container['billing_postal_code']; + } + + /** + * Sets billing_postal_code + * + * @param string|null $billing_postal_code billing_postal_code + * + * @return self + */ + public function setBillingPostalCode($billing_postal_code) + { + if (is_null($billing_postal_code)) { + array_push($this->openAPINullablesSetToNull, 'billing_postal_code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('billing_postal_code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['billing_postal_code'] = $billing_postal_code; + + return $this; + } + + /** + * Gets billing_city + * + * @return string|null + */ + public function getBillingCity() + { + return $this->container['billing_city']; + } + + /** + * Sets billing_city + * + * @param string|null $billing_city billing_city + * + * @return self + */ + public function setBillingCity($billing_city) + { + if (is_null($billing_city)) { + array_push($this->openAPINullablesSetToNull, 'billing_city'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('billing_city', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['billing_city'] = $billing_city; + + return $this; + } + + /** + * Gets billing_country + * + * @return string|null + */ + public function getBillingCountry() + { + return $this->container['billing_country']; + } + + /** + * Sets billing_country + * + * @param string|null $billing_country billing_country + * + * @return self + */ + public function setBillingCountry($billing_country) + { + if (is_null($billing_country)) { + array_push($this->openAPINullablesSetToNull, 'billing_country'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('billing_country', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['billing_country'] = $billing_country; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/CreateOrderRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/CreateOrderRequest.php new file mode 100644 index 0000000..8a01169 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/CreateOrderRequest.php @@ -0,0 +1,723 @@ + + */ +class CreateOrderRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateOrderRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'facility_id' => 'string', + 'facility_contact_id' => 'string', + 'start_date' => '\DateTime', + 'end_date' => '\DateTime', + 'required_qualification' => 'string', + 'shift_type' => 'string', + 'required_headcount' => 'int', + 'conditions' => 'string', + 'priority' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'facility_id' => 'uuid', + 'facility_contact_id' => 'uuid', + 'start_date' => 'date', + 'end_date' => 'date', + 'required_qualification' => null, + 'shift_type' => null, + 'required_headcount' => 'int32', + 'conditions' => null, + 'priority' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'facility_id' => false, + 'facility_contact_id' => true, + 'start_date' => false, + 'end_date' => true, + 'required_qualification' => true, + 'shift_type' => true, + 'required_headcount' => false, + 'conditions' => true, + 'priority' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'facility_id' => 'facilityId', + 'facility_contact_id' => 'facilityContactId', + 'start_date' => 'startDate', + 'end_date' => 'endDate', + 'required_qualification' => 'requiredQualification', + 'shift_type' => 'shiftType', + 'required_headcount' => 'requiredHeadcount', + 'conditions' => 'conditions', + 'priority' => 'priority' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'facility_id' => 'setFacilityId', + 'facility_contact_id' => 'setFacilityContactId', + 'start_date' => 'setStartDate', + 'end_date' => 'setEndDate', + 'required_qualification' => 'setRequiredQualification', + 'shift_type' => 'setShiftType', + 'required_headcount' => 'setRequiredHeadcount', + 'conditions' => 'setConditions', + 'priority' => 'setPriority' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'facility_id' => 'getFacilityId', + 'facility_contact_id' => 'getFacilityContactId', + 'start_date' => 'getStartDate', + 'end_date' => 'getEndDate', + 'required_qualification' => 'getRequiredQualification', + 'shift_type' => 'getShiftType', + 'required_headcount' => 'getRequiredHeadcount', + 'conditions' => 'getConditions', + 'priority' => 'getPriority' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('facility_id', $data ?? [], null); + $this->setIfExists('facility_contact_id', $data ?? [], null); + $this->setIfExists('start_date', $data ?? [], null); + $this->setIfExists('end_date', $data ?? [], null); + $this->setIfExists('required_qualification', $data ?? [], null); + $this->setIfExists('shift_type', $data ?? [], null); + $this->setIfExists('required_headcount', $data ?? [], null); + $this->setIfExists('conditions', $data ?? [], null); + $this->setIfExists('priority', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets facility_id + * + * @return string|null + */ + public function getFacilityId() + { + return $this->container['facility_id']; + } + + /** + * Sets facility_id + * + * @param string|null $facility_id facility_id + * + * @return self + */ + public function setFacilityId($facility_id) + { + if (is_null($facility_id)) { + throw new \InvalidArgumentException('non-nullable facility_id cannot be null'); + } + $this->container['facility_id'] = $facility_id; + + return $this; + } + + /** + * Gets facility_contact_id + * + * @return string|null + */ + public function getFacilityContactId() + { + return $this->container['facility_contact_id']; + } + + /** + * Sets facility_contact_id + * + * @param string|null $facility_contact_id facility_contact_id + * + * @return self + */ + public function setFacilityContactId($facility_contact_id) + { + if (is_null($facility_contact_id)) { + array_push($this->openAPINullablesSetToNull, 'facility_contact_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('facility_contact_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['facility_contact_id'] = $facility_contact_id; + + return $this; + } + + /** + * Gets start_date + * + * @return \DateTime|null + */ + public function getStartDate() + { + return $this->container['start_date']; + } + + /** + * Sets start_date + * + * @param \DateTime|null $start_date start_date + * + * @return self + */ + public function setStartDate($start_date) + { + if (is_null($start_date)) { + throw new \InvalidArgumentException('non-nullable start_date cannot be null'); + } + $this->container['start_date'] = $start_date; + + return $this; + } + + /** + * Gets end_date + * + * @return \DateTime|null + */ + public function getEndDate() + { + return $this->container['end_date']; + } + + /** + * Sets end_date + * + * @param \DateTime|null $end_date end_date + * + * @return self + */ + public function setEndDate($end_date) + { + if (is_null($end_date)) { + array_push($this->openAPINullablesSetToNull, 'end_date'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('end_date', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['end_date'] = $end_date; + + return $this; + } + + /** + * Gets required_qualification + * + * @return string|null + */ + public function getRequiredQualification() + { + return $this->container['required_qualification']; + } + + /** + * Sets required_qualification + * + * @param string|null $required_qualification required_qualification + * + * @return self + */ + public function setRequiredQualification($required_qualification) + { + if (is_null($required_qualification)) { + array_push($this->openAPINullablesSetToNull, 'required_qualification'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('required_qualification', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['required_qualification'] = $required_qualification; + + return $this; + } + + /** + * Gets shift_type + * + * @return string|null + */ + public function getShiftType() + { + return $this->container['shift_type']; + } + + /** + * Sets shift_type + * + * @param string|null $shift_type shift_type + * + * @return self + */ + public function setShiftType($shift_type) + { + if (is_null($shift_type)) { + array_push($this->openAPINullablesSetToNull, 'shift_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('shift_type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['shift_type'] = $shift_type; + + return $this; + } + + /** + * Gets required_headcount + * + * @return int|null + */ + public function getRequiredHeadcount() + { + return $this->container['required_headcount']; + } + + /** + * Sets required_headcount + * + * @param int|null $required_headcount required_headcount + * + * @return self + */ + public function setRequiredHeadcount($required_headcount) + { + if (is_null($required_headcount)) { + throw new \InvalidArgumentException('non-nullable required_headcount cannot be null'); + } + $this->container['required_headcount'] = $required_headcount; + + return $this; + } + + /** + * Gets conditions + * + * @return string|null + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param string|null $conditions conditions + * + * @return self + */ + public function setConditions($conditions) + { + if (is_null($conditions)) { + array_push($this->openAPINullablesSetToNull, 'conditions'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('conditions', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['conditions'] = $conditions; + + return $this; + } + + /** + * Gets priority + * + * @return string|null + */ + public function getPriority() + { + return $this->container['priority']; + } + + /** + * Sets priority + * + * @param string|null $priority priority + * + * @return self + */ + public function setPriority($priority) + { + if (is_null($priority)) { + array_push($this->openAPINullablesSetToNull, 'priority'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('priority', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['priority'] = $priority; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/CreateRoleRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/CreateRoleRequest.php new file mode 100644 index 0000000..6b8bb94 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/CreateRoleRequest.php @@ -0,0 +1,416 @@ + + */ +class CreateRoleRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateRoleRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/CreateUserRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/CreateUserRequest.php new file mode 100644 index 0000000..f2dea3c --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/CreateUserRequest.php @@ -0,0 +1,607 @@ + + */ +class CreateUserRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateUserRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'employee_id' => 'string', + 'username' => 'string', + 'role_id' => 'string', + 'mode' => 'string', + 'initial_password' => 'string', + 'pin_validity_days' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'employee_id' => 'uuid', + 'username' => null, + 'role_id' => 'uuid', + 'mode' => null, + 'initial_password' => null, + 'pin_validity_days' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'employee_id' => false, + 'username' => true, + 'role_id' => false, + 'mode' => true, + 'initial_password' => true, + 'pin_validity_days' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'employee_id' => 'employeeId', + 'username' => 'username', + 'role_id' => 'roleId', + 'mode' => 'mode', + 'initial_password' => 'initialPassword', + 'pin_validity_days' => 'pinValidityDays' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'employee_id' => 'setEmployeeId', + 'username' => 'setUsername', + 'role_id' => 'setRoleId', + 'mode' => 'setMode', + 'initial_password' => 'setInitialPassword', + 'pin_validity_days' => 'setPinValidityDays' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'employee_id' => 'getEmployeeId', + 'username' => 'getUsername', + 'role_id' => 'getRoleId', + 'mode' => 'getMode', + 'initial_password' => 'getInitialPassword', + 'pin_validity_days' => 'getPinValidityDays' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + $this->setIfExists('role_id', $data ?? [], null); + $this->setIfExists('mode', $data ?? [], null); + $this->setIfExists('initial_password', $data ?? [], null); + $this->setIfExists('pin_validity_days', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets employee_id + * + * @return string|null + */ + public function getEmployeeId() + { + return $this->container['employee_id']; + } + + /** + * Sets employee_id + * + * @param string|null $employee_id employee_id + * + * @return self + */ + public function setEmployeeId($employee_id) + { + if (is_null($employee_id)) { + throw new \InvalidArgumentException('non-nullable employee_id cannot be null'); + } + $this->container['employee_id'] = $employee_id; + + return $this; + } + + /** + * Gets username + * + * @return string|null + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string|null $username username + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + array_push($this->openAPINullablesSetToNull, 'username'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('username', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['username'] = $username; + + return $this; + } + + /** + * Gets role_id + * + * @return string|null + */ + public function getRoleId() + { + return $this->container['role_id']; + } + + /** + * Sets role_id + * + * @param string|null $role_id role_id + * + * @return self + */ + public function setRoleId($role_id) + { + if (is_null($role_id)) { + throw new \InvalidArgumentException('non-nullable role_id cannot be null'); + } + $this->container['role_id'] = $role_id; + + return $this; + } + + /** + * Gets mode + * + * @return string|null + */ + public function getMode() + { + return $this->container['mode']; + } + + /** + * Sets mode + * + * @param string|null $mode mode + * + * @return self + */ + public function setMode($mode) + { + if (is_null($mode)) { + array_push($this->openAPINullablesSetToNull, 'mode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['mode'] = $mode; + + return $this; + } + + /** + * Gets initial_password + * + * @return string|null + */ + public function getInitialPassword() + { + return $this->container['initial_password']; + } + + /** + * Sets initial_password + * + * @param string|null $initial_password initial_password + * + * @return self + */ + public function setInitialPassword($initial_password) + { + if (is_null($initial_password)) { + array_push($this->openAPINullablesSetToNull, 'initial_password'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('initial_password', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['initial_password'] = $initial_password; + + return $this; + } + + /** + * Gets pin_validity_days + * + * @return int|null + */ + public function getPinValidityDays() + { + return $this->container['pin_validity_days']; + } + + /** + * Sets pin_validity_days + * + * @param int|null $pin_validity_days pin_validity_days + * + * @return self + */ + public function setPinValidityDays($pin_validity_days) + { + if (is_null($pin_validity_days)) { + array_push($this->openAPINullablesSetToNull, 'pin_validity_days'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pin_validity_days', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pin_validity_days'] = $pin_validity_days; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/CreateValueListItemRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/CreateValueListItemRequest.php new file mode 100644 index 0000000..4f3abd0 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/CreateValueListItemRequest.php @@ -0,0 +1,552 @@ + + */ +class CreateValueListItemRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'CreateValueListItemRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'value' => 'string', + 'sort_order' => 'int', + 'is_default' => 'bool', + 'is_initial' => 'bool', + 'is_terminal' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null, + 'sort_order' => 'int32', + 'is_default' => null, + 'is_initial' => null, + 'is_terminal' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'value' => true, + 'sort_order' => false, + 'is_default' => false, + 'is_initial' => false, + 'is_terminal' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'sort_order' => 'sortOrder', + 'is_default' => 'isDefault', + 'is_initial' => 'isInitial', + 'is_terminal' => 'isTerminal' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'sort_order' => 'setSortOrder', + 'is_default' => 'setIsDefault', + 'is_initial' => 'setIsInitial', + 'is_terminal' => 'setIsTerminal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'sort_order' => 'getSortOrder', + 'is_default' => 'getIsDefault', + 'is_initial' => 'getIsInitial', + 'is_terminal' => 'getIsTerminal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('sort_order', $data ?? [], null); + $this->setIfExists('is_default', $data ?? [], null); + $this->setIfExists('is_initial', $data ?? [], null); + $this->setIfExists('is_terminal', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value value + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + array_push($this->openAPINullablesSetToNull, 'value'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('value', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets sort_order + * + * @return int|null + */ + public function getSortOrder() + { + return $this->container['sort_order']; + } + + /** + * Sets sort_order + * + * @param int|null $sort_order sort_order + * + * @return self + */ + public function setSortOrder($sort_order) + { + if (is_null($sort_order)) { + throw new \InvalidArgumentException('non-nullable sort_order cannot be null'); + } + $this->container['sort_order'] = $sort_order; + + return $this; + } + + /** + * Gets is_default + * + * @return bool|null + */ + public function getIsDefault() + { + return $this->container['is_default']; + } + + /** + * Sets is_default + * + * @param bool|null $is_default is_default + * + * @return self + */ + public function setIsDefault($is_default) + { + if (is_null($is_default)) { + throw new \InvalidArgumentException('non-nullable is_default cannot be null'); + } + $this->container['is_default'] = $is_default; + + return $this; + } + + /** + * Gets is_initial + * + * @return bool|null + */ + public function getIsInitial() + { + return $this->container['is_initial']; + } + + /** + * Sets is_initial + * + * @param bool|null $is_initial is_initial + * + * @return self + */ + public function setIsInitial($is_initial) + { + if (is_null($is_initial)) { + throw new \InvalidArgumentException('non-nullable is_initial cannot be null'); + } + $this->container['is_initial'] = $is_initial; + + return $this; + } + + /** + * Gets is_terminal + * + * @return bool|null + */ + public function getIsTerminal() + { + return $this->container['is_terminal']; + } + + /** + * Sets is_terminal + * + * @param bool|null $is_terminal is_terminal + * + * @return self + */ + public function setIsTerminal($is_terminal) + { + if (is_null($is_terminal)) { + throw new \InvalidArgumentException('non-nullable is_terminal cannot be null'); + } + $this->container['is_terminal'] = $is_terminal; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/EmployeeResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/EmployeeResponse.php new file mode 100644 index 0000000..d2832fa --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/EmployeeResponse.php @@ -0,0 +1,1147 @@ + + */ +class EmployeeResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'EmployeeResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'first_name' => 'string', + 'last_name' => 'string', + 'status' => 'string', + 'date_of_birth' => '\DateTime', + 'street' => 'string', + 'postal_code' => 'string', + 'city' => 'string', + 'country' => 'string', + 'phone_number' => 'string', + 'email' => 'string', + 'entry_date' => '\DateTime', + 'exit_date' => '\DateTime', + 'emergency_contact_name' => 'string', + 'emergency_contact_phone' => 'string', + 'emergency_contact_relation' => 'string', + 'employment_type' => 'string', + 'qualification' => 'string', + 'avatar_file_name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'uuid', + 'first_name' => null, + 'last_name' => null, + 'status' => null, + 'date_of_birth' => 'date', + 'street' => null, + 'postal_code' => null, + 'city' => null, + 'country' => null, + 'phone_number' => null, + 'email' => null, + 'entry_date' => 'date', + 'exit_date' => 'date', + 'emergency_contact_name' => null, + 'emergency_contact_phone' => null, + 'emergency_contact_relation' => null, + 'employment_type' => null, + 'qualification' => null, + 'avatar_file_name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'first_name' => true, + 'last_name' => true, + 'status' => true, + 'date_of_birth' => true, + 'street' => true, + 'postal_code' => true, + 'city' => true, + 'country' => true, + 'phone_number' => true, + 'email' => true, + 'entry_date' => true, + 'exit_date' => true, + 'emergency_contact_name' => true, + 'emergency_contact_phone' => true, + 'emergency_contact_relation' => true, + 'employment_type' => true, + 'qualification' => true, + 'avatar_file_name' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'first_name' => 'firstName', + 'last_name' => 'lastName', + 'status' => 'status', + 'date_of_birth' => 'dateOfBirth', + 'street' => 'street', + 'postal_code' => 'postalCode', + 'city' => 'city', + 'country' => 'country', + 'phone_number' => 'phoneNumber', + 'email' => 'email', + 'entry_date' => 'entryDate', + 'exit_date' => 'exitDate', + 'emergency_contact_name' => 'emergencyContactName', + 'emergency_contact_phone' => 'emergencyContactPhone', + 'emergency_contact_relation' => 'emergencyContactRelation', + 'employment_type' => 'employmentType', + 'qualification' => 'qualification', + 'avatar_file_name' => 'avatarFileName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName', + 'status' => 'setStatus', + 'date_of_birth' => 'setDateOfBirth', + 'street' => 'setStreet', + 'postal_code' => 'setPostalCode', + 'city' => 'setCity', + 'country' => 'setCountry', + 'phone_number' => 'setPhoneNumber', + 'email' => 'setEmail', + 'entry_date' => 'setEntryDate', + 'exit_date' => 'setExitDate', + 'emergency_contact_name' => 'setEmergencyContactName', + 'emergency_contact_phone' => 'setEmergencyContactPhone', + 'emergency_contact_relation' => 'setEmergencyContactRelation', + 'employment_type' => 'setEmploymentType', + 'qualification' => 'setQualification', + 'avatar_file_name' => 'setAvatarFileName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName', + 'status' => 'getStatus', + 'date_of_birth' => 'getDateOfBirth', + 'street' => 'getStreet', + 'postal_code' => 'getPostalCode', + 'city' => 'getCity', + 'country' => 'getCountry', + 'phone_number' => 'getPhoneNumber', + 'email' => 'getEmail', + 'entry_date' => 'getEntryDate', + 'exit_date' => 'getExitDate', + 'emergency_contact_name' => 'getEmergencyContactName', + 'emergency_contact_phone' => 'getEmergencyContactPhone', + 'emergency_contact_relation' => 'getEmergencyContactRelation', + 'employment_type' => 'getEmploymentType', + 'qualification' => 'getQualification', + 'avatar_file_name' => 'getAvatarFileName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('date_of_birth', $data ?? [], null); + $this->setIfExists('street', $data ?? [], null); + $this->setIfExists('postal_code', $data ?? [], null); + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('entry_date', $data ?? [], null); + $this->setIfExists('exit_date', $data ?? [], null); + $this->setIfExists('emergency_contact_name', $data ?? [], null); + $this->setIfExists('emergency_contact_phone', $data ?? [], null); + $this->setIfExists('emergency_contact_relation', $data ?? [], null); + $this->setIfExists('employment_type', $data ?? [], null); + $this->setIfExists('qualification', $data ?? [], null); + $this->setIfExists('avatar_file_name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets first_name + * + * @return string|null + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string|null $first_name first_name + * + * @return self + */ + public function setFirstName($first_name) + { + if (is_null($first_name)) { + array_push($this->openAPINullablesSetToNull, 'first_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('first_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string|null + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string|null $last_name last_name + * + * @return self + */ + public function setLastName($last_name) + { + if (is_null($last_name)) { + array_push($this->openAPINullablesSetToNull, 'last_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('last_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['last_name'] = $last_name; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + array_push($this->openAPINullablesSetToNull, 'status'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('status', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets date_of_birth + * + * @return \DateTime|null + */ + public function getDateOfBirth() + { + return $this->container['date_of_birth']; + } + + /** + * Sets date_of_birth + * + * @param \DateTime|null $date_of_birth date_of_birth + * + * @return self + */ + public function setDateOfBirth($date_of_birth) + { + if (is_null($date_of_birth)) { + array_push($this->openAPINullablesSetToNull, 'date_of_birth'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('date_of_birth', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['date_of_birth'] = $date_of_birth; + + return $this; + } + + /** + * Gets street + * + * @return string|null + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string|null $street street + * + * @return self + */ + public function setStreet($street) + { + if (is_null($street)) { + array_push($this->openAPINullablesSetToNull, 'street'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('street', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['street'] = $street; + + return $this; + } + + /** + * Gets postal_code + * + * @return string|null + */ + public function getPostalCode() + { + return $this->container['postal_code']; + } + + /** + * Sets postal_code + * + * @param string|null $postal_code postal_code + * + * @return self + */ + public function setPostalCode($postal_code) + { + if (is_null($postal_code)) { + array_push($this->openAPINullablesSetToNull, 'postal_code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('postal_code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['postal_code'] = $postal_code; + + return $this; + } + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city city + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + array_push($this->openAPINullablesSetToNull, 'city'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('city', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country country + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + array_push($this->openAPINullablesSetToNull, 'country'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('country', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets phone_number + * + * @return string|null + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string|null $phone_number phone_number + * + * @return self + */ + public function setPhoneNumber($phone_number) + { + if (is_null($phone_number)) { + array_push($this->openAPINullablesSetToNull, 'phone_number'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('phone_number', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['phone_number'] = $phone_number; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email email + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets entry_date + * + * @return \DateTime|null + */ + public function getEntryDate() + { + return $this->container['entry_date']; + } + + /** + * Sets entry_date + * + * @param \DateTime|null $entry_date entry_date + * + * @return self + */ + public function setEntryDate($entry_date) + { + if (is_null($entry_date)) { + array_push($this->openAPINullablesSetToNull, 'entry_date'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('entry_date', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['entry_date'] = $entry_date; + + return $this; + } + + /** + * Gets exit_date + * + * @return \DateTime|null + */ + public function getExitDate() + { + return $this->container['exit_date']; + } + + /** + * Sets exit_date + * + * @param \DateTime|null $exit_date exit_date + * + * @return self + */ + public function setExitDate($exit_date) + { + if (is_null($exit_date)) { + array_push($this->openAPINullablesSetToNull, 'exit_date'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('exit_date', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['exit_date'] = $exit_date; + + return $this; + } + + /** + * Gets emergency_contact_name + * + * @return string|null + */ + public function getEmergencyContactName() + { + return $this->container['emergency_contact_name']; + } + + /** + * Sets emergency_contact_name + * + * @param string|null $emergency_contact_name emergency_contact_name + * + * @return self + */ + public function setEmergencyContactName($emergency_contact_name) + { + if (is_null($emergency_contact_name)) { + array_push($this->openAPINullablesSetToNull, 'emergency_contact_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('emergency_contact_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['emergency_contact_name'] = $emergency_contact_name; + + return $this; + } + + /** + * Gets emergency_contact_phone + * + * @return string|null + */ + public function getEmergencyContactPhone() + { + return $this->container['emergency_contact_phone']; + } + + /** + * Sets emergency_contact_phone + * + * @param string|null $emergency_contact_phone emergency_contact_phone + * + * @return self + */ + public function setEmergencyContactPhone($emergency_contact_phone) + { + if (is_null($emergency_contact_phone)) { + array_push($this->openAPINullablesSetToNull, 'emergency_contact_phone'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('emergency_contact_phone', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['emergency_contact_phone'] = $emergency_contact_phone; + + return $this; + } + + /** + * Gets emergency_contact_relation + * + * @return string|null + */ + public function getEmergencyContactRelation() + { + return $this->container['emergency_contact_relation']; + } + + /** + * Sets emergency_contact_relation + * + * @param string|null $emergency_contact_relation emergency_contact_relation + * + * @return self + */ + public function setEmergencyContactRelation($emergency_contact_relation) + { + if (is_null($emergency_contact_relation)) { + array_push($this->openAPINullablesSetToNull, 'emergency_contact_relation'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('emergency_contact_relation', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['emergency_contact_relation'] = $emergency_contact_relation; + + return $this; + } + + /** + * Gets employment_type + * + * @return string|null + */ + public function getEmploymentType() + { + return $this->container['employment_type']; + } + + /** + * Sets employment_type + * + * @param string|null $employment_type employment_type + * + * @return self + */ + public function setEmploymentType($employment_type) + { + if (is_null($employment_type)) { + array_push($this->openAPINullablesSetToNull, 'employment_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employment_type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employment_type'] = $employment_type; + + return $this; + } + + /** + * Gets qualification + * + * @return string|null + */ + public function getQualification() + { + return $this->container['qualification']; + } + + /** + * Sets qualification + * + * @param string|null $qualification qualification + * + * @return self + */ + public function setQualification($qualification) + { + if (is_null($qualification)) { + array_push($this->openAPINullablesSetToNull, 'qualification'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('qualification', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['qualification'] = $qualification; + + return $this; + } + + /** + * Gets avatar_file_name + * + * @return string|null + */ + public function getAvatarFileName() + { + return $this->container['avatar_file_name']; + } + + /** + * Sets avatar_file_name + * + * @param string|null $avatar_file_name avatar_file_name + * + * @return self + */ + public function setAvatarFileName($avatar_file_name) + { + if (is_null($avatar_file_name)) { + array_push($this->openAPINullablesSetToNull, 'avatar_file_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('avatar_file_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['avatar_file_name'] = $avatar_file_name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/EmployeeResponsePagedResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/EmployeeResponsePagedResponse.php new file mode 100644 index 0000000..6ed29f0 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/EmployeeResponsePagedResponse.php @@ -0,0 +1,518 @@ + + */ +class EmployeeResponsePagedResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'EmployeeResponsePagedResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'items' => '\OmsorgCoreClient\Model\EmployeeResponse[]', + 'total_count' => 'int', + 'page' => 'int', + 'page_size' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'items' => null, + 'total_count' => 'int32', + 'page' => 'int32', + 'page_size' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'items' => true, + 'total_count' => false, + 'page' => false, + 'page_size' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'items' => 'items', + 'total_count' => 'totalCount', + 'page' => 'page', + 'page_size' => 'pageSize' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'items' => 'setItems', + 'total_count' => 'setTotalCount', + 'page' => 'setPage', + 'page_size' => 'setPageSize' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'items' => 'getItems', + 'total_count' => 'getTotalCount', + 'page' => 'getPage', + 'page_size' => 'getPageSize' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('items', $data ?? [], null); + $this->setIfExists('total_count', $data ?? [], null); + $this->setIfExists('page', $data ?? [], null); + $this->setIfExists('page_size', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets items + * + * @return \OmsorgCoreClient\Model\EmployeeResponse[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \OmsorgCoreClient\Model\EmployeeResponse[]|null $items items + * + * @return self + */ + public function setItems($items) + { + if (is_null($items)) { + array_push($this->openAPINullablesSetToNull, 'items'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('items', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets total_count + * + * @return int|null + */ + public function getTotalCount() + { + return $this->container['total_count']; + } + + /** + * Sets total_count + * + * @param int|null $total_count total_count + * + * @return self + */ + public function setTotalCount($total_count) + { + if (is_null($total_count)) { + throw new \InvalidArgumentException('non-nullable total_count cannot be null'); + } + $this->container['total_count'] = $total_count; + + return $this; + } + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int|null $page page + * + * @return self + */ + public function setPage($page) + { + if (is_null($page)) { + throw new \InvalidArgumentException('non-nullable page cannot be null'); + } + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets page_size + * + * @return int|null + */ + public function getPageSize() + { + return $this->container['page_size']; + } + + /** + * Sets page_size + * + * @param int|null $page_size page_size + * + * @return self + */ + public function setPageSize($page_size) + { + if (is_null($page_size)) { + throw new \InvalidArgumentException('non-nullable page_size cannot be null'); + } + $this->container['page_size'] = $page_size; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/FacilityContactResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/FacilityContactResponse.php new file mode 100644 index 0000000..fa35723 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/FacilityContactResponse.php @@ -0,0 +1,689 @@ + + */ +class FacilityContactResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FacilityContactResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'facility_id' => 'string', + 'name' => 'string', + 'role' => 'string', + 'department' => 'string', + 'phone_number' => 'string', + 'email' => 'string', + 'notes' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'uuid', + 'facility_id' => 'uuid', + 'name' => null, + 'role' => null, + 'department' => null, + 'phone_number' => null, + 'email' => null, + 'notes' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'facility_id' => false, + 'name' => true, + 'role' => true, + 'department' => true, + 'phone_number' => true, + 'email' => true, + 'notes' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'facility_id' => 'facilityId', + 'name' => 'name', + 'role' => 'role', + 'department' => 'department', + 'phone_number' => 'phoneNumber', + 'email' => 'email', + 'notes' => 'notes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'facility_id' => 'setFacilityId', + 'name' => 'setName', + 'role' => 'setRole', + 'department' => 'setDepartment', + 'phone_number' => 'setPhoneNumber', + 'email' => 'setEmail', + 'notes' => 'setNotes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'facility_id' => 'getFacilityId', + 'name' => 'getName', + 'role' => 'getRole', + 'department' => 'getDepartment', + 'phone_number' => 'getPhoneNumber', + 'email' => 'getEmail', + 'notes' => 'getNotes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('facility_id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('role', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('notes', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets facility_id + * + * @return string|null + */ + public function getFacilityId() + { + return $this->container['facility_id']; + } + + /** + * Sets facility_id + * + * @param string|null $facility_id facility_id + * + * @return self + */ + public function setFacilityId($facility_id) + { + if (is_null($facility_id)) { + throw new \InvalidArgumentException('non-nullable facility_id cannot be null'); + } + $this->container['facility_id'] = $facility_id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets role + * + * @return string|null + */ + public function getRole() + { + return $this->container['role']; + } + + /** + * Sets role + * + * @param string|null $role role + * + * @return self + */ + public function setRole($role) + { + if (is_null($role)) { + array_push($this->openAPINullablesSetToNull, 'role'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('role', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['role'] = $role; + + return $this; + } + + /** + * Gets department + * + * @return string|null + */ + public function getDepartment() + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param string|null $department department + * + * @return self + */ + public function setDepartment($department) + { + if (is_null($department)) { + array_push($this->openAPINullablesSetToNull, 'department'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('department', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['department'] = $department; + + return $this; + } + + /** + * Gets phone_number + * + * @return string|null + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string|null $phone_number phone_number + * + * @return self + */ + public function setPhoneNumber($phone_number) + { + if (is_null($phone_number)) { + array_push($this->openAPINullablesSetToNull, 'phone_number'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('phone_number', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['phone_number'] = $phone_number; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email email + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets notes + * + * @return string|null + */ + public function getNotes() + { + return $this->container['notes']; + } + + /** + * Sets notes + * + * @param string|null $notes notes + * + * @return self + */ + public function setNotes($notes) + { + if (is_null($notes)) { + array_push($this->openAPINullablesSetToNull, 'notes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('notes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['notes'] = $notes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/FacilityResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/FacilityResponse.php new file mode 100644 index 0000000..2ce62db --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/FacilityResponse.php @@ -0,0 +1,860 @@ + + */ +class FacilityResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FacilityResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'crm_status' => 'string', + 'facility_type' => 'string', + 'street' => 'string', + 'postal_code' => 'string', + 'city' => 'string', + 'country' => 'string', + 'billing_street' => 'string', + 'billing_postal_code' => 'string', + 'billing_city' => 'string', + 'billing_country' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'uuid', + 'name' => null, + 'crm_status' => null, + 'facility_type' => null, + 'street' => null, + 'postal_code' => null, + 'city' => null, + 'country' => null, + 'billing_street' => null, + 'billing_postal_code' => null, + 'billing_city' => null, + 'billing_country' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => true, + 'crm_status' => true, + 'facility_type' => true, + 'street' => true, + 'postal_code' => true, + 'city' => true, + 'country' => true, + 'billing_street' => true, + 'billing_postal_code' => true, + 'billing_city' => true, + 'billing_country' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'crm_status' => 'crmStatus', + 'facility_type' => 'facilityType', + 'street' => 'street', + 'postal_code' => 'postalCode', + 'city' => 'city', + 'country' => 'country', + 'billing_street' => 'billingStreet', + 'billing_postal_code' => 'billingPostalCode', + 'billing_city' => 'billingCity', + 'billing_country' => 'billingCountry' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'crm_status' => 'setCrmStatus', + 'facility_type' => 'setFacilityType', + 'street' => 'setStreet', + 'postal_code' => 'setPostalCode', + 'city' => 'setCity', + 'country' => 'setCountry', + 'billing_street' => 'setBillingStreet', + 'billing_postal_code' => 'setBillingPostalCode', + 'billing_city' => 'setBillingCity', + 'billing_country' => 'setBillingCountry' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'crm_status' => 'getCrmStatus', + 'facility_type' => 'getFacilityType', + 'street' => 'getStreet', + 'postal_code' => 'getPostalCode', + 'city' => 'getCity', + 'country' => 'getCountry', + 'billing_street' => 'getBillingStreet', + 'billing_postal_code' => 'getBillingPostalCode', + 'billing_city' => 'getBillingCity', + 'billing_country' => 'getBillingCountry' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('crm_status', $data ?? [], null); + $this->setIfExists('facility_type', $data ?? [], null); + $this->setIfExists('street', $data ?? [], null); + $this->setIfExists('postal_code', $data ?? [], null); + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('billing_street', $data ?? [], null); + $this->setIfExists('billing_postal_code', $data ?? [], null); + $this->setIfExists('billing_city', $data ?? [], null); + $this->setIfExists('billing_country', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets crm_status + * + * @return string|null + */ + public function getCrmStatus() + { + return $this->container['crm_status']; + } + + /** + * Sets crm_status + * + * @param string|null $crm_status crm_status + * + * @return self + */ + public function setCrmStatus($crm_status) + { + if (is_null($crm_status)) { + array_push($this->openAPINullablesSetToNull, 'crm_status'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('crm_status', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['crm_status'] = $crm_status; + + return $this; + } + + /** + * Gets facility_type + * + * @return string|null + */ + public function getFacilityType() + { + return $this->container['facility_type']; + } + + /** + * Sets facility_type + * + * @param string|null $facility_type facility_type + * + * @return self + */ + public function setFacilityType($facility_type) + { + if (is_null($facility_type)) { + array_push($this->openAPINullablesSetToNull, 'facility_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('facility_type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['facility_type'] = $facility_type; + + return $this; + } + + /** + * Gets street + * + * @return string|null + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string|null $street street + * + * @return self + */ + public function setStreet($street) + { + if (is_null($street)) { + array_push($this->openAPINullablesSetToNull, 'street'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('street', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['street'] = $street; + + return $this; + } + + /** + * Gets postal_code + * + * @return string|null + */ + public function getPostalCode() + { + return $this->container['postal_code']; + } + + /** + * Sets postal_code + * + * @param string|null $postal_code postal_code + * + * @return self + */ + public function setPostalCode($postal_code) + { + if (is_null($postal_code)) { + array_push($this->openAPINullablesSetToNull, 'postal_code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('postal_code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['postal_code'] = $postal_code; + + return $this; + } + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city city + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + array_push($this->openAPINullablesSetToNull, 'city'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('city', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country country + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + array_push($this->openAPINullablesSetToNull, 'country'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('country', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets billing_street + * + * @return string|null + */ + public function getBillingStreet() + { + return $this->container['billing_street']; + } + + /** + * Sets billing_street + * + * @param string|null $billing_street billing_street + * + * @return self + */ + public function setBillingStreet($billing_street) + { + if (is_null($billing_street)) { + array_push($this->openAPINullablesSetToNull, 'billing_street'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('billing_street', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['billing_street'] = $billing_street; + + return $this; + } + + /** + * Gets billing_postal_code + * + * @return string|null + */ + public function getBillingPostalCode() + { + return $this->container['billing_postal_code']; + } + + /** + * Sets billing_postal_code + * + * @param string|null $billing_postal_code billing_postal_code + * + * @return self + */ + public function setBillingPostalCode($billing_postal_code) + { + if (is_null($billing_postal_code)) { + array_push($this->openAPINullablesSetToNull, 'billing_postal_code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('billing_postal_code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['billing_postal_code'] = $billing_postal_code; + + return $this; + } + + /** + * Gets billing_city + * + * @return string|null + */ + public function getBillingCity() + { + return $this->container['billing_city']; + } + + /** + * Sets billing_city + * + * @param string|null $billing_city billing_city + * + * @return self + */ + public function setBillingCity($billing_city) + { + if (is_null($billing_city)) { + array_push($this->openAPINullablesSetToNull, 'billing_city'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('billing_city', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['billing_city'] = $billing_city; + + return $this; + } + + /** + * Gets billing_country + * + * @return string|null + */ + public function getBillingCountry() + { + return $this->container['billing_country']; + } + + /** + * Sets billing_country + * + * @param string|null $billing_country billing_country + * + * @return self + */ + public function setBillingCountry($billing_country) + { + if (is_null($billing_country)) { + array_push($this->openAPINullablesSetToNull, 'billing_country'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('billing_country', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['billing_country'] = $billing_country; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/FacilityResponsePagedResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/FacilityResponsePagedResponse.php new file mode 100644 index 0000000..fd9b1be --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/FacilityResponsePagedResponse.php @@ -0,0 +1,518 @@ + + */ +class FacilityResponsePagedResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'FacilityResponsePagedResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'items' => '\OmsorgCoreClient\Model\FacilityResponse[]', + 'total_count' => 'int', + 'page' => 'int', + 'page_size' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'items' => null, + 'total_count' => 'int32', + 'page' => 'int32', + 'page_size' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'items' => true, + 'total_count' => false, + 'page' => false, + 'page_size' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'items' => 'items', + 'total_count' => 'totalCount', + 'page' => 'page', + 'page_size' => 'pageSize' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'items' => 'setItems', + 'total_count' => 'setTotalCount', + 'page' => 'setPage', + 'page_size' => 'setPageSize' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'items' => 'getItems', + 'total_count' => 'getTotalCount', + 'page' => 'getPage', + 'page_size' => 'getPageSize' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('items', $data ?? [], null); + $this->setIfExists('total_count', $data ?? [], null); + $this->setIfExists('page', $data ?? [], null); + $this->setIfExists('page_size', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets items + * + * @return \OmsorgCoreClient\Model\FacilityResponse[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \OmsorgCoreClient\Model\FacilityResponse[]|null $items items + * + * @return self + */ + public function setItems($items) + { + if (is_null($items)) { + array_push($this->openAPINullablesSetToNull, 'items'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('items', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets total_count + * + * @return int|null + */ + public function getTotalCount() + { + return $this->container['total_count']; + } + + /** + * Sets total_count + * + * @param int|null $total_count total_count + * + * @return self + */ + public function setTotalCount($total_count) + { + if (is_null($total_count)) { + throw new \InvalidArgumentException('non-nullable total_count cannot be null'); + } + $this->container['total_count'] = $total_count; + + return $this; + } + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int|null $page page + * + * @return self + */ + public function setPage($page) + { + if (is_null($page)) { + throw new \InvalidArgumentException('non-nullable page cannot be null'); + } + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets page_size + * + * @return int|null + */ + public function getPageSize() + { + return $this->container['page_size']; + } + + /** + * Sets page_size + * + * @param int|null $page_size page_size + * + * @return self + */ + public function setPageSize($page_size) + { + if (is_null($page_size)) { + throw new \InvalidArgumentException('non-nullable page_size cannot be null'); + } + $this->container['page_size'] = $page_size; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ForgotPasswordRequestRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ForgotPasswordRequestRequest.php new file mode 100644 index 0000000..ca9695a --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ForgotPasswordRequestRequest.php @@ -0,0 +1,416 @@ + + */ +class ForgotPasswordRequestRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ForgotPasswordRequestRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'username' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'username' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'username' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'username' => 'username' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'username' => 'setUsername' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'username' => 'getUsername' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('username', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets username + * + * @return string|null + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string|null $username username + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + array_push($this->openAPINullablesSetToNull, 'username'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('username', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['username'] = $username; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ForgotPasswordRequestResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ForgotPasswordRequestResponse.php new file mode 100644 index 0000000..7553f93 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ForgotPasswordRequestResponse.php @@ -0,0 +1,416 @@ + + */ +class ForgotPasswordRequestResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ForgotPasswordRequestResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'status' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'status' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'status' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'status' => 'status' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'status' => 'setStatus' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'status' => 'getStatus' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('status', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + array_push($this->openAPINullablesSetToNull, 'status'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('status', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['status'] = $status; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ForgotPasswordResetRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ForgotPasswordResetRequest.php new file mode 100644 index 0000000..6658873 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ForgotPasswordResetRequest.php @@ -0,0 +1,457 @@ + + */ +class ForgotPasswordResetRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ForgotPasswordResetRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'reset_token' => 'string', + 'new_password' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'reset_token' => null, + 'new_password' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'reset_token' => true, + 'new_password' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'reset_token' => 'resetToken', + 'new_password' => 'newPassword' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'reset_token' => 'setResetToken', + 'new_password' => 'setNewPassword' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'reset_token' => 'getResetToken', + 'new_password' => 'getNewPassword' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('reset_token', $data ?? [], null); + $this->setIfExists('new_password', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets reset_token + * + * @return string|null + */ + public function getResetToken() + { + return $this->container['reset_token']; + } + + /** + * Sets reset_token + * + * @param string|null $reset_token reset_token + * + * @return self + */ + public function setResetToken($reset_token) + { + if (is_null($reset_token)) { + array_push($this->openAPINullablesSetToNull, 'reset_token'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('reset_token', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['reset_token'] = $reset_token; + + return $this; + } + + /** + * Gets new_password + * + * @return string|null + */ + public function getNewPassword() + { + return $this->container['new_password']; + } + + /** + * Sets new_password + * + * @param string|null $new_password new_password + * + * @return self + */ + public function setNewPassword($new_password) + { + if (is_null($new_password)) { + array_push($this->openAPINullablesSetToNull, 'new_password'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('new_password', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['new_password'] = $new_password; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ForgotPasswordVerifyRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ForgotPasswordVerifyRequest.php new file mode 100644 index 0000000..88c127a --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ForgotPasswordVerifyRequest.php @@ -0,0 +1,457 @@ + + */ +class ForgotPasswordVerifyRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ForgotPasswordVerifyRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'username' => 'string', + 'pin' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'username' => null, + 'pin' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'username' => true, + 'pin' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'username' => 'username', + 'pin' => 'pin' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'username' => 'setUsername', + 'pin' => 'setPin' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'username' => 'getUsername', + 'pin' => 'getPin' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('username', $data ?? [], null); + $this->setIfExists('pin', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets username + * + * @return string|null + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string|null $username username + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + array_push($this->openAPINullablesSetToNull, 'username'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('username', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['username'] = $username; + + return $this; + } + + /** + * Gets pin + * + * @return string|null + */ + public function getPin() + { + return $this->container['pin']; + } + + /** + * Sets pin + * + * @param string|null $pin pin + * + * @return self + */ + public function setPin($pin) + { + if (is_null($pin)) { + array_push($this->openAPINullablesSetToNull, 'pin'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pin', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pin'] = $pin; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ForgotPasswordVerifyResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ForgotPasswordVerifyResponse.php new file mode 100644 index 0000000..5a2d78a --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ForgotPasswordVerifyResponse.php @@ -0,0 +1,416 @@ + + */ +class ForgotPasswordVerifyResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ForgotPasswordVerifyResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'reset_token' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'reset_token' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'reset_token' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'reset_token' => 'resetToken' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'reset_token' => 'setResetToken' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'reset_token' => 'getResetToken' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('reset_token', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets reset_token + * + * @return string|null + */ + public function getResetToken() + { + return $this->container['reset_token']; + } + + /** + * Sets reset_token + * + * @param string|null $reset_token reset_token + * + * @return self + */ + public function setResetToken($reset_token) + { + if (is_null($reset_token)) { + array_push($this->openAPINullablesSetToNull, 'reset_token'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('reset_token', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['reset_token'] = $reset_token; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/LoginRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/LoginRequest.php new file mode 100644 index 0000000..631f210 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/LoginRequest.php @@ -0,0 +1,457 @@ + + */ +class LoginRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LoginRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'username' => 'string', + 'password' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'username' => null, + 'password' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'username' => true, + 'password' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'username' => 'username', + 'password' => 'password' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'username' => 'setUsername', + 'password' => 'setPassword' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'username' => 'getUsername', + 'password' => 'getPassword' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('username', $data ?? [], null); + $this->setIfExists('password', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets username + * + * @return string|null + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string|null $username username + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + array_push($this->openAPINullablesSetToNull, 'username'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('username', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['username'] = $username; + + return $this; + } + + /** + * Gets password + * + * @return string|null + */ + public function getPassword() + { + return $this->container['password']; + } + + /** + * Sets password + * + * @param string|null $password password + * + * @return self + */ + public function setPassword($password) + { + if (is_null($password)) { + array_push($this->openAPINullablesSetToNull, 'password'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('password', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['password'] = $password; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/LoginResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/LoginResponse.php new file mode 100644 index 0000000..7501ff5 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/LoginResponse.php @@ -0,0 +1,525 @@ + + */ +class LoginResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LoginResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'access_token' => 'string', + 'refresh_token' => 'string', + 'expires_at' => '\DateTime', + 'must_change_password' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'access_token' => null, + 'refresh_token' => null, + 'expires_at' => 'date-time', + 'must_change_password' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'access_token' => true, + 'refresh_token' => true, + 'expires_at' => false, + 'must_change_password' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'access_token' => 'accessToken', + 'refresh_token' => 'refreshToken', + 'expires_at' => 'expiresAt', + 'must_change_password' => 'mustChangePassword' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'access_token' => 'setAccessToken', + 'refresh_token' => 'setRefreshToken', + 'expires_at' => 'setExpiresAt', + 'must_change_password' => 'setMustChangePassword' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'access_token' => 'getAccessToken', + 'refresh_token' => 'getRefreshToken', + 'expires_at' => 'getExpiresAt', + 'must_change_password' => 'getMustChangePassword' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('access_token', $data ?? [], null); + $this->setIfExists('refresh_token', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); + $this->setIfExists('must_change_password', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets access_token + * + * @return string|null + */ + public function getAccessToken() + { + return $this->container['access_token']; + } + + /** + * Sets access_token + * + * @param string|null $access_token access_token + * + * @return self + */ + public function setAccessToken($access_token) + { + if (is_null($access_token)) { + array_push($this->openAPINullablesSetToNull, 'access_token'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('access_token', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['access_token'] = $access_token; + + return $this; + } + + /** + * Gets refresh_token + * + * @return string|null + */ + public function getRefreshToken() + { + return $this->container['refresh_token']; + } + + /** + * Sets refresh_token + * + * @param string|null $refresh_token refresh_token + * + * @return self + */ + public function setRefreshToken($refresh_token) + { + if (is_null($refresh_token)) { + array_push($this->openAPINullablesSetToNull, 'refresh_token'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('refresh_token', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['refresh_token'] = $refresh_token; + + return $this; + } + + /** + * Gets expires_at + * + * @return \DateTime|null + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * + * @param \DateTime|null $expires_at expires_at + * + * @return self + */ + public function setExpiresAt($expires_at) + { + if (is_null($expires_at)) { + throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); + } + $this->container['expires_at'] = $expires_at; + + return $this; + } + + /** + * Gets must_change_password + * + * @return bool|null + */ + public function getMustChangePassword() + { + return $this->container['must_change_password']; + } + + /** + * Sets must_change_password + * + * @param bool|null $must_change_password must_change_password + * + * @return self + */ + public function setMustChangePassword($must_change_password) + { + if (is_null($must_change_password)) { + throw new \InvalidArgumentException('non-nullable must_change_password cannot be null'); + } + $this->container['must_change_password'] = $must_change_password; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/LogoutRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/LogoutRequest.php new file mode 100644 index 0000000..38d5017 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/LogoutRequest.php @@ -0,0 +1,416 @@ + + */ +class LogoutRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'LogoutRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'refresh_token' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'refresh_token' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'refresh_token' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'refresh_token' => 'refreshToken' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'refresh_token' => 'setRefreshToken' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'refresh_token' => 'getRefreshToken' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('refresh_token', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets refresh_token + * + * @return string|null + */ + public function getRefreshToken() + { + return $this->container['refresh_token']; + } + + /** + * Sets refresh_token + * + * @param string|null $refresh_token refresh_token + * + * @return self + */ + public function setRefreshToken($refresh_token) + { + if (is_null($refresh_token)) { + array_push($this->openAPINullablesSetToNull, 'refresh_token'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('refresh_token', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['refresh_token'] = $refresh_token; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/MeResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/MeResponse.php new file mode 100644 index 0000000..85737d3 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/MeResponse.php @@ -0,0 +1,778 @@ + + */ +class MeResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'MeResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'user_id' => 'string', + 'username' => 'string', + 'role' => 'string', + 'permissions' => '\OmsorgCoreClient\Model\PermissionDto[]', + 'employee_id' => 'string', + 'first_name' => 'string', + 'last_name' => 'string', + 'email' => 'string', + 'phone_number' => 'string', + 'avatar_file_name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'user_id' => 'uuid', + 'username' => null, + 'role' => null, + 'permissions' => null, + 'employee_id' => 'uuid', + 'first_name' => null, + 'last_name' => null, + 'email' => null, + 'phone_number' => null, + 'avatar_file_name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'user_id' => false, + 'username' => true, + 'role' => true, + 'permissions' => true, + 'employee_id' => true, + 'first_name' => true, + 'last_name' => true, + 'email' => true, + 'phone_number' => true, + 'avatar_file_name' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'user_id' => 'userId', + 'username' => 'username', + 'role' => 'role', + 'permissions' => 'permissions', + 'employee_id' => 'employeeId', + 'first_name' => 'firstName', + 'last_name' => 'lastName', + 'email' => 'email', + 'phone_number' => 'phoneNumber', + 'avatar_file_name' => 'avatarFileName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'user_id' => 'setUserId', + 'username' => 'setUsername', + 'role' => 'setRole', + 'permissions' => 'setPermissions', + 'employee_id' => 'setEmployeeId', + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName', + 'email' => 'setEmail', + 'phone_number' => 'setPhoneNumber', + 'avatar_file_name' => 'setAvatarFileName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'user_id' => 'getUserId', + 'username' => 'getUsername', + 'role' => 'getRole', + 'permissions' => 'getPermissions', + 'employee_id' => 'getEmployeeId', + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName', + 'email' => 'getEmail', + 'phone_number' => 'getPhoneNumber', + 'avatar_file_name' => 'getAvatarFileName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('user_id', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + $this->setIfExists('role', $data ?? [], null); + $this->setIfExists('permissions', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('avatar_file_name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets user_id + * + * @return string|null + */ + public function getUserId() + { + return $this->container['user_id']; + } + + /** + * Sets user_id + * + * @param string|null $user_id user_id + * + * @return self + */ + public function setUserId($user_id) + { + if (is_null($user_id)) { + throw new \InvalidArgumentException('non-nullable user_id cannot be null'); + } + $this->container['user_id'] = $user_id; + + return $this; + } + + /** + * Gets username + * + * @return string|null + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string|null $username username + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + array_push($this->openAPINullablesSetToNull, 'username'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('username', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['username'] = $username; + + return $this; + } + + /** + * Gets role + * + * @return string|null + */ + public function getRole() + { + return $this->container['role']; + } + + /** + * Sets role + * + * @param string|null $role role + * + * @return self + */ + public function setRole($role) + { + if (is_null($role)) { + array_push($this->openAPINullablesSetToNull, 'role'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('role', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['role'] = $role; + + return $this; + } + + /** + * Gets permissions + * + * @return \OmsorgCoreClient\Model\PermissionDto[]|null + */ + public function getPermissions() + { + return $this->container['permissions']; + } + + /** + * Sets permissions + * + * @param \OmsorgCoreClient\Model\PermissionDto[]|null $permissions permissions + * + * @return self + */ + public function setPermissions($permissions) + { + if (is_null($permissions)) { + array_push($this->openAPINullablesSetToNull, 'permissions'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('permissions', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['permissions'] = $permissions; + + return $this; + } + + /** + * Gets employee_id + * + * @return string|null + */ + public function getEmployeeId() + { + return $this->container['employee_id']; + } + + /** + * Sets employee_id + * + * @param string|null $employee_id employee_id + * + * @return self + */ + public function setEmployeeId($employee_id) + { + if (is_null($employee_id)) { + array_push($this->openAPINullablesSetToNull, 'employee_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employee_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employee_id'] = $employee_id; + + return $this; + } + + /** + * Gets first_name + * + * @return string|null + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string|null $first_name first_name + * + * @return self + */ + public function setFirstName($first_name) + { + if (is_null($first_name)) { + array_push($this->openAPINullablesSetToNull, 'first_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('first_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string|null + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string|null $last_name last_name + * + * @return self + */ + public function setLastName($last_name) + { + if (is_null($last_name)) { + array_push($this->openAPINullablesSetToNull, 'last_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('last_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['last_name'] = $last_name; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email email + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets phone_number + * + * @return string|null + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string|null $phone_number phone_number + * + * @return self + */ + public function setPhoneNumber($phone_number) + { + if (is_null($phone_number)) { + array_push($this->openAPINullablesSetToNull, 'phone_number'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('phone_number', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['phone_number'] = $phone_number; + + return $this; + } + + /** + * Gets avatar_file_name + * + * @return string|null + */ + public function getAvatarFileName() + { + return $this->container['avatar_file_name']; + } + + /** + * Sets avatar_file_name + * + * @param string|null $avatar_file_name avatar_file_name + * + * @return self + */ + public function setAvatarFileName($avatar_file_name) + { + if (is_null($avatar_file_name)) { + array_push($this->openAPINullablesSetToNull, 'avatar_file_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('avatar_file_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['avatar_file_name'] = $avatar_file_name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ModelInterface.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ModelInterface.php new file mode 100644 index 0000000..33251ce --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ModelInterface.php @@ -0,0 +1,111 @@ + + */ +class OrderResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OrderResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'facility_id' => 'string', + 'facility_contact_id' => 'string', + 'start_date' => '\DateTime', + 'end_date' => '\DateTime', + 'required_qualification' => 'string', + 'shift_type' => 'string', + 'required_headcount' => 'int', + 'conditions' => 'string', + 'priority' => 'string', + 'status_id' => 'string', + 'status_name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'uuid', + 'facility_id' => 'uuid', + 'facility_contact_id' => 'uuid', + 'start_date' => 'date', + 'end_date' => 'date', + 'required_qualification' => null, + 'shift_type' => null, + 'required_headcount' => 'int32', + 'conditions' => null, + 'priority' => null, + 'status_id' => 'uuid', + 'status_name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'facility_id' => false, + 'facility_contact_id' => true, + 'start_date' => false, + 'end_date' => true, + 'required_qualification' => true, + 'shift_type' => true, + 'required_headcount' => false, + 'conditions' => true, + 'priority' => true, + 'status_id' => false, + 'status_name' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'facility_id' => 'facilityId', + 'facility_contact_id' => 'facilityContactId', + 'start_date' => 'startDate', + 'end_date' => 'endDate', + 'required_qualification' => 'requiredQualification', + 'shift_type' => 'shiftType', + 'required_headcount' => 'requiredHeadcount', + 'conditions' => 'conditions', + 'priority' => 'priority', + 'status_id' => 'statusId', + 'status_name' => 'statusName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'facility_id' => 'setFacilityId', + 'facility_contact_id' => 'setFacilityContactId', + 'start_date' => 'setStartDate', + 'end_date' => 'setEndDate', + 'required_qualification' => 'setRequiredQualification', + 'shift_type' => 'setShiftType', + 'required_headcount' => 'setRequiredHeadcount', + 'conditions' => 'setConditions', + 'priority' => 'setPriority', + 'status_id' => 'setStatusId', + 'status_name' => 'setStatusName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'facility_id' => 'getFacilityId', + 'facility_contact_id' => 'getFacilityContactId', + 'start_date' => 'getStartDate', + 'end_date' => 'getEndDate', + 'required_qualification' => 'getRequiredQualification', + 'shift_type' => 'getShiftType', + 'required_headcount' => 'getRequiredHeadcount', + 'conditions' => 'getConditions', + 'priority' => 'getPriority', + 'status_id' => 'getStatusId', + 'status_name' => 'getStatusName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('facility_id', $data ?? [], null); + $this->setIfExists('facility_contact_id', $data ?? [], null); + $this->setIfExists('start_date', $data ?? [], null); + $this->setIfExists('end_date', $data ?? [], null); + $this->setIfExists('required_qualification', $data ?? [], null); + $this->setIfExists('shift_type', $data ?? [], null); + $this->setIfExists('required_headcount', $data ?? [], null); + $this->setIfExists('conditions', $data ?? [], null); + $this->setIfExists('priority', $data ?? [], null); + $this->setIfExists('status_id', $data ?? [], null); + $this->setIfExists('status_name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets facility_id + * + * @return string|null + */ + public function getFacilityId() + { + return $this->container['facility_id']; + } + + /** + * Sets facility_id + * + * @param string|null $facility_id facility_id + * + * @return self + */ + public function setFacilityId($facility_id) + { + if (is_null($facility_id)) { + throw new \InvalidArgumentException('non-nullable facility_id cannot be null'); + } + $this->container['facility_id'] = $facility_id; + + return $this; + } + + /** + * Gets facility_contact_id + * + * @return string|null + */ + public function getFacilityContactId() + { + return $this->container['facility_contact_id']; + } + + /** + * Sets facility_contact_id + * + * @param string|null $facility_contact_id facility_contact_id + * + * @return self + */ + public function setFacilityContactId($facility_contact_id) + { + if (is_null($facility_contact_id)) { + array_push($this->openAPINullablesSetToNull, 'facility_contact_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('facility_contact_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['facility_contact_id'] = $facility_contact_id; + + return $this; + } + + /** + * Gets start_date + * + * @return \DateTime|null + */ + public function getStartDate() + { + return $this->container['start_date']; + } + + /** + * Sets start_date + * + * @param \DateTime|null $start_date start_date + * + * @return self + */ + public function setStartDate($start_date) + { + if (is_null($start_date)) { + throw new \InvalidArgumentException('non-nullable start_date cannot be null'); + } + $this->container['start_date'] = $start_date; + + return $this; + } + + /** + * Gets end_date + * + * @return \DateTime|null + */ + public function getEndDate() + { + return $this->container['end_date']; + } + + /** + * Sets end_date + * + * @param \DateTime|null $end_date end_date + * + * @return self + */ + public function setEndDate($end_date) + { + if (is_null($end_date)) { + array_push($this->openAPINullablesSetToNull, 'end_date'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('end_date', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['end_date'] = $end_date; + + return $this; + } + + /** + * Gets required_qualification + * + * @return string|null + */ + public function getRequiredQualification() + { + return $this->container['required_qualification']; + } + + /** + * Sets required_qualification + * + * @param string|null $required_qualification required_qualification + * + * @return self + */ + public function setRequiredQualification($required_qualification) + { + if (is_null($required_qualification)) { + array_push($this->openAPINullablesSetToNull, 'required_qualification'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('required_qualification', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['required_qualification'] = $required_qualification; + + return $this; + } + + /** + * Gets shift_type + * + * @return string|null + */ + public function getShiftType() + { + return $this->container['shift_type']; + } + + /** + * Sets shift_type + * + * @param string|null $shift_type shift_type + * + * @return self + */ + public function setShiftType($shift_type) + { + if (is_null($shift_type)) { + array_push($this->openAPINullablesSetToNull, 'shift_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('shift_type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['shift_type'] = $shift_type; + + return $this; + } + + /** + * Gets required_headcount + * + * @return int|null + */ + public function getRequiredHeadcount() + { + return $this->container['required_headcount']; + } + + /** + * Sets required_headcount + * + * @param int|null $required_headcount required_headcount + * + * @return self + */ + public function setRequiredHeadcount($required_headcount) + { + if (is_null($required_headcount)) { + throw new \InvalidArgumentException('non-nullable required_headcount cannot be null'); + } + $this->container['required_headcount'] = $required_headcount; + + return $this; + } + + /** + * Gets conditions + * + * @return string|null + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param string|null $conditions conditions + * + * @return self + */ + public function setConditions($conditions) + { + if (is_null($conditions)) { + array_push($this->openAPINullablesSetToNull, 'conditions'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('conditions', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['conditions'] = $conditions; + + return $this; + } + + /** + * Gets priority + * + * @return string|null + */ + public function getPriority() + { + return $this->container['priority']; + } + + /** + * Sets priority + * + * @param string|null $priority priority + * + * @return self + */ + public function setPriority($priority) + { + if (is_null($priority)) { + array_push($this->openAPINullablesSetToNull, 'priority'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('priority', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['priority'] = $priority; + + return $this; + } + + /** + * Gets status_id + * + * @return string|null + */ + public function getStatusId() + { + return $this->container['status_id']; + } + + /** + * Sets status_id + * + * @param string|null $status_id status_id + * + * @return self + */ + public function setStatusId($status_id) + { + if (is_null($status_id)) { + throw new \InvalidArgumentException('non-nullable status_id cannot be null'); + } + $this->container['status_id'] = $status_id; + + return $this; + } + + /** + * Gets status_name + * + * @return string|null + */ + public function getStatusName() + { + return $this->container['status_name']; + } + + /** + * Sets status_name + * + * @param string|null $status_name status_name + * + * @return self + */ + public function setStatusName($status_name) + { + if (is_null($status_name)) { + array_push($this->openAPINullablesSetToNull, 'status_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('status_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['status_name'] = $status_name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/OrderResponsePagedResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/OrderResponsePagedResponse.php new file mode 100644 index 0000000..a86c93d --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/OrderResponsePagedResponse.php @@ -0,0 +1,518 @@ + + */ +class OrderResponsePagedResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'OrderResponsePagedResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'items' => '\OmsorgCoreClient\Model\OrderResponse[]', + 'total_count' => 'int', + 'page' => 'int', + 'page_size' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'items' => null, + 'total_count' => 'int32', + 'page' => 'int32', + 'page_size' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'items' => true, + 'total_count' => false, + 'page' => false, + 'page_size' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'items' => 'items', + 'total_count' => 'totalCount', + 'page' => 'page', + 'page_size' => 'pageSize' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'items' => 'setItems', + 'total_count' => 'setTotalCount', + 'page' => 'setPage', + 'page_size' => 'setPageSize' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'items' => 'getItems', + 'total_count' => 'getTotalCount', + 'page' => 'getPage', + 'page_size' => 'getPageSize' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('items', $data ?? [], null); + $this->setIfExists('total_count', $data ?? [], null); + $this->setIfExists('page', $data ?? [], null); + $this->setIfExists('page_size', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets items + * + * @return \OmsorgCoreClient\Model\OrderResponse[]|null + */ + public function getItems() + { + return $this->container['items']; + } + + /** + * Sets items + * + * @param \OmsorgCoreClient\Model\OrderResponse[]|null $items items + * + * @return self + */ + public function setItems($items) + { + if (is_null($items)) { + array_push($this->openAPINullablesSetToNull, 'items'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('items', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['items'] = $items; + + return $this; + } + + /** + * Gets total_count + * + * @return int|null + */ + public function getTotalCount() + { + return $this->container['total_count']; + } + + /** + * Sets total_count + * + * @param int|null $total_count total_count + * + * @return self + */ + public function setTotalCount($total_count) + { + if (is_null($total_count)) { + throw new \InvalidArgumentException('non-nullable total_count cannot be null'); + } + $this->container['total_count'] = $total_count; + + return $this; + } + + /** + * Gets page + * + * @return int|null + */ + public function getPage() + { + return $this->container['page']; + } + + /** + * Sets page + * + * @param int|null $page page + * + * @return self + */ + public function setPage($page) + { + if (is_null($page)) { + throw new \InvalidArgumentException('non-nullable page cannot be null'); + } + $this->container['page'] = $page; + + return $this; + } + + /** + * Gets page_size + * + * @return int|null + */ + public function getPageSize() + { + return $this->container['page_size']; + } + + /** + * Sets page_size + * + * @param int|null $page_size page_size + * + * @return self + */ + public function setPageSize($page_size) + { + if (is_null($page_size)) { + throw new \InvalidArgumentException('non-nullable page_size cannot be null'); + } + $this->container['page_size'] = $page_size; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/PasswordPolicyResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/PasswordPolicyResponse.php new file mode 100644 index 0000000..48e657a --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/PasswordPolicyResponse.php @@ -0,0 +1,409 @@ + + */ +class PasswordPolicyResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PasswordPolicyResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'min_length' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'min_length' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'min_length' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'min_length' => 'minLength' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'min_length' => 'setMinLength' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'min_length' => 'getMinLength' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('min_length', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets min_length + * + * @return int|null + */ + public function getMinLength() + { + return $this->container['min_length']; + } + + /** + * Sets min_length + * + * @param int|null $min_length min_length + * + * @return self + */ + public function setMinLength($min_length) + { + if (is_null($min_length)) { + throw new \InvalidArgumentException('non-nullable min_length cannot be null'); + } + $this->container['min_length'] = $min_length; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/PasswordResetTemplateResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/PasswordResetTemplateResponse.php new file mode 100644 index 0000000..a60fbca --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/PasswordResetTemplateResponse.php @@ -0,0 +1,457 @@ + + */ +class PasswordResetTemplateResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PasswordResetTemplateResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'subject' => 'string', + 'body_template' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'subject' => null, + 'body_template' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'subject' => true, + 'body_template' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'subject' => 'subject', + 'body_template' => 'bodyTemplate' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'subject' => 'setSubject', + 'body_template' => 'setBodyTemplate' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'subject' => 'getSubject', + 'body_template' => 'getBodyTemplate' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('body_template', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets subject + * + * @return string|null + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string|null $subject subject + * + * @return self + */ + public function setSubject($subject) + { + if (is_null($subject)) { + array_push($this->openAPINullablesSetToNull, 'subject'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('subject', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets body_template + * + * @return string|null + */ + public function getBodyTemplate() + { + return $this->container['body_template']; + } + + /** + * Sets body_template + * + * @param string|null $body_template body_template + * + * @return self + */ + public function setBodyTemplate($body_template) + { + if (is_null($body_template)) { + array_push($this->openAPINullablesSetToNull, 'body_template'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('body_template', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['body_template'] = $body_template; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/PermissionDto.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/PermissionDto.php new file mode 100644 index 0000000..1a22dae --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/PermissionDto.php @@ -0,0 +1,457 @@ + + */ +class PermissionDto implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'PermissionDto'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'module' => 'string', + 'action' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'module' => null, + 'action' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'module' => true, + 'action' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'module' => 'module', + 'action' => 'action' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'module' => 'setModule', + 'action' => 'setAction' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'module' => 'getModule', + 'action' => 'getAction' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('module', $data ?? [], null); + $this->setIfExists('action', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets module + * + * @return string|null + */ + public function getModule() + { + return $this->container['module']; + } + + /** + * Sets module + * + * @param string|null $module module + * + * @return self + */ + public function setModule($module) + { + if (is_null($module)) { + array_push($this->openAPINullablesSetToNull, 'module'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('module', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['module'] = $module; + + return $this; + } + + /** + * Gets action + * + * @return string|null + */ + public function getAction() + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param string|null $action action + * + * @return self + */ + public function setAction($action) + { + if (is_null($action)) { + array_push($this->openAPINullablesSetToNull, 'action'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('action', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['action'] = $action; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/RefreshRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/RefreshRequest.php new file mode 100644 index 0000000..535ed67 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/RefreshRequest.php @@ -0,0 +1,416 @@ + + */ +class RefreshRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RefreshRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'refresh_token' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'refresh_token' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'refresh_token' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'refresh_token' => 'refreshToken' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'refresh_token' => 'setRefreshToken' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'refresh_token' => 'getRefreshToken' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('refresh_token', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets refresh_token + * + * @return string|null + */ + public function getRefreshToken() + { + return $this->container['refresh_token']; + } + + /** + * Sets refresh_token + * + * @param string|null $refresh_token refresh_token + * + * @return self + */ + public function setRefreshToken($refresh_token) + { + if (is_null($refresh_token)) { + array_push($this->openAPINullablesSetToNull, 'refresh_token'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('refresh_token', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['refresh_token'] = $refresh_token; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ResetUserPasswordRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ResetUserPasswordRequest.php new file mode 100644 index 0000000..5eea5d7 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ResetUserPasswordRequest.php @@ -0,0 +1,498 @@ + + */ +class ResetUserPasswordRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ResetUserPasswordRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'mode' => 'string', + 'initial_password' => 'string', + 'pin_validity_days' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'mode' => null, + 'initial_password' => null, + 'pin_validity_days' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'mode' => true, + 'initial_password' => true, + 'pin_validity_days' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'mode' => 'mode', + 'initial_password' => 'initialPassword', + 'pin_validity_days' => 'pinValidityDays' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'mode' => 'setMode', + 'initial_password' => 'setInitialPassword', + 'pin_validity_days' => 'setPinValidityDays' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'mode' => 'getMode', + 'initial_password' => 'getInitialPassword', + 'pin_validity_days' => 'getPinValidityDays' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('mode', $data ?? [], null); + $this->setIfExists('initial_password', $data ?? [], null); + $this->setIfExists('pin_validity_days', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets mode + * + * @return string|null + */ + public function getMode() + { + return $this->container['mode']; + } + + /** + * Sets mode + * + * @param string|null $mode mode + * + * @return self + */ + public function setMode($mode) + { + if (is_null($mode)) { + array_push($this->openAPINullablesSetToNull, 'mode'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('mode', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['mode'] = $mode; + + return $this; + } + + /** + * Gets initial_password + * + * @return string|null + */ + public function getInitialPassword() + { + return $this->container['initial_password']; + } + + /** + * Sets initial_password + * + * @param string|null $initial_password initial_password + * + * @return self + */ + public function setInitialPassword($initial_password) + { + if (is_null($initial_password)) { + array_push($this->openAPINullablesSetToNull, 'initial_password'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('initial_password', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['initial_password'] = $initial_password; + + return $this; + } + + /** + * Gets pin_validity_days + * + * @return int|null + */ + public function getPinValidityDays() + { + return $this->container['pin_validity_days']; + } + + /** + * Sets pin_validity_days + * + * @param int|null $pin_validity_days pin_validity_days + * + * @return self + */ + public function setPinValidityDays($pin_validity_days) + { + if (is_null($pin_validity_days)) { + array_push($this->openAPINullablesSetToNull, 'pin_validity_days'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('pin_validity_days', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['pin_validity_days'] = $pin_validity_days; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/RolePermissionsResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/RolePermissionsResponse.php new file mode 100644 index 0000000..773be68 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/RolePermissionsResponse.php @@ -0,0 +1,491 @@ + + */ +class RolePermissionsResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RolePermissionsResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string', + 'permissions' => '\OmsorgCoreClient\Model\PermissionDto[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'uuid', + 'name' => null, + 'permissions' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => true, + 'permissions' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name', + 'permissions' => 'permissions' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName', + 'permissions' => 'setPermissions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName', + 'permissions' => 'getPermissions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('permissions', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets permissions + * + * @return \OmsorgCoreClient\Model\PermissionDto[]|null + */ + public function getPermissions() + { + return $this->container['permissions']; + } + + /** + * Sets permissions + * + * @param \OmsorgCoreClient\Model\PermissionDto[]|null $permissions permissions + * + * @return self + */ + public function setPermissions($permissions) + { + if (is_null($permissions)) { + array_push($this->openAPINullablesSetToNull, 'permissions'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('permissions', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['permissions'] = $permissions; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/RoleResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/RoleResponse.php new file mode 100644 index 0000000..3176b9a --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/RoleResponse.php @@ -0,0 +1,450 @@ + + */ +class RoleResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'RoleResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'uuid', + 'name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'name' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'name' => 'name' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'name' => 'setName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'name' => 'getName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/SendTestEmailRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/SendTestEmailRequest.php new file mode 100644 index 0000000..2d306d8 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/SendTestEmailRequest.php @@ -0,0 +1,498 @@ + + */ +class SendTestEmailRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SendTestEmailRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'to_address' => 'string', + 'subject' => 'string', + 'body' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'to_address' => null, + 'subject' => null, + 'body' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'to_address' => true, + 'subject' => true, + 'body' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'to_address' => 'toAddress', + 'subject' => 'subject', + 'body' => 'body' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'to_address' => 'setToAddress', + 'subject' => 'setSubject', + 'body' => 'setBody' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'to_address' => 'getToAddress', + 'subject' => 'getSubject', + 'body' => 'getBody' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('to_address', $data ?? [], null); + $this->setIfExists('subject', $data ?? [], null); + $this->setIfExists('body', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets to_address + * + * @return string|null + */ + public function getToAddress() + { + return $this->container['to_address']; + } + + /** + * Sets to_address + * + * @param string|null $to_address to_address + * + * @return self + */ + public function setToAddress($to_address) + { + if (is_null($to_address)) { + array_push($this->openAPINullablesSetToNull, 'to_address'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('to_address', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['to_address'] = $to_address; + + return $this; + } + + /** + * Gets subject + * + * @return string|null + */ + public function getSubject() + { + return $this->container['subject']; + } + + /** + * Sets subject + * + * @param string|null $subject subject + * + * @return self + */ + public function setSubject($subject) + { + if (is_null($subject)) { + array_push($this->openAPINullablesSetToNull, 'subject'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('subject', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['subject'] = $subject; + + return $this; + } + + /** + * Gets body + * + * @return string|null + */ + public function getBody() + { + return $this->container['body']; + } + + /** + * Sets body + * + * @param string|null $body body + * + * @return self + */ + public function setBody($body) + { + if (is_null($body)) { + array_push($this->openAPINullablesSetToNull, 'body'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('body', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['body'] = $body; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/SessionResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/SessionResponse.php new file mode 100644 index 0000000..2a58eca --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/SessionResponse.php @@ -0,0 +1,518 @@ + + */ +class SessionResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'SessionResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'username' => 'string', + 'created_at' => '\DateTime', + 'expires_at' => '\DateTime' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'uuid', + 'username' => null, + 'created_at' => 'date-time', + 'expires_at' => 'date-time' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'username' => true, + 'created_at' => false, + 'expires_at' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'username' => 'username', + 'created_at' => 'createdAt', + 'expires_at' => 'expiresAt' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'username' => 'setUsername', + 'created_at' => 'setCreatedAt', + 'expires_at' => 'setExpiresAt' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'username' => 'getUsername', + 'created_at' => 'getCreatedAt', + 'expires_at' => 'getExpiresAt' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + $this->setIfExists('created_at', $data ?? [], null); + $this->setIfExists('expires_at', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets username + * + * @return string|null + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string|null $username username + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + array_push($this->openAPINullablesSetToNull, 'username'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('username', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['username'] = $username; + + return $this; + } + + /** + * Gets created_at + * + * @return \DateTime|null + */ + public function getCreatedAt() + { + return $this->container['created_at']; + } + + /** + * Sets created_at + * + * @param \DateTime|null $created_at created_at + * + * @return self + */ + public function setCreatedAt($created_at) + { + if (is_null($created_at)) { + throw new \InvalidArgumentException('non-nullable created_at cannot be null'); + } + $this->container['created_at'] = $created_at; + + return $this; + } + + /** + * Gets expires_at + * + * @return \DateTime|null + */ + public function getExpiresAt() + { + return $this->container['expires_at']; + } + + /** + * Sets expires_at + * + * @param \DateTime|null $expires_at expires_at + * + * @return self + */ + public function setExpiresAt($expires_at) + { + if (is_null($expires_at)) { + throw new \InvalidArgumentException('non-nullable expires_at cannot be null'); + } + $this->container['expires_at'] = $expires_at; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UpdateContractRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UpdateContractRequest.php new file mode 100644 index 0000000..5f79496 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UpdateContractRequest.php @@ -0,0 +1,860 @@ + + */ +class UpdateContractRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateContractRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'contract_type' => 'string', + 'employee_id' => 'string', + 'facility_id' => 'string', + 'start_date' => '\DateTime', + 'end_date' => '\DateTime', + 'status' => 'string', + 'weekly_hours' => 'float', + 'hourly_wage' => 'float', + 'allowances_description' => 'string', + 'overtime_rules' => 'string', + 'vacation_days_per_year' => 'int', + 'probation_period_months' => 'int' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'contract_type' => null, + 'employee_id' => 'uuid', + 'facility_id' => 'uuid', + 'start_date' => 'date', + 'end_date' => 'date', + 'status' => null, + 'weekly_hours' => 'double', + 'hourly_wage' => 'double', + 'allowances_description' => null, + 'overtime_rules' => null, + 'vacation_days_per_year' => 'int32', + 'probation_period_months' => 'int32' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'contract_type' => true, + 'employee_id' => true, + 'facility_id' => true, + 'start_date' => false, + 'end_date' => true, + 'status' => true, + 'weekly_hours' => true, + 'hourly_wage' => true, + 'allowances_description' => true, + 'overtime_rules' => true, + 'vacation_days_per_year' => true, + 'probation_period_months' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'contract_type' => 'contractType', + 'employee_id' => 'employeeId', + 'facility_id' => 'facilityId', + 'start_date' => 'startDate', + 'end_date' => 'endDate', + 'status' => 'status', + 'weekly_hours' => 'weeklyHours', + 'hourly_wage' => 'hourlyWage', + 'allowances_description' => 'allowancesDescription', + 'overtime_rules' => 'overtimeRules', + 'vacation_days_per_year' => 'vacationDaysPerYear', + 'probation_period_months' => 'probationPeriodMonths' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'contract_type' => 'setContractType', + 'employee_id' => 'setEmployeeId', + 'facility_id' => 'setFacilityId', + 'start_date' => 'setStartDate', + 'end_date' => 'setEndDate', + 'status' => 'setStatus', + 'weekly_hours' => 'setWeeklyHours', + 'hourly_wage' => 'setHourlyWage', + 'allowances_description' => 'setAllowancesDescription', + 'overtime_rules' => 'setOvertimeRules', + 'vacation_days_per_year' => 'setVacationDaysPerYear', + 'probation_period_months' => 'setProbationPeriodMonths' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'contract_type' => 'getContractType', + 'employee_id' => 'getEmployeeId', + 'facility_id' => 'getFacilityId', + 'start_date' => 'getStartDate', + 'end_date' => 'getEndDate', + 'status' => 'getStatus', + 'weekly_hours' => 'getWeeklyHours', + 'hourly_wage' => 'getHourlyWage', + 'allowances_description' => 'getAllowancesDescription', + 'overtime_rules' => 'getOvertimeRules', + 'vacation_days_per_year' => 'getVacationDaysPerYear', + 'probation_period_months' => 'getProbationPeriodMonths' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('contract_type', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('facility_id', $data ?? [], null); + $this->setIfExists('start_date', $data ?? [], null); + $this->setIfExists('end_date', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('weekly_hours', $data ?? [], null); + $this->setIfExists('hourly_wage', $data ?? [], null); + $this->setIfExists('allowances_description', $data ?? [], null); + $this->setIfExists('overtime_rules', $data ?? [], null); + $this->setIfExists('vacation_days_per_year', $data ?? [], null); + $this->setIfExists('probation_period_months', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets contract_type + * + * @return string|null + */ + public function getContractType() + { + return $this->container['contract_type']; + } + + /** + * Sets contract_type + * + * @param string|null $contract_type contract_type + * + * @return self + */ + public function setContractType($contract_type) + { + if (is_null($contract_type)) { + array_push($this->openAPINullablesSetToNull, 'contract_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('contract_type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['contract_type'] = $contract_type; + + return $this; + } + + /** + * Gets employee_id + * + * @return string|null + */ + public function getEmployeeId() + { + return $this->container['employee_id']; + } + + /** + * Sets employee_id + * + * @param string|null $employee_id employee_id + * + * @return self + */ + public function setEmployeeId($employee_id) + { + if (is_null($employee_id)) { + array_push($this->openAPINullablesSetToNull, 'employee_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employee_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employee_id'] = $employee_id; + + return $this; + } + + /** + * Gets facility_id + * + * @return string|null + */ + public function getFacilityId() + { + return $this->container['facility_id']; + } + + /** + * Sets facility_id + * + * @param string|null $facility_id facility_id + * + * @return self + */ + public function setFacilityId($facility_id) + { + if (is_null($facility_id)) { + array_push($this->openAPINullablesSetToNull, 'facility_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('facility_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['facility_id'] = $facility_id; + + return $this; + } + + /** + * Gets start_date + * + * @return \DateTime|null + */ + public function getStartDate() + { + return $this->container['start_date']; + } + + /** + * Sets start_date + * + * @param \DateTime|null $start_date start_date + * + * @return self + */ + public function setStartDate($start_date) + { + if (is_null($start_date)) { + throw new \InvalidArgumentException('non-nullable start_date cannot be null'); + } + $this->container['start_date'] = $start_date; + + return $this; + } + + /** + * Gets end_date + * + * @return \DateTime|null + */ + public function getEndDate() + { + return $this->container['end_date']; + } + + /** + * Sets end_date + * + * @param \DateTime|null $end_date end_date + * + * @return self + */ + public function setEndDate($end_date) + { + if (is_null($end_date)) { + array_push($this->openAPINullablesSetToNull, 'end_date'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('end_date', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['end_date'] = $end_date; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + array_push($this->openAPINullablesSetToNull, 'status'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('status', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets weekly_hours + * + * @return float|null + */ + public function getWeeklyHours() + { + return $this->container['weekly_hours']; + } + + /** + * Sets weekly_hours + * + * @param float|null $weekly_hours weekly_hours + * + * @return self + */ + public function setWeeklyHours($weekly_hours) + { + if (is_null($weekly_hours)) { + array_push($this->openAPINullablesSetToNull, 'weekly_hours'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('weekly_hours', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['weekly_hours'] = $weekly_hours; + + return $this; + } + + /** + * Gets hourly_wage + * + * @return float|null + */ + public function getHourlyWage() + { + return $this->container['hourly_wage']; + } + + /** + * Sets hourly_wage + * + * @param float|null $hourly_wage hourly_wage + * + * @return self + */ + public function setHourlyWage($hourly_wage) + { + if (is_null($hourly_wage)) { + array_push($this->openAPINullablesSetToNull, 'hourly_wage'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('hourly_wage', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['hourly_wage'] = $hourly_wage; + + return $this; + } + + /** + * Gets allowances_description + * + * @return string|null + */ + public function getAllowancesDescription() + { + return $this->container['allowances_description']; + } + + /** + * Sets allowances_description + * + * @param string|null $allowances_description allowances_description + * + * @return self + */ + public function setAllowancesDescription($allowances_description) + { + if (is_null($allowances_description)) { + array_push($this->openAPINullablesSetToNull, 'allowances_description'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('allowances_description', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['allowances_description'] = $allowances_description; + + return $this; + } + + /** + * Gets overtime_rules + * + * @return string|null + */ + public function getOvertimeRules() + { + return $this->container['overtime_rules']; + } + + /** + * Sets overtime_rules + * + * @param string|null $overtime_rules overtime_rules + * + * @return self + */ + public function setOvertimeRules($overtime_rules) + { + if (is_null($overtime_rules)) { + array_push($this->openAPINullablesSetToNull, 'overtime_rules'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('overtime_rules', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['overtime_rules'] = $overtime_rules; + + return $this; + } + + /** + * Gets vacation_days_per_year + * + * @return int|null + */ + public function getVacationDaysPerYear() + { + return $this->container['vacation_days_per_year']; + } + + /** + * Sets vacation_days_per_year + * + * @param int|null $vacation_days_per_year vacation_days_per_year + * + * @return self + */ + public function setVacationDaysPerYear($vacation_days_per_year) + { + if (is_null($vacation_days_per_year)) { + array_push($this->openAPINullablesSetToNull, 'vacation_days_per_year'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('vacation_days_per_year', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['vacation_days_per_year'] = $vacation_days_per_year; + + return $this; + } + + /** + * Gets probation_period_months + * + * @return int|null + */ + public function getProbationPeriodMonths() + { + return $this->container['probation_period_months']; + } + + /** + * Sets probation_period_months + * + * @param int|null $probation_period_months probation_period_months + * + * @return self + */ + public function setProbationPeriodMonths($probation_period_months) + { + if (is_null($probation_period_months)) { + array_push($this->openAPINullablesSetToNull, 'probation_period_months'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('probation_period_months', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['probation_period_months'] = $probation_period_months; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UpdateEmployeeRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UpdateEmployeeRequest.php new file mode 100644 index 0000000..2138162 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UpdateEmployeeRequest.php @@ -0,0 +1,1113 @@ + + */ +class UpdateEmployeeRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateEmployeeRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'first_name' => 'string', + 'last_name' => 'string', + 'status' => 'string', + 'date_of_birth' => '\DateTime', + 'street' => 'string', + 'postal_code' => 'string', + 'city' => 'string', + 'country' => 'string', + 'phone_number' => 'string', + 'email' => 'string', + 'entry_date' => '\DateTime', + 'exit_date' => '\DateTime', + 'emergency_contact_name' => 'string', + 'emergency_contact_phone' => 'string', + 'emergency_contact_relation' => 'string', + 'employment_type' => 'string', + 'qualification' => 'string', + 'avatar_file_name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'first_name' => null, + 'last_name' => null, + 'status' => null, + 'date_of_birth' => 'date', + 'street' => null, + 'postal_code' => null, + 'city' => null, + 'country' => null, + 'phone_number' => null, + 'email' => null, + 'entry_date' => 'date', + 'exit_date' => 'date', + 'emergency_contact_name' => null, + 'emergency_contact_phone' => null, + 'emergency_contact_relation' => null, + 'employment_type' => null, + 'qualification' => null, + 'avatar_file_name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'first_name' => true, + 'last_name' => true, + 'status' => true, + 'date_of_birth' => true, + 'street' => true, + 'postal_code' => true, + 'city' => true, + 'country' => true, + 'phone_number' => true, + 'email' => true, + 'entry_date' => true, + 'exit_date' => true, + 'emergency_contact_name' => true, + 'emergency_contact_phone' => true, + 'emergency_contact_relation' => true, + 'employment_type' => true, + 'qualification' => true, + 'avatar_file_name' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'first_name' => 'firstName', + 'last_name' => 'lastName', + 'status' => 'status', + 'date_of_birth' => 'dateOfBirth', + 'street' => 'street', + 'postal_code' => 'postalCode', + 'city' => 'city', + 'country' => 'country', + 'phone_number' => 'phoneNumber', + 'email' => 'email', + 'entry_date' => 'entryDate', + 'exit_date' => 'exitDate', + 'emergency_contact_name' => 'emergencyContactName', + 'emergency_contact_phone' => 'emergencyContactPhone', + 'emergency_contact_relation' => 'emergencyContactRelation', + 'employment_type' => 'employmentType', + 'qualification' => 'qualification', + 'avatar_file_name' => 'avatarFileName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'first_name' => 'setFirstName', + 'last_name' => 'setLastName', + 'status' => 'setStatus', + 'date_of_birth' => 'setDateOfBirth', + 'street' => 'setStreet', + 'postal_code' => 'setPostalCode', + 'city' => 'setCity', + 'country' => 'setCountry', + 'phone_number' => 'setPhoneNumber', + 'email' => 'setEmail', + 'entry_date' => 'setEntryDate', + 'exit_date' => 'setExitDate', + 'emergency_contact_name' => 'setEmergencyContactName', + 'emergency_contact_phone' => 'setEmergencyContactPhone', + 'emergency_contact_relation' => 'setEmergencyContactRelation', + 'employment_type' => 'setEmploymentType', + 'qualification' => 'setQualification', + 'avatar_file_name' => 'setAvatarFileName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'first_name' => 'getFirstName', + 'last_name' => 'getLastName', + 'status' => 'getStatus', + 'date_of_birth' => 'getDateOfBirth', + 'street' => 'getStreet', + 'postal_code' => 'getPostalCode', + 'city' => 'getCity', + 'country' => 'getCountry', + 'phone_number' => 'getPhoneNumber', + 'email' => 'getEmail', + 'entry_date' => 'getEntryDate', + 'exit_date' => 'getExitDate', + 'emergency_contact_name' => 'getEmergencyContactName', + 'emergency_contact_phone' => 'getEmergencyContactPhone', + 'emergency_contact_relation' => 'getEmergencyContactRelation', + 'employment_type' => 'getEmploymentType', + 'qualification' => 'getQualification', + 'avatar_file_name' => 'getAvatarFileName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('first_name', $data ?? [], null); + $this->setIfExists('last_name', $data ?? [], null); + $this->setIfExists('status', $data ?? [], null); + $this->setIfExists('date_of_birth', $data ?? [], null); + $this->setIfExists('street', $data ?? [], null); + $this->setIfExists('postal_code', $data ?? [], null); + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('entry_date', $data ?? [], null); + $this->setIfExists('exit_date', $data ?? [], null); + $this->setIfExists('emergency_contact_name', $data ?? [], null); + $this->setIfExists('emergency_contact_phone', $data ?? [], null); + $this->setIfExists('emergency_contact_relation', $data ?? [], null); + $this->setIfExists('employment_type', $data ?? [], null); + $this->setIfExists('qualification', $data ?? [], null); + $this->setIfExists('avatar_file_name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets first_name + * + * @return string|null + */ + public function getFirstName() + { + return $this->container['first_name']; + } + + /** + * Sets first_name + * + * @param string|null $first_name first_name + * + * @return self + */ + public function setFirstName($first_name) + { + if (is_null($first_name)) { + array_push($this->openAPINullablesSetToNull, 'first_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('first_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['first_name'] = $first_name; + + return $this; + } + + /** + * Gets last_name + * + * @return string|null + */ + public function getLastName() + { + return $this->container['last_name']; + } + + /** + * Sets last_name + * + * @param string|null $last_name last_name + * + * @return self + */ + public function setLastName($last_name) + { + if (is_null($last_name)) { + array_push($this->openAPINullablesSetToNull, 'last_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('last_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['last_name'] = $last_name; + + return $this; + } + + /** + * Gets status + * + * @return string|null + */ + public function getStatus() + { + return $this->container['status']; + } + + /** + * Sets status + * + * @param string|null $status status + * + * @return self + */ + public function setStatus($status) + { + if (is_null($status)) { + array_push($this->openAPINullablesSetToNull, 'status'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('status', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['status'] = $status; + + return $this; + } + + /** + * Gets date_of_birth + * + * @return \DateTime|null + */ + public function getDateOfBirth() + { + return $this->container['date_of_birth']; + } + + /** + * Sets date_of_birth + * + * @param \DateTime|null $date_of_birth date_of_birth + * + * @return self + */ + public function setDateOfBirth($date_of_birth) + { + if (is_null($date_of_birth)) { + array_push($this->openAPINullablesSetToNull, 'date_of_birth'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('date_of_birth', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['date_of_birth'] = $date_of_birth; + + return $this; + } + + /** + * Gets street + * + * @return string|null + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string|null $street street + * + * @return self + */ + public function setStreet($street) + { + if (is_null($street)) { + array_push($this->openAPINullablesSetToNull, 'street'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('street', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['street'] = $street; + + return $this; + } + + /** + * Gets postal_code + * + * @return string|null + */ + public function getPostalCode() + { + return $this->container['postal_code']; + } + + /** + * Sets postal_code + * + * @param string|null $postal_code postal_code + * + * @return self + */ + public function setPostalCode($postal_code) + { + if (is_null($postal_code)) { + array_push($this->openAPINullablesSetToNull, 'postal_code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('postal_code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['postal_code'] = $postal_code; + + return $this; + } + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city city + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + array_push($this->openAPINullablesSetToNull, 'city'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('city', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country country + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + array_push($this->openAPINullablesSetToNull, 'country'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('country', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets phone_number + * + * @return string|null + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string|null $phone_number phone_number + * + * @return self + */ + public function setPhoneNumber($phone_number) + { + if (is_null($phone_number)) { + array_push($this->openAPINullablesSetToNull, 'phone_number'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('phone_number', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['phone_number'] = $phone_number; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email email + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets entry_date + * + * @return \DateTime|null + */ + public function getEntryDate() + { + return $this->container['entry_date']; + } + + /** + * Sets entry_date + * + * @param \DateTime|null $entry_date entry_date + * + * @return self + */ + public function setEntryDate($entry_date) + { + if (is_null($entry_date)) { + array_push($this->openAPINullablesSetToNull, 'entry_date'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('entry_date', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['entry_date'] = $entry_date; + + return $this; + } + + /** + * Gets exit_date + * + * @return \DateTime|null + */ + public function getExitDate() + { + return $this->container['exit_date']; + } + + /** + * Sets exit_date + * + * @param \DateTime|null $exit_date exit_date + * + * @return self + */ + public function setExitDate($exit_date) + { + if (is_null($exit_date)) { + array_push($this->openAPINullablesSetToNull, 'exit_date'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('exit_date', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['exit_date'] = $exit_date; + + return $this; + } + + /** + * Gets emergency_contact_name + * + * @return string|null + */ + public function getEmergencyContactName() + { + return $this->container['emergency_contact_name']; + } + + /** + * Sets emergency_contact_name + * + * @param string|null $emergency_contact_name emergency_contact_name + * + * @return self + */ + public function setEmergencyContactName($emergency_contact_name) + { + if (is_null($emergency_contact_name)) { + array_push($this->openAPINullablesSetToNull, 'emergency_contact_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('emergency_contact_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['emergency_contact_name'] = $emergency_contact_name; + + return $this; + } + + /** + * Gets emergency_contact_phone + * + * @return string|null + */ + public function getEmergencyContactPhone() + { + return $this->container['emergency_contact_phone']; + } + + /** + * Sets emergency_contact_phone + * + * @param string|null $emergency_contact_phone emergency_contact_phone + * + * @return self + */ + public function setEmergencyContactPhone($emergency_contact_phone) + { + if (is_null($emergency_contact_phone)) { + array_push($this->openAPINullablesSetToNull, 'emergency_contact_phone'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('emergency_contact_phone', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['emergency_contact_phone'] = $emergency_contact_phone; + + return $this; + } + + /** + * Gets emergency_contact_relation + * + * @return string|null + */ + public function getEmergencyContactRelation() + { + return $this->container['emergency_contact_relation']; + } + + /** + * Sets emergency_contact_relation + * + * @param string|null $emergency_contact_relation emergency_contact_relation + * + * @return self + */ + public function setEmergencyContactRelation($emergency_contact_relation) + { + if (is_null($emergency_contact_relation)) { + array_push($this->openAPINullablesSetToNull, 'emergency_contact_relation'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('emergency_contact_relation', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['emergency_contact_relation'] = $emergency_contact_relation; + + return $this; + } + + /** + * Gets employment_type + * + * @return string|null + */ + public function getEmploymentType() + { + return $this->container['employment_type']; + } + + /** + * Sets employment_type + * + * @param string|null $employment_type employment_type + * + * @return self + */ + public function setEmploymentType($employment_type) + { + if (is_null($employment_type)) { + array_push($this->openAPINullablesSetToNull, 'employment_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employment_type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employment_type'] = $employment_type; + + return $this; + } + + /** + * Gets qualification + * + * @return string|null + */ + public function getQualification() + { + return $this->container['qualification']; + } + + /** + * Sets qualification + * + * @param string|null $qualification qualification + * + * @return self + */ + public function setQualification($qualification) + { + if (is_null($qualification)) { + array_push($this->openAPINullablesSetToNull, 'qualification'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('qualification', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['qualification'] = $qualification; + + return $this; + } + + /** + * Gets avatar_file_name + * + * @return string|null + */ + public function getAvatarFileName() + { + return $this->container['avatar_file_name']; + } + + /** + * Sets avatar_file_name + * + * @param string|null $avatar_file_name avatar_file_name + * + * @return self + */ + public function setAvatarFileName($avatar_file_name) + { + if (is_null($avatar_file_name)) { + array_push($this->openAPINullablesSetToNull, 'avatar_file_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('avatar_file_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['avatar_file_name'] = $avatar_file_name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UpdateFacilityContactRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UpdateFacilityContactRequest.php new file mode 100644 index 0000000..ddb13fc --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UpdateFacilityContactRequest.php @@ -0,0 +1,621 @@ + + */ +class UpdateFacilityContactRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateFacilityContactRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'role' => 'string', + 'department' => 'string', + 'phone_number' => 'string', + 'email' => 'string', + 'notes' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'role' => null, + 'department' => null, + 'phone_number' => null, + 'email' => null, + 'notes' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => true, + 'role' => true, + 'department' => true, + 'phone_number' => true, + 'email' => true, + 'notes' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'role' => 'role', + 'department' => 'department', + 'phone_number' => 'phoneNumber', + 'email' => 'email', + 'notes' => 'notes' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'role' => 'setRole', + 'department' => 'setDepartment', + 'phone_number' => 'setPhoneNumber', + 'email' => 'setEmail', + 'notes' => 'setNotes' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'role' => 'getRole', + 'department' => 'getDepartment', + 'phone_number' => 'getPhoneNumber', + 'email' => 'getEmail', + 'notes' => 'getNotes' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('role', $data ?? [], null); + $this->setIfExists('department', $data ?? [], null); + $this->setIfExists('phone_number', $data ?? [], null); + $this->setIfExists('email', $data ?? [], null); + $this->setIfExists('notes', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets role + * + * @return string|null + */ + public function getRole() + { + return $this->container['role']; + } + + /** + * Sets role + * + * @param string|null $role role + * + * @return self + */ + public function setRole($role) + { + if (is_null($role)) { + array_push($this->openAPINullablesSetToNull, 'role'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('role', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['role'] = $role; + + return $this; + } + + /** + * Gets department + * + * @return string|null + */ + public function getDepartment() + { + return $this->container['department']; + } + + /** + * Sets department + * + * @param string|null $department department + * + * @return self + */ + public function setDepartment($department) + { + if (is_null($department)) { + array_push($this->openAPINullablesSetToNull, 'department'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('department', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['department'] = $department; + + return $this; + } + + /** + * Gets phone_number + * + * @return string|null + */ + public function getPhoneNumber() + { + return $this->container['phone_number']; + } + + /** + * Sets phone_number + * + * @param string|null $phone_number phone_number + * + * @return self + */ + public function setPhoneNumber($phone_number) + { + if (is_null($phone_number)) { + array_push($this->openAPINullablesSetToNull, 'phone_number'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('phone_number', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['phone_number'] = $phone_number; + + return $this; + } + + /** + * Gets email + * + * @return string|null + */ + public function getEmail() + { + return $this->container['email']; + } + + /** + * Sets email + * + * @param string|null $email email + * + * @return self + */ + public function setEmail($email) + { + if (is_null($email)) { + array_push($this->openAPINullablesSetToNull, 'email'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('email', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['email'] = $email; + + return $this; + } + + /** + * Gets notes + * + * @return string|null + */ + public function getNotes() + { + return $this->container['notes']; + } + + /** + * Sets notes + * + * @param string|null $notes notes + * + * @return self + */ + public function setNotes($notes) + { + if (is_null($notes)) { + array_push($this->openAPINullablesSetToNull, 'notes'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('notes', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['notes'] = $notes; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UpdateFacilityRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UpdateFacilityRequest.php new file mode 100644 index 0000000..4a90817 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UpdateFacilityRequest.php @@ -0,0 +1,826 @@ + + */ +class UpdateFacilityRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateFacilityRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'name' => 'string', + 'crm_status' => 'string', + 'facility_type' => 'string', + 'street' => 'string', + 'postal_code' => 'string', + 'city' => 'string', + 'country' => 'string', + 'billing_street' => 'string', + 'billing_postal_code' => 'string', + 'billing_city' => 'string', + 'billing_country' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'name' => null, + 'crm_status' => null, + 'facility_type' => null, + 'street' => null, + 'postal_code' => null, + 'city' => null, + 'country' => null, + 'billing_street' => null, + 'billing_postal_code' => null, + 'billing_city' => null, + 'billing_country' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'name' => true, + 'crm_status' => true, + 'facility_type' => true, + 'street' => true, + 'postal_code' => true, + 'city' => true, + 'country' => true, + 'billing_street' => true, + 'billing_postal_code' => true, + 'billing_city' => true, + 'billing_country' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'name' => 'name', + 'crm_status' => 'crmStatus', + 'facility_type' => 'facilityType', + 'street' => 'street', + 'postal_code' => 'postalCode', + 'city' => 'city', + 'country' => 'country', + 'billing_street' => 'billingStreet', + 'billing_postal_code' => 'billingPostalCode', + 'billing_city' => 'billingCity', + 'billing_country' => 'billingCountry' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'name' => 'setName', + 'crm_status' => 'setCrmStatus', + 'facility_type' => 'setFacilityType', + 'street' => 'setStreet', + 'postal_code' => 'setPostalCode', + 'city' => 'setCity', + 'country' => 'setCountry', + 'billing_street' => 'setBillingStreet', + 'billing_postal_code' => 'setBillingPostalCode', + 'billing_city' => 'setBillingCity', + 'billing_country' => 'setBillingCountry' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'name' => 'getName', + 'crm_status' => 'getCrmStatus', + 'facility_type' => 'getFacilityType', + 'street' => 'getStreet', + 'postal_code' => 'getPostalCode', + 'city' => 'getCity', + 'country' => 'getCountry', + 'billing_street' => 'getBillingStreet', + 'billing_postal_code' => 'getBillingPostalCode', + 'billing_city' => 'getBillingCity', + 'billing_country' => 'getBillingCountry' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('name', $data ?? [], null); + $this->setIfExists('crm_status', $data ?? [], null); + $this->setIfExists('facility_type', $data ?? [], null); + $this->setIfExists('street', $data ?? [], null); + $this->setIfExists('postal_code', $data ?? [], null); + $this->setIfExists('city', $data ?? [], null); + $this->setIfExists('country', $data ?? [], null); + $this->setIfExists('billing_street', $data ?? [], null); + $this->setIfExists('billing_postal_code', $data ?? [], null); + $this->setIfExists('billing_city', $data ?? [], null); + $this->setIfExists('billing_country', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets name + * + * @return string|null + */ + public function getName() + { + return $this->container['name']; + } + + /** + * Sets name + * + * @param string|null $name name + * + * @return self + */ + public function setName($name) + { + if (is_null($name)) { + array_push($this->openAPINullablesSetToNull, 'name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['name'] = $name; + + return $this; + } + + /** + * Gets crm_status + * + * @return string|null + */ + public function getCrmStatus() + { + return $this->container['crm_status']; + } + + /** + * Sets crm_status + * + * @param string|null $crm_status crm_status + * + * @return self + */ + public function setCrmStatus($crm_status) + { + if (is_null($crm_status)) { + array_push($this->openAPINullablesSetToNull, 'crm_status'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('crm_status', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['crm_status'] = $crm_status; + + return $this; + } + + /** + * Gets facility_type + * + * @return string|null + */ + public function getFacilityType() + { + return $this->container['facility_type']; + } + + /** + * Sets facility_type + * + * @param string|null $facility_type facility_type + * + * @return self + */ + public function setFacilityType($facility_type) + { + if (is_null($facility_type)) { + array_push($this->openAPINullablesSetToNull, 'facility_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('facility_type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['facility_type'] = $facility_type; + + return $this; + } + + /** + * Gets street + * + * @return string|null + */ + public function getStreet() + { + return $this->container['street']; + } + + /** + * Sets street + * + * @param string|null $street street + * + * @return self + */ + public function setStreet($street) + { + if (is_null($street)) { + array_push($this->openAPINullablesSetToNull, 'street'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('street', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['street'] = $street; + + return $this; + } + + /** + * Gets postal_code + * + * @return string|null + */ + public function getPostalCode() + { + return $this->container['postal_code']; + } + + /** + * Sets postal_code + * + * @param string|null $postal_code postal_code + * + * @return self + */ + public function setPostalCode($postal_code) + { + if (is_null($postal_code)) { + array_push($this->openAPINullablesSetToNull, 'postal_code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('postal_code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['postal_code'] = $postal_code; + + return $this; + } + + /** + * Gets city + * + * @return string|null + */ + public function getCity() + { + return $this->container['city']; + } + + /** + * Sets city + * + * @param string|null $city city + * + * @return self + */ + public function setCity($city) + { + if (is_null($city)) { + array_push($this->openAPINullablesSetToNull, 'city'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('city', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['city'] = $city; + + return $this; + } + + /** + * Gets country + * + * @return string|null + */ + public function getCountry() + { + return $this->container['country']; + } + + /** + * Sets country + * + * @param string|null $country country + * + * @return self + */ + public function setCountry($country) + { + if (is_null($country)) { + array_push($this->openAPINullablesSetToNull, 'country'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('country', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['country'] = $country; + + return $this; + } + + /** + * Gets billing_street + * + * @return string|null + */ + public function getBillingStreet() + { + return $this->container['billing_street']; + } + + /** + * Sets billing_street + * + * @param string|null $billing_street billing_street + * + * @return self + */ + public function setBillingStreet($billing_street) + { + if (is_null($billing_street)) { + array_push($this->openAPINullablesSetToNull, 'billing_street'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('billing_street', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['billing_street'] = $billing_street; + + return $this; + } + + /** + * Gets billing_postal_code + * + * @return string|null + */ + public function getBillingPostalCode() + { + return $this->container['billing_postal_code']; + } + + /** + * Sets billing_postal_code + * + * @param string|null $billing_postal_code billing_postal_code + * + * @return self + */ + public function setBillingPostalCode($billing_postal_code) + { + if (is_null($billing_postal_code)) { + array_push($this->openAPINullablesSetToNull, 'billing_postal_code'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('billing_postal_code', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['billing_postal_code'] = $billing_postal_code; + + return $this; + } + + /** + * Gets billing_city + * + * @return string|null + */ + public function getBillingCity() + { + return $this->container['billing_city']; + } + + /** + * Sets billing_city + * + * @param string|null $billing_city billing_city + * + * @return self + */ + public function setBillingCity($billing_city) + { + if (is_null($billing_city)) { + array_push($this->openAPINullablesSetToNull, 'billing_city'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('billing_city', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['billing_city'] = $billing_city; + + return $this; + } + + /** + * Gets billing_country + * + * @return string|null + */ + public function getBillingCountry() + { + return $this->container['billing_country']; + } + + /** + * Sets billing_country + * + * @param string|null $billing_country billing_country + * + * @return self + */ + public function setBillingCountry($billing_country) + { + if (is_null($billing_country)) { + array_push($this->openAPINullablesSetToNull, 'billing_country'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('billing_country', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['billing_country'] = $billing_country; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UpdateOrderRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UpdateOrderRequest.php new file mode 100644 index 0000000..159fced --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UpdateOrderRequest.php @@ -0,0 +1,757 @@ + + */ +class UpdateOrderRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateOrderRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'facility_id' => 'string', + 'facility_contact_id' => 'string', + 'start_date' => '\DateTime', + 'end_date' => '\DateTime', + 'required_qualification' => 'string', + 'shift_type' => 'string', + 'required_headcount' => 'int', + 'conditions' => 'string', + 'priority' => 'string', + 'status_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'facility_id' => 'uuid', + 'facility_contact_id' => 'uuid', + 'start_date' => 'date', + 'end_date' => 'date', + 'required_qualification' => null, + 'shift_type' => null, + 'required_headcount' => 'int32', + 'conditions' => null, + 'priority' => null, + 'status_id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'facility_id' => false, + 'facility_contact_id' => true, + 'start_date' => false, + 'end_date' => true, + 'required_qualification' => true, + 'shift_type' => true, + 'required_headcount' => false, + 'conditions' => true, + 'priority' => true, + 'status_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'facility_id' => 'facilityId', + 'facility_contact_id' => 'facilityContactId', + 'start_date' => 'startDate', + 'end_date' => 'endDate', + 'required_qualification' => 'requiredQualification', + 'shift_type' => 'shiftType', + 'required_headcount' => 'requiredHeadcount', + 'conditions' => 'conditions', + 'priority' => 'priority', + 'status_id' => 'statusId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'facility_id' => 'setFacilityId', + 'facility_contact_id' => 'setFacilityContactId', + 'start_date' => 'setStartDate', + 'end_date' => 'setEndDate', + 'required_qualification' => 'setRequiredQualification', + 'shift_type' => 'setShiftType', + 'required_headcount' => 'setRequiredHeadcount', + 'conditions' => 'setConditions', + 'priority' => 'setPriority', + 'status_id' => 'setStatusId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'facility_id' => 'getFacilityId', + 'facility_contact_id' => 'getFacilityContactId', + 'start_date' => 'getStartDate', + 'end_date' => 'getEndDate', + 'required_qualification' => 'getRequiredQualification', + 'shift_type' => 'getShiftType', + 'required_headcount' => 'getRequiredHeadcount', + 'conditions' => 'getConditions', + 'priority' => 'getPriority', + 'status_id' => 'getStatusId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('facility_id', $data ?? [], null); + $this->setIfExists('facility_contact_id', $data ?? [], null); + $this->setIfExists('start_date', $data ?? [], null); + $this->setIfExists('end_date', $data ?? [], null); + $this->setIfExists('required_qualification', $data ?? [], null); + $this->setIfExists('shift_type', $data ?? [], null); + $this->setIfExists('required_headcount', $data ?? [], null); + $this->setIfExists('conditions', $data ?? [], null); + $this->setIfExists('priority', $data ?? [], null); + $this->setIfExists('status_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets facility_id + * + * @return string|null + */ + public function getFacilityId() + { + return $this->container['facility_id']; + } + + /** + * Sets facility_id + * + * @param string|null $facility_id facility_id + * + * @return self + */ + public function setFacilityId($facility_id) + { + if (is_null($facility_id)) { + throw new \InvalidArgumentException('non-nullable facility_id cannot be null'); + } + $this->container['facility_id'] = $facility_id; + + return $this; + } + + /** + * Gets facility_contact_id + * + * @return string|null + */ + public function getFacilityContactId() + { + return $this->container['facility_contact_id']; + } + + /** + * Sets facility_contact_id + * + * @param string|null $facility_contact_id facility_contact_id + * + * @return self + */ + public function setFacilityContactId($facility_contact_id) + { + if (is_null($facility_contact_id)) { + array_push($this->openAPINullablesSetToNull, 'facility_contact_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('facility_contact_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['facility_contact_id'] = $facility_contact_id; + + return $this; + } + + /** + * Gets start_date + * + * @return \DateTime|null + */ + public function getStartDate() + { + return $this->container['start_date']; + } + + /** + * Sets start_date + * + * @param \DateTime|null $start_date start_date + * + * @return self + */ + public function setStartDate($start_date) + { + if (is_null($start_date)) { + throw new \InvalidArgumentException('non-nullable start_date cannot be null'); + } + $this->container['start_date'] = $start_date; + + return $this; + } + + /** + * Gets end_date + * + * @return \DateTime|null + */ + public function getEndDate() + { + return $this->container['end_date']; + } + + /** + * Sets end_date + * + * @param \DateTime|null $end_date end_date + * + * @return self + */ + public function setEndDate($end_date) + { + if (is_null($end_date)) { + array_push($this->openAPINullablesSetToNull, 'end_date'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('end_date', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['end_date'] = $end_date; + + return $this; + } + + /** + * Gets required_qualification + * + * @return string|null + */ + public function getRequiredQualification() + { + return $this->container['required_qualification']; + } + + /** + * Sets required_qualification + * + * @param string|null $required_qualification required_qualification + * + * @return self + */ + public function setRequiredQualification($required_qualification) + { + if (is_null($required_qualification)) { + array_push($this->openAPINullablesSetToNull, 'required_qualification'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('required_qualification', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['required_qualification'] = $required_qualification; + + return $this; + } + + /** + * Gets shift_type + * + * @return string|null + */ + public function getShiftType() + { + return $this->container['shift_type']; + } + + /** + * Sets shift_type + * + * @param string|null $shift_type shift_type + * + * @return self + */ + public function setShiftType($shift_type) + { + if (is_null($shift_type)) { + array_push($this->openAPINullablesSetToNull, 'shift_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('shift_type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['shift_type'] = $shift_type; + + return $this; + } + + /** + * Gets required_headcount + * + * @return int|null + */ + public function getRequiredHeadcount() + { + return $this->container['required_headcount']; + } + + /** + * Sets required_headcount + * + * @param int|null $required_headcount required_headcount + * + * @return self + */ + public function setRequiredHeadcount($required_headcount) + { + if (is_null($required_headcount)) { + throw new \InvalidArgumentException('non-nullable required_headcount cannot be null'); + } + $this->container['required_headcount'] = $required_headcount; + + return $this; + } + + /** + * Gets conditions + * + * @return string|null + */ + public function getConditions() + { + return $this->container['conditions']; + } + + /** + * Sets conditions + * + * @param string|null $conditions conditions + * + * @return self + */ + public function setConditions($conditions) + { + if (is_null($conditions)) { + array_push($this->openAPINullablesSetToNull, 'conditions'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('conditions', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['conditions'] = $conditions; + + return $this; + } + + /** + * Gets priority + * + * @return string|null + */ + public function getPriority() + { + return $this->container['priority']; + } + + /** + * Sets priority + * + * @param string|null $priority priority + * + * @return self + */ + public function setPriority($priority) + { + if (is_null($priority)) { + array_push($this->openAPINullablesSetToNull, 'priority'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('priority', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['priority'] = $priority; + + return $this; + } + + /** + * Gets status_id + * + * @return string|null + */ + public function getStatusId() + { + return $this->container['status_id']; + } + + /** + * Sets status_id + * + * @param string|null $status_id status_id + * + * @return self + */ + public function setStatusId($status_id) + { + if (is_null($status_id)) { + throw new \InvalidArgumentException('non-nullable status_id cannot be null'); + } + $this->container['status_id'] = $status_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UpdateRolePermissionsRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UpdateRolePermissionsRequest.php new file mode 100644 index 0000000..628c7dd --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UpdateRolePermissionsRequest.php @@ -0,0 +1,416 @@ + + */ +class UpdateRolePermissionsRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateRolePermissionsRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'permissions' => '\OmsorgCoreClient\Model\PermissionDto[]' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'permissions' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'permissions' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'permissions' => 'permissions' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'permissions' => 'setPermissions' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'permissions' => 'getPermissions' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('permissions', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets permissions + * + * @return \OmsorgCoreClient\Model\PermissionDto[]|null + */ + public function getPermissions() + { + return $this->container['permissions']; + } + + /** + * Sets permissions + * + * @param \OmsorgCoreClient\Model\PermissionDto[]|null $permissions permissions + * + * @return self + */ + public function setPermissions($permissions) + { + if (is_null($permissions)) { + array_push($this->openAPINullablesSetToNull, 'permissions'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('permissions', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['permissions'] = $permissions; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UpdateUserRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UpdateUserRequest.php new file mode 100644 index 0000000..4082618 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UpdateUserRequest.php @@ -0,0 +1,443 @@ + + */ +class UpdateUserRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateUserRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'role_id' => 'string', + 'is_active' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'role_id' => 'uuid', + 'is_active' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'role_id' => false, + 'is_active' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'role_id' => 'roleId', + 'is_active' => 'isActive' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'role_id' => 'setRoleId', + 'is_active' => 'setIsActive' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'role_id' => 'getRoleId', + 'is_active' => 'getIsActive' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('role_id', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets role_id + * + * @return string|null + */ + public function getRoleId() + { + return $this->container['role_id']; + } + + /** + * Sets role_id + * + * @param string|null $role_id role_id + * + * @return self + */ + public function setRoleId($role_id) + { + if (is_null($role_id)) { + throw new \InvalidArgumentException('non-nullable role_id cannot be null'); + } + $this->container['role_id'] = $role_id; + + return $this; + } + + /** + * Gets is_active + * + * @return bool|null + */ + public function getIsActive() + { + return $this->container['is_active']; + } + + /** + * Sets is_active + * + * @param bool|null $is_active is_active + * + * @return self + */ + public function setIsActive($is_active) + { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } + $this->container['is_active'] = $is_active; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UpdateValueListItemRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UpdateValueListItemRequest.php new file mode 100644 index 0000000..e064052 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UpdateValueListItemRequest.php @@ -0,0 +1,552 @@ + + */ +class UpdateValueListItemRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UpdateValueListItemRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'value' => 'string', + 'sort_order' => 'int', + 'is_default' => 'bool', + 'is_initial' => 'bool', + 'is_terminal' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'value' => null, + 'sort_order' => 'int32', + 'is_default' => null, + 'is_initial' => null, + 'is_terminal' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'value' => true, + 'sort_order' => false, + 'is_default' => false, + 'is_initial' => false, + 'is_terminal' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'value' => 'value', + 'sort_order' => 'sortOrder', + 'is_default' => 'isDefault', + 'is_initial' => 'isInitial', + 'is_terminal' => 'isTerminal' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'value' => 'setValue', + 'sort_order' => 'setSortOrder', + 'is_default' => 'setIsDefault', + 'is_initial' => 'setIsInitial', + 'is_terminal' => 'setIsTerminal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'value' => 'getValue', + 'sort_order' => 'getSortOrder', + 'is_default' => 'getIsDefault', + 'is_initial' => 'getIsInitial', + 'is_terminal' => 'getIsTerminal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('sort_order', $data ?? [], null); + $this->setIfExists('is_default', $data ?? [], null); + $this->setIfExists('is_initial', $data ?? [], null); + $this->setIfExists('is_terminal', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value value + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + array_push($this->openAPINullablesSetToNull, 'value'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('value', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets sort_order + * + * @return int|null + */ + public function getSortOrder() + { + return $this->container['sort_order']; + } + + /** + * Sets sort_order + * + * @param int|null $sort_order sort_order + * + * @return self + */ + public function setSortOrder($sort_order) + { + if (is_null($sort_order)) { + throw new \InvalidArgumentException('non-nullable sort_order cannot be null'); + } + $this->container['sort_order'] = $sort_order; + + return $this; + } + + /** + * Gets is_default + * + * @return bool|null + */ + public function getIsDefault() + { + return $this->container['is_default']; + } + + /** + * Sets is_default + * + * @param bool|null $is_default is_default + * + * @return self + */ + public function setIsDefault($is_default) + { + if (is_null($is_default)) { + throw new \InvalidArgumentException('non-nullable is_default cannot be null'); + } + $this->container['is_default'] = $is_default; + + return $this; + } + + /** + * Gets is_initial + * + * @return bool|null + */ + public function getIsInitial() + { + return $this->container['is_initial']; + } + + /** + * Sets is_initial + * + * @param bool|null $is_initial is_initial + * + * @return self + */ + public function setIsInitial($is_initial) + { + if (is_null($is_initial)) { + throw new \InvalidArgumentException('non-nullable is_initial cannot be null'); + } + $this->container['is_initial'] = $is_initial; + + return $this; + } + + /** + * Gets is_terminal + * + * @return bool|null + */ + public function getIsTerminal() + { + return $this->container['is_terminal']; + } + + /** + * Sets is_terminal + * + * @param bool|null $is_terminal is_terminal + * + * @return self + */ + public function setIsTerminal($is_terminal) + { + if (is_null($is_terminal)) { + throw new \InvalidArgumentException('non-nullable is_terminal cannot be null'); + } + $this->container['is_terminal'] = $is_terminal; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UserPermissionOverrideResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UserPermissionOverrideResponse.php new file mode 100644 index 0000000..47ba17b --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UserPermissionOverrideResponse.php @@ -0,0 +1,532 @@ + + */ +class UserPermissionOverrideResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UserPermissionOverrideResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'module' => 'string', + 'action' => 'string', + 'effect' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'uuid', + 'module' => null, + 'action' => null, + 'effect' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'module' => true, + 'action' => true, + 'effect' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'module' => 'module', + 'action' => 'action', + 'effect' => 'effect' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'module' => 'setModule', + 'action' => 'setAction', + 'effect' => 'setEffect' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'module' => 'getModule', + 'action' => 'getAction', + 'effect' => 'getEffect' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('module', $data ?? [], null); + $this->setIfExists('action', $data ?? [], null); + $this->setIfExists('effect', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets module + * + * @return string|null + */ + public function getModule() + { + return $this->container['module']; + } + + /** + * Sets module + * + * @param string|null $module module + * + * @return self + */ + public function setModule($module) + { + if (is_null($module)) { + array_push($this->openAPINullablesSetToNull, 'module'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('module', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['module'] = $module; + + return $this; + } + + /** + * Gets action + * + * @return string|null + */ + public function getAction() + { + return $this->container['action']; + } + + /** + * Sets action + * + * @param string|null $action action + * + * @return self + */ + public function setAction($action) + { + if (is_null($action)) { + array_push($this->openAPINullablesSetToNull, 'action'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('action', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['action'] = $action; + + return $this; + } + + /** + * Gets effect + * + * @return string|null + */ + public function getEffect() + { + return $this->container['effect']; + } + + /** + * Sets effect + * + * @param string|null $effect effect + * + * @return self + */ + public function setEffect($effect) + { + if (is_null($effect)) { + array_push($this->openAPINullablesSetToNull, 'effect'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('effect', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['effect'] = $effect; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UserResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UserResponse.php new file mode 100644 index 0000000..ef7ce43 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/UserResponse.php @@ -0,0 +1,600 @@ + + */ +class UserResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'UserResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'username' => 'string', + 'employee_id' => 'string', + 'role_name' => 'string', + 'is_active' => 'bool', + 'must_change_password' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'uuid', + 'username' => null, + 'employee_id' => 'uuid', + 'role_name' => null, + 'is_active' => null, + 'must_change_password' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'username' => true, + 'employee_id' => true, + 'role_name' => true, + 'is_active' => false, + 'must_change_password' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'username' => 'username', + 'employee_id' => 'employeeId', + 'role_name' => 'roleName', + 'is_active' => 'isActive', + 'must_change_password' => 'mustChangePassword' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'username' => 'setUsername', + 'employee_id' => 'setEmployeeId', + 'role_name' => 'setRoleName', + 'is_active' => 'setIsActive', + 'must_change_password' => 'setMustChangePassword' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'username' => 'getUsername', + 'employee_id' => 'getEmployeeId', + 'role_name' => 'getRoleName', + 'is_active' => 'getIsActive', + 'must_change_password' => 'getMustChangePassword' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('username', $data ?? [], null); + $this->setIfExists('employee_id', $data ?? [], null); + $this->setIfExists('role_name', $data ?? [], null); + $this->setIfExists('is_active', $data ?? [], null); + $this->setIfExists('must_change_password', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets username + * + * @return string|null + */ + public function getUsername() + { + return $this->container['username']; + } + + /** + * Sets username + * + * @param string|null $username username + * + * @return self + */ + public function setUsername($username) + { + if (is_null($username)) { + array_push($this->openAPINullablesSetToNull, 'username'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('username', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['username'] = $username; + + return $this; + } + + /** + * Gets employee_id + * + * @return string|null + */ + public function getEmployeeId() + { + return $this->container['employee_id']; + } + + /** + * Sets employee_id + * + * @param string|null $employee_id employee_id + * + * @return self + */ + public function setEmployeeId($employee_id) + { + if (is_null($employee_id)) { + array_push($this->openAPINullablesSetToNull, 'employee_id'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('employee_id', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['employee_id'] = $employee_id; + + return $this; + } + + /** + * Gets role_name + * + * @return string|null + */ + public function getRoleName() + { + return $this->container['role_name']; + } + + /** + * Sets role_name + * + * @param string|null $role_name role_name + * + * @return self + */ + public function setRoleName($role_name) + { + if (is_null($role_name)) { + array_push($this->openAPINullablesSetToNull, 'role_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('role_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['role_name'] = $role_name; + + return $this; + } + + /** + * Gets is_active + * + * @return bool|null + */ + public function getIsActive() + { + return $this->container['is_active']; + } + + /** + * Sets is_active + * + * @param bool|null $is_active is_active + * + * @return self + */ + public function setIsActive($is_active) + { + if (is_null($is_active)) { + throw new \InvalidArgumentException('non-nullable is_active cannot be null'); + } + $this->container['is_active'] = $is_active; + + return $this; + } + + /** + * Gets must_change_password + * + * @return bool|null + */ + public function getMustChangePassword() + { + return $this->container['must_change_password']; + } + + /** + * Sets must_change_password + * + * @param bool|null $must_change_password must_change_password + * + * @return self + */ + public function setMustChangePassword($must_change_password) + { + if (is_null($must_change_password)) { + throw new \InvalidArgumentException('non-nullable must_change_password cannot be null'); + } + $this->container['must_change_password'] = $must_change_password; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ValueListItemResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ValueListItemResponse.php new file mode 100644 index 0000000..970336e --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ValueListItemResponse.php @@ -0,0 +1,586 @@ + + */ +class ValueListItemResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ValueListItemResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'value' => 'string', + 'sort_order' => 'int', + 'is_default' => 'bool', + 'is_initial' => 'bool', + 'is_terminal' => 'bool' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'uuid', + 'value' => null, + 'sort_order' => 'int32', + 'is_default' => null, + 'is_initial' => null, + 'is_terminal' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'value' => true, + 'sort_order' => false, + 'is_default' => false, + 'is_initial' => false, + 'is_terminal' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'value' => 'value', + 'sort_order' => 'sortOrder', + 'is_default' => 'isDefault', + 'is_initial' => 'isInitial', + 'is_terminal' => 'isTerminal' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'value' => 'setValue', + 'sort_order' => 'setSortOrder', + 'is_default' => 'setIsDefault', + 'is_initial' => 'setIsInitial', + 'is_terminal' => 'setIsTerminal' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'value' => 'getValue', + 'sort_order' => 'getSortOrder', + 'is_default' => 'getIsDefault', + 'is_initial' => 'getIsInitial', + 'is_terminal' => 'getIsTerminal' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('value', $data ?? [], null); + $this->setIfExists('sort_order', $data ?? [], null); + $this->setIfExists('is_default', $data ?? [], null); + $this->setIfExists('is_initial', $data ?? [], null); + $this->setIfExists('is_terminal', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets value + * + * @return string|null + */ + public function getValue() + { + return $this->container['value']; + } + + /** + * Sets value + * + * @param string|null $value value + * + * @return self + */ + public function setValue($value) + { + if (is_null($value)) { + array_push($this->openAPINullablesSetToNull, 'value'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('value', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['value'] = $value; + + return $this; + } + + /** + * Gets sort_order + * + * @return int|null + */ + public function getSortOrder() + { + return $this->container['sort_order']; + } + + /** + * Sets sort_order + * + * @param int|null $sort_order sort_order + * + * @return self + */ + public function setSortOrder($sort_order) + { + if (is_null($sort_order)) { + throw new \InvalidArgumentException('non-nullable sort_order cannot be null'); + } + $this->container['sort_order'] = $sort_order; + + return $this; + } + + /** + * Gets is_default + * + * @return bool|null + */ + public function getIsDefault() + { + return $this->container['is_default']; + } + + /** + * Sets is_default + * + * @param bool|null $is_default is_default + * + * @return self + */ + public function setIsDefault($is_default) + { + if (is_null($is_default)) { + throw new \InvalidArgumentException('non-nullable is_default cannot be null'); + } + $this->container['is_default'] = $is_default; + + return $this; + } + + /** + * Gets is_initial + * + * @return bool|null + */ + public function getIsInitial() + { + return $this->container['is_initial']; + } + + /** + * Sets is_initial + * + * @param bool|null $is_initial is_initial + * + * @return self + */ + public function setIsInitial($is_initial) + { + if (is_null($is_initial)) { + throw new \InvalidArgumentException('non-nullable is_initial cannot be null'); + } + $this->container['is_initial'] = $is_initial; + + return $this; + } + + /** + * Gets is_terminal + * + * @return bool|null + */ + public function getIsTerminal() + { + return $this->container['is_terminal']; + } + + /** + * Sets is_terminal + * + * @param bool|null $is_terminal is_terminal + * + * @return self + */ + public function setIsTerminal($is_terminal) + { + if (is_null($is_terminal)) { + throw new \InvalidArgumentException('non-nullable is_terminal cannot be null'); + } + $this->container['is_terminal'] = $is_terminal; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ValueListResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ValueListResponse.php new file mode 100644 index 0000000..9927ec1 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ValueListResponse.php @@ -0,0 +1,491 @@ + + */ +class ValueListResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ValueListResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'key' => 'string', + 'display_name' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'uuid', + 'key' => null, + 'display_name' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'key' => true, + 'display_name' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'key' => 'key', + 'display_name' => 'displayName' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'key' => 'setKey', + 'display_name' => 'setDisplayName' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'key' => 'getKey', + 'display_name' => 'getDisplayName' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('key', $data ?? [], null); + $this->setIfExists('display_name', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets key + * + * @return string|null + */ + public function getKey() + { + return $this->container['key']; + } + + /** + * Sets key + * + * @param string|null $key key + * + * @return self + */ + public function setKey($key) + { + if (is_null($key)) { + array_push($this->openAPINullablesSetToNull, 'key'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('key', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['key'] = $key; + + return $this; + } + + /** + * Gets display_name + * + * @return string|null + */ + public function getDisplayName() + { + return $this->container['display_name']; + } + + /** + * Sets display_name + * + * @param string|null $display_name display_name + * + * @return self + */ + public function setDisplayName($display_name) + { + if (is_null($display_name)) { + array_push($this->openAPINullablesSetToNull, 'display_name'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('display_name', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['display_name'] = $display_name; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ValueListTransitionRequest.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ValueListTransitionRequest.php new file mode 100644 index 0000000..24bc425 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ValueListTransitionRequest.php @@ -0,0 +1,443 @@ + + */ +class ValueListTransitionRequest implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ValueListTransitionRequest'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'from_item_id' => 'string', + 'to_item_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'from_item_id' => 'uuid', + 'to_item_id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'from_item_id' => false, + 'to_item_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'from_item_id' => 'fromItemId', + 'to_item_id' => 'toItemId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'from_item_id' => 'setFromItemId', + 'to_item_id' => 'setToItemId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'from_item_id' => 'getFromItemId', + 'to_item_id' => 'getToItemId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('from_item_id', $data ?? [], null); + $this->setIfExists('to_item_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets from_item_id + * + * @return string|null + */ + public function getFromItemId() + { + return $this->container['from_item_id']; + } + + /** + * Sets from_item_id + * + * @param string|null $from_item_id from_item_id + * + * @return self + */ + public function setFromItemId($from_item_id) + { + if (is_null($from_item_id)) { + throw new \InvalidArgumentException('non-nullable from_item_id cannot be null'); + } + $this->container['from_item_id'] = $from_item_id; + + return $this; + } + + /** + * Gets to_item_id + * + * @return string|null + */ + public function getToItemId() + { + return $this->container['to_item_id']; + } + + /** + * Sets to_item_id + * + * @param string|null $to_item_id to_item_id + * + * @return self + */ + public function setToItemId($to_item_id) + { + if (is_null($to_item_id)) { + throw new \InvalidArgumentException('non-nullable to_item_id cannot be null'); + } + $this->container['to_item_id'] = $to_item_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ValueListTransitionResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ValueListTransitionResponse.php new file mode 100644 index 0000000..221e94c --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ValueListTransitionResponse.php @@ -0,0 +1,477 @@ + + */ +class ValueListTransitionResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ValueListTransitionResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'id' => 'string', + 'from_item_id' => 'string', + 'to_item_id' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'id' => 'uuid', + 'from_item_id' => 'uuid', + 'to_item_id' => 'uuid' + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'id' => false, + 'from_item_id' => false, + 'to_item_id' => false + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'id' => 'id', + 'from_item_id' => 'fromItemId', + 'to_item_id' => 'toItemId' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'id' => 'setId', + 'from_item_id' => 'setFromItemId', + 'to_item_id' => 'setToItemId' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'id' => 'getId', + 'from_item_id' => 'getFromItemId', + 'to_item_id' => 'getToItemId' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('id', $data ?? [], null); + $this->setIfExists('from_item_id', $data ?? [], null); + $this->setIfExists('to_item_id', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets id + * + * @return string|null + */ + public function getId() + { + return $this->container['id']; + } + + /** + * Sets id + * + * @param string|null $id id + * + * @return self + */ + public function setId($id) + { + if (is_null($id)) { + throw new \InvalidArgumentException('non-nullable id cannot be null'); + } + $this->container['id'] = $id; + + return $this; + } + + /** + * Gets from_item_id + * + * @return string|null + */ + public function getFromItemId() + { + return $this->container['from_item_id']; + } + + /** + * Sets from_item_id + * + * @param string|null $from_item_id from_item_id + * + * @return self + */ + public function setFromItemId($from_item_id) + { + if (is_null($from_item_id)) { + throw new \InvalidArgumentException('non-nullable from_item_id cannot be null'); + } + $this->container['from_item_id'] = $from_item_id; + + return $this; + } + + /** + * Gets to_item_id + * + * @return string|null + */ + public function getToItemId() + { + return $this->container['to_item_id']; + } + + /** + * Sets to_item_id + * + * @param string|null $to_item_id to_item_id + * + * @return self + */ + public function setToItemId($to_item_id) + { + if (is_null($to_item_id)) { + throw new \InvalidArgumentException('non-nullable to_item_id cannot be null'); + } + $this->container['to_item_id'] = $to_item_id; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ValueListUsageResponse.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ValueListUsageResponse.php new file mode 100644 index 0000000..4a2d071 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/Model/ValueListUsageResponse.php @@ -0,0 +1,491 @@ + + */ +class ValueListUsageResponse implements ModelInterface, ArrayAccess, \JsonSerializable +{ + public const DISCRIMINATOR = null; + + /** + * The original name of the model. + * + * @var string + */ + protected static $openAPIModelName = 'ValueListUsageResponse'; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @var string[] + */ + protected static $openAPITypes = [ + 'entity_type' => 'string', + 'entity_id' => 'string', + 'display_label' => 'string' + ]; + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @var string[] + * @phpstan-var array + * @psalm-var array + */ + protected static $openAPIFormats = [ + 'entity_type' => null, + 'entity_id' => 'uuid', + 'display_label' => null + ]; + + /** + * Array of nullable properties. Used for (de)serialization + * + * @var boolean[] + */ + protected static array $openAPINullables = [ + 'entity_type' => true, + 'entity_id' => false, + 'display_label' => true + ]; + + /** + * If a nullable field gets set to null, insert it here + * + * @var boolean[] + */ + protected array $openAPINullablesSetToNull = []; + + /** + * Array of property to type mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPITypes() + { + return self::$openAPITypes; + } + + /** + * Array of property to format mappings. Used for (de)serialization + * + * @return array + */ + public static function openAPIFormats() + { + return self::$openAPIFormats; + } + + /** + * Array of nullable properties + * + * @return array + */ + protected static function openAPINullables(): array + { + return self::$openAPINullables; + } + + /** + * Array of nullable field names deliberately set to null + * + * @return boolean[] + */ + private function getOpenAPINullablesSetToNull(): array + { + return $this->openAPINullablesSetToNull; + } + + /** + * Setter - Array of nullable field names deliberately set to null + * + * @param boolean[] $openAPINullablesSetToNull + */ + private function setOpenAPINullablesSetToNull(array $openAPINullablesSetToNull): void + { + $this->openAPINullablesSetToNull = $openAPINullablesSetToNull; + } + + /** + * Checks if a property is nullable + * + * @param string $property + * @return bool + */ + public static function isNullable(string $property): bool + { + return self::openAPINullables()[$property] ?? false; + } + + /** + * Checks if a nullable property is set to null. + * + * @param string $property + * @return bool + */ + public function isNullableSetToNull(string $property): bool + { + return in_array($property, $this->getOpenAPINullablesSetToNull(), true); + } + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @var string[] + */ + protected static $attributeMap = [ + 'entity_type' => 'entityType', + 'entity_id' => 'entityId', + 'display_label' => 'displayLabel' + ]; + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @var string[] + */ + protected static $setters = [ + 'entity_type' => 'setEntityType', + 'entity_id' => 'setEntityId', + 'display_label' => 'setDisplayLabel' + ]; + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @var string[] + */ + protected static $getters = [ + 'entity_type' => 'getEntityType', + 'entity_id' => 'getEntityId', + 'display_label' => 'getDisplayLabel' + ]; + + /** + * Array of attributes where the key is the local name, + * and the value is the original name + * + * @return array + */ + public static function attributeMap() + { + return self::$attributeMap; + } + + /** + * Array of attributes to setter functions (for deserialization of responses) + * + * @return array + */ + public static function setters() + { + return self::$setters; + } + + /** + * Array of attributes to getter functions (for serialization of requests) + * + * @return array + */ + public static function getters() + { + return self::$getters; + } + + /** + * The original name of the model. + * + * @return string + */ + public function getModelName() + { + return self::$openAPIModelName; + } + + + /** + * Associative array for storing property values + * + * @var mixed[] + */ + protected $container = []; + + /** + * Constructor + * + * @param mixed[]|null $data Associated array of property values + * initializing the model + */ + public function __construct(?array $data = null) + { + $this->setIfExists('entity_type', $data ?? [], null); + $this->setIfExists('entity_id', $data ?? [], null); + $this->setIfExists('display_label', $data ?? [], null); + } + + /** + * Sets $this->container[$variableName] to the given data or to the given default Value; if $variableName + * is nullable and its value is set to null in the $fields array, then mark it as "set to null" in the + * $this->openAPINullablesSetToNull array + * + * @param string $variableName + * @param array $fields + * @param mixed $defaultValue + */ + private function setIfExists(string $variableName, array $fields, $defaultValue): void + { + if (self::isNullable($variableName) && array_key_exists($variableName, $fields) && is_null($fields[$variableName])) { + $this->openAPINullablesSetToNull[] = $variableName; + } + + $this->container[$variableName] = $fields[$variableName] ?? $defaultValue; + } + + /** + * Show all the invalid properties with reasons. + * + * @return array invalid properties with reasons + */ + public function listInvalidProperties() + { + $invalidProperties = []; + + return $invalidProperties; + } + + /** + * Validate all the properties in the model + * return true if all passed + * + * @return bool True if all properties are valid + */ + public function valid() + { + return count($this->listInvalidProperties()) === 0; + } + + + /** + * Gets entity_type + * + * @return string|null + */ + public function getEntityType() + { + return $this->container['entity_type']; + } + + /** + * Sets entity_type + * + * @param string|null $entity_type entity_type + * + * @return self + */ + public function setEntityType($entity_type) + { + if (is_null($entity_type)) { + array_push($this->openAPINullablesSetToNull, 'entity_type'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('entity_type', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['entity_type'] = $entity_type; + + return $this; + } + + /** + * Gets entity_id + * + * @return string|null + */ + public function getEntityId() + { + return $this->container['entity_id']; + } + + /** + * Sets entity_id + * + * @param string|null $entity_id entity_id + * + * @return self + */ + public function setEntityId($entity_id) + { + if (is_null($entity_id)) { + throw new \InvalidArgumentException('non-nullable entity_id cannot be null'); + } + $this->container['entity_id'] = $entity_id; + + return $this; + } + + /** + * Gets display_label + * + * @return string|null + */ + public function getDisplayLabel() + { + return $this->container['display_label']; + } + + /** + * Sets display_label + * + * @param string|null $display_label display_label + * + * @return self + */ + public function setDisplayLabel($display_label) + { + if (is_null($display_label)) { + array_push($this->openAPINullablesSetToNull, 'display_label'); + } else { + $nullablesSetToNull = $this->getOpenAPINullablesSetToNull(); + $index = array_search('display_label', $nullablesSetToNull); + if ($index !== FALSE) { + unset($nullablesSetToNull[$index]); + $this->setOpenAPINullablesSetToNull($nullablesSetToNull); + } + } + $this->container['display_label'] = $display_label; + + return $this; + } + /** + * Returns true if offset exists. False otherwise. + * + * @param integer $offset Offset + * + * @return boolean + */ + public function offsetExists($offset): bool + { + return isset($this->container[$offset]); + } + + /** + * Gets offset. + * + * @param integer $offset Offset + * + * @return mixed|null + */ + #[\ReturnTypeWillChange] + public function offsetGet($offset) + { + return $this->container[$offset] ?? null; + } + + /** + * Sets value based on offset. + * + * @param int|null $offset Offset + * @param mixed $value Value to be set + * + * @return void + */ + public function offsetSet($offset, $value): void + { + if (is_null($offset)) { + $this->container[] = $value; + } else { + $this->container[$offset] = $value; + } + } + + /** + * Unsets offset. + * + * @param integer $offset Offset + * + * @return void + */ + public function offsetUnset($offset): void + { + unset($this->container[$offset]); + } + + /** + * Serializes the object to a value that can be serialized natively by json_encode(). + * @link https://www.php.net/manual/en/jsonserializable.jsonserialize.php + * + * @return mixed Returns data which can be serialized by json_encode(), which is a value + * of any type other than a resource. + */ + #[\ReturnTypeWillChange] + public function jsonSerialize() + { + return ObjectSerializer::sanitizeForSerialization($this); + } + + /** + * Gets the string presentation of the object + * + * @return string + */ + public function __toString() + { + return json_encode( + ObjectSerializer::sanitizeForSerialization($this), + JSON_PRETTY_PRINT + ); + } + + /** + * Gets a header-safe presentation of the object + * + * @return string + */ + public function toHeaderValue() + { + return json_encode(ObjectSerializer::sanitizeForSerialization($this)); + } +} + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/lib/ObjectSerializer.php b/omsorgWeb/mitarbeiter-app/api-client-php/lib/ObjectSerializer.php new file mode 100644 index 0000000..6bc2de1 --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/lib/ObjectSerializer.php @@ -0,0 +1,599 @@ +format('Y-m-d') : $data->format(self::$dateTimeFormat); + } + + if (is_array($data)) { + foreach ($data as $property => $value) { + $data[$property] = self::sanitizeForSerialization($value); + } + return $data; + } + + if (is_object($data)) { + $values = []; + if ($data instanceof ModelInterface) { + $formats = $data::openAPIFormats(); + foreach ($data::openAPITypes() as $property => $openAPIType) { + $getter = $data::getters()[$property]; + $value = $data->$getter(); + if ($value !== null && !in_array($openAPIType, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + $callable = [$openAPIType, 'getAllowableEnumValues']; + if (is_callable($callable)) { + /** array $callable */ + $allowedEnumTypes = $callable(); + if (!in_array($value, $allowedEnumTypes, true)) { + $imploded = implode("', '", $allowedEnumTypes); + throw new \InvalidArgumentException("Invalid value for enum '$openAPIType', must be one of: '$imploded'"); + } + } + } + if (($data::isNullable($property) && $data->isNullableSetToNull($property)) || $value !== null) { + $values[$data::attributeMap()[$property]] = self::sanitizeForSerialization($value, $openAPIType, $formats[$property]); + } + } + } else { + foreach($data as $property => $value) { + $values[$property] = self::sanitizeForSerialization($value); + } + } + return (object)$values; + } else { + return (string)$data; + } + } + + /** + * Sanitize filename by removing path. + * e.g. ../../sun.gif becomes sun.gif + * + * @param string $filename filename to be sanitized + * + * @return string the sanitized filename + */ + public static function sanitizeFilename($filename) + { + if (preg_match("/.*[\/\\\\](.*)$/", $filename, $match)) { + return $match[1]; + } else { + return $filename; + } + } + + /** + * Shorter timestamp microseconds to 6 digits length. + * + * @param string $timestamp Original timestamp + * + * @return string the shorten timestamp + */ + public static function sanitizeTimestamp($timestamp) + { + if (!is_string($timestamp)) return $timestamp; + + return preg_replace('/(:\d{2}.\d{6})\d*/', '$1', $timestamp); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the path, by url-encoding. + * + * @param string $value a string which will be part of the path + * + * @return string the serialized object + */ + public static function toPathValue($value) + { + return rawurlencode(self::toString($value)); + } + + /** + * Checks if a value is empty, based on its OpenAPI type. + * + * @param mixed $value + * @param string $openApiType + * + * @return bool true if $value is empty + */ + private static function isEmptyValue($value, string $openApiType): bool + { + # If empty() returns false, it is not empty regardless of its type. + if (!empty($value)) { + return false; + } + + # Null is always empty, as we cannot send a real "null" value in a query parameter. + if ($value === null) { + return true; + } + + switch ($openApiType) { + # For numeric values, false and '' are considered empty. + # This comparison is safe for floating point values, since the previous call to empty() will + # filter out values that don't match 0. + case 'int': + case 'integer': + return $value !== 0; + + case 'number': + case 'float': + return $value !== 0 && $value !== 0.0; + + # For boolean values, '' is considered empty + case 'bool': + case 'boolean': + return !in_array($value, [false, 0], true); + + # For string values, '' is considered empty. + case 'string': + return $value === ''; + + # For all the other types, any value at this point can be considered empty. + default: + return true; + } + } + + /** + * Take query parameter properties and turn it into an array suitable for + * native http_build_query or GuzzleHttp\Psr7\Query::build. + * + * @param mixed $value Parameter value + * @param string $paramName Parameter name + * @param string $openApiType OpenAPIType eg. array or object + * @param string $style Parameter serialization style + * @param bool $explode Parameter explode option + * @param bool $required Whether query param is required or not + * + * @return array + */ + public static function toQueryValue( + $value, + string $paramName, + string $openApiType = 'string', + string $style = 'form', + bool $explode = true, + bool $required = true + ): array { + + # Check if we should omit this parameter from the query. This should only happen when: + # - Parameter is NOT required; AND + # - its value is set to a value that is equivalent to "empty", depending on its OpenAPI type. For + # example, 0 as "int" or "boolean" is NOT an empty value. + if (self::isEmptyValue($value, $openApiType)) { + if ($required) { + return ["{$paramName}" => '']; + } else { + return []; + } + } + + # Handle DateTime objects in query + if($openApiType === "\\DateTime" && $value instanceof \DateTime) { + return ["{$paramName}" => $value->format(self::$dateTimeFormat)]; + } + + $query = []; + $value = (in_array($openApiType, ['object', 'array'], true)) ? (array)$value : $value; + + // since \GuzzleHttp\Psr7\Query::build fails with nested arrays + // need to flatten array first + $flattenArray = function ($arr, $name, &$result = []) use (&$flattenArray, $style, $explode) { + if (!is_array($arr)) return $arr; + + foreach ($arr as $k => $v) { + $prop = ($style === 'deepObject') ? $prop = "{$name}[{$k}]" : $k; + + if (is_array($v)) { + $flattenArray($v, $prop, $result); + } else { + if ($style !== 'deepObject' && !$explode) { + // push key itself + $result[] = $prop; + } + $result[$prop] = $v; + } + } + return $result; + }; + + $value = $flattenArray($value, $paramName); + + // https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.1.0.md#style-values + if ($openApiType === 'array' && $style === 'deepObject' && $explode) { + return $value; + } + + if ($openApiType === 'object' && ($style === 'deepObject' || $explode)) { + return $value; + } + + if ('boolean' === $openApiType && is_bool($value)) { + $value = self::convertBoolToQueryStringFormat($value); + } + + // handle style in serializeCollection + $query[$paramName] = ($explode) ? $value : self::serializeCollection((array)$value, $style); + + return $query; + } + + /** + * Convert boolean value to format for query string. + * + * @param bool $value Boolean value + * + * @return int|string Boolean value in format + */ + public static function convertBoolToQueryStringFormat(bool $value) + { + if (Configuration::BOOLEAN_FORMAT_STRING == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString()) { + return $value ? 'true' : 'false'; + } + + return (int) $value; + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the header. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * + * @param string $value a string which will be part of the header + * + * @return string the header string + */ + public static function toHeaderValue($value) + { + $callable = [$value, 'toHeaderValue']; + if (is_callable($callable)) { + return $callable(); + } + + return self::toString($value); + } + + /** + * Take value and turn it into a string suitable for inclusion in + * the parameter. If it's a string, pass through unchanged + * If it's a datetime object, format it in ISO8601 + * If it's a boolean, convert it to "true" or "false". + * + * @param float|int|bool|\DateTime $value the value of the parameter + * + * @return string the header string + */ + public static function toString($value) + { + if ($value instanceof \DateTime) { // datetime in ISO8601 format + return $value->format(self::$dateTimeFormat); + } elseif (is_bool($value)) { + return $value ? 'true' : 'false'; + } else { + return (string) $value; + } + } + + /** + * Serialize an array to a string. + * + * @param array $collection collection to serialize to a string + * @param string $style the format use for serialization (csv, + * ssv, tsv, pipes, multi) + * @param bool $allowCollectionFormatMulti allow collection format to be a multidimensional array + * + * @return string + */ + public static function serializeCollection(array $collection, $style, $allowCollectionFormatMulti = false) + { + if ($allowCollectionFormatMulti && ('multi' === $style)) { + // http_build_query() almost does the job for us. We just + // need to fix the result of multidimensional arrays. + return preg_replace('/%5B[0-9]+%5D=/', '=', http_build_query($collection, '', '&')); + } + switch ($style) { + case 'pipeDelimited': + case 'pipes': + return implode('|', $collection); + + case 'tsv': + return implode("\t", $collection); + + case 'spaceDelimited': + case 'ssv': + return implode(' ', $collection); + + case 'simple': + case 'csv': + // Deliberate fall through. CSV is default format. + default: + return implode(',', $collection); + } + } + + /** + * Deserialize a JSON string into an object + * + * @param mixed $data object or primitive to be deserialized + * @param string $class class name is passed as a string + * @param string[]|null $httpHeaders HTTP headers + * + * @return object|array|null a single or an array of $class instances + */ + public static function deserialize($data, $class, $httpHeaders = null) + { + if (null === $data) { + return null; + } + + if (strcasecmp(substr($class, -2), '[]') === 0) { + $data = is_string($data) ? json_decode($data) : $data; + + if (!is_array($data)) { + throw new \InvalidArgumentException("Invalid array '$class'"); + } + + $subClass = substr($class, 0, -2); + $values = []; + foreach ($data as $key => $value) { + $values[] = self::deserialize($value, $subClass, null); + } + return $values; + } + + if (preg_match('/^(array<|map\[)/', $class)) { // for associative array e.g. array + $data = is_string($data) ? json_decode($data) : $data; + settype($data, 'array'); + $inner = substr($class, 4, -1); + $deserialized = []; + if (strrpos($inner, ",") !== false) { + $subClass_array = explode(',', $inner, 2); + $subClass = $subClass_array[1]; + foreach ($data as $key => $value) { + $deserialized[$key] = self::deserialize($value, $subClass, null); + } + } + return $deserialized; + } + + if ($class === 'object') { + settype($data, 'array'); + return $data; + } elseif ($class === 'mixed') { + settype($data, gettype($data)); + return $data; + } + + if ($class === '\DateTime') { + // Some APIs return an invalid, empty string as a + // date-time property. DateTime::__construct() will return + // the current time for empty input which is probably not + // what is meant. The invalid empty string is probably to + // be interpreted as a missing field/value. Let's handle + // this graceful. + if (!empty($data)) { + try { + return new \DateTime($data); + } catch (\Exception $exception) { + // Some APIs return a date-time with too high nanosecond + // precision for php's DateTime to handle. + // With provided regexp 6 digits of microseconds saved + return new \DateTime(self::sanitizeTimestamp($data)); + } + } else { + return null; + } + } + + if ($class === '\SplFileObject') { + $data = Utils::streamFor($data); + + /** @var \Psr\Http\Message\StreamInterface $data */ + + // determine file name + if ( + is_array($httpHeaders) + && array_key_exists('Content-Disposition', $httpHeaders) + && preg_match('/inline; filename=[\'"]?([^\'"\s]+)[\'"]?$/i', $httpHeaders['Content-Disposition'], $match) + ) { + $filename = Configuration::getDefaultConfiguration()->getTempFolderPath() . DIRECTORY_SEPARATOR . self::sanitizeFilename($match[1]); + } else { + $filename = tempnam(Configuration::getDefaultConfiguration()->getTempFolderPath(), ''); + } + + $file = fopen($filename, 'w'); + while ($chunk = $data->read(200)) { + fwrite($file, $chunk); + } + fclose($file); + + return new \SplFileObject($filename, 'r'); + } + + /** @psalm-suppress ParadoxicalCondition */ + if (in_array($class, ['\DateTime', '\SplFileObject', 'array', 'bool', 'boolean', 'byte', 'float', 'int', 'integer', 'mixed', 'number', 'object', 'string', 'void'], true)) { + settype($data, $class); + return $data; + } + + + if (method_exists($class, 'getAllowableEnumValues')) { + if (!in_array($data, $class::getAllowableEnumValues(), true)) { + $imploded = implode("', '", $class::getAllowableEnumValues()); + throw new \InvalidArgumentException("Invalid value for enum '$class', must be one of: '$imploded'"); + } + return $data; + } else { + $data = is_string($data) ? json_decode($data) : $data; + + if (is_array($data)) { + $data = (object)$data; + } + + // If a discriminator is defined and points to a valid subclass, use it. + $discriminator = $class::DISCRIMINATOR; + if (!empty($discriminator) && isset($data->{$discriminator}) && is_string($data->{$discriminator})) { + $subclass = '\OmsorgCoreClient\Model\\' . $data->{$discriminator}; + if (is_subclass_of($subclass, $class)) { + $class = $subclass; + } + } + + /** @var ModelInterface $instance */ + $instance = new $class(); + foreach ($instance::openAPITypes() as $property => $type) { + $propertySetter = $instance::setters()[$property]; + + if (!isset($propertySetter)) { + continue; + } + + if (!isset($data->{$instance::attributeMap()[$property]})) { + if ($instance::isNullable($property)) { + $instance->$propertySetter(null); + } + + continue; + } + + if (isset($data->{$instance::attributeMap()[$property]})) { + $propertyValue = $data->{$instance::attributeMap()[$property]}; + $instance->$propertySetter(self::deserialize($propertyValue, $type, null)); + } + } + return $instance; + } + } + + /** + * Build a query string from an array of key value pairs. + * + * This function can use the return value of `parse()` to build a query + * string. This function does not modify the provided keys when an array is + * encountered (like `http_build_query()` would). + * + * The function is copied from https://github.com/guzzle/psr7/blob/a243f80a1ca7fe8ceed4deee17f12c1930efe662/src/Query.php#L59-L112 + * with a modification which is described in https://github.com/guzzle/psr7/pull/603 + * + * @param array $params Query string parameters. + * @param int|false $encoding Set to false to not encode, PHP_QUERY_RFC3986 + * to encode using RFC3986, or PHP_QUERY_RFC1738 + * to encode using RFC1738. + */ + public static function buildQuery(array $params, $encoding = PHP_QUERY_RFC3986): string + { + if (!$params) { + return ''; + } + + if ($encoding === false) { + $encoder = function (string $str): string { + return $str; + }; + } elseif ($encoding === PHP_QUERY_RFC3986) { + $encoder = 'rawurlencode'; + } elseif ($encoding === PHP_QUERY_RFC1738) { + $encoder = 'urlencode'; + } else { + throw new \InvalidArgumentException('Invalid type'); + } + + $castBool = Configuration::BOOLEAN_FORMAT_INT == Configuration::getDefaultConfiguration()->getBooleanFormatForQueryString() + ? function ($v) { return (int) $v; } + : function ($v) { return $v ? 'true' : 'false'; }; + + $qs = ''; + foreach ($params as $k => $v) { + $k = $encoder((string) $k); + if (!is_array($v)) { + $qs .= $k; + $v = is_bool($v) ? $castBool($v) : $v; + if ($v !== null) { + $qs .= '='.$encoder((string) $v); + } + $qs .= '&'; + } else { + foreach ($v as $vv) { + $qs .= $k; + $vv = is_bool($vv) ? $castBool($vv) : $vv; + if ($vv !== null) { + $qs .= '='.$encoder((string) $vv); + } + $qs .= '&'; + } + } + } + + return $qs ? (string) substr($qs, 0, -1) : ''; + } +} diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/openapitools.json b/omsorgWeb/mitarbeiter-app/api-client-php/openapitools.json new file mode 100644 index 0000000..a82623d --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/openapitools.json @@ -0,0 +1,7 @@ +{ + "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json", + "spaces": 2, + "generator-cli": { + "version": "7.14.0" + } +} diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/phpunit.xml.dist b/omsorgWeb/mitarbeiter-app/api-client-php/phpunit.xml.dist new file mode 100644 index 0000000..485899a --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/phpunit.xml.dist @@ -0,0 +1,18 @@ + + + + + ./lib/Api + ./lib/Model + + + + + ./test/Api + ./test/Model + + + + + + diff --git a/omsorgWeb/mitarbeiter-app/api-client-php/test/Api/AdminEmailApiTest.php b/omsorgWeb/mitarbeiter-app/api-client-php/test/Api/AdminEmailApiTest.php new file mode 100644 index 0000000..8c6e5ee --- /dev/null +++ b/omsorgWeb/mitarbeiter-app/api-client-php/test/Api/AdminEmailApiTest.php @@ -0,0 +1,97 @@ +
+ +
Passwort geändert. Bitte melde dich neu an.
@@ -73,6 +75,10 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') {
+ +

+ Passwort vergessen? +

diff --git a/omsorgWeb/mitarbeiter-app/lib/layout.php b/omsorgWeb/mitarbeiter-app/lib/layout.php index fab88dc..c4edf8d 100644 --- a/omsorgWeb/mitarbeiter-app/lib/layout.php +++ b/omsorgWeb/mitarbeiter-app/lib/layout.php @@ -1,7 +1,7 @@ @@ -32,9 +32,12 @@ function layout_start(string $title): void {