Migrate omsorgapp to browser SPA, add Docker/CI build setup
Docker-Images bauen und veröffentlichen / build (, omsorgCore/Dockerfile, omsorgcore) (push) Successful in 23s
Docker-Images bauen und veröffentlichen / build (VITE_OMSORG_CORE_URL=${{ vars.OMSORG_CORE_PUBLIC_URL }}, omsorgapp/Dockerfile, omsorgapp) (push) Failing after 2s
Docker-Images bauen und veröffentlichen / build (, omsorgWeb/Dockerfile, omsorgweb) (push) Failing after 39s
Docker-Images bauen und veröffentlichen / build (, omsorgCore/Dockerfile, omsorgcore) (push) Successful in 23s
Docker-Images bauen und veröffentlichen / build (VITE_OMSORG_CORE_URL=${{ vars.OMSORG_CORE_PUBLIC_URL }}, omsorgapp/Dockerfile, omsorgapp) (push) Failing after 2s
Docker-Images bauen und veröffentlichen / build (, omsorgWeb/Dockerfile, omsorgweb) (push) Failing after 39s
- omsorgapp: drop Electron, run as a plain Vite/React browser app; refresh token moves to an HttpOnly cookie (omsorgCore), CORS added for the new browser origin, document download/preview switched to Blob-based browser APIs. - Add Dockerfiles for omsorgCore, omsorgapp, and omsorgWeb, a docker-compose.yml wiring Postgres/MySQL/all three apps together, and a Gitea Actions workflow that builds and pushes images to the repo's container registry on push to main and on version tags. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
e9e96a57dc
commit
598dfcd38a
+29
-23
File diff suppressed because one or more lines are too long
@@ -0,0 +1,26 @@
|
||||
# Build-Kontext ist der Repo-Root (siehe .gitea/workflows/docker-build.yml und docker-compose.yml).
|
||||
FROM node:20-alpine AS build
|
||||
WORKDIR /app
|
||||
|
||||
# omsorgcore-client-ts (file:./api-client-ts) hat seinen dist/-Ordner NICHT eingecheckt
|
||||
# (siehe omsorgapp/api-client-ts/ANLEITUNG.md) - muss hier zuerst gebaut werden, sonst schlägt
|
||||
# der spätere `import ... from "omsorgcore-client-ts"` in omsorgapp fehl.
|
||||
COPY omsorgapp/api-client-ts ./api-client-ts
|
||||
RUN cd api-client-ts && npm ci && npm run build
|
||||
|
||||
COPY omsorgapp/package.json omsorgapp/package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
COPY omsorgapp/ .
|
||||
|
||||
# Vite bäckt import.meta.env.VITE_OMSORG_CORE_URL (src/api/config.js) zur Build-Zeit ein - kein
|
||||
# Runtime-Wert. Default passt zum docker-compose.yml-Setup, für einen echten Deploy überschreibt
|
||||
# CI das per --build-arg mit der öffentlich erreichbaren omsorgCore-URL.
|
||||
ARG VITE_OMSORG_CORE_URL=http://localhost:8080
|
||||
ENV VITE_OMSORG_CORE_URL=$VITE_OMSORG_CORE_URL
|
||||
RUN npm run build
|
||||
|
||||
FROM nginx:1.27-alpine AS runtime
|
||||
COPY --from=build /app/dist /usr/share/nginx/html
|
||||
COPY omsorgapp/nginx.conf /etc/nginx/conf.d/default.conf
|
||||
EXPOSE 80
|
||||
@@ -2,21 +2,29 @@
|
||||
.npmignore
|
||||
README.md
|
||||
package.json
|
||||
src/apis/AbsencesApi.ts
|
||||
src/apis/AdminEmailApi.ts
|
||||
src/apis/AdminSessionsApi.ts
|
||||
src/apis/AuditLogApi.ts
|
||||
src/apis/AuthApi.ts
|
||||
src/apis/ContractsApi.ts
|
||||
src/apis/DocumentsApi.ts
|
||||
src/apis/EmployeesApi.ts
|
||||
src/apis/FacilitiesApi.ts
|
||||
src/apis/FacilityContactsApi.ts
|
||||
src/apis/FacilityQualificationRatesApi.ts
|
||||
src/apis/HealthApi.ts
|
||||
src/apis/OrdersApi.ts
|
||||
src/apis/RolesApi.ts
|
||||
src/apis/TimeEntriesApi.ts
|
||||
src/apis/TrashApi.ts
|
||||
src/apis/UsersApi.ts
|
||||
src/apis/ValueListsApi.ts
|
||||
src/apis/index.ts
|
||||
src/index.ts
|
||||
src/models/AbsenceDecisionRequest.ts
|
||||
src/models/AbsenceResponse.ts
|
||||
src/models/AbsenceResponsePagedResponse.ts
|
||||
src/models/AddUserPermissionOverrideRequest.ts
|
||||
src/models/AuditEventCategory.ts
|
||||
src/models/AuditLogEntryResponse.ts
|
||||
@@ -24,17 +32,22 @@ src/models/AuditLogEntryResponsePagedResponse.ts
|
||||
src/models/ChangePasswordRequest.ts
|
||||
src/models/ContractResponse.ts
|
||||
src/models/ContractResponsePagedResponse.ts
|
||||
src/models/CreateAbsenceRequest.ts
|
||||
src/models/CreateContractRequest.ts
|
||||
src/models/CreateEmployeeRequest.ts
|
||||
src/models/CreateFacilityContactRequest.ts
|
||||
src/models/CreateFacilityQualificationRateRequest.ts
|
||||
src/models/CreateFacilityRequest.ts
|
||||
src/models/CreateOrderRequest.ts
|
||||
src/models/CreateRoleRequest.ts
|
||||
src/models/CreateTimeEntryRequest.ts
|
||||
src/models/CreateUserRequest.ts
|
||||
src/models/CreateValueListItemRequest.ts
|
||||
src/models/DocumentResponse.ts
|
||||
src/models/EmployeeResponse.ts
|
||||
src/models/EmployeeResponsePagedResponse.ts
|
||||
src/models/FacilityContactResponse.ts
|
||||
src/models/FacilityQualificationRateResponse.ts
|
||||
src/models/FacilityResponse.ts
|
||||
src/models/FacilityResponsePagedResponse.ts
|
||||
src/models/ForgotPasswordRequestRequest.ts
|
||||
@@ -44,7 +57,6 @@ src/models/ForgotPasswordVerifyRequest.ts
|
||||
src/models/ForgotPasswordVerifyResponse.ts
|
||||
src/models/LoginRequest.ts
|
||||
src/models/LoginResponse.ts
|
||||
src/models/LogoutRequest.ts
|
||||
src/models/MeResponse.ts
|
||||
src/models/ModuleType.ts
|
||||
src/models/OrderResponse.ts
|
||||
@@ -54,18 +66,33 @@ src/models/PasswordResetTemplateResponse.ts
|
||||
src/models/PermissionAction.ts
|
||||
src/models/PermissionDto.ts
|
||||
src/models/PermissionEffect.ts
|
||||
src/models/RefreshRequest.ts
|
||||
src/models/PermissionScope.ts
|
||||
src/models/ResetUserPasswordRequest.ts
|
||||
src/models/RolePermissionsResponse.ts
|
||||
src/models/RoleResponse.ts
|
||||
src/models/SendTestEmailRequest.ts
|
||||
src/models/SessionResponse.ts
|
||||
src/models/TimeEntryDecisionRequest.ts
|
||||
src/models/TimeEntryResponse.ts
|
||||
src/models/TimeEntryResponsePagedResponse.ts
|
||||
src/models/TrashAbsenceResponse.ts
|
||||
src/models/TrashContractResponse.ts
|
||||
src/models/TrashEmployeeResponse.ts
|
||||
src/models/TrashFacilityContactResponse.ts
|
||||
src/models/TrashFacilityQualificationRateResponse.ts
|
||||
src/models/TrashFacilityResponse.ts
|
||||
src/models/TrashOrderResponse.ts
|
||||
src/models/TrashTimeEntryResponse.ts
|
||||
src/models/UpdateAbsenceRequest.ts
|
||||
src/models/UpdateContractRequest.ts
|
||||
src/models/UpdateDocumentRequest.ts
|
||||
src/models/UpdateEmployeeRequest.ts
|
||||
src/models/UpdateFacilityContactRequest.ts
|
||||
src/models/UpdateFacilityQualificationRateRequest.ts
|
||||
src/models/UpdateFacilityRequest.ts
|
||||
src/models/UpdateOrderRequest.ts
|
||||
src/models/UpdateRolePermissionsRequest.ts
|
||||
src/models/UpdateTimeEntryRequest.ts
|
||||
src/models/UpdateUserRequest.ts
|
||||
src/models/UpdateValueListItemRequest.ts
|
||||
src/models/UserPermissionOverrideResponse.ts
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Anleitung — omsorgcore-client-ts
|
||||
|
||||
Generierter TypeScript-Client für die `omsorgCore`-API, erzeugt mit [openapi-generator-cli](https://github.com/OpenAPITools/openapi-generator) aus der Swagger/OpenAPI-JSON des Backends. **Kein eigenständiges Extra mehr:** Alle handgeschriebenen Wrapper unter `electron/backend/*Client.cjs` (`employeesClient.cjs`, `facilitiesClient.cjs`, `usersClient.cjs`, ...) importieren ihre `*Api`-Klasse aus diesem Paket (`require('omsorgcore-client-ts')`) und reichen dessen typisierte Requests/Responses direkt durch — dieser Client ist damit Teil des echten Datenpfads von `omsorgapp` gegen `omsorgCore`, nicht nur eine zusätzliche Bibliothek für Skripte/Typprüfung.
|
||||
Generierter TypeScript-Client für die `omsorgCore`-API, erzeugt mit [openapi-generator-cli](https://github.com/OpenAPITools/openapi-generator) aus der Swagger/OpenAPI-JSON des Backends. **Kein eigenständiges Extra mehr:** Alle handgeschriebenen Wrapper unter `src/api/*Api.js` (`employeesApi.js`, `facilitiesApi.js`, `usersApi.js`, ...) importieren ihre `*Api`-Klasse aus diesem Paket (`import ... from "omsorgcore-client-ts"`) und reichen dessen typisierte Requests/Responses direkt durch — dieser Client ist damit Teil des echten Datenpfads von `omsorgapp` gegen `omsorgCore`, nicht nur eine zusätzliche Bibliothek für Skripte/Typprüfung.
|
||||
|
||||
`README.md` in diesem Ordner wird bei jeder Generierung automatisch neu geschrieben (Standard-Output von openapi-generator, dokumentiert die generierten API-Methoden) — diese Datei hier nicht, sie bleibt stabil.
|
||||
|
||||
@@ -26,7 +26,7 @@ npm run generate
|
||||
# entspricht: ./generate.sh
|
||||
```
|
||||
|
||||
Nimmt die Backend-URL aus `OMSORG_CORE_URL` (Default `http://localhost:5245`, dieselbe Konvention wie `electron/backend/config.cjs`). Überschreibt `src/`, `README.md`, `package.json`, `.gitignore`, `tsconfig*.json` mit dem aktuellen generierten Stand — danach `git diff` prüfen, bevor committet wird (eigene Anpassungen an `package.json`, z. B. das `generate`-Script, ggf. erneut eintragen, siehe unten).
|
||||
Nimmt die Backend-URL aus `OMSORG_CORE_URL` (Default `http://localhost:5245`, dieselbe Konvention wie `src/api/config.js`). Überschreibt `src/`, `README.md`, `package.json`, `.gitignore`, `tsconfig*.json` mit dem aktuellen generierten Stand — danach `git diff` prüfen, bevor committet wird (eigene Anpassungen an `package.json`, z. B. das `generate`-Script, ggf. erneut eintragen, siehe unten).
|
||||
|
||||
## Bauen
|
||||
|
||||
|
||||
@@ -0,0 +1,342 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
AbsenceDecisionRequest,
|
||||
AbsenceResponse,
|
||||
AbsenceResponsePagedResponse,
|
||||
CreateAbsenceRequest,
|
||||
UpdateAbsenceRequest,
|
||||
} from '../models/index';
|
||||
import {
|
||||
AbsenceDecisionRequestFromJSON,
|
||||
AbsenceDecisionRequestToJSON,
|
||||
AbsenceResponseFromJSON,
|
||||
AbsenceResponseToJSON,
|
||||
AbsenceResponsePagedResponseFromJSON,
|
||||
AbsenceResponsePagedResponseToJSON,
|
||||
CreateAbsenceRequestFromJSON,
|
||||
CreateAbsenceRequestToJSON,
|
||||
UpdateAbsenceRequestFromJSON,
|
||||
UpdateAbsenceRequestToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface ApiAbsencesGetRequest {
|
||||
status?: string;
|
||||
type?: string;
|
||||
employeeId?: string;
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface ApiAbsencesIdDecisionPostRequest {
|
||||
id: string;
|
||||
absenceDecisionRequest?: AbsenceDecisionRequest;
|
||||
}
|
||||
|
||||
export interface ApiAbsencesIdDeleteRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ApiAbsencesIdGetRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ApiAbsencesIdPutRequest {
|
||||
id: string;
|
||||
updateAbsenceRequest?: UpdateAbsenceRequest;
|
||||
}
|
||||
|
||||
export interface ApiAbsencesPostRequest {
|
||||
createAbsenceRequest?: CreateAbsenceRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class AbsencesApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiAbsencesGetRaw(requestParameters: ApiAbsencesGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AbsenceResponsePagedResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['status'] != null) {
|
||||
queryParameters['status'] = requestParameters['status'];
|
||||
}
|
||||
|
||||
if (requestParameters['type'] != null) {
|
||||
queryParameters['type'] = requestParameters['type'];
|
||||
}
|
||||
|
||||
if (requestParameters['employeeId'] != null) {
|
||||
queryParameters['employeeId'] = requestParameters['employeeId'];
|
||||
}
|
||||
|
||||
if (requestParameters['page'] != null) {
|
||||
queryParameters['page'] = requestParameters['page'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['pageSize'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/absences`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => AbsenceResponsePagedResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiAbsencesGet(requestParameters: ApiAbsencesGetRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AbsenceResponsePagedResponse> {
|
||||
const response = await this.apiAbsencesGetRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiAbsencesIdDecisionPostRaw(requestParameters: ApiAbsencesIdDecisionPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AbsenceResponse>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiAbsencesIdDecisionPost().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/absences/{id}/decision`;
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: AbsenceDecisionRequestToJSON(requestParameters['absenceDecisionRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => AbsenceResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiAbsencesIdDecisionPost(requestParameters: ApiAbsencesIdDecisionPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AbsenceResponse> {
|
||||
const response = await this.apiAbsencesIdDecisionPostRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiAbsencesIdDeleteRaw(requestParameters: ApiAbsencesIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiAbsencesIdDelete().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/absences/{id}`;
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiAbsencesIdDelete(requestParameters: ApiAbsencesIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
await this.apiAbsencesIdDeleteRaw(requestParameters, initOverrides);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiAbsencesIdGetRaw(requestParameters: ApiAbsencesIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AbsenceResponse>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiAbsencesIdGet().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/absences/{id}`;
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => AbsenceResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiAbsencesIdGet(requestParameters: ApiAbsencesIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AbsenceResponse> {
|
||||
const response = await this.apiAbsencesIdGetRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiAbsencesIdPutRaw(requestParameters: ApiAbsencesIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AbsenceResponse>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiAbsencesIdPut().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/absences/{id}`;
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'PUT',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: UpdateAbsenceRequestToJSON(requestParameters['updateAbsenceRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => AbsenceResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiAbsencesIdPut(requestParameters: ApiAbsencesIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AbsenceResponse> {
|
||||
const response = await this.apiAbsencesIdPutRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiAbsencesPostRaw(requestParameters: ApiAbsencesPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AbsenceResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/absences`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CreateAbsenceRequestToJSON(requestParameters['createAbsenceRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => AbsenceResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiAbsencesPost(requestParameters: ApiAbsencesPostRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AbsenceResponse> {
|
||||
const response = await this.apiAbsencesPostRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -23,10 +23,8 @@ import type {
|
||||
ForgotPasswordVerifyResponse,
|
||||
LoginRequest,
|
||||
LoginResponse,
|
||||
LogoutRequest,
|
||||
MeResponse,
|
||||
PasswordPolicyResponse,
|
||||
RefreshRequest,
|
||||
} from '../models/index';
|
||||
import {
|
||||
ChangePasswordRequestFromJSON,
|
||||
@@ -45,14 +43,10 @@ import {
|
||||
LoginRequestToJSON,
|
||||
LoginResponseFromJSON,
|
||||
LoginResponseToJSON,
|
||||
LogoutRequestFromJSON,
|
||||
LogoutRequestToJSON,
|
||||
MeResponseFromJSON,
|
||||
MeResponseToJSON,
|
||||
PasswordPolicyResponseFromJSON,
|
||||
PasswordPolicyResponseToJSON,
|
||||
RefreshRequestFromJSON,
|
||||
RefreshRequestToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface ApiAuthChangePasswordPostRequest {
|
||||
@@ -75,14 +69,6 @@ export interface ApiAuthLoginPostRequest {
|
||||
loginRequest?: LoginRequest;
|
||||
}
|
||||
|
||||
export interface ApiAuthLogoutPostRequest {
|
||||
logoutRequest?: LogoutRequest;
|
||||
}
|
||||
|
||||
export interface ApiAuthRefreshPostRequest {
|
||||
refreshRequest?: RefreshRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -278,13 +264,11 @@ export class AuthApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiAuthLogoutPostRaw(requestParameters: ApiAuthLogoutPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
async apiAuthLogoutPostRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
@@ -301,7 +285,6 @@ export class AuthApi extends runtime.BaseAPI {
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: LogoutRequestToJSON(requestParameters['logoutRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
@@ -309,8 +292,8 @@ export class AuthApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiAuthLogoutPost(requestParameters: ApiAuthLogoutPostRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
await this.apiAuthLogoutPostRaw(requestParameters, initOverrides);
|
||||
async apiAuthLogoutPost(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
await this.apiAuthLogoutPostRaw(initOverrides);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -385,13 +368,11 @@ export class AuthApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiAuthRefreshPostRaw(requestParameters: ApiAuthRefreshPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LoginResponse>> {
|
||||
async apiAuthRefreshPostRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<LoginResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
@@ -408,7 +389,6 @@ export class AuthApi extends runtime.BaseAPI {
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: RefreshRequestToJSON(requestParameters['refreshRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => LoginResponseFromJSON(jsonValue));
|
||||
@@ -416,8 +396,8 @@ export class AuthApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiAuthRefreshPost(requestParameters: ApiAuthRefreshPostRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LoginResponse> {
|
||||
const response = await this.apiAuthRefreshPostRaw(requestParameters, initOverrides);
|
||||
async apiAuthRefreshPost(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<LoginResponse> {
|
||||
const response = await this.apiAuthRefreshPostRaw(initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
|
||||
@@ -40,6 +40,10 @@ export interface ApiContractsGetRequest {
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface ApiContractsIdDeleteRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ApiContractsIdGetRequest {
|
||||
id: string;
|
||||
}
|
||||
@@ -117,6 +121,48 @@ export class ContractsApi extends runtime.BaseAPI {
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiContractsIdDeleteRaw(requestParameters: ApiContractsIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiContractsIdDelete().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/contracts/{id}`;
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiContractsIdDelete(requestParameters: ApiContractsIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
await this.apiContractsIdDeleteRaw(requestParameters, initOverrides);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiContractsIdGetRaw(requestParameters: ApiContractsIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ContractResponse>> {
|
||||
|
||||
@@ -0,0 +1,304 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
DocumentResponse,
|
||||
UpdateDocumentRequest,
|
||||
} from '../models/index';
|
||||
import {
|
||||
DocumentResponseFromJSON,
|
||||
DocumentResponseToJSON,
|
||||
UpdateDocumentRequestFromJSON,
|
||||
UpdateDocumentRequestToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface ApiDocumentsGetRequest {
|
||||
entityType?: string;
|
||||
entityId?: string;
|
||||
}
|
||||
|
||||
export interface ApiDocumentsIdDeleteRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ApiDocumentsIdDownloadGetRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ApiDocumentsIdPutRequest {
|
||||
id: string;
|
||||
updateDocumentRequest?: UpdateDocumentRequest;
|
||||
}
|
||||
|
||||
export interface ApiDocumentsPostRequest {
|
||||
entityType?: string;
|
||||
entityId?: string;
|
||||
category?: string;
|
||||
description?: string;
|
||||
file?: Blob;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class DocumentsApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiDocumentsGetRaw(requestParameters: ApiDocumentsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<DocumentResponse>>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['entityType'] != null) {
|
||||
queryParameters['entityType'] = requestParameters['entityType'];
|
||||
}
|
||||
|
||||
if (requestParameters['entityId'] != null) {
|
||||
queryParameters['entityId'] = requestParameters['entityId'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/documents`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(DocumentResponseFromJSON));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiDocumentsGet(requestParameters: ApiDocumentsGetRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<DocumentResponse>> {
|
||||
const response = await this.apiDocumentsGetRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiDocumentsIdDeleteRaw(requestParameters: ApiDocumentsIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiDocumentsIdDelete().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/documents/{id}`;
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiDocumentsIdDelete(requestParameters: ApiDocumentsIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
await this.apiDocumentsIdDeleteRaw(requestParameters, initOverrides);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiDocumentsIdDownloadGetRaw(requestParameters: ApiDocumentsIdDownloadGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiDocumentsIdDownloadGet().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/documents/{id}/download`;
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiDocumentsIdDownloadGet(requestParameters: ApiDocumentsIdDownloadGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
await this.apiDocumentsIdDownloadGetRaw(requestParameters, initOverrides);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiDocumentsIdPutRaw(requestParameters: ApiDocumentsIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiDocumentsIdPut().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/documents/{id}`;
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'PUT',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: UpdateDocumentRequestToJSON(requestParameters['updateDocumentRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => DocumentResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiDocumentsIdPut(requestParameters: ApiDocumentsIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse> {
|
||||
const response = await this.apiDocumentsIdPutRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiDocumentsPostRaw(requestParameters: ApiDocumentsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DocumentResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
const consumes: runtime.Consume[] = [
|
||||
{ contentType: 'multipart/form-data' },
|
||||
];
|
||||
// @ts-ignore: canConsumeForm may be unused
|
||||
const canConsumeForm = runtime.canConsumeForm(consumes);
|
||||
|
||||
let formParams: { append(param: string, value: any): any };
|
||||
let useForm = false;
|
||||
// use FormData to transmit files using content-type "multipart/form-data"
|
||||
useForm = canConsumeForm;
|
||||
if (useForm) {
|
||||
formParams = new FormData();
|
||||
} else {
|
||||
formParams = new URLSearchParams();
|
||||
}
|
||||
|
||||
if (requestParameters['entityType'] != null) {
|
||||
formParams.append('EntityType', requestParameters['entityType'] as any);
|
||||
}
|
||||
|
||||
if (requestParameters['entityId'] != null) {
|
||||
formParams.append('EntityId', requestParameters['entityId'] as any);
|
||||
}
|
||||
|
||||
if (requestParameters['category'] != null) {
|
||||
formParams.append('Category', requestParameters['category'] as any);
|
||||
}
|
||||
|
||||
if (requestParameters['description'] != null) {
|
||||
formParams.append('Description', requestParameters['description'] as any);
|
||||
}
|
||||
|
||||
if (requestParameters['file'] != null) {
|
||||
formParams.append('File', requestParameters['file'] as any);
|
||||
}
|
||||
|
||||
|
||||
let urlPath = `/api/documents`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: formParams,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => DocumentResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiDocumentsPost(requestParameters: ApiDocumentsPostRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DocumentResponse> {
|
||||
const response = await this.apiDocumentsPostRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -39,6 +39,10 @@ export interface ApiEmployeesGetRequest {
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface ApiEmployeesIdDeleteRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ApiEmployeesIdGetRequest {
|
||||
id: string;
|
||||
}
|
||||
@@ -112,6 +116,48 @@ export class EmployeesApi extends runtime.BaseAPI {
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiEmployeesIdDeleteRaw(requestParameters: ApiEmployeesIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiEmployeesIdDelete().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/employees/{id}`;
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiEmployeesIdDelete(requestParameters: ApiEmployeesIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
await this.apiEmployeesIdDeleteRaw(requestParameters, initOverrides);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiEmployeesIdGetRaw(requestParameters: ApiEmployeesIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EmployeeResponse>> {
|
||||
|
||||
@@ -34,10 +34,15 @@ import {
|
||||
export interface ApiFacilitiesGetRequest {
|
||||
search?: string;
|
||||
crmStatus?: string;
|
||||
followUpDueOnly?: boolean;
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface ApiFacilitiesIdDeleteRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ApiFacilitiesIdGetRequest {
|
||||
id: string;
|
||||
}
|
||||
@@ -69,6 +74,10 @@ export class FacilitiesApi extends runtime.BaseAPI {
|
||||
queryParameters['crmStatus'] = requestParameters['crmStatus'];
|
||||
}
|
||||
|
||||
if (requestParameters['followUpDueOnly'] != null) {
|
||||
queryParameters['followUpDueOnly'] = requestParameters['followUpDueOnly'];
|
||||
}
|
||||
|
||||
if (requestParameters['page'] != null) {
|
||||
queryParameters['page'] = requestParameters['page'];
|
||||
}
|
||||
@@ -107,6 +116,48 @@ export class FacilitiesApi extends runtime.BaseAPI {
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiFacilitiesIdDeleteRaw(requestParameters: ApiFacilitiesIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiFacilitiesIdDelete().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/facilities/{id}`;
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiFacilitiesIdDelete(requestParameters: ApiFacilitiesIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
await this.apiFacilitiesIdDeleteRaw(requestParameters, initOverrides);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiFacilitiesIdGetRaw(requestParameters: ApiFacilitiesIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FacilityResponse>> {
|
||||
|
||||
@@ -32,6 +32,11 @@ export interface ApiFacilitiesFacilityIdContactsGetRequest {
|
||||
facilityId: string;
|
||||
}
|
||||
|
||||
export interface ApiFacilitiesFacilityIdContactsIdDeleteRequest {
|
||||
facilityId: string;
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ApiFacilitiesFacilityIdContactsIdPutRequest {
|
||||
facilityId: string;
|
||||
id: string;
|
||||
@@ -91,6 +96,56 @@ export class FacilityContactsApi extends runtime.BaseAPI {
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiFacilitiesFacilityIdContactsIdDeleteRaw(requestParameters: ApiFacilitiesFacilityIdContactsIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
if (requestParameters['facilityId'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'facilityId',
|
||||
'Required parameter "facilityId" was null or undefined when calling apiFacilitiesFacilityIdContactsIdDelete().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiFacilitiesFacilityIdContactsIdDelete().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/facilities/{facilityId}/contacts/{id}`;
|
||||
urlPath = urlPath.replace(`{${"facilityId"}}`, encodeURIComponent(String(requestParameters['facilityId'])));
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiFacilitiesFacilityIdContactsIdDelete(requestParameters: ApiFacilitiesFacilityIdContactsIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
await this.apiFacilitiesFacilityIdContactsIdDeleteRaw(requestParameters, initOverrides);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiFacilitiesFacilityIdContactsIdPutRaw(requestParameters: ApiFacilitiesFacilityIdContactsIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FacilityContactResponse>> {
|
||||
|
||||
@@ -0,0 +1,249 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
CreateFacilityQualificationRateRequest,
|
||||
FacilityQualificationRateResponse,
|
||||
UpdateFacilityQualificationRateRequest,
|
||||
} from '../models/index';
|
||||
import {
|
||||
CreateFacilityQualificationRateRequestFromJSON,
|
||||
CreateFacilityQualificationRateRequestToJSON,
|
||||
FacilityQualificationRateResponseFromJSON,
|
||||
FacilityQualificationRateResponseToJSON,
|
||||
UpdateFacilityQualificationRateRequestFromJSON,
|
||||
UpdateFacilityQualificationRateRequestToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface ApiFacilitiesFacilityIdQualificationRatesGetRequest {
|
||||
facilityId: string;
|
||||
}
|
||||
|
||||
export interface ApiFacilitiesFacilityIdQualificationRatesIdDeleteRequest {
|
||||
facilityId: string;
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ApiFacilitiesFacilityIdQualificationRatesIdPutRequest {
|
||||
facilityId: string;
|
||||
id: string;
|
||||
updateFacilityQualificationRateRequest?: UpdateFacilityQualificationRateRequest;
|
||||
}
|
||||
|
||||
export interface ApiFacilitiesFacilityIdQualificationRatesPostRequest {
|
||||
facilityId: string;
|
||||
createFacilityQualificationRateRequest?: CreateFacilityQualificationRateRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class FacilityQualificationRatesApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiFacilitiesFacilityIdQualificationRatesGetRaw(requestParameters: ApiFacilitiesFacilityIdQualificationRatesGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<FacilityQualificationRateResponse>>> {
|
||||
if (requestParameters['facilityId'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'facilityId',
|
||||
'Required parameter "facilityId" was null or undefined when calling apiFacilitiesFacilityIdQualificationRatesGet().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/facilities/{facilityId}/qualification-rates`;
|
||||
urlPath = urlPath.replace(`{${"facilityId"}}`, encodeURIComponent(String(requestParameters['facilityId'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(FacilityQualificationRateResponseFromJSON));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiFacilitiesFacilityIdQualificationRatesGet(requestParameters: ApiFacilitiesFacilityIdQualificationRatesGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<FacilityQualificationRateResponse>> {
|
||||
const response = await this.apiFacilitiesFacilityIdQualificationRatesGetRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiFacilitiesFacilityIdQualificationRatesIdDeleteRaw(requestParameters: ApiFacilitiesFacilityIdQualificationRatesIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
if (requestParameters['facilityId'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'facilityId',
|
||||
'Required parameter "facilityId" was null or undefined when calling apiFacilitiesFacilityIdQualificationRatesIdDelete().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiFacilitiesFacilityIdQualificationRatesIdDelete().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/facilities/{facilityId}/qualification-rates/{id}`;
|
||||
urlPath = urlPath.replace(`{${"facilityId"}}`, encodeURIComponent(String(requestParameters['facilityId'])));
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiFacilitiesFacilityIdQualificationRatesIdDelete(requestParameters: ApiFacilitiesFacilityIdQualificationRatesIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
await this.apiFacilitiesFacilityIdQualificationRatesIdDeleteRaw(requestParameters, initOverrides);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiFacilitiesFacilityIdQualificationRatesIdPutRaw(requestParameters: ApiFacilitiesFacilityIdQualificationRatesIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FacilityQualificationRateResponse>> {
|
||||
if (requestParameters['facilityId'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'facilityId',
|
||||
'Required parameter "facilityId" was null or undefined when calling apiFacilitiesFacilityIdQualificationRatesIdPut().'
|
||||
);
|
||||
}
|
||||
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiFacilitiesFacilityIdQualificationRatesIdPut().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/facilities/{facilityId}/qualification-rates/{id}`;
|
||||
urlPath = urlPath.replace(`{${"facilityId"}}`, encodeURIComponent(String(requestParameters['facilityId'])));
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'PUT',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: UpdateFacilityQualificationRateRequestToJSON(requestParameters['updateFacilityQualificationRateRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => FacilityQualificationRateResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiFacilitiesFacilityIdQualificationRatesIdPut(requestParameters: ApiFacilitiesFacilityIdQualificationRatesIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FacilityQualificationRateResponse> {
|
||||
const response = await this.apiFacilitiesFacilityIdQualificationRatesIdPutRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiFacilitiesFacilityIdQualificationRatesPostRaw(requestParameters: ApiFacilitiesFacilityIdQualificationRatesPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<FacilityQualificationRateResponse>> {
|
||||
if (requestParameters['facilityId'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'facilityId',
|
||||
'Required parameter "facilityId" was null or undefined when calling apiFacilitiesFacilityIdQualificationRatesPost().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/facilities/{facilityId}/qualification-rates`;
|
||||
urlPath = urlPath.replace(`{${"facilityId"}}`, encodeURIComponent(String(requestParameters['facilityId'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CreateFacilityQualificationRateRequestToJSON(requestParameters['createFacilityQualificationRateRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => FacilityQualificationRateResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiFacilitiesFacilityIdQualificationRatesPost(requestParameters: ApiFacilitiesFacilityIdQualificationRatesPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<FacilityQualificationRateResponse> {
|
||||
const response = await this.apiFacilitiesFacilityIdQualificationRatesPostRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -35,10 +35,17 @@ export interface ApiOrdersGetRequest {
|
||||
search?: string;
|
||||
statusId?: string;
|
||||
facilityId?: string;
|
||||
priority?: string;
|
||||
requiredQualification?: string;
|
||||
shiftType?: string;
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface ApiOrdersIdDeleteRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ApiOrdersIdGetRequest {
|
||||
id: string;
|
||||
}
|
||||
@@ -74,6 +81,18 @@ export class OrdersApi extends runtime.BaseAPI {
|
||||
queryParameters['facilityId'] = requestParameters['facilityId'];
|
||||
}
|
||||
|
||||
if (requestParameters['priority'] != null) {
|
||||
queryParameters['priority'] = requestParameters['priority'];
|
||||
}
|
||||
|
||||
if (requestParameters['requiredQualification'] != null) {
|
||||
queryParameters['requiredQualification'] = requestParameters['requiredQualification'];
|
||||
}
|
||||
|
||||
if (requestParameters['shiftType'] != null) {
|
||||
queryParameters['shiftType'] = requestParameters['shiftType'];
|
||||
}
|
||||
|
||||
if (requestParameters['page'] != null) {
|
||||
queryParameters['page'] = requestParameters['page'];
|
||||
}
|
||||
@@ -112,6 +131,48 @@ export class OrdersApi extends runtime.BaseAPI {
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiOrdersIdDeleteRaw(requestParameters: ApiOrdersIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiOrdersIdDelete().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/orders/{id}`;
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiOrdersIdDelete(requestParameters: ApiOrdersIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
await this.apiOrdersIdDeleteRaw(requestParameters, initOverrides);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiOrdersIdGetRaw(requestParameters: ApiOrdersIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<OrderResponse>> {
|
||||
|
||||
@@ -0,0 +1,389 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
CreateTimeEntryRequest,
|
||||
TimeEntryDecisionRequest,
|
||||
TimeEntryResponse,
|
||||
TimeEntryResponsePagedResponse,
|
||||
UpdateTimeEntryRequest,
|
||||
} from '../models/index';
|
||||
import {
|
||||
CreateTimeEntryRequestFromJSON,
|
||||
CreateTimeEntryRequestToJSON,
|
||||
TimeEntryDecisionRequestFromJSON,
|
||||
TimeEntryDecisionRequestToJSON,
|
||||
TimeEntryResponseFromJSON,
|
||||
TimeEntryResponseToJSON,
|
||||
TimeEntryResponsePagedResponseFromJSON,
|
||||
TimeEntryResponsePagedResponseToJSON,
|
||||
UpdateTimeEntryRequestFromJSON,
|
||||
UpdateTimeEntryRequestToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface ApiTimeEntriesGetRequest {
|
||||
statusId?: string;
|
||||
employeeId?: string;
|
||||
orderId?: string;
|
||||
page?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface ApiTimeEntriesIdDecisionPostRequest {
|
||||
id: string;
|
||||
timeEntryDecisionRequest?: TimeEntryDecisionRequest;
|
||||
}
|
||||
|
||||
export interface ApiTimeEntriesIdDeleteRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ApiTimeEntriesIdGetRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ApiTimeEntriesIdPutRequest {
|
||||
id: string;
|
||||
updateTimeEntryRequest?: UpdateTimeEntryRequest;
|
||||
}
|
||||
|
||||
export interface ApiTimeEntriesIdSubmitPostRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ApiTimeEntriesPostRequest {
|
||||
createTimeEntryRequest?: CreateTimeEntryRequest;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class TimeEntriesApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTimeEntriesGetRaw(requestParameters: ApiTimeEntriesGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TimeEntryResponsePagedResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['statusId'] != null) {
|
||||
queryParameters['statusId'] = requestParameters['statusId'];
|
||||
}
|
||||
|
||||
if (requestParameters['employeeId'] != null) {
|
||||
queryParameters['employeeId'] = requestParameters['employeeId'];
|
||||
}
|
||||
|
||||
if (requestParameters['orderId'] != null) {
|
||||
queryParameters['orderId'] = requestParameters['orderId'];
|
||||
}
|
||||
|
||||
if (requestParameters['page'] != null) {
|
||||
queryParameters['page'] = requestParameters['page'];
|
||||
}
|
||||
|
||||
if (requestParameters['pageSize'] != null) {
|
||||
queryParameters['pageSize'] = requestParameters['pageSize'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/time-entries`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => TimeEntryResponsePagedResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTimeEntriesGet(requestParameters: ApiTimeEntriesGetRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TimeEntryResponsePagedResponse> {
|
||||
const response = await this.apiTimeEntriesGetRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTimeEntriesIdDecisionPostRaw(requestParameters: ApiTimeEntriesIdDecisionPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TimeEntryResponse>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiTimeEntriesIdDecisionPost().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/time-entries/{id}/decision`;
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: TimeEntryDecisionRequestToJSON(requestParameters['timeEntryDecisionRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => TimeEntryResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTimeEntriesIdDecisionPost(requestParameters: ApiTimeEntriesIdDecisionPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TimeEntryResponse> {
|
||||
const response = await this.apiTimeEntriesIdDecisionPostRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTimeEntriesIdDeleteRaw(requestParameters: ApiTimeEntriesIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiTimeEntriesIdDelete().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/time-entries/{id}`;
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'DELETE',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTimeEntriesIdDelete(requestParameters: ApiTimeEntriesIdDeleteRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
await this.apiTimeEntriesIdDeleteRaw(requestParameters, initOverrides);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTimeEntriesIdGetRaw(requestParameters: ApiTimeEntriesIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TimeEntryResponse>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiTimeEntriesIdGet().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/time-entries/{id}`;
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => TimeEntryResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTimeEntriesIdGet(requestParameters: ApiTimeEntriesIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TimeEntryResponse> {
|
||||
const response = await this.apiTimeEntriesIdGetRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTimeEntriesIdPutRaw(requestParameters: ApiTimeEntriesIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TimeEntryResponse>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiTimeEntriesIdPut().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/time-entries/{id}`;
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'PUT',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: UpdateTimeEntryRequestToJSON(requestParameters['updateTimeEntryRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => TimeEntryResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTimeEntriesIdPut(requestParameters: ApiTimeEntriesIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TimeEntryResponse> {
|
||||
const response = await this.apiTimeEntriesIdPutRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTimeEntriesIdSubmitPostRaw(requestParameters: ApiTimeEntriesIdSubmitPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TimeEntryResponse>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiTimeEntriesIdSubmitPost().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/time-entries/{id}/submit`;
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => TimeEntryResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTimeEntriesIdSubmitPost(requestParameters: ApiTimeEntriesIdSubmitPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TimeEntryResponse> {
|
||||
const response = await this.apiTimeEntriesIdSubmitPostRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTimeEntriesPostRaw(requestParameters: ApiTimeEntriesPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<TimeEntryResponse>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
headerParameters['Content-Type'] = 'application/json';
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/time-entries`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
body: CreateTimeEntryRequestToJSON(requestParameters['createTimeEntryRequest']),
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => TimeEntryResponseFromJSON(jsonValue));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTimeEntriesPost(requestParameters: ApiTimeEntriesPostRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<TimeEntryResponse> {
|
||||
const response = await this.apiTimeEntriesPostRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,763 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
import * as runtime from '../runtime';
|
||||
import type {
|
||||
TrashAbsenceResponse,
|
||||
TrashContractResponse,
|
||||
TrashEmployeeResponse,
|
||||
TrashFacilityContactResponse,
|
||||
TrashFacilityQualificationRateResponse,
|
||||
TrashFacilityResponse,
|
||||
TrashOrderResponse,
|
||||
TrashTimeEntryResponse,
|
||||
} from '../models/index';
|
||||
import {
|
||||
TrashAbsenceResponseFromJSON,
|
||||
TrashAbsenceResponseToJSON,
|
||||
TrashContractResponseFromJSON,
|
||||
TrashContractResponseToJSON,
|
||||
TrashEmployeeResponseFromJSON,
|
||||
TrashEmployeeResponseToJSON,
|
||||
TrashFacilityContactResponseFromJSON,
|
||||
TrashFacilityContactResponseToJSON,
|
||||
TrashFacilityQualificationRateResponseFromJSON,
|
||||
TrashFacilityQualificationRateResponseToJSON,
|
||||
TrashFacilityResponseFromJSON,
|
||||
TrashFacilityResponseToJSON,
|
||||
TrashOrderResponseFromJSON,
|
||||
TrashOrderResponseToJSON,
|
||||
TrashTimeEntryResponseFromJSON,
|
||||
TrashTimeEntryResponseToJSON,
|
||||
} from '../models/index';
|
||||
|
||||
export interface ApiTrashAbsencesGetRequest {
|
||||
search?: string;
|
||||
}
|
||||
|
||||
export interface ApiTrashAbsencesIdRestorePostRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ApiTrashContractsGetRequest {
|
||||
search?: string;
|
||||
}
|
||||
|
||||
export interface ApiTrashContractsIdRestorePostRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ApiTrashEmployeesGetRequest {
|
||||
search?: string;
|
||||
}
|
||||
|
||||
export interface ApiTrashEmployeesIdRestorePostRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ApiTrashFacilitiesGetRequest {
|
||||
search?: string;
|
||||
}
|
||||
|
||||
export interface ApiTrashFacilitiesIdRestorePostRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ApiTrashFacilityContactsGetRequest {
|
||||
search?: string;
|
||||
}
|
||||
|
||||
export interface ApiTrashFacilityContactsIdRestorePostRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ApiTrashFacilityQualificationRatesGetRequest {
|
||||
search?: string;
|
||||
}
|
||||
|
||||
export interface ApiTrashFacilityQualificationRatesIdRestorePostRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ApiTrashOrdersGetRequest {
|
||||
search?: string;
|
||||
}
|
||||
|
||||
export interface ApiTrashOrdersIdRestorePostRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
export interface ApiTrashTimeEntriesGetRequest {
|
||||
search?: string;
|
||||
}
|
||||
|
||||
export interface ApiTrashTimeEntriesIdRestorePostRequest {
|
||||
id: string;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
export class TrashApi extends runtime.BaseAPI {
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashAbsencesGetRaw(requestParameters: ApiTrashAbsencesGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<TrashAbsenceResponse>>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['search'] != null) {
|
||||
queryParameters['search'] = requestParameters['search'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/trash/absences`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(TrashAbsenceResponseFromJSON));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashAbsencesGet(requestParameters: ApiTrashAbsencesGetRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<TrashAbsenceResponse>> {
|
||||
const response = await this.apiTrashAbsencesGetRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashAbsencesIdRestorePostRaw(requestParameters: ApiTrashAbsencesIdRestorePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiTrashAbsencesIdRestorePost().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/trash/absences/{id}/restore`;
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashAbsencesIdRestorePost(requestParameters: ApiTrashAbsencesIdRestorePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
await this.apiTrashAbsencesIdRestorePostRaw(requestParameters, initOverrides);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashContractsGetRaw(requestParameters: ApiTrashContractsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<TrashContractResponse>>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['search'] != null) {
|
||||
queryParameters['search'] = requestParameters['search'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/trash/contracts`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(TrashContractResponseFromJSON));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashContractsGet(requestParameters: ApiTrashContractsGetRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<TrashContractResponse>> {
|
||||
const response = await this.apiTrashContractsGetRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashContractsIdRestorePostRaw(requestParameters: ApiTrashContractsIdRestorePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiTrashContractsIdRestorePost().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/trash/contracts/{id}/restore`;
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashContractsIdRestorePost(requestParameters: ApiTrashContractsIdRestorePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
await this.apiTrashContractsIdRestorePostRaw(requestParameters, initOverrides);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashEmployeesGetRaw(requestParameters: ApiTrashEmployeesGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<TrashEmployeeResponse>>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['search'] != null) {
|
||||
queryParameters['search'] = requestParameters['search'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/trash/employees`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(TrashEmployeeResponseFromJSON));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashEmployeesGet(requestParameters: ApiTrashEmployeesGetRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<TrashEmployeeResponse>> {
|
||||
const response = await this.apiTrashEmployeesGetRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashEmployeesIdRestorePostRaw(requestParameters: ApiTrashEmployeesIdRestorePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiTrashEmployeesIdRestorePost().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/trash/employees/{id}/restore`;
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashEmployeesIdRestorePost(requestParameters: ApiTrashEmployeesIdRestorePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
await this.apiTrashEmployeesIdRestorePostRaw(requestParameters, initOverrides);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashFacilitiesGetRaw(requestParameters: ApiTrashFacilitiesGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<TrashFacilityResponse>>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['search'] != null) {
|
||||
queryParameters['search'] = requestParameters['search'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/trash/facilities`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(TrashFacilityResponseFromJSON));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashFacilitiesGet(requestParameters: ApiTrashFacilitiesGetRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<TrashFacilityResponse>> {
|
||||
const response = await this.apiTrashFacilitiesGetRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashFacilitiesIdRestorePostRaw(requestParameters: ApiTrashFacilitiesIdRestorePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiTrashFacilitiesIdRestorePost().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/trash/facilities/{id}/restore`;
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashFacilitiesIdRestorePost(requestParameters: ApiTrashFacilitiesIdRestorePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
await this.apiTrashFacilitiesIdRestorePostRaw(requestParameters, initOverrides);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashFacilityContactsGetRaw(requestParameters: ApiTrashFacilityContactsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<TrashFacilityContactResponse>>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['search'] != null) {
|
||||
queryParameters['search'] = requestParameters['search'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/trash/facility-contacts`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(TrashFacilityContactResponseFromJSON));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashFacilityContactsGet(requestParameters: ApiTrashFacilityContactsGetRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<TrashFacilityContactResponse>> {
|
||||
const response = await this.apiTrashFacilityContactsGetRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashFacilityContactsIdRestorePostRaw(requestParameters: ApiTrashFacilityContactsIdRestorePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiTrashFacilityContactsIdRestorePost().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/trash/facility-contacts/{id}/restore`;
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashFacilityContactsIdRestorePost(requestParameters: ApiTrashFacilityContactsIdRestorePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
await this.apiTrashFacilityContactsIdRestorePostRaw(requestParameters, initOverrides);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashFacilityQualificationRatesGetRaw(requestParameters: ApiTrashFacilityQualificationRatesGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<TrashFacilityQualificationRateResponse>>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['search'] != null) {
|
||||
queryParameters['search'] = requestParameters['search'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/trash/facility-qualification-rates`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(TrashFacilityQualificationRateResponseFromJSON));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashFacilityQualificationRatesGet(requestParameters: ApiTrashFacilityQualificationRatesGetRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<TrashFacilityQualificationRateResponse>> {
|
||||
const response = await this.apiTrashFacilityQualificationRatesGetRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashFacilityQualificationRatesIdRestorePostRaw(requestParameters: ApiTrashFacilityQualificationRatesIdRestorePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiTrashFacilityQualificationRatesIdRestorePost().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/trash/facility-qualification-rates/{id}/restore`;
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashFacilityQualificationRatesIdRestorePost(requestParameters: ApiTrashFacilityQualificationRatesIdRestorePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
await this.apiTrashFacilityQualificationRatesIdRestorePostRaw(requestParameters, initOverrides);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashOrdersGetRaw(requestParameters: ApiTrashOrdersGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<TrashOrderResponse>>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['search'] != null) {
|
||||
queryParameters['search'] = requestParameters['search'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/trash/orders`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(TrashOrderResponseFromJSON));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashOrdersGet(requestParameters: ApiTrashOrdersGetRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<TrashOrderResponse>> {
|
||||
const response = await this.apiTrashOrdersGetRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashOrdersIdRestorePostRaw(requestParameters: ApiTrashOrdersIdRestorePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiTrashOrdersIdRestorePost().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/trash/orders/{id}/restore`;
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashOrdersIdRestorePost(requestParameters: ApiTrashOrdersIdRestorePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
await this.apiTrashOrdersIdRestorePostRaw(requestParameters, initOverrides);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashTimeEntriesGetRaw(requestParameters: ApiTrashTimeEntriesGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Array<TrashTimeEntryResponse>>> {
|
||||
const queryParameters: any = {};
|
||||
|
||||
if (requestParameters['search'] != null) {
|
||||
queryParameters['search'] = requestParameters['search'];
|
||||
}
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/trash/time-entries`;
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'GET',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(TrashTimeEntryResponseFromJSON));
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashTimeEntriesGet(requestParameters: ApiTrashTimeEntriesGetRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Array<TrashTimeEntryResponse>> {
|
||||
const response = await this.apiTrashTimeEntriesGetRaw(requestParameters, initOverrides);
|
||||
return await response.value();
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashTimeEntriesIdRestorePostRaw(requestParameters: ApiTrashTimeEntriesIdRestorePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
|
||||
if (requestParameters['id'] == null) {
|
||||
throw new runtime.RequiredError(
|
||||
'id',
|
||||
'Required parameter "id" was null or undefined when calling apiTrashTimeEntriesIdRestorePost().'
|
||||
);
|
||||
}
|
||||
|
||||
const queryParameters: any = {};
|
||||
|
||||
const headerParameters: runtime.HTTPHeaders = {};
|
||||
|
||||
if (this.configuration && this.configuration.accessToken) {
|
||||
const token = this.configuration.accessToken;
|
||||
const tokenString = await token("Bearer", []);
|
||||
|
||||
if (tokenString) {
|
||||
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
||||
}
|
||||
}
|
||||
|
||||
let urlPath = `/api/trash/time-entries/{id}/restore`;
|
||||
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
||||
|
||||
const response = await this.request({
|
||||
path: urlPath,
|
||||
method: 'POST',
|
||||
headers: headerParameters,
|
||||
query: queryParameters,
|
||||
}, initOverrides);
|
||||
|
||||
return new runtime.VoidApiResponse(response);
|
||||
}
|
||||
|
||||
/**
|
||||
*/
|
||||
async apiTrashTimeEntriesIdRestorePost(requestParameters: ApiTrashTimeEntriesIdRestorePostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
|
||||
await this.apiTrashTimeEntriesIdRestorePostRaw(requestParameters, initOverrides);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,15 +1,20 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export * from './AbsencesApi';
|
||||
export * from './AdminEmailApi';
|
||||
export * from './AdminSessionsApi';
|
||||
export * from './AuditLogApi';
|
||||
export * from './AuthApi';
|
||||
export * from './ContractsApi';
|
||||
export * from './DocumentsApi';
|
||||
export * from './EmployeesApi';
|
||||
export * from './FacilitiesApi';
|
||||
export * from './FacilityContactsApi';
|
||||
export * from './FacilityQualificationRatesApi';
|
||||
export * from './HealthApi';
|
||||
export * from './OrdersApi';
|
||||
export * from './RolesApi';
|
||||
export * from './TimeEntriesApi';
|
||||
export * from './TrashApi';
|
||||
export * from './UsersApi';
|
||||
export * from './ValueListsApi';
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface AbsenceDecisionRequest
|
||||
*/
|
||||
export interface AbsenceDecisionRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AbsenceDecisionRequest
|
||||
*/
|
||||
status?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AbsenceDecisionRequest
|
||||
*/
|
||||
adminNote?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the AbsenceDecisionRequest interface.
|
||||
*/
|
||||
export function instanceOfAbsenceDecisionRequest(value: object): value is AbsenceDecisionRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function AbsenceDecisionRequestFromJSON(json: any): AbsenceDecisionRequest {
|
||||
return AbsenceDecisionRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function AbsenceDecisionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AbsenceDecisionRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'status': json['status'] == null ? undefined : json['status'],
|
||||
'adminNote': json['adminNote'] == null ? undefined : json['adminNote'],
|
||||
};
|
||||
}
|
||||
|
||||
export function AbsenceDecisionRequestToJSON(json: any): AbsenceDecisionRequest {
|
||||
return AbsenceDecisionRequestToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function AbsenceDecisionRequestToJSONTyped(value?: AbsenceDecisionRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'status': value['status'],
|
||||
'adminNote': value['adminNote'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,153 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface AbsenceResponse
|
||||
*/
|
||||
export interface AbsenceResponse {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AbsenceResponse
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AbsenceResponse
|
||||
*/
|
||||
employeeId?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AbsenceResponse
|
||||
*/
|
||||
employeeName?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AbsenceResponse
|
||||
*/
|
||||
type?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof AbsenceResponse
|
||||
*/
|
||||
startDate?: Date;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof AbsenceResponse
|
||||
*/
|
||||
endDate?: Date;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AbsenceResponse
|
||||
*/
|
||||
reason?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AbsenceResponse
|
||||
*/
|
||||
substitute?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AbsenceResponse
|
||||
*/
|
||||
note?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AbsenceResponse
|
||||
*/
|
||||
status?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof AbsenceResponse
|
||||
*/
|
||||
adminNote?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof AbsenceResponse
|
||||
*/
|
||||
createdAt?: Date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the AbsenceResponse interface.
|
||||
*/
|
||||
export function instanceOfAbsenceResponse(value: object): value is AbsenceResponse {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function AbsenceResponseFromJSON(json: any): AbsenceResponse {
|
||||
return AbsenceResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function AbsenceResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AbsenceResponse {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'] == null ? undefined : json['id'],
|
||||
'employeeId': json['employeeId'] == null ? undefined : json['employeeId'],
|
||||
'employeeName': json['employeeName'] == null ? undefined : json['employeeName'],
|
||||
'type': json['type'] == null ? undefined : json['type'],
|
||||
'startDate': json['startDate'] == null ? undefined : (new Date(json['startDate'])),
|
||||
'endDate': json['endDate'] == null ? undefined : (new Date(json['endDate'])),
|
||||
'reason': json['reason'] == null ? undefined : json['reason'],
|
||||
'substitute': json['substitute'] == null ? undefined : json['substitute'],
|
||||
'note': json['note'] == null ? undefined : json['note'],
|
||||
'status': json['status'] == null ? undefined : json['status'],
|
||||
'adminNote': json['adminNote'] == null ? undefined : json['adminNote'],
|
||||
'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])),
|
||||
};
|
||||
}
|
||||
|
||||
export function AbsenceResponseToJSON(json: any): AbsenceResponse {
|
||||
return AbsenceResponseToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function AbsenceResponseToJSONTyped(value?: AbsenceResponse | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'id': value['id'],
|
||||
'employeeId': value['employeeId'],
|
||||
'employeeName': value['employeeName'],
|
||||
'type': value['type'],
|
||||
'startDate': value['startDate'] == null ? undefined : ((value['startDate']).toISOString().substring(0,10)),
|
||||
'endDate': value['endDate'] == null ? undefined : ((value['endDate']).toISOString().substring(0,10)),
|
||||
'reason': value['reason'],
|
||||
'substitute': value['substitute'],
|
||||
'note': value['note'],
|
||||
'status': value['status'],
|
||||
'adminNote': value['adminNote'],
|
||||
'createdAt': value['createdAt'] == null ? undefined : ((value['createdAt']).toISOString()),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
import type { AbsenceResponse } from './AbsenceResponse';
|
||||
import {
|
||||
AbsenceResponseFromJSON,
|
||||
AbsenceResponseFromJSONTyped,
|
||||
AbsenceResponseToJSON,
|
||||
AbsenceResponseToJSONTyped,
|
||||
} from './AbsenceResponse';
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface AbsenceResponsePagedResponse
|
||||
*/
|
||||
export interface AbsenceResponsePagedResponse {
|
||||
/**
|
||||
*
|
||||
* @type {Array<AbsenceResponse>}
|
||||
* @memberof AbsenceResponsePagedResponse
|
||||
*/
|
||||
items?: Array<AbsenceResponse> | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof AbsenceResponsePagedResponse
|
||||
*/
|
||||
totalCount?: number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof AbsenceResponsePagedResponse
|
||||
*/
|
||||
page?: number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof AbsenceResponsePagedResponse
|
||||
*/
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the AbsenceResponsePagedResponse interface.
|
||||
*/
|
||||
export function instanceOfAbsenceResponsePagedResponse(value: object): value is AbsenceResponsePagedResponse {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function AbsenceResponsePagedResponseFromJSON(json: any): AbsenceResponsePagedResponse {
|
||||
return AbsenceResponsePagedResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function AbsenceResponsePagedResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): AbsenceResponsePagedResponse {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'items': json['items'] == null ? undefined : ((json['items'] as Array<any>).map(AbsenceResponseFromJSON)),
|
||||
'totalCount': json['totalCount'] == null ? undefined : json['totalCount'],
|
||||
'page': json['page'] == null ? undefined : json['page'],
|
||||
'pageSize': json['pageSize'] == null ? undefined : json['pageSize'],
|
||||
};
|
||||
}
|
||||
|
||||
export function AbsenceResponsePagedResponseToJSON(json: any): AbsenceResponsePagedResponse {
|
||||
return AbsenceResponsePagedResponseToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function AbsenceResponsePagedResponseToJSONTyped(value?: AbsenceResponsePagedResponse | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'items': value['items'] == null ? undefined : ((value['items'] as Array<any>).map(AbsenceResponseToJSON)),
|
||||
'totalCount': value['totalCount'],
|
||||
'page': value['page'],
|
||||
'pageSize': value['pageSize'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -34,6 +34,13 @@ import {
|
||||
PermissionEffectToJSON,
|
||||
PermissionEffectToJSONTyped,
|
||||
} from './PermissionEffect';
|
||||
import type { PermissionScope } from './PermissionScope';
|
||||
import {
|
||||
PermissionScopeFromJSON,
|
||||
PermissionScopeFromJSONTyped,
|
||||
PermissionScopeToJSON,
|
||||
PermissionScopeToJSONTyped,
|
||||
} from './PermissionScope';
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -59,6 +66,12 @@ export interface AddUserPermissionOverrideRequest {
|
||||
* @memberof AddUserPermissionOverrideRequest
|
||||
*/
|
||||
effect?: PermissionEffect;
|
||||
/**
|
||||
*
|
||||
* @type {PermissionScope}
|
||||
* @memberof AddUserPermissionOverrideRequest
|
||||
*/
|
||||
scope?: PermissionScope;
|
||||
}
|
||||
|
||||
|
||||
@@ -83,6 +96,7 @@ export function AddUserPermissionOverrideRequestFromJSONTyped(json: any, ignoreD
|
||||
'module': json['module'] == null ? undefined : ModuleTypeFromJSON(json['module']),
|
||||
'action': json['action'] == null ? undefined : PermissionActionFromJSON(json['action']),
|
||||
'effect': json['effect'] == null ? undefined : PermissionEffectFromJSON(json['effect']),
|
||||
'scope': json['scope'] == null ? undefined : PermissionScopeFromJSON(json['scope']),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -100,6 +114,7 @@ export function AddUserPermissionOverrideRequestToJSONTyped(value?: AddUserPermi
|
||||
'module': ModuleTypeToJSON(value['module']),
|
||||
'action': PermissionActionToJSON(value['action']),
|
||||
'effect': PermissionEffectToJSON(value['effect']),
|
||||
'scope': PermissionScopeToJSON(value['scope']),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface CreateAbsenceRequest
|
||||
*/
|
||||
export interface CreateAbsenceRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof CreateAbsenceRequest
|
||||
*/
|
||||
type?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof CreateAbsenceRequest
|
||||
*/
|
||||
startDate?: Date;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof CreateAbsenceRequest
|
||||
*/
|
||||
endDate?: Date;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof CreateAbsenceRequest
|
||||
*/
|
||||
reason?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof CreateAbsenceRequest
|
||||
*/
|
||||
substitute?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof CreateAbsenceRequest
|
||||
*/
|
||||
note?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the CreateAbsenceRequest interface.
|
||||
*/
|
||||
export function instanceOfCreateAbsenceRequest(value: object): value is CreateAbsenceRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function CreateAbsenceRequestFromJSON(json: any): CreateAbsenceRequest {
|
||||
return CreateAbsenceRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function CreateAbsenceRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateAbsenceRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'type': json['type'] == null ? undefined : json['type'],
|
||||
'startDate': json['startDate'] == null ? undefined : (new Date(json['startDate'])),
|
||||
'endDate': json['endDate'] == null ? undefined : (new Date(json['endDate'])),
|
||||
'reason': json['reason'] == null ? undefined : json['reason'],
|
||||
'substitute': json['substitute'] == null ? undefined : json['substitute'],
|
||||
'note': json['note'] == null ? undefined : json['note'],
|
||||
};
|
||||
}
|
||||
|
||||
export function CreateAbsenceRequestToJSON(json: any): CreateAbsenceRequest {
|
||||
return CreateAbsenceRequestToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function CreateAbsenceRequestToJSONTyped(value?: CreateAbsenceRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'type': value['type'],
|
||||
'startDate': value['startDate'] == null ? undefined : ((value['startDate']).toISOString().substring(0,10)),
|
||||
'endDate': value['endDate'] == null ? undefined : ((value['endDate']).toISOString().substring(0,10)),
|
||||
'reason': value['reason'],
|
||||
'substitute': value['substitute'],
|
||||
'note': value['note'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface CreateFacilityQualificationRateRequest
|
||||
*/
|
||||
export interface CreateFacilityQualificationRateRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof CreateFacilityQualificationRateRequest
|
||||
*/
|
||||
qualification?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof CreateFacilityQualificationRateRequest
|
||||
*/
|
||||
rate?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the CreateFacilityQualificationRateRequest interface.
|
||||
*/
|
||||
export function instanceOfCreateFacilityQualificationRateRequest(value: object): value is CreateFacilityQualificationRateRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function CreateFacilityQualificationRateRequestFromJSON(json: any): CreateFacilityQualificationRateRequest {
|
||||
return CreateFacilityQualificationRateRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function CreateFacilityQualificationRateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateFacilityQualificationRateRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'qualification': json['qualification'] == null ? undefined : json['qualification'],
|
||||
'rate': json['rate'] == null ? undefined : json['rate'],
|
||||
};
|
||||
}
|
||||
|
||||
export function CreateFacilityQualificationRateRequestToJSON(json: any): CreateFacilityQualificationRateRequest {
|
||||
return CreateFacilityQualificationRateRequestToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function CreateFacilityQualificationRateRequestToJSONTyped(value?: CreateFacilityQualificationRateRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'qualification': value['qualification'],
|
||||
'rate': value['rate'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface CreateTimeEntryRequest
|
||||
*/
|
||||
export interface CreateTimeEntryRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof CreateTimeEntryRequest
|
||||
*/
|
||||
orderId?: string;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof CreateTimeEntryRequest
|
||||
*/
|
||||
date?: Date;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof CreateTimeEntryRequest
|
||||
*/
|
||||
start?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof CreateTimeEntryRequest
|
||||
*/
|
||||
end?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof CreateTimeEntryRequest
|
||||
*/
|
||||
breakDuration?: string;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof CreateTimeEntryRequest
|
||||
*/
|
||||
nightHours?: number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof CreateTimeEntryRequest
|
||||
*/
|
||||
saturdayHours?: number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof CreateTimeEntryRequest
|
||||
*/
|
||||
sundayHours?: number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof CreateTimeEntryRequest
|
||||
*/
|
||||
holidayHours?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the CreateTimeEntryRequest interface.
|
||||
*/
|
||||
export function instanceOfCreateTimeEntryRequest(value: object): value is CreateTimeEntryRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function CreateTimeEntryRequestFromJSON(json: any): CreateTimeEntryRequest {
|
||||
return CreateTimeEntryRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function CreateTimeEntryRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateTimeEntryRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'orderId': json['orderId'] == null ? undefined : json['orderId'],
|
||||
'date': json['date'] == null ? undefined : (new Date(json['date'])),
|
||||
'start': json['start'] == null ? undefined : json['start'],
|
||||
'end': json['end'] == null ? undefined : json['end'],
|
||||
'breakDuration': json['breakDuration'] == null ? undefined : json['breakDuration'],
|
||||
'nightHours': json['nightHours'] == null ? undefined : json['nightHours'],
|
||||
'saturdayHours': json['saturdayHours'] == null ? undefined : json['saturdayHours'],
|
||||
'sundayHours': json['sundayHours'] == null ? undefined : json['sundayHours'],
|
||||
'holidayHours': json['holidayHours'] == null ? undefined : json['holidayHours'],
|
||||
};
|
||||
}
|
||||
|
||||
export function CreateTimeEntryRequestToJSON(json: any): CreateTimeEntryRequest {
|
||||
return CreateTimeEntryRequestToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function CreateTimeEntryRequestToJSONTyped(value?: CreateTimeEntryRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'orderId': value['orderId'],
|
||||
'date': value['date'] == null ? undefined : ((value['date']).toISOString().substring(0,10)),
|
||||
'start': value['start'],
|
||||
'end': value['end'],
|
||||
'breakDuration': value['breakDuration'],
|
||||
'nightHours': value['nightHours'],
|
||||
'saturdayHours': value['saturdayHours'],
|
||||
'sundayHours': value['sundayHours'],
|
||||
'holidayHours': value['holidayHours'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -49,6 +49,12 @@ export interface CreateValueListItemRequest {
|
||||
* @memberof CreateValueListItemRequest
|
||||
*/
|
||||
isTerminal?: boolean;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof CreateValueListItemRequest
|
||||
*/
|
||||
triggersFollowUp?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,6 +79,7 @@ export function CreateValueListItemRequestFromJSONTyped(json: any, ignoreDiscrim
|
||||
'isDefault': json['isDefault'] == null ? undefined : json['isDefault'],
|
||||
'isInitial': json['isInitial'] == null ? undefined : json['isInitial'],
|
||||
'isTerminal': json['isTerminal'] == null ? undefined : json['isTerminal'],
|
||||
'triggersFollowUp': json['triggersFollowUp'] == null ? undefined : json['triggersFollowUp'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -92,6 +99,7 @@ export function CreateValueListItemRequestToJSONTyped(value?: CreateValueListIte
|
||||
'isDefault': value['isDefault'],
|
||||
'isInitial': value['isInitial'],
|
||||
'isTerminal': value['isTerminal'],
|
||||
'triggersFollowUp': value['triggersFollowUp'],
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface DocumentResponse
|
||||
*/
|
||||
export interface DocumentResponse {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof DocumentResponse
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof DocumentResponse
|
||||
*/
|
||||
entityType?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof DocumentResponse
|
||||
*/
|
||||
entityId?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof DocumentResponse
|
||||
*/
|
||||
category?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof DocumentResponse
|
||||
*/
|
||||
fileName?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof DocumentResponse
|
||||
*/
|
||||
contentType?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof DocumentResponse
|
||||
*/
|
||||
sizeBytes?: number;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof DocumentResponse
|
||||
*/
|
||||
description?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof DocumentResponse
|
||||
*/
|
||||
uploadedByUserId?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof DocumentResponse
|
||||
*/
|
||||
uploadedByUsername?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof DocumentResponse
|
||||
*/
|
||||
createdAt?: Date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the DocumentResponse interface.
|
||||
*/
|
||||
export function instanceOfDocumentResponse(value: object): value is DocumentResponse {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function DocumentResponseFromJSON(json: any): DocumentResponse {
|
||||
return DocumentResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function DocumentResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): DocumentResponse {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'] == null ? undefined : json['id'],
|
||||
'entityType': json['entityType'] == null ? undefined : json['entityType'],
|
||||
'entityId': json['entityId'] == null ? undefined : json['entityId'],
|
||||
'category': json['category'] == null ? undefined : json['category'],
|
||||
'fileName': json['fileName'] == null ? undefined : json['fileName'],
|
||||
'contentType': json['contentType'] == null ? undefined : json['contentType'],
|
||||
'sizeBytes': json['sizeBytes'] == null ? undefined : json['sizeBytes'],
|
||||
'description': json['description'] == null ? undefined : json['description'],
|
||||
'uploadedByUserId': json['uploadedByUserId'] == null ? undefined : json['uploadedByUserId'],
|
||||
'uploadedByUsername': json['uploadedByUsername'] == null ? undefined : json['uploadedByUsername'],
|
||||
'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])),
|
||||
};
|
||||
}
|
||||
|
||||
export function DocumentResponseToJSON(json: any): DocumentResponse {
|
||||
return DocumentResponseToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function DocumentResponseToJSONTyped(value?: DocumentResponse | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'id': value['id'],
|
||||
'entityType': value['entityType'],
|
||||
'entityId': value['entityId'],
|
||||
'category': value['category'],
|
||||
'fileName': value['fileName'],
|
||||
'contentType': value['contentType'],
|
||||
'sizeBytes': value['sizeBytes'],
|
||||
'description': value['description'],
|
||||
'uploadedByUserId': value['uploadedByUserId'],
|
||||
'uploadedByUsername': value['uploadedByUsername'],
|
||||
'createdAt': value['createdAt'] == null ? undefined : ((value['createdAt']).toISOString()),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface FacilityQualificationRateResponse
|
||||
*/
|
||||
export interface FacilityQualificationRateResponse {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof FacilityQualificationRateResponse
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof FacilityQualificationRateResponse
|
||||
*/
|
||||
facilityId?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof FacilityQualificationRateResponse
|
||||
*/
|
||||
qualification?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof FacilityQualificationRateResponse
|
||||
*/
|
||||
rate?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the FacilityQualificationRateResponse interface.
|
||||
*/
|
||||
export function instanceOfFacilityQualificationRateResponse(value: object): value is FacilityQualificationRateResponse {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function FacilityQualificationRateResponseFromJSON(json: any): FacilityQualificationRateResponse {
|
||||
return FacilityQualificationRateResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function FacilityQualificationRateResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): FacilityQualificationRateResponse {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'] == null ? undefined : json['id'],
|
||||
'facilityId': json['facilityId'] == null ? undefined : json['facilityId'],
|
||||
'qualification': json['qualification'] == null ? undefined : json['qualification'],
|
||||
'rate': json['rate'] == null ? undefined : json['rate'],
|
||||
};
|
||||
}
|
||||
|
||||
export function FacilityQualificationRateResponseToJSON(json: any): FacilityQualificationRateResponse {
|
||||
return FacilityQualificationRateResponseToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function FacilityQualificationRateResponseToJSONTyped(value?: FacilityQualificationRateResponse | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'id': value['id'],
|
||||
'facilityId': value['facilityId'],
|
||||
'qualification': value['qualification'],
|
||||
'rate': value['rate'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -97,6 +97,78 @@ export interface FacilityResponse {
|
||||
* @memberof FacilityResponse
|
||||
*/
|
||||
billingCountry?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof FacilityResponse
|
||||
*/
|
||||
followUpDueDate?: Date | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof FacilityResponse
|
||||
*/
|
||||
billingRate?: number | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof FacilityResponse
|
||||
*/
|
||||
nightSurchargePercent?: number | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof FacilityResponse
|
||||
*/
|
||||
saturdaySurchargePercent?: number | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof FacilityResponse
|
||||
*/
|
||||
sundaySurchargePercent?: number | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof FacilityResponse
|
||||
*/
|
||||
holidaySurchargePercent?: number | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof FacilityResponse
|
||||
*/
|
||||
travelCostRate?: number | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof FacilityResponse
|
||||
*/
|
||||
minimumHours?: number | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof FacilityResponse
|
||||
*/
|
||||
breakPolicy?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof FacilityResponse
|
||||
*/
|
||||
billingInterval?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof FacilityResponse
|
||||
*/
|
||||
paymentTermDays?: number | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof FacilityResponse
|
||||
*/
|
||||
individualAgreements?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -129,6 +201,18 @@ export function FacilityResponseFromJSONTyped(json: any, ignoreDiscriminator: bo
|
||||
'billingPostalCode': json['billingPostalCode'] == null ? undefined : json['billingPostalCode'],
|
||||
'billingCity': json['billingCity'] == null ? undefined : json['billingCity'],
|
||||
'billingCountry': json['billingCountry'] == null ? undefined : json['billingCountry'],
|
||||
'followUpDueDate': json['followUpDueDate'] == null ? undefined : (new Date(json['followUpDueDate'])),
|
||||
'billingRate': json['billingRate'] == null ? undefined : json['billingRate'],
|
||||
'nightSurchargePercent': json['nightSurchargePercent'] == null ? undefined : json['nightSurchargePercent'],
|
||||
'saturdaySurchargePercent': json['saturdaySurchargePercent'] == null ? undefined : json['saturdaySurchargePercent'],
|
||||
'sundaySurchargePercent': json['sundaySurchargePercent'] == null ? undefined : json['sundaySurchargePercent'],
|
||||
'holidaySurchargePercent': json['holidaySurchargePercent'] == null ? undefined : json['holidaySurchargePercent'],
|
||||
'travelCostRate': json['travelCostRate'] == null ? undefined : json['travelCostRate'],
|
||||
'minimumHours': json['minimumHours'] == null ? undefined : json['minimumHours'],
|
||||
'breakPolicy': json['breakPolicy'] == null ? undefined : json['breakPolicy'],
|
||||
'billingInterval': json['billingInterval'] == null ? undefined : json['billingInterval'],
|
||||
'paymentTermDays': json['paymentTermDays'] == null ? undefined : json['paymentTermDays'],
|
||||
'individualAgreements': json['individualAgreements'] == null ? undefined : json['individualAgreements'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -156,6 +240,18 @@ export function FacilityResponseToJSONTyped(value?: FacilityResponse | null, ign
|
||||
'billingPostalCode': value['billingPostalCode'],
|
||||
'billingCity': value['billingCity'],
|
||||
'billingCountry': value['billingCountry'],
|
||||
'followUpDueDate': value['followUpDueDate'] === null ? null : ((value['followUpDueDate'] as any)?.toISOString()),
|
||||
'billingRate': value['billingRate'],
|
||||
'nightSurchargePercent': value['nightSurchargePercent'],
|
||||
'saturdaySurchargePercent': value['saturdaySurchargePercent'],
|
||||
'sundaySurchargePercent': value['sundaySurchargePercent'],
|
||||
'holidaySurchargePercent': value['holidaySurchargePercent'],
|
||||
'travelCostRate': value['travelCostRate'],
|
||||
'minimumHours': value['minimumHours'],
|
||||
'breakPolicy': value['breakPolicy'],
|
||||
'billingInterval': value['billingInterval'],
|
||||
'paymentTermDays': value['paymentTermDays'],
|
||||
'individualAgreements': value['individualAgreements'],
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -25,12 +25,6 @@ export interface LoginResponse {
|
||||
* @memberof LoginResponse
|
||||
*/
|
||||
accessToken?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof LoginResponse
|
||||
*/
|
||||
refreshToken?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
@@ -63,7 +57,6 @@ export function LoginResponseFromJSONTyped(json: any, ignoreDiscriminator: boole
|
||||
return {
|
||||
|
||||
'accessToken': json['accessToken'] == null ? undefined : json['accessToken'],
|
||||
'refreshToken': json['refreshToken'] == null ? undefined : json['refreshToken'],
|
||||
'expiresAt': json['expiresAt'] == null ? undefined : (new Date(json['expiresAt'])),
|
||||
'mustChangePassword': json['mustChangePassword'] == null ? undefined : json['mustChangePassword'],
|
||||
};
|
||||
@@ -81,7 +74,6 @@ export function LoginResponseToJSONTyped(value?: LoginResponse | null, ignoreDis
|
||||
return {
|
||||
|
||||
'accessToken': value['accessToken'],
|
||||
'refreshToken': value['refreshToken'],
|
||||
'expiresAt': value['expiresAt'] == null ? undefined : ((value['expiresAt']).toISOString()),
|
||||
'mustChangePassword': value['mustChangePassword'],
|
||||
};
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface LogoutRequest
|
||||
*/
|
||||
export interface LogoutRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof LogoutRequest
|
||||
*/
|
||||
refreshToken?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the LogoutRequest interface.
|
||||
*/
|
||||
export function instanceOfLogoutRequest(value: object): value is LogoutRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function LogoutRequestFromJSON(json: any): LogoutRequest {
|
||||
return LogoutRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function LogoutRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): LogoutRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'refreshToken': json['refreshToken'] == null ? undefined : json['refreshToken'],
|
||||
};
|
||||
}
|
||||
|
||||
export function LogoutRequestToJSON(json: any): LogoutRequest {
|
||||
return LogoutRequestToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function LogoutRequestToJSONTyped(value?: LogoutRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'refreshToken': value['refreshToken'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -27,7 +27,11 @@ export const ModuleType = {
|
||||
Recruiting: 'Recruiting',
|
||||
Controlling: 'Controlling',
|
||||
UserManagement: 'UserManagement',
|
||||
AuditLog: 'AuditLog'
|
||||
AuditLog: 'AuditLog',
|
||||
Documents: 'Documents',
|
||||
Users: 'Users',
|
||||
Configuration: 'Configuration',
|
||||
Absences: 'Absences'
|
||||
} as const;
|
||||
export type ModuleType = typeof ModuleType[keyof typeof ModuleType];
|
||||
|
||||
|
||||
@@ -23,7 +23,8 @@ export const PermissionAction = {
|
||||
Edit: 'Edit',
|
||||
Delete: 'Delete',
|
||||
Export: 'Export',
|
||||
Approve: 'Approve'
|
||||
Approve: 'Approve',
|
||||
Recover: 'Recover'
|
||||
} as const;
|
||||
export type PermissionAction = typeof PermissionAction[keyof typeof PermissionAction];
|
||||
|
||||
|
||||
@@ -27,6 +27,13 @@ import {
|
||||
PermissionActionToJSON,
|
||||
PermissionActionToJSONTyped,
|
||||
} from './PermissionAction';
|
||||
import type { PermissionScope } from './PermissionScope';
|
||||
import {
|
||||
PermissionScopeFromJSON,
|
||||
PermissionScopeFromJSONTyped,
|
||||
PermissionScopeToJSON,
|
||||
PermissionScopeToJSONTyped,
|
||||
} from './PermissionScope';
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -46,6 +53,12 @@ export interface PermissionDto {
|
||||
* @memberof PermissionDto
|
||||
*/
|
||||
action?: PermissionAction;
|
||||
/**
|
||||
*
|
||||
* @type {PermissionScope}
|
||||
* @memberof PermissionDto
|
||||
*/
|
||||
scope?: PermissionScope;
|
||||
}
|
||||
|
||||
|
||||
@@ -69,6 +82,7 @@ export function PermissionDtoFromJSONTyped(json: any, ignoreDiscriminator: boole
|
||||
|
||||
'module': json['module'] == null ? undefined : ModuleTypeFromJSON(json['module']),
|
||||
'action': json['action'] == null ? undefined : PermissionActionFromJSON(json['action']),
|
||||
'scope': json['scope'] == null ? undefined : PermissionScopeFromJSON(json['scope']),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -85,6 +99,7 @@ export function PermissionDtoToJSONTyped(value?: PermissionDto | null, ignoreDis
|
||||
|
||||
'module': ModuleTypeToJSON(value['module']),
|
||||
'action': PermissionActionToJSON(value['action']),
|
||||
'scope': PermissionScopeToJSON(value['scope']),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
*/
|
||||
export const PermissionScope = {
|
||||
All: 'All',
|
||||
Own: 'Own'
|
||||
} as const;
|
||||
export type PermissionScope = typeof PermissionScope[keyof typeof PermissionScope];
|
||||
|
||||
|
||||
export function instanceOfPermissionScope(value: any): boolean {
|
||||
for (const key in PermissionScope) {
|
||||
if (Object.prototype.hasOwnProperty.call(PermissionScope, key)) {
|
||||
if (PermissionScope[key as keyof typeof PermissionScope] === value) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
export function PermissionScopeFromJSON(json: any): PermissionScope {
|
||||
return PermissionScopeFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function PermissionScopeFromJSONTyped(json: any, ignoreDiscriminator: boolean): PermissionScope {
|
||||
return json as PermissionScope;
|
||||
}
|
||||
|
||||
export function PermissionScopeToJSON(value?: PermissionScope | null): any {
|
||||
return value as any;
|
||||
}
|
||||
|
||||
export function PermissionScopeToJSONTyped(value: any, ignoreDiscriminator: boolean): PermissionScope {
|
||||
return value as PermissionScope;
|
||||
}
|
||||
|
||||
@@ -1,65 +0,0 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface RefreshRequest
|
||||
*/
|
||||
export interface RefreshRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof RefreshRequest
|
||||
*/
|
||||
refreshToken?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the RefreshRequest interface.
|
||||
*/
|
||||
export function instanceOfRefreshRequest(value: object): value is RefreshRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function RefreshRequestFromJSON(json: any): RefreshRequest {
|
||||
return RefreshRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function RefreshRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): RefreshRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'refreshToken': json['refreshToken'] == null ? undefined : json['refreshToken'],
|
||||
};
|
||||
}
|
||||
|
||||
export function RefreshRequestToJSON(json: any): RefreshRequest {
|
||||
return RefreshRequestToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function RefreshRequestToJSONTyped(value?: RefreshRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'refreshToken': value['refreshToken'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface TimeEntryDecisionRequest
|
||||
*/
|
||||
export interface TimeEntryDecisionRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TimeEntryDecisionRequest
|
||||
*/
|
||||
statusId?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TimeEntryDecisionRequest
|
||||
*/
|
||||
adminNote?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the TimeEntryDecisionRequest interface.
|
||||
*/
|
||||
export function instanceOfTimeEntryDecisionRequest(value: object): value is TimeEntryDecisionRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function TimeEntryDecisionRequestFromJSON(json: any): TimeEntryDecisionRequest {
|
||||
return TimeEntryDecisionRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TimeEntryDecisionRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): TimeEntryDecisionRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'statusId': json['statusId'] == null ? undefined : json['statusId'],
|
||||
'adminNote': json['adminNote'] == null ? undefined : json['adminNote'],
|
||||
};
|
||||
}
|
||||
|
||||
export function TimeEntryDecisionRequestToJSON(json: any): TimeEntryDecisionRequest {
|
||||
return TimeEntryDecisionRequestToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TimeEntryDecisionRequestToJSONTyped(value?: TimeEntryDecisionRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'statusId': value['statusId'],
|
||||
'adminNote': value['adminNote'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,209 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface TimeEntryResponse
|
||||
*/
|
||||
export interface TimeEntryResponse {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TimeEntryResponse
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TimeEntryResponse
|
||||
*/
|
||||
employeeId?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TimeEntryResponse
|
||||
*/
|
||||
employeeName?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TimeEntryResponse
|
||||
*/
|
||||
orderId?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TimeEntryResponse
|
||||
*/
|
||||
facilityId?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TimeEntryResponse
|
||||
*/
|
||||
facilityName?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof TimeEntryResponse
|
||||
*/
|
||||
date?: Date;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TimeEntryResponse
|
||||
*/
|
||||
start?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TimeEntryResponse
|
||||
*/
|
||||
end?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TimeEntryResponse
|
||||
*/
|
||||
breakDuration?: string;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof TimeEntryResponse
|
||||
*/
|
||||
nightHours?: number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof TimeEntryResponse
|
||||
*/
|
||||
saturdayHours?: number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof TimeEntryResponse
|
||||
*/
|
||||
sundayHours?: number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof TimeEntryResponse
|
||||
*/
|
||||
holidayHours?: number;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TimeEntryResponse
|
||||
*/
|
||||
statusId?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TimeEntryResponse
|
||||
*/
|
||||
statusName?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof TimeEntryResponse
|
||||
*/
|
||||
isEditableByOwner?: boolean;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TimeEntryResponse
|
||||
*/
|
||||
adminNote?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof TimeEntryResponse
|
||||
*/
|
||||
createdAt?: Date;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the TimeEntryResponse interface.
|
||||
*/
|
||||
export function instanceOfTimeEntryResponse(value: object): value is TimeEntryResponse {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function TimeEntryResponseFromJSON(json: any): TimeEntryResponse {
|
||||
return TimeEntryResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TimeEntryResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): TimeEntryResponse {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'] == null ? undefined : json['id'],
|
||||
'employeeId': json['employeeId'] == null ? undefined : json['employeeId'],
|
||||
'employeeName': json['employeeName'] == null ? undefined : json['employeeName'],
|
||||
'orderId': json['orderId'] == null ? undefined : json['orderId'],
|
||||
'facilityId': json['facilityId'] == null ? undefined : json['facilityId'],
|
||||
'facilityName': json['facilityName'] == null ? undefined : json['facilityName'],
|
||||
'date': json['date'] == null ? undefined : (new Date(json['date'])),
|
||||
'start': json['start'] == null ? undefined : json['start'],
|
||||
'end': json['end'] == null ? undefined : json['end'],
|
||||
'breakDuration': json['breakDuration'] == null ? undefined : json['breakDuration'],
|
||||
'nightHours': json['nightHours'] == null ? undefined : json['nightHours'],
|
||||
'saturdayHours': json['saturdayHours'] == null ? undefined : json['saturdayHours'],
|
||||
'sundayHours': json['sundayHours'] == null ? undefined : json['sundayHours'],
|
||||
'holidayHours': json['holidayHours'] == null ? undefined : json['holidayHours'],
|
||||
'statusId': json['statusId'] == null ? undefined : json['statusId'],
|
||||
'statusName': json['statusName'] == null ? undefined : json['statusName'],
|
||||
'isEditableByOwner': json['isEditableByOwner'] == null ? undefined : json['isEditableByOwner'],
|
||||
'adminNote': json['adminNote'] == null ? undefined : json['adminNote'],
|
||||
'createdAt': json['createdAt'] == null ? undefined : (new Date(json['createdAt'])),
|
||||
};
|
||||
}
|
||||
|
||||
export function TimeEntryResponseToJSON(json: any): TimeEntryResponse {
|
||||
return TimeEntryResponseToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TimeEntryResponseToJSONTyped(value?: TimeEntryResponse | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'id': value['id'],
|
||||
'employeeId': value['employeeId'],
|
||||
'employeeName': value['employeeName'],
|
||||
'orderId': value['orderId'],
|
||||
'facilityId': value['facilityId'],
|
||||
'facilityName': value['facilityName'],
|
||||
'date': value['date'] == null ? undefined : ((value['date']).toISOString().substring(0,10)),
|
||||
'start': value['start'],
|
||||
'end': value['end'],
|
||||
'breakDuration': value['breakDuration'],
|
||||
'nightHours': value['nightHours'],
|
||||
'saturdayHours': value['saturdayHours'],
|
||||
'sundayHours': value['sundayHours'],
|
||||
'holidayHours': value['holidayHours'],
|
||||
'statusId': value['statusId'],
|
||||
'statusName': value['statusName'],
|
||||
'isEditableByOwner': value['isEditableByOwner'],
|
||||
'adminNote': value['adminNote'],
|
||||
'createdAt': value['createdAt'] == null ? undefined : ((value['createdAt']).toISOString()),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
import type { TimeEntryResponse } from './TimeEntryResponse';
|
||||
import {
|
||||
TimeEntryResponseFromJSON,
|
||||
TimeEntryResponseFromJSONTyped,
|
||||
TimeEntryResponseToJSON,
|
||||
TimeEntryResponseToJSONTyped,
|
||||
} from './TimeEntryResponse';
|
||||
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface TimeEntryResponsePagedResponse
|
||||
*/
|
||||
export interface TimeEntryResponsePagedResponse {
|
||||
/**
|
||||
*
|
||||
* @type {Array<TimeEntryResponse>}
|
||||
* @memberof TimeEntryResponsePagedResponse
|
||||
*/
|
||||
items?: Array<TimeEntryResponse> | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof TimeEntryResponsePagedResponse
|
||||
*/
|
||||
totalCount?: number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof TimeEntryResponsePagedResponse
|
||||
*/
|
||||
page?: number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof TimeEntryResponsePagedResponse
|
||||
*/
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the TimeEntryResponsePagedResponse interface.
|
||||
*/
|
||||
export function instanceOfTimeEntryResponsePagedResponse(value: object): value is TimeEntryResponsePagedResponse {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function TimeEntryResponsePagedResponseFromJSON(json: any): TimeEntryResponsePagedResponse {
|
||||
return TimeEntryResponsePagedResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TimeEntryResponsePagedResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): TimeEntryResponsePagedResponse {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'items': json['items'] == null ? undefined : ((json['items'] as Array<any>).map(TimeEntryResponseFromJSON)),
|
||||
'totalCount': json['totalCount'] == null ? undefined : json['totalCount'],
|
||||
'page': json['page'] == null ? undefined : json['page'],
|
||||
'pageSize': json['pageSize'] == null ? undefined : json['pageSize'],
|
||||
};
|
||||
}
|
||||
|
||||
export function TimeEntryResponsePagedResponseToJSON(json: any): TimeEntryResponsePagedResponse {
|
||||
return TimeEntryResponsePagedResponseToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TimeEntryResponsePagedResponseToJSONTyped(value?: TimeEntryResponsePagedResponse | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'items': value['items'] == null ? undefined : ((value['items'] as Array<any>).map(TimeEntryResponseToJSON)),
|
||||
'totalCount': value['totalCount'],
|
||||
'page': value['page'],
|
||||
'pageSize': value['pageSize'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface TrashAbsenceResponse
|
||||
*/
|
||||
export interface TrashAbsenceResponse {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TrashAbsenceResponse
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TrashAbsenceResponse
|
||||
*/
|
||||
type?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof TrashAbsenceResponse
|
||||
*/
|
||||
deletedAt?: Date | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the TrashAbsenceResponse interface.
|
||||
*/
|
||||
export function instanceOfTrashAbsenceResponse(value: object): value is TrashAbsenceResponse {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function TrashAbsenceResponseFromJSON(json: any): TrashAbsenceResponse {
|
||||
return TrashAbsenceResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TrashAbsenceResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): TrashAbsenceResponse {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'] == null ? undefined : json['id'],
|
||||
'type': json['type'] == null ? undefined : json['type'],
|
||||
'deletedAt': json['deletedAt'] == null ? undefined : (new Date(json['deletedAt'])),
|
||||
};
|
||||
}
|
||||
|
||||
export function TrashAbsenceResponseToJSON(json: any): TrashAbsenceResponse {
|
||||
return TrashAbsenceResponseToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TrashAbsenceResponseToJSONTyped(value?: TrashAbsenceResponse | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'id': value['id'],
|
||||
'type': value['type'],
|
||||
'deletedAt': value['deletedAt'] === null ? null : ((value['deletedAt'] as any)?.toISOString()),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface TrashContractResponse
|
||||
*/
|
||||
export interface TrashContractResponse {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TrashContractResponse
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TrashContractResponse
|
||||
*/
|
||||
contractType?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof TrashContractResponse
|
||||
*/
|
||||
deletedAt?: Date | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the TrashContractResponse interface.
|
||||
*/
|
||||
export function instanceOfTrashContractResponse(value: object): value is TrashContractResponse {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function TrashContractResponseFromJSON(json: any): TrashContractResponse {
|
||||
return TrashContractResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TrashContractResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): TrashContractResponse {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'] == null ? undefined : json['id'],
|
||||
'contractType': json['contractType'] == null ? undefined : json['contractType'],
|
||||
'deletedAt': json['deletedAt'] == null ? undefined : (new Date(json['deletedAt'])),
|
||||
};
|
||||
}
|
||||
|
||||
export function TrashContractResponseToJSON(json: any): TrashContractResponse {
|
||||
return TrashContractResponseToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TrashContractResponseToJSONTyped(value?: TrashContractResponse | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'id': value['id'],
|
||||
'contractType': value['contractType'],
|
||||
'deletedAt': value['deletedAt'] === null ? null : ((value['deletedAt'] as any)?.toISOString()),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface TrashEmployeeResponse
|
||||
*/
|
||||
export interface TrashEmployeeResponse {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TrashEmployeeResponse
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TrashEmployeeResponse
|
||||
*/
|
||||
firstName?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TrashEmployeeResponse
|
||||
*/
|
||||
lastName?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof TrashEmployeeResponse
|
||||
*/
|
||||
deletedAt?: Date | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the TrashEmployeeResponse interface.
|
||||
*/
|
||||
export function instanceOfTrashEmployeeResponse(value: object): value is TrashEmployeeResponse {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function TrashEmployeeResponseFromJSON(json: any): TrashEmployeeResponse {
|
||||
return TrashEmployeeResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TrashEmployeeResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): TrashEmployeeResponse {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'] == null ? undefined : json['id'],
|
||||
'firstName': json['firstName'] == null ? undefined : json['firstName'],
|
||||
'lastName': json['lastName'] == null ? undefined : json['lastName'],
|
||||
'deletedAt': json['deletedAt'] == null ? undefined : (new Date(json['deletedAt'])),
|
||||
};
|
||||
}
|
||||
|
||||
export function TrashEmployeeResponseToJSON(json: any): TrashEmployeeResponse {
|
||||
return TrashEmployeeResponseToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TrashEmployeeResponseToJSONTyped(value?: TrashEmployeeResponse | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'id': value['id'],
|
||||
'firstName': value['firstName'],
|
||||
'lastName': value['lastName'],
|
||||
'deletedAt': value['deletedAt'] === null ? null : ((value['deletedAt'] as any)?.toISOString()),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface TrashFacilityContactResponse
|
||||
*/
|
||||
export interface TrashFacilityContactResponse {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TrashFacilityContactResponse
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TrashFacilityContactResponse
|
||||
*/
|
||||
facilityId?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TrashFacilityContactResponse
|
||||
*/
|
||||
name?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof TrashFacilityContactResponse
|
||||
*/
|
||||
deletedAt?: Date | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the TrashFacilityContactResponse interface.
|
||||
*/
|
||||
export function instanceOfTrashFacilityContactResponse(value: object): value is TrashFacilityContactResponse {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function TrashFacilityContactResponseFromJSON(json: any): TrashFacilityContactResponse {
|
||||
return TrashFacilityContactResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TrashFacilityContactResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): TrashFacilityContactResponse {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'] == null ? undefined : json['id'],
|
||||
'facilityId': json['facilityId'] == null ? undefined : json['facilityId'],
|
||||
'name': json['name'] == null ? undefined : json['name'],
|
||||
'deletedAt': json['deletedAt'] == null ? undefined : (new Date(json['deletedAt'])),
|
||||
};
|
||||
}
|
||||
|
||||
export function TrashFacilityContactResponseToJSON(json: any): TrashFacilityContactResponse {
|
||||
return TrashFacilityContactResponseToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TrashFacilityContactResponseToJSONTyped(value?: TrashFacilityContactResponse | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'id': value['id'],
|
||||
'facilityId': value['facilityId'],
|
||||
'name': value['name'],
|
||||
'deletedAt': value['deletedAt'] === null ? null : ((value['deletedAt'] as any)?.toISOString()),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,89 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface TrashFacilityQualificationRateResponse
|
||||
*/
|
||||
export interface TrashFacilityQualificationRateResponse {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TrashFacilityQualificationRateResponse
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TrashFacilityQualificationRateResponse
|
||||
*/
|
||||
facilityId?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TrashFacilityQualificationRateResponse
|
||||
*/
|
||||
qualification?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof TrashFacilityQualificationRateResponse
|
||||
*/
|
||||
deletedAt?: Date | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the TrashFacilityQualificationRateResponse interface.
|
||||
*/
|
||||
export function instanceOfTrashFacilityQualificationRateResponse(value: object): value is TrashFacilityQualificationRateResponse {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function TrashFacilityQualificationRateResponseFromJSON(json: any): TrashFacilityQualificationRateResponse {
|
||||
return TrashFacilityQualificationRateResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TrashFacilityQualificationRateResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): TrashFacilityQualificationRateResponse {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'] == null ? undefined : json['id'],
|
||||
'facilityId': json['facilityId'] == null ? undefined : json['facilityId'],
|
||||
'qualification': json['qualification'] == null ? undefined : json['qualification'],
|
||||
'deletedAt': json['deletedAt'] == null ? undefined : (new Date(json['deletedAt'])),
|
||||
};
|
||||
}
|
||||
|
||||
export function TrashFacilityQualificationRateResponseToJSON(json: any): TrashFacilityQualificationRateResponse {
|
||||
return TrashFacilityQualificationRateResponseToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TrashFacilityQualificationRateResponseToJSONTyped(value?: TrashFacilityQualificationRateResponse | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'id': value['id'],
|
||||
'facilityId': value['facilityId'],
|
||||
'qualification': value['qualification'],
|
||||
'deletedAt': value['deletedAt'] === null ? null : ((value['deletedAt'] as any)?.toISOString()),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface TrashFacilityResponse
|
||||
*/
|
||||
export interface TrashFacilityResponse {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TrashFacilityResponse
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TrashFacilityResponse
|
||||
*/
|
||||
name?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof TrashFacilityResponse
|
||||
*/
|
||||
deletedAt?: Date | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the TrashFacilityResponse interface.
|
||||
*/
|
||||
export function instanceOfTrashFacilityResponse(value: object): value is TrashFacilityResponse {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function TrashFacilityResponseFromJSON(json: any): TrashFacilityResponse {
|
||||
return TrashFacilityResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TrashFacilityResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): TrashFacilityResponse {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'] == null ? undefined : json['id'],
|
||||
'name': json['name'] == null ? undefined : json['name'],
|
||||
'deletedAt': json['deletedAt'] == null ? undefined : (new Date(json['deletedAt'])),
|
||||
};
|
||||
}
|
||||
|
||||
export function TrashFacilityResponseToJSON(json: any): TrashFacilityResponse {
|
||||
return TrashFacilityResponseToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TrashFacilityResponseToJSONTyped(value?: TrashFacilityResponse | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'id': value['id'],
|
||||
'name': value['name'],
|
||||
'deletedAt': value['deletedAt'] === null ? null : ((value['deletedAt'] as any)?.toISOString()),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface TrashOrderResponse
|
||||
*/
|
||||
export interface TrashOrderResponse {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TrashOrderResponse
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TrashOrderResponse
|
||||
*/
|
||||
requiredQualification?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof TrashOrderResponse
|
||||
*/
|
||||
deletedAt?: Date | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the TrashOrderResponse interface.
|
||||
*/
|
||||
export function instanceOfTrashOrderResponse(value: object): value is TrashOrderResponse {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function TrashOrderResponseFromJSON(json: any): TrashOrderResponse {
|
||||
return TrashOrderResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TrashOrderResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): TrashOrderResponse {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'] == null ? undefined : json['id'],
|
||||
'requiredQualification': json['requiredQualification'] == null ? undefined : json['requiredQualification'],
|
||||
'deletedAt': json['deletedAt'] == null ? undefined : (new Date(json['deletedAt'])),
|
||||
};
|
||||
}
|
||||
|
||||
export function TrashOrderResponseToJSON(json: any): TrashOrderResponse {
|
||||
return TrashOrderResponseToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TrashOrderResponseToJSONTyped(value?: TrashOrderResponse | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'id': value['id'],
|
||||
'requiredQualification': value['requiredQualification'],
|
||||
'deletedAt': value['deletedAt'] === null ? null : ((value['deletedAt'] as any)?.toISOString()),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface TrashTimeEntryResponse
|
||||
*/
|
||||
export interface TrashTimeEntryResponse {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof TrashTimeEntryResponse
|
||||
*/
|
||||
id?: string;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof TrashTimeEntryResponse
|
||||
*/
|
||||
date?: Date;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof TrashTimeEntryResponse
|
||||
*/
|
||||
deletedAt?: Date | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the TrashTimeEntryResponse interface.
|
||||
*/
|
||||
export function instanceOfTrashTimeEntryResponse(value: object): value is TrashTimeEntryResponse {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function TrashTimeEntryResponseFromJSON(json: any): TrashTimeEntryResponse {
|
||||
return TrashTimeEntryResponseFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TrashTimeEntryResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): TrashTimeEntryResponse {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'id': json['id'] == null ? undefined : json['id'],
|
||||
'date': json['date'] == null ? undefined : (new Date(json['date'])),
|
||||
'deletedAt': json['deletedAt'] == null ? undefined : (new Date(json['deletedAt'])),
|
||||
};
|
||||
}
|
||||
|
||||
export function TrashTimeEntryResponseToJSON(json: any): TrashTimeEntryResponse {
|
||||
return TrashTimeEntryResponseToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function TrashTimeEntryResponseToJSONTyped(value?: TrashTimeEntryResponse | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'id': value['id'],
|
||||
'date': value['date'] == null ? undefined : ((value['date']).toISOString().substring(0,10)),
|
||||
'deletedAt': value['deletedAt'] === null ? null : ((value['deletedAt'] as any)?.toISOString()),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,105 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface UpdateAbsenceRequest
|
||||
*/
|
||||
export interface UpdateAbsenceRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UpdateAbsenceRequest
|
||||
*/
|
||||
type?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof UpdateAbsenceRequest
|
||||
*/
|
||||
startDate?: Date;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof UpdateAbsenceRequest
|
||||
*/
|
||||
endDate?: Date;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UpdateAbsenceRequest
|
||||
*/
|
||||
reason?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UpdateAbsenceRequest
|
||||
*/
|
||||
substitute?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UpdateAbsenceRequest
|
||||
*/
|
||||
note?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the UpdateAbsenceRequest interface.
|
||||
*/
|
||||
export function instanceOfUpdateAbsenceRequest(value: object): value is UpdateAbsenceRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function UpdateAbsenceRequestFromJSON(json: any): UpdateAbsenceRequest {
|
||||
return UpdateAbsenceRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function UpdateAbsenceRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateAbsenceRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'type': json['type'] == null ? undefined : json['type'],
|
||||
'startDate': json['startDate'] == null ? undefined : (new Date(json['startDate'])),
|
||||
'endDate': json['endDate'] == null ? undefined : (new Date(json['endDate'])),
|
||||
'reason': json['reason'] == null ? undefined : json['reason'],
|
||||
'substitute': json['substitute'] == null ? undefined : json['substitute'],
|
||||
'note': json['note'] == null ? undefined : json['note'],
|
||||
};
|
||||
}
|
||||
|
||||
export function UpdateAbsenceRequestToJSON(json: any): UpdateAbsenceRequest {
|
||||
return UpdateAbsenceRequestToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function UpdateAbsenceRequestToJSONTyped(value?: UpdateAbsenceRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'type': value['type'],
|
||||
'startDate': value['startDate'] == null ? undefined : ((value['startDate']).toISOString().substring(0,10)),
|
||||
'endDate': value['endDate'] == null ? undefined : ((value['endDate']).toISOString().substring(0,10)),
|
||||
'reason': value['reason'],
|
||||
'substitute': value['substitute'],
|
||||
'note': value['note'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface UpdateDocumentRequest
|
||||
*/
|
||||
export interface UpdateDocumentRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UpdateDocumentRequest
|
||||
*/
|
||||
category?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UpdateDocumentRequest
|
||||
*/
|
||||
description?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UpdateDocumentRequest
|
||||
*/
|
||||
fileName?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the UpdateDocumentRequest interface.
|
||||
*/
|
||||
export function instanceOfUpdateDocumentRequest(value: object): value is UpdateDocumentRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function UpdateDocumentRequestFromJSON(json: any): UpdateDocumentRequest {
|
||||
return UpdateDocumentRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function UpdateDocumentRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateDocumentRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'category': json['category'] == null ? undefined : json['category'],
|
||||
'description': json['description'] == null ? undefined : json['description'],
|
||||
'fileName': json['fileName'] == null ? undefined : json['fileName'],
|
||||
};
|
||||
}
|
||||
|
||||
export function UpdateDocumentRequestToJSON(json: any): UpdateDocumentRequest {
|
||||
return UpdateDocumentRequestToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function UpdateDocumentRequestToJSONTyped(value?: UpdateDocumentRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'category': value['category'],
|
||||
'description': value['description'],
|
||||
'fileName': value['fileName'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface UpdateFacilityQualificationRateRequest
|
||||
*/
|
||||
export interface UpdateFacilityQualificationRateRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UpdateFacilityQualificationRateRequest
|
||||
*/
|
||||
qualification?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UpdateFacilityQualificationRateRequest
|
||||
*/
|
||||
rate?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the UpdateFacilityQualificationRateRequest interface.
|
||||
*/
|
||||
export function instanceOfUpdateFacilityQualificationRateRequest(value: object): value is UpdateFacilityQualificationRateRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function UpdateFacilityQualificationRateRequestFromJSON(json: any): UpdateFacilityQualificationRateRequest {
|
||||
return UpdateFacilityQualificationRateRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function UpdateFacilityQualificationRateRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateFacilityQualificationRateRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'qualification': json['qualification'] == null ? undefined : json['qualification'],
|
||||
'rate': json['rate'] == null ? undefined : json['rate'],
|
||||
};
|
||||
}
|
||||
|
||||
export function UpdateFacilityQualificationRateRequestToJSON(json: any): UpdateFacilityQualificationRateRequest {
|
||||
return UpdateFacilityQualificationRateRequestToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function UpdateFacilityQualificationRateRequestToJSONTyped(value?: UpdateFacilityQualificationRateRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'qualification': value['qualification'],
|
||||
'rate': value['rate'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -91,6 +91,78 @@ export interface UpdateFacilityRequest {
|
||||
* @memberof UpdateFacilityRequest
|
||||
*/
|
||||
billingCountry?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UpdateFacilityRequest
|
||||
*/
|
||||
followUpDays?: number | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UpdateFacilityRequest
|
||||
*/
|
||||
billingRate?: number | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UpdateFacilityRequest
|
||||
*/
|
||||
nightSurchargePercent?: number | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UpdateFacilityRequest
|
||||
*/
|
||||
saturdaySurchargePercent?: number | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UpdateFacilityRequest
|
||||
*/
|
||||
sundaySurchargePercent?: number | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UpdateFacilityRequest
|
||||
*/
|
||||
holidaySurchargePercent?: number | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UpdateFacilityRequest
|
||||
*/
|
||||
travelCostRate?: number | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UpdateFacilityRequest
|
||||
*/
|
||||
minimumHours?: number | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UpdateFacilityRequest
|
||||
*/
|
||||
breakPolicy?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UpdateFacilityRequest
|
||||
*/
|
||||
billingInterval?: string | null;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UpdateFacilityRequest
|
||||
*/
|
||||
paymentTermDays?: number | null;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UpdateFacilityRequest
|
||||
*/
|
||||
individualAgreements?: string | null;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -122,6 +194,18 @@ export function UpdateFacilityRequestFromJSONTyped(json: any, ignoreDiscriminato
|
||||
'billingPostalCode': json['billingPostalCode'] == null ? undefined : json['billingPostalCode'],
|
||||
'billingCity': json['billingCity'] == null ? undefined : json['billingCity'],
|
||||
'billingCountry': json['billingCountry'] == null ? undefined : json['billingCountry'],
|
||||
'followUpDays': json['followUpDays'] == null ? undefined : json['followUpDays'],
|
||||
'billingRate': json['billingRate'] == null ? undefined : json['billingRate'],
|
||||
'nightSurchargePercent': json['nightSurchargePercent'] == null ? undefined : json['nightSurchargePercent'],
|
||||
'saturdaySurchargePercent': json['saturdaySurchargePercent'] == null ? undefined : json['saturdaySurchargePercent'],
|
||||
'sundaySurchargePercent': json['sundaySurchargePercent'] == null ? undefined : json['sundaySurchargePercent'],
|
||||
'holidaySurchargePercent': json['holidaySurchargePercent'] == null ? undefined : json['holidaySurchargePercent'],
|
||||
'travelCostRate': json['travelCostRate'] == null ? undefined : json['travelCostRate'],
|
||||
'minimumHours': json['minimumHours'] == null ? undefined : json['minimumHours'],
|
||||
'breakPolicy': json['breakPolicy'] == null ? undefined : json['breakPolicy'],
|
||||
'billingInterval': json['billingInterval'] == null ? undefined : json['billingInterval'],
|
||||
'paymentTermDays': json['paymentTermDays'] == null ? undefined : json['paymentTermDays'],
|
||||
'individualAgreements': json['individualAgreements'] == null ? undefined : json['individualAgreements'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -148,6 +232,18 @@ export function UpdateFacilityRequestToJSONTyped(value?: UpdateFacilityRequest |
|
||||
'billingPostalCode': value['billingPostalCode'],
|
||||
'billingCity': value['billingCity'],
|
||||
'billingCountry': value['billingCountry'],
|
||||
'followUpDays': value['followUpDays'],
|
||||
'billingRate': value['billingRate'],
|
||||
'nightSurchargePercent': value['nightSurchargePercent'],
|
||||
'saturdaySurchargePercent': value['saturdaySurchargePercent'],
|
||||
'sundaySurchargePercent': value['sundaySurchargePercent'],
|
||||
'holidaySurchargePercent': value['holidaySurchargePercent'],
|
||||
'travelCostRate': value['travelCostRate'],
|
||||
'minimumHours': value['minimumHours'],
|
||||
'breakPolicy': value['breakPolicy'],
|
||||
'billingInterval': value['billingInterval'],
|
||||
'paymentTermDays': value['paymentTermDays'],
|
||||
'individualAgreements': value['individualAgreements'],
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,129 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
/**
|
||||
* OmsorgCore.Api
|
||||
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
||||
*
|
||||
* The version of the OpenAPI document: 1.0
|
||||
*
|
||||
*
|
||||
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
||||
* https://openapi-generator.tech
|
||||
* Do not edit the class manually.
|
||||
*/
|
||||
|
||||
import { mapValues } from '../runtime';
|
||||
/**
|
||||
*
|
||||
* @export
|
||||
* @interface UpdateTimeEntryRequest
|
||||
*/
|
||||
export interface UpdateTimeEntryRequest {
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UpdateTimeEntryRequest
|
||||
*/
|
||||
orderId?: string;
|
||||
/**
|
||||
*
|
||||
* @type {Date}
|
||||
* @memberof UpdateTimeEntryRequest
|
||||
*/
|
||||
date?: Date;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UpdateTimeEntryRequest
|
||||
*/
|
||||
start?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UpdateTimeEntryRequest
|
||||
*/
|
||||
end?: string;
|
||||
/**
|
||||
*
|
||||
* @type {string}
|
||||
* @memberof UpdateTimeEntryRequest
|
||||
*/
|
||||
breakDuration?: string;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UpdateTimeEntryRequest
|
||||
*/
|
||||
nightHours?: number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UpdateTimeEntryRequest
|
||||
*/
|
||||
saturdayHours?: number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UpdateTimeEntryRequest
|
||||
*/
|
||||
sundayHours?: number;
|
||||
/**
|
||||
*
|
||||
* @type {number}
|
||||
* @memberof UpdateTimeEntryRequest
|
||||
*/
|
||||
holidayHours?: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if a given object implements the UpdateTimeEntryRequest interface.
|
||||
*/
|
||||
export function instanceOfUpdateTimeEntryRequest(value: object): value is UpdateTimeEntryRequest {
|
||||
return true;
|
||||
}
|
||||
|
||||
export function UpdateTimeEntryRequestFromJSON(json: any): UpdateTimeEntryRequest {
|
||||
return UpdateTimeEntryRequestFromJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function UpdateTimeEntryRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateTimeEntryRequest {
|
||||
if (json == null) {
|
||||
return json;
|
||||
}
|
||||
return {
|
||||
|
||||
'orderId': json['orderId'] == null ? undefined : json['orderId'],
|
||||
'date': json['date'] == null ? undefined : (new Date(json['date'])),
|
||||
'start': json['start'] == null ? undefined : json['start'],
|
||||
'end': json['end'] == null ? undefined : json['end'],
|
||||
'breakDuration': json['breakDuration'] == null ? undefined : json['breakDuration'],
|
||||
'nightHours': json['nightHours'] == null ? undefined : json['nightHours'],
|
||||
'saturdayHours': json['saturdayHours'] == null ? undefined : json['saturdayHours'],
|
||||
'sundayHours': json['sundayHours'] == null ? undefined : json['sundayHours'],
|
||||
'holidayHours': json['holidayHours'] == null ? undefined : json['holidayHours'],
|
||||
};
|
||||
}
|
||||
|
||||
export function UpdateTimeEntryRequestToJSON(json: any): UpdateTimeEntryRequest {
|
||||
return UpdateTimeEntryRequestToJSONTyped(json, false);
|
||||
}
|
||||
|
||||
export function UpdateTimeEntryRequestToJSONTyped(value?: UpdateTimeEntryRequest | null, ignoreDiscriminator: boolean = false): any {
|
||||
if (value == null) {
|
||||
return value;
|
||||
}
|
||||
|
||||
return {
|
||||
|
||||
'orderId': value['orderId'],
|
||||
'date': value['date'] == null ? undefined : ((value['date']).toISOString().substring(0,10)),
|
||||
'start': value['start'],
|
||||
'end': value['end'],
|
||||
'breakDuration': value['breakDuration'],
|
||||
'nightHours': value['nightHours'],
|
||||
'saturdayHours': value['saturdayHours'],
|
||||
'sundayHours': value['sundayHours'],
|
||||
'holidayHours': value['holidayHours'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -49,6 +49,12 @@ export interface UpdateValueListItemRequest {
|
||||
* @memberof UpdateValueListItemRequest
|
||||
*/
|
||||
isTerminal?: boolean;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof UpdateValueListItemRequest
|
||||
*/
|
||||
triggersFollowUp?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,6 +79,7 @@ export function UpdateValueListItemRequestFromJSONTyped(json: any, ignoreDiscrim
|
||||
'isDefault': json['isDefault'] == null ? undefined : json['isDefault'],
|
||||
'isInitial': json['isInitial'] == null ? undefined : json['isInitial'],
|
||||
'isTerminal': json['isTerminal'] == null ? undefined : json['isTerminal'],
|
||||
'triggersFollowUp': json['triggersFollowUp'] == null ? undefined : json['triggersFollowUp'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -92,6 +99,7 @@ export function UpdateValueListItemRequestToJSONTyped(value?: UpdateValueListIte
|
||||
'isDefault': value['isDefault'],
|
||||
'isInitial': value['isInitial'],
|
||||
'isTerminal': value['isTerminal'],
|
||||
'triggersFollowUp': value['triggersFollowUp'],
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,13 @@ import {
|
||||
PermissionEffectToJSON,
|
||||
PermissionEffectToJSONTyped,
|
||||
} from './PermissionEffect';
|
||||
import type { PermissionScope } from './PermissionScope';
|
||||
import {
|
||||
PermissionScopeFromJSON,
|
||||
PermissionScopeFromJSONTyped,
|
||||
PermissionScopeToJSON,
|
||||
PermissionScopeToJSONTyped,
|
||||
} from './PermissionScope';
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -65,6 +72,12 @@ export interface UserPermissionOverrideResponse {
|
||||
* @memberof UserPermissionOverrideResponse
|
||||
*/
|
||||
effect?: PermissionEffect;
|
||||
/**
|
||||
*
|
||||
* @type {PermissionScope}
|
||||
* @memberof UserPermissionOverrideResponse
|
||||
*/
|
||||
scope?: PermissionScope;
|
||||
}
|
||||
|
||||
|
||||
@@ -90,6 +103,7 @@ export function UserPermissionOverrideResponseFromJSONTyped(json: any, ignoreDis
|
||||
'module': json['module'] == null ? undefined : ModuleTypeFromJSON(json['module']),
|
||||
'action': json['action'] == null ? undefined : PermissionActionFromJSON(json['action']),
|
||||
'effect': json['effect'] == null ? undefined : PermissionEffectFromJSON(json['effect']),
|
||||
'scope': json['scope'] == null ? undefined : PermissionScopeFromJSON(json['scope']),
|
||||
};
|
||||
}
|
||||
|
||||
@@ -108,6 +122,7 @@ export function UserPermissionOverrideResponseToJSONTyped(value?: UserPermission
|
||||
'module': ModuleTypeToJSON(value['module']),
|
||||
'action': PermissionActionToJSON(value['action']),
|
||||
'effect': PermissionEffectToJSON(value['effect']),
|
||||
'scope': PermissionScopeToJSON(value['scope']),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -55,6 +55,12 @@ export interface ValueListItemResponse {
|
||||
* @memberof ValueListItemResponse
|
||||
*/
|
||||
isTerminal?: boolean;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof ValueListItemResponse
|
||||
*/
|
||||
triggersFollowUp?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,6 +86,7 @@ export function ValueListItemResponseFromJSONTyped(json: any, ignoreDiscriminato
|
||||
'isDefault': json['isDefault'] == null ? undefined : json['isDefault'],
|
||||
'isInitial': json['isInitial'] == null ? undefined : json['isInitial'],
|
||||
'isTerminal': json['isTerminal'] == null ? undefined : json['isTerminal'],
|
||||
'triggersFollowUp': json['triggersFollowUp'] == null ? undefined : json['triggersFollowUp'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -100,6 +107,7 @@ export function ValueListItemResponseToJSONTyped(value?: ValueListItemResponse |
|
||||
'isDefault': value['isDefault'],
|
||||
'isInitial': value['isInitial'],
|
||||
'isTerminal': value['isTerminal'],
|
||||
'triggersFollowUp': value['triggersFollowUp'],
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -37,6 +37,12 @@ export interface ValueListTransitionResponse {
|
||||
* @memberof ValueListTransitionResponse
|
||||
*/
|
||||
toItemId?: string;
|
||||
/**
|
||||
*
|
||||
* @type {boolean}
|
||||
* @memberof ValueListTransitionResponse
|
||||
*/
|
||||
requiresApproval?: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -59,6 +65,7 @@ export function ValueListTransitionResponseFromJSONTyped(json: any, ignoreDiscri
|
||||
'id': json['id'] == null ? undefined : json['id'],
|
||||
'fromItemId': json['fromItemId'] == null ? undefined : json['fromItemId'],
|
||||
'toItemId': json['toItemId'] == null ? undefined : json['toItemId'],
|
||||
'requiresApproval': json['requiresApproval'] == null ? undefined : json['requiresApproval'],
|
||||
};
|
||||
}
|
||||
|
||||
@@ -76,6 +83,7 @@ export function ValueListTransitionResponseToJSONTyped(value?: ValueListTransiti
|
||||
'id': value['id'],
|
||||
'fromItemId': value['fromItemId'],
|
||||
'toItemId': value['toItemId'],
|
||||
'requiresApproval': value['requiresApproval'],
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
/* tslint:disable */
|
||||
/* eslint-disable */
|
||||
export * from './AbsenceDecisionRequest';
|
||||
export * from './AbsenceResponse';
|
||||
export * from './AbsenceResponsePagedResponse';
|
||||
export * from './AddUserPermissionOverrideRequest';
|
||||
export * from './AuditEventCategory';
|
||||
export * from './AuditLogEntryResponse';
|
||||
@@ -7,17 +10,22 @@ export * from './AuditLogEntryResponsePagedResponse';
|
||||
export * from './ChangePasswordRequest';
|
||||
export * from './ContractResponse';
|
||||
export * from './ContractResponsePagedResponse';
|
||||
export * from './CreateAbsenceRequest';
|
||||
export * from './CreateContractRequest';
|
||||
export * from './CreateEmployeeRequest';
|
||||
export * from './CreateFacilityContactRequest';
|
||||
export * from './CreateFacilityQualificationRateRequest';
|
||||
export * from './CreateFacilityRequest';
|
||||
export * from './CreateOrderRequest';
|
||||
export * from './CreateRoleRequest';
|
||||
export * from './CreateTimeEntryRequest';
|
||||
export * from './CreateUserRequest';
|
||||
export * from './CreateValueListItemRequest';
|
||||
export * from './DocumentResponse';
|
||||
export * from './EmployeeResponse';
|
||||
export * from './EmployeeResponsePagedResponse';
|
||||
export * from './FacilityContactResponse';
|
||||
export * from './FacilityQualificationRateResponse';
|
||||
export * from './FacilityResponse';
|
||||
export * from './FacilityResponsePagedResponse';
|
||||
export * from './ForgotPasswordRequestRequest';
|
||||
@@ -27,7 +35,6 @@ export * from './ForgotPasswordVerifyRequest';
|
||||
export * from './ForgotPasswordVerifyResponse';
|
||||
export * from './LoginRequest';
|
||||
export * from './LoginResponse';
|
||||
export * from './LogoutRequest';
|
||||
export * from './MeResponse';
|
||||
export * from './ModuleType';
|
||||
export * from './OrderResponse';
|
||||
@@ -37,18 +44,33 @@ export * from './PasswordResetTemplateResponse';
|
||||
export * from './PermissionAction';
|
||||
export * from './PermissionDto';
|
||||
export * from './PermissionEffect';
|
||||
export * from './RefreshRequest';
|
||||
export * from './PermissionScope';
|
||||
export * from './ResetUserPasswordRequest';
|
||||
export * from './RolePermissionsResponse';
|
||||
export * from './RoleResponse';
|
||||
export * from './SendTestEmailRequest';
|
||||
export * from './SessionResponse';
|
||||
export * from './TimeEntryDecisionRequest';
|
||||
export * from './TimeEntryResponse';
|
||||
export * from './TimeEntryResponsePagedResponse';
|
||||
export * from './TrashAbsenceResponse';
|
||||
export * from './TrashContractResponse';
|
||||
export * from './TrashEmployeeResponse';
|
||||
export * from './TrashFacilityContactResponse';
|
||||
export * from './TrashFacilityQualificationRateResponse';
|
||||
export * from './TrashFacilityResponse';
|
||||
export * from './TrashOrderResponse';
|
||||
export * from './TrashTimeEntryResponse';
|
||||
export * from './UpdateAbsenceRequest';
|
||||
export * from './UpdateContractRequest';
|
||||
export * from './UpdateDocumentRequest';
|
||||
export * from './UpdateEmployeeRequest';
|
||||
export * from './UpdateFacilityContactRequest';
|
||||
export * from './UpdateFacilityQualificationRateRequest';
|
||||
export * from './UpdateFacilityRequest';
|
||||
export * from './UpdateOrderRequest';
|
||||
export * from './UpdateRolePermissionsRequest';
|
||||
export * from './UpdateTimeEntryRequest';
|
||||
export * from './UpdateUserRequest';
|
||||
export * from './UpdateValueListItemRequest';
|
||||
export * from './UserPermissionOverrideResponse';
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
// Einzige Stelle im Projekt, die die Adresse von omsorgCore kennt.
|
||||
// Default passt zum lokalen `dotnet run --project src/OmsorgCore.Api` (http-Profil, Port 5245),
|
||||
// überschreibbar per Umgebungsvariable für andere Umgebungen (Produktion, anderer Rechner, ...).
|
||||
module.exports = {
|
||||
API_BASE: process.env.OMSORG_CORE_URL || 'http://localhost:5245'
|
||||
};
|
||||
@@ -1,27 +0,0 @@
|
||||
const { FacilitiesApi } = require('omsorgcore-client-ts');
|
||||
const { configFor, callApi } = require('./apiClientHelpers.cjs');
|
||||
|
||||
// Kapselt /api/facilities von omsorgCore (FacilitiesController) über den generierten
|
||||
// Client (omsorgcore-client-ts). Feldnamen sind camelCase, da ASP.NET Core
|
||||
// standardmäßig camelCase-JSON ausgibt.
|
||||
async function listFacilities(accessToken, { search, crmStatus, page = 1, pageSize = 20 } = {}) {
|
||||
const api = new FacilitiesApi(configFor(accessToken));
|
||||
return callApi(api.apiFacilitiesGetRaw({ search, crmStatus, page, pageSize }));
|
||||
}
|
||||
|
||||
async function createFacility(accessToken, payload) {
|
||||
const api = new FacilitiesApi(configFor(accessToken));
|
||||
return callApi(api.apiFacilitiesPostRaw({ createFacilityRequest: payload }));
|
||||
}
|
||||
|
||||
async function getFacility(accessToken, id) {
|
||||
const api = new FacilitiesApi(configFor(accessToken));
|
||||
return callApi(api.apiFacilitiesIdGetRaw({ id }));
|
||||
}
|
||||
|
||||
async function updateFacility(accessToken, id, payload) {
|
||||
const api = new FacilitiesApi(configFor(accessToken));
|
||||
return callApi(api.apiFacilitiesIdPutRaw({ id, updateFacilityRequest: payload }));
|
||||
}
|
||||
|
||||
module.exports = { listFacilities, createFacility, getFacility, updateFacility };
|
||||
@@ -1,37 +0,0 @@
|
||||
const { UsersApi } = require('omsorgcore-client-ts');
|
||||
const { configFor, callApi } = require('./apiClientHelpers.cjs');
|
||||
|
||||
// Kapselt /api/users von omsorgCore (UsersController) über den generierten Client
|
||||
// (omsorgcore-client-ts).
|
||||
async function listUsers(accessToken) {
|
||||
const api = new UsersApi(configFor(accessToken));
|
||||
return callApi(api.apiUsersGetRaw());
|
||||
}
|
||||
|
||||
async function createUser(accessToken, payload) {
|
||||
const api = new UsersApi(configFor(accessToken));
|
||||
return callApi(api.apiUsersPostRaw({ createUserRequest: payload }));
|
||||
}
|
||||
|
||||
async function listPermissionOverrides(accessToken, userId) {
|
||||
const api = new UsersApi(configFor(accessToken));
|
||||
return callApi(api.apiUsersIdPermissionOverridesGetRaw({ id: userId }));
|
||||
}
|
||||
|
||||
async function addPermissionOverride(accessToken, userId, payload) {
|
||||
const api = new UsersApi(configFor(accessToken));
|
||||
return callApi(api.apiUsersIdPermissionOverridesPostRaw({ id: userId, addUserPermissionOverrideRequest: payload }));
|
||||
}
|
||||
|
||||
async function deletePermissionOverride(accessToken, userId, overrideId) {
|
||||
const api = new UsersApi(configFor(accessToken));
|
||||
return callApi(api.apiUsersIdPermissionOverridesOverrideIdDeleteRaw({ id: userId, overrideId }));
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
listUsers,
|
||||
createUser,
|
||||
listPermissionOverrides,
|
||||
addPermissionOverride,
|
||||
deletePermissionOverride
|
||||
};
|
||||
@@ -1,340 +0,0 @@
|
||||
const { app, BrowserWindow, ipcMain, safeStorage } = require('electron');
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
const authClient = require('./backend/authClient.cjs');
|
||||
const httpClient = require('./backend/httpClient.cjs');
|
||||
const employeesClient = require('./backend/employeesClient.cjs');
|
||||
const facilitiesClient = require('./backend/facilitiesClient.cjs');
|
||||
const facilityContactsClient = require('./backend/facilityContactsClient.cjs');
|
||||
const usersClient = require('./backend/usersClient.cjs');
|
||||
const rolesClient = require('./backend/rolesClient.cjs');
|
||||
const auditLogClient = require('./backend/auditLogClient.cjs');
|
||||
const valueListsClient = require('./backend/valueListsClient.cjs');
|
||||
|
||||
app.commandLine.appendSwitch('lang', 'de');
|
||||
|
||||
let mainWindow;
|
||||
const isDev = !app.isPackaged;
|
||||
|
||||
let session = { accessToken: null, expiresAt: null, user: null, mustChangePassword: false };
|
||||
let refreshTimer = null;
|
||||
const REFRESH_BUFFER_MS = 2 * 60 * 1000;
|
||||
|
||||
function sessionFilePath() { return path.join(app.getPath('userData'), 'session.enc'); }
|
||||
|
||||
function saveRefreshToken(rawToken) {
|
||||
if (!safeStorage.isEncryptionAvailable()) return;
|
||||
fs.writeFileSync(sessionFilePath(), safeStorage.encryptString(rawToken));
|
||||
}
|
||||
function loadRefreshToken() {
|
||||
const file = sessionFilePath();
|
||||
if (!fs.existsSync(file) || !safeStorage.isEncryptionAvailable()) return null;
|
||||
try {
|
||||
return safeStorage.decryptString(fs.readFileSync(file));
|
||||
} catch {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
function clearRefreshToken() {
|
||||
const file = sessionFilePath();
|
||||
if (fs.existsSync(file)) fs.unlinkSync(file);
|
||||
}
|
||||
|
||||
// Nur für die Anzeige "angemeldet als ..." im Renderer - die Signaturprüfung passiert
|
||||
// serverseitig bei jedem authentifizierten Aufruf, hier wird nichts sicherheitsrelevantes entschieden.
|
||||
function decodeJwtClaims(token) {
|
||||
try {
|
||||
const payload = token.split('.')[1];
|
||||
return JSON.parse(Buffer.from(payload, 'base64url').toString('utf-8'));
|
||||
} catch {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
function userFromAccessToken(accessToken) {
|
||||
const claims = decodeJwtClaims(accessToken);
|
||||
return {
|
||||
username: claims['name'] || claims['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name'] || null,
|
||||
role: claims['role'] || claims['http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role'] || null
|
||||
};
|
||||
}
|
||||
|
||||
function broadcastSession() {
|
||||
if (mainWindow && !mainWindow.isDestroyed()) {
|
||||
mainWindow.webContents.send('auth:sessionChanged', {
|
||||
isAuthenticated: !!session.accessToken,
|
||||
user: session.user,
|
||||
mustChangePassword: session.mustChangePassword
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function scheduleRefresh() {
|
||||
if (refreshTimer) clearTimeout(refreshTimer);
|
||||
if (!session.expiresAt) return;
|
||||
const delay = Math.max(new Date(session.expiresAt).getTime() - Date.now() - REFRESH_BUFFER_MS, 5000);
|
||||
refreshTimer = setTimeout(refreshSilently, delay);
|
||||
}
|
||||
|
||||
function applySession(tokenPair) {
|
||||
session = {
|
||||
accessToken: tokenPair.accessToken,
|
||||
expiresAt: tokenPair.expiresAt,
|
||||
user: userFromAccessToken(tokenPair.accessToken),
|
||||
mustChangePassword: !!tokenPair.mustChangePassword
|
||||
};
|
||||
saveRefreshToken(tokenPair.refreshToken);
|
||||
scheduleRefresh();
|
||||
broadcastSession();
|
||||
refreshPermissions();
|
||||
}
|
||||
|
||||
// Rechte kommen nicht aus dem JWT (das trägt nur den Rollennamen), sondern aus /api/auth/me -
|
||||
// läuft nach dem schnellen JWT-basierten Zwischenstand nach und broadcastet erneut, sobald da.
|
||||
async function refreshPermissions() {
|
||||
const accessToken = session.accessToken;
|
||||
if (!accessToken) return;
|
||||
const profile = await authClient.me(accessToken);
|
||||
if (!profile.ok || session.accessToken !== accessToken) return;
|
||||
session.user = { username: profile.username, role: profile.role, permissions: profile.permissions };
|
||||
broadcastSession();
|
||||
}
|
||||
|
||||
function clearSession() {
|
||||
session = { accessToken: null, expiresAt: null, user: null, mustChangePassword: false };
|
||||
clearRefreshToken();
|
||||
if (refreshTimer) clearTimeout(refreshTimer);
|
||||
refreshTimer = null;
|
||||
broadcastSession();
|
||||
}
|
||||
|
||||
// Proaktiver Timer kurz vor Ablauf UND Fallback bei 401 (z.B. nach Standby) - siehe Plan.
|
||||
async function refreshSilently() {
|
||||
const rawRefreshToken = loadRefreshToken();
|
||||
if (!rawRefreshToken) {
|
||||
clearSession();
|
||||
return false;
|
||||
}
|
||||
const result = await authClient.refresh(rawRefreshToken);
|
||||
if (!result.ok) {
|
||||
clearSession();
|
||||
return false;
|
||||
}
|
||||
applySession(result);
|
||||
return true;
|
||||
}
|
||||
|
||||
async function bootstrapSession() {
|
||||
const rawRefreshToken = loadRefreshToken();
|
||||
if (!rawRefreshToken) return;
|
||||
const result = await authClient.refresh(rawRefreshToken);
|
||||
if (result.ok) {
|
||||
applySession(result);
|
||||
} else {
|
||||
clearRefreshToken();
|
||||
}
|
||||
}
|
||||
|
||||
// Ruft callFn(accessToken) auf und wiederholt einmal nach Silent-Refresh bei 401 -
|
||||
// gemeinsame Grundlage für den generischen api:*-Proxy und die <kategorie>Client.cjs-Aufrufe.
|
||||
async function withAuthRetry(callFn) {
|
||||
if (!session.accessToken) return { ok: false, status: 401, data: null };
|
||||
let result = await callFn(session.accessToken);
|
||||
if (result.status === 401 && (await refreshSilently())) {
|
||||
result = await callFn(session.accessToken);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
function authorizedRequest(method, resourcePath, body) {
|
||||
return withAuthRetry((accessToken) => httpClient.request(method, resourcePath, { body, accessToken }));
|
||||
}
|
||||
|
||||
function createWindow() {
|
||||
mainWindow = new BrowserWindow({
|
||||
width: 1440,
|
||||
height: 920,
|
||||
minWidth: 1100,
|
||||
minHeight: 760,
|
||||
title: 'Omsorg Business Controls Pro',
|
||||
backgroundColor: '#08111f',
|
||||
webPreferences: {
|
||||
preload: path.join(__dirname, 'preload.cjs'),
|
||||
contextIsolation: true,
|
||||
nodeIntegration: false
|
||||
}
|
||||
});
|
||||
if (isDev) mainWindow.loadURL('http://127.0.0.1:5173');
|
||||
else mainWindow.loadFile(path.join(__dirname, '../dist/index.html'));
|
||||
}
|
||||
app.whenReady().then(async () => {
|
||||
createWindow();
|
||||
await bootstrapSession();
|
||||
broadcastSession();
|
||||
});
|
||||
app.on('window-all-closed', () => { if (process.platform !== 'darwin') app.quit(); });
|
||||
app.on('activate', () => { if (BrowserWindow.getAllWindows().length === 0) createWindow(); });
|
||||
|
||||
ipcMain.handle('auth:login', async (_event, { username, password }) => {
|
||||
const result = await authClient.login(username, password);
|
||||
if (!result.ok) {
|
||||
const error = result.status === 0
|
||||
? 'network_error'
|
||||
: result.status === 429
|
||||
? 'too_many_attempts'
|
||||
: 'invalid_credentials';
|
||||
return { success: false, error };
|
||||
}
|
||||
applySession(result);
|
||||
return { success: true, user: session.user, mustChangePassword: session.mustChangePassword };
|
||||
});
|
||||
|
||||
ipcMain.handle('auth:logout', async () => {
|
||||
const rawRefreshToken = loadRefreshToken();
|
||||
if (rawRefreshToken) {
|
||||
try { await authClient.logout(rawRefreshToken); } catch { /* best effort */ }
|
||||
}
|
||||
clearSession();
|
||||
return { success: true };
|
||||
});
|
||||
|
||||
ipcMain.handle('auth:getSession', () => ({
|
||||
isAuthenticated: !!session.accessToken,
|
||||
user: session.user,
|
||||
mustChangePassword: session.mustChangePassword
|
||||
}));
|
||||
|
||||
ipcMain.handle('auth:requestPasswordReset', async (_event, { username }) => {
|
||||
const result = await authClient.requestPasswordReset(username);
|
||||
if (!result.ok) return { success: false, error: 'network_error' };
|
||||
return { success: true, status: result.status };
|
||||
});
|
||||
|
||||
ipcMain.handle('auth:verifyPasswordResetCode', async (_event, { username, pin }) => {
|
||||
const result = await authClient.verifyPasswordResetCode(username, pin);
|
||||
if (!result.ok) return { success: false, error: result.error || 'invalid_or_expired' };
|
||||
return { success: true, resetToken: result.resetToken };
|
||||
});
|
||||
|
||||
ipcMain.handle('auth:resetPassword', async (_event, { resetToken, newPassword }) => {
|
||||
const result = await authClient.resetPassword(resetToken, newPassword);
|
||||
if (!result.ok) {
|
||||
const error = result.status === 400
|
||||
? 'password_too_short'
|
||||
: 'invalid_or_expired';
|
||||
return {
|
||||
success: false,
|
||||
error,
|
||||
message: result.status === 400 && typeof result.data === 'string' ? result.data : undefined
|
||||
};
|
||||
}
|
||||
return { success: true };
|
||||
});
|
||||
|
||||
// Erfolgreicher Wechsel widerruft serverseitig alle Sessions (siehe UserService.ChangeOwnPasswordAsync) -
|
||||
// der aktuelle Access-Token ist danach tot, also Session lokal beenden statt weiterzumachen.
|
||||
ipcMain.handle('auth:changePassword', async (_event, { currentPassword, newPassword }) => {
|
||||
if (!session.accessToken) return { success: false, error: 'not_authenticated' };
|
||||
const result = await authClient.changePassword(session.accessToken, currentPassword, newPassword);
|
||||
if (!result.ok) {
|
||||
const error = result.status === 401
|
||||
? 'invalid_current_password'
|
||||
: result.status === 400
|
||||
? 'password_too_short'
|
||||
: 'unknown';
|
||||
return {
|
||||
success: false,
|
||||
error,
|
||||
message: result.status === 400 && typeof result.data === 'string' ? result.data : undefined
|
||||
};
|
||||
}
|
||||
clearSession();
|
||||
return { success: true };
|
||||
});
|
||||
|
||||
ipcMain.handle('auth:getPasswordPolicy', async () => {
|
||||
const result = await authClient.getPasswordPolicy();
|
||||
if (!result.ok) return { success: false };
|
||||
return { success: true, minLength: result.minLength };
|
||||
});
|
||||
|
||||
// Generischer Proxy für Ressourcen ohne eigene <kategorie>Client.cjs-Datei (siehe Plan).
|
||||
ipcMain.handle('api:get', (_event, resourcePath) => authorizedRequest('GET', resourcePath));
|
||||
ipcMain.handle('api:post', (_event, resourcePath, body) => authorizedRequest('POST', resourcePath, body));
|
||||
|
||||
ipcMain.handle('employees:list', (_event, params) => withAuthRetry((accessToken) => employeesClient.listEmployees(accessToken, params)));
|
||||
ipcMain.handle('employees:create', (_event, payload) =>
|
||||
withAuthRetry((accessToken) => employeesClient.createEmployee(accessToken, payload))
|
||||
);
|
||||
ipcMain.handle('employees:update', (_event, id, payload) =>
|
||||
withAuthRetry((accessToken) => employeesClient.updateEmployee(accessToken, id, payload))
|
||||
);
|
||||
|
||||
ipcMain.handle('facilities:list', (_event, params) => withAuthRetry((accessToken) => facilitiesClient.listFacilities(accessToken, params)));
|
||||
ipcMain.handle('facilities:create', (_event, payload) =>
|
||||
withAuthRetry((accessToken) => facilitiesClient.createFacility(accessToken, payload))
|
||||
);
|
||||
ipcMain.handle('facilities:update', (_event, id, payload) =>
|
||||
withAuthRetry((accessToken) => facilitiesClient.updateFacility(accessToken, id, payload))
|
||||
);
|
||||
|
||||
ipcMain.handle('facilityContacts:list', (_event, facilityId) =>
|
||||
withAuthRetry((accessToken) => facilityContactsClient.listFacilityContacts(accessToken, facilityId))
|
||||
);
|
||||
ipcMain.handle('facilityContacts:create', (_event, facilityId, payload) =>
|
||||
withAuthRetry((accessToken) => facilityContactsClient.createFacilityContact(accessToken, facilityId, payload))
|
||||
);
|
||||
ipcMain.handle('facilityContacts:update', (_event, facilityId, id, payload) =>
|
||||
withAuthRetry((accessToken) => facilityContactsClient.updateFacilityContact(accessToken, facilityId, id, payload))
|
||||
);
|
||||
|
||||
ipcMain.handle('users:list', () => withAuthRetry((accessToken) => usersClient.listUsers(accessToken)));
|
||||
ipcMain.handle('users:create', (_event, payload) =>
|
||||
withAuthRetry((accessToken) => usersClient.createUser(accessToken, payload))
|
||||
);
|
||||
ipcMain.handle('users:listPermissionOverrides', (_event, userId) =>
|
||||
withAuthRetry((accessToken) => usersClient.listPermissionOverrides(accessToken, userId))
|
||||
);
|
||||
ipcMain.handle('users:addPermissionOverride', (_event, userId, payload) =>
|
||||
withAuthRetry((accessToken) => usersClient.addPermissionOverride(accessToken, userId, payload))
|
||||
);
|
||||
ipcMain.handle('users:deletePermissionOverride', (_event, userId, overrideId) =>
|
||||
withAuthRetry((accessToken) => usersClient.deletePermissionOverride(accessToken, userId, overrideId))
|
||||
);
|
||||
|
||||
ipcMain.handle('roles:list', () => withAuthRetry((accessToken) => rolesClient.listRoles(accessToken)));
|
||||
ipcMain.handle('roles:get', (_event, roleId) =>
|
||||
withAuthRetry((accessToken) => rolesClient.getRole(accessToken, roleId))
|
||||
);
|
||||
ipcMain.handle('roles:create', (_event, payload) =>
|
||||
withAuthRetry((accessToken) => rolesClient.createRole(accessToken, payload))
|
||||
);
|
||||
ipcMain.handle('roles:updatePermissions', (_event, roleId, payload) =>
|
||||
withAuthRetry((accessToken) => rolesClient.updateRolePermissions(accessToken, roleId, payload))
|
||||
);
|
||||
|
||||
ipcMain.handle('auditLog:list', (_event, params) =>
|
||||
withAuthRetry((accessToken) => auditLogClient.listAuditLog(accessToken, params))
|
||||
);
|
||||
|
||||
ipcMain.handle('valueLists:list', () => withAuthRetry((accessToken) => valueListsClient.listValueLists(accessToken)));
|
||||
ipcMain.handle('valueLists:listItems', (_event, key) =>
|
||||
withAuthRetry((accessToken) => valueListsClient.listItems(accessToken, key))
|
||||
);
|
||||
ipcMain.handle('valueLists:createItem', (_event, key, payload) =>
|
||||
withAuthRetry((accessToken) => valueListsClient.createItem(accessToken, key, payload))
|
||||
);
|
||||
ipcMain.handle('valueLists:updateItem', (_event, key, id, payload) =>
|
||||
withAuthRetry((accessToken) => valueListsClient.updateItem(accessToken, key, id, payload))
|
||||
);
|
||||
ipcMain.handle('valueLists:deleteItem', (_event, key, id) =>
|
||||
withAuthRetry((accessToken) => valueListsClient.deleteItem(accessToken, key, id))
|
||||
);
|
||||
ipcMain.handle('valueLists:getUsages', (_event, key, id) =>
|
||||
withAuthRetry((accessToken) => valueListsClient.getUsages(accessToken, key, id))
|
||||
);
|
||||
ipcMain.handle('valueLists:listTransitions', (_event, key) =>
|
||||
withAuthRetry((accessToken) => valueListsClient.listTransitions(accessToken, key))
|
||||
);
|
||||
ipcMain.handle('valueLists:replaceTransitions', (_event, key, payload) =>
|
||||
withAuthRetry((accessToken) => valueListsClient.replaceTransitions(accessToken, key, payload))
|
||||
);
|
||||
@@ -1,65 +0,0 @@
|
||||
const { contextBridge, ipcRenderer } = require('electron');
|
||||
contextBridge.exposeInMainWorld('omsorg', {
|
||||
auth: {
|
||||
login: (username, password) => ipcRenderer.invoke('auth:login', { username, password }),
|
||||
logout: () => ipcRenderer.invoke('auth:logout'),
|
||||
getSession: () => ipcRenderer.invoke('auth:getSession'),
|
||||
onSessionChanged: (callback) => {
|
||||
const listener = (_event, session) => callback(session);
|
||||
ipcRenderer.on('auth:sessionChanged', listener);
|
||||
return () => ipcRenderer.removeListener('auth:sessionChanged', listener);
|
||||
},
|
||||
requestPasswordReset: (username) => ipcRenderer.invoke('auth:requestPasswordReset', { username }),
|
||||
verifyPasswordResetCode: (username, pin) => ipcRenderer.invoke('auth:verifyPasswordResetCode', { username, pin }),
|
||||
resetPassword: (resetToken, newPassword) => ipcRenderer.invoke('auth:resetPassword', { resetToken, newPassword }),
|
||||
changePassword: (currentPassword, newPassword) =>
|
||||
ipcRenderer.invoke('auth:changePassword', { currentPassword, newPassword }),
|
||||
getPasswordPolicy: () => ipcRenderer.invoke('auth:getPasswordPolicy')
|
||||
},
|
||||
api: {
|
||||
get: (path) => ipcRenderer.invoke('api:get', path),
|
||||
post: (path, body) => ipcRenderer.invoke('api:post', path, body)
|
||||
},
|
||||
employees: {
|
||||
list: (params) => ipcRenderer.invoke('employees:list', params),
|
||||
create: (payload) => ipcRenderer.invoke('employees:create', payload),
|
||||
update: (id, payload) => ipcRenderer.invoke('employees:update', id, payload)
|
||||
},
|
||||
facilities: {
|
||||
list: (params) => ipcRenderer.invoke('facilities:list', params),
|
||||
create: (payload) => ipcRenderer.invoke('facilities:create', payload),
|
||||
update: (id, payload) => ipcRenderer.invoke('facilities:update', id, payload)
|
||||
},
|
||||
facilityContacts: {
|
||||
list: (facilityId) => ipcRenderer.invoke('facilityContacts:list', facilityId),
|
||||
create: (facilityId, payload) => ipcRenderer.invoke('facilityContacts:create', facilityId, payload),
|
||||
update: (facilityId, id, payload) => ipcRenderer.invoke('facilityContacts:update', facilityId, id, payload)
|
||||
},
|
||||
users: {
|
||||
list: () => ipcRenderer.invoke('users:list'),
|
||||
create: (payload) => ipcRenderer.invoke('users:create', payload),
|
||||
listPermissionOverrides: (userId) => ipcRenderer.invoke('users:listPermissionOverrides', userId),
|
||||
addPermissionOverride: (userId, payload) => ipcRenderer.invoke('users:addPermissionOverride', userId, payload),
|
||||
deletePermissionOverride: (userId, overrideId) =>
|
||||
ipcRenderer.invoke('users:deletePermissionOverride', userId, overrideId)
|
||||
},
|
||||
roles: {
|
||||
list: () => ipcRenderer.invoke('roles:list'),
|
||||
get: (roleId) => ipcRenderer.invoke('roles:get', roleId),
|
||||
create: (payload) => ipcRenderer.invoke('roles:create', payload),
|
||||
updatePermissions: (roleId, payload) => ipcRenderer.invoke('roles:updatePermissions', roleId, payload)
|
||||
},
|
||||
auditLog: {
|
||||
list: (params) => ipcRenderer.invoke('auditLog:list', params)
|
||||
},
|
||||
valueLists: {
|
||||
list: () => ipcRenderer.invoke('valueLists:list'),
|
||||
listItems: (key) => ipcRenderer.invoke('valueLists:listItems', key),
|
||||
createItem: (key, payload) => ipcRenderer.invoke('valueLists:createItem', key, payload),
|
||||
updateItem: (key, id, payload) => ipcRenderer.invoke('valueLists:updateItem', key, id, payload),
|
||||
deleteItem: (key, id) => ipcRenderer.invoke('valueLists:deleteItem', key, id),
|
||||
getUsages: (key, id) => ipcRenderer.invoke('valueLists:getUsages', key, id),
|
||||
listTransitions: (key) => ipcRenderer.invoke('valueLists:listTransitions', key),
|
||||
replaceTransitions: (key, payload) => ipcRenderer.invoke('valueLists:replaceTransitions', key, payload)
|
||||
}
|
||||
});
|
||||
@@ -0,0 +1,12 @@
|
||||
server {
|
||||
listen 80;
|
||||
server_name _;
|
||||
root /usr/share/nginx/html;
|
||||
index index.html;
|
||||
|
||||
# SPA-Fallback: kein serverseitiges Routing (app.jsx hält activePage als lokalen State,
|
||||
# siehe omsorgapp/CLAUDE.md) - jede Route liefert index.html, React übernimmt den Rest.
|
||||
location / {
|
||||
try_files $uri $uri/ /index.html;
|
||||
}
|
||||
}
|
||||
Generated
+144
-1440
File diff suppressed because it is too large
Load Diff
+3
-10
@@ -2,25 +2,18 @@
|
||||
"name": "omsorg-business-controls-pro",
|
||||
"version": "0.1.1",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"description": "Omsorg Business Controls Pro - Release 0.1.1 Foundation",
|
||||
"main": "electron/main.cjs",
|
||||
"scripts": {
|
||||
"dev": "concurrently -k \"vite --host 127.0.0.1\" \"wait-on http://127.0.0.1:5173 && electron .\"",
|
||||
"web": "vite --host 127.0.0.1",
|
||||
"start": "electron ."
|
||||
"dev": "vite --host 127.0.0.1",
|
||||
"build": "vite build"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vitejs/plugin-react": "latest",
|
||||
"vite": "latest",
|
||||
"typescript": "latest",
|
||||
"react": "latest",
|
||||
"react-dom": "latest",
|
||||
"electron": "latest",
|
||||
"lucide-react": "latest",
|
||||
"omsorgcore-client-ts": "file:./api-client-ts"
|
||||
},
|
||||
"devDependencies": {
|
||||
"concurrently": "latest",
|
||||
"wait-on": "latest"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
import { AbsencesApi } from "omsorgcore-client-ts";
|
||||
import { configFor, callApi } from "./apiClientHelpers.js";
|
||||
|
||||
// Kapselt /api/absences von omsorgCore (AbsencesController) über den generierten Client
|
||||
// (omsorgcore-client-ts). Anlegen (mit Date-Feldern) passiert nur über omsorgWeb/mitarbeiter-app,
|
||||
// omsorgapp braucht hier Lesen + Bearbeiten (solange "Eingereicht") + Entscheiden (Genehmigen/Ablehnen).
|
||||
|
||||
// startDate/endDate müssen als Date-Objekte übergeben werden - siehe ordersApi.js für dasselbe Muster.
|
||||
function toDatePayload(payload) {
|
||||
return {
|
||||
...payload,
|
||||
startDate: payload.startDate ? new Date(payload.startDate) : payload.startDate,
|
||||
endDate: payload.endDate ? new Date(payload.endDate) : payload.endDate
|
||||
};
|
||||
}
|
||||
|
||||
export async function listAbsences(accessToken, { status, type, employeeId, page = 1, pageSize = 20 } = {}) {
|
||||
const api = new AbsencesApi(configFor(accessToken));
|
||||
return callApi(api.apiAbsencesGetRaw({ status, type, employeeId, page, pageSize }));
|
||||
}
|
||||
|
||||
export async function getAbsence(accessToken, id) {
|
||||
const api = new AbsencesApi(configFor(accessToken));
|
||||
return callApi(api.apiAbsencesIdGetRaw({ id }));
|
||||
}
|
||||
|
||||
export async function updateAbsence(accessToken, id, payload) {
|
||||
const api = new AbsencesApi(configFor(accessToken));
|
||||
return callApi(api.apiAbsencesIdPutRaw({ id, updateAbsenceRequest: toDatePayload(payload) }));
|
||||
}
|
||||
|
||||
export async function decideAbsence(accessToken, id, payload) {
|
||||
const api = new AbsencesApi(configFor(accessToken));
|
||||
return callApi(api.apiAbsencesIdDecisionPostRaw({ id, absenceDecisionRequest: payload }));
|
||||
}
|
||||
|
||||
export async function deleteAbsence(accessToken, id) {
|
||||
const api = new AbsencesApi(configFor(accessToken));
|
||||
return callApi(api.apiAbsencesIdDeleteRaw({ id }));
|
||||
}
|
||||
+8
-9
@@ -1,23 +1,24 @@
|
||||
const { Configuration } = require('omsorgcore-client-ts');
|
||||
const { API_BASE } = require('./config.cjs');
|
||||
import { Configuration } from "omsorgcore-client-ts";
|
||||
import { API_BASE } from "./config.js";
|
||||
|
||||
// Baut die Configuration für eine generierte *Api-Klasse (omsorgcore-client-ts).
|
||||
// Einzige Stelle, die API_BASE mit dem generierten Client verbindet.
|
||||
function configFor(accessToken) {
|
||||
return new Configuration({ basePath: API_BASE, accessToken });
|
||||
// credentials:"include" ist nötig, damit der Browser die HttpOnly-Refresh-Token-Cookie
|
||||
// auf /api/auth/* mitschickt bzw. entgegennimmt (siehe omsorgCore/CLAUDE.md, "Auth-Flow").
|
||||
export function configFor(accessToken) {
|
||||
return new Configuration({ basePath: API_BASE, accessToken, credentials: "include" });
|
||||
}
|
||||
|
||||
// Wandelt den Aufruf einer generierten `...Raw()`-Methode in denselben
|
||||
// Vertrag um, den vorher httpClient.request(...) lieferte: { ok, status, data, error? }.
|
||||
// Generierte Clients werfen bei Nicht-2xx eine ResponseError-Exception statt ein
|
||||
// Ergebnisobjekt zurückzugeben - das fangen wir hier zentral ab.
|
||||
async function callApi(rawPromise) {
|
||||
export async function callApi(rawPromise) {
|
||||
try {
|
||||
const response = await rawPromise;
|
||||
const data = await response.value();
|
||||
return { ok: true, status: response.raw.status, data: data === undefined ? null : data };
|
||||
} catch (err) {
|
||||
if (err && err.name === 'ResponseError') {
|
||||
if (err && err.name === "ResponseError") {
|
||||
const status = err.response.status;
|
||||
let data = null;
|
||||
try {
|
||||
@@ -30,5 +31,3 @@ async function callApi(rawPromise) {
|
||||
return { ok: false, status: 0, data: null, error: err && err.message };
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = { configFor, callApi };
|
||||
@@ -1,9 +1,9 @@
|
||||
const { AuditLogApi } = require('omsorgcore-client-ts');
|
||||
const { configFor, callApi } = require('./apiClientHelpers.cjs');
|
||||
import { AuditLogApi } from "omsorgcore-client-ts";
|
||||
import { configFor, callApi } from "./apiClientHelpers.js";
|
||||
|
||||
// Kapselt GET /api/audit-log (AuditLogController) über den generierten Client
|
||||
// (omsorgcore-client-ts) - rein lesend, keine weiteren Verben.
|
||||
async function listAuditLog(
|
||||
export async function listAuditLog(
|
||||
accessToken,
|
||||
{ page = 1, pageSize = 50, entityType, entityId, actorUserId, category, fromUtc, toUtc } = {}
|
||||
) {
|
||||
@@ -17,9 +17,7 @@ async function listAuditLog(
|
||||
actorUserId: actorUserId || undefined,
|
||||
category: category || undefined,
|
||||
fromUtc: fromUtc ? new Date(fromUtc) : undefined,
|
||||
toUtc: toUtc ? new Date(toUtc) : undefined,
|
||||
toUtc: toUtc ? new Date(toUtc) : undefined
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
module.exports = { listAuditLog };
|
||||
@@ -1,19 +1,18 @@
|
||||
const { AuthApi } = require('omsorgcore-client-ts');
|
||||
const { configFor, callApi } = require('./apiClientHelpers.cjs');
|
||||
import { AuthApi } from "omsorgcore-client-ts";
|
||||
import { configFor, callApi } from "./apiClientHelpers.js";
|
||||
|
||||
// Kapselt /api/auth/* von omsorgCore über den generierten Client (omsorgcore-client-ts).
|
||||
// Kennt die Feldnamen der LoginResponse (camelCase, da ASP.NET Core standardmäßig
|
||||
// camelCase-JSON ausgibt).
|
||||
// refresh/logout brauchen keinen Refresh-Token-Parameter mehr - er steckt in der
|
||||
// HttpOnly-Cookie, die der Browser dank credentials:"include" automatisch mitschickt.
|
||||
function toTokenPair(data) {
|
||||
return {
|
||||
accessToken: data.accessToken,
|
||||
refreshToken: data.refreshToken,
|
||||
expiresAt: data.expiresAt,
|
||||
mustChangePassword: !!data.mustChangePassword
|
||||
};
|
||||
}
|
||||
|
||||
async function login(username, password) {
|
||||
export async function login(username, password) {
|
||||
const api = new AuthApi(configFor(undefined));
|
||||
const result = await callApi(api.apiAuthLoginPostRaw({ loginRequest: { username, password } }));
|
||||
if (!result.ok) {
|
||||
@@ -22,67 +21,55 @@ async function login(username, password) {
|
||||
return { ok: true, ...toTokenPair(result.data) };
|
||||
}
|
||||
|
||||
async function refresh(refreshToken) {
|
||||
export async function refresh() {
|
||||
const api = new AuthApi(configFor(undefined));
|
||||
const result = await callApi(api.apiAuthRefreshPostRaw({ refreshRequest: { refreshToken } }));
|
||||
const result = await callApi(api.apiAuthRefreshPostRaw());
|
||||
if (!result.ok) return { ok: false, status: result.status };
|
||||
return { ok: true, ...toTokenPair(result.data) };
|
||||
}
|
||||
|
||||
async function logout(refreshToken) {
|
||||
export async function logout() {
|
||||
const api = new AuthApi(configFor(undefined));
|
||||
const result = await callApi(api.apiAuthLogoutPostRaw({ logoutRequest: { refreshToken } }));
|
||||
const result = await callApi(api.apiAuthLogoutPostRaw());
|
||||
return { ok: result.ok, status: result.status };
|
||||
}
|
||||
|
||||
async function me(accessToken) {
|
||||
export async function me(accessToken) {
|
||||
const api = new AuthApi(configFor(accessToken));
|
||||
const result = await callApi(api.apiAuthMeGetRaw());
|
||||
if (!result.ok) return { ok: false, status: result.status };
|
||||
return { ok: true, username: result.data.username, role: result.data.role, permissions: result.data.permissions };
|
||||
}
|
||||
|
||||
async function requestPasswordReset(username) {
|
||||
export async function requestPasswordReset(username) {
|
||||
const api = new AuthApi(configFor(undefined));
|
||||
const result = await callApi(api.apiAuthForgotPasswordRequestPostRaw({ forgotPasswordRequestRequest: { username } }));
|
||||
if (!result.ok) return { ok: false, status: result.status };
|
||||
return { ok: true, status: result.data.status };
|
||||
}
|
||||
|
||||
async function verifyPasswordResetCode(username, pin) {
|
||||
export async function verifyPasswordResetCode(username, pin) {
|
||||
const api = new AuthApi(configFor(undefined));
|
||||
const result = await callApi(api.apiAuthForgotPasswordVerifyPostRaw({ forgotPasswordVerifyRequest: { username, pin } }));
|
||||
if (!result.ok) return { ok: false, status: result.status, error: result.data?.error };
|
||||
return { ok: true, resetToken: result.data.resetToken };
|
||||
}
|
||||
|
||||
async function resetPassword(resetToken, newPassword) {
|
||||
export async function resetPassword(resetToken, newPassword) {
|
||||
const api = new AuthApi(configFor(undefined));
|
||||
const result = await callApi(api.apiAuthForgotPasswordResetPostRaw({ forgotPasswordResetRequest: { resetToken, newPassword } }));
|
||||
return { ok: result.ok, status: result.status, data: result.data };
|
||||
}
|
||||
|
||||
async function changePassword(accessToken, currentPassword, newPassword) {
|
||||
export async function changePassword(accessToken, currentPassword, newPassword) {
|
||||
const api = new AuthApi(configFor(accessToken));
|
||||
const result = await callApi(api.apiAuthChangePasswordPostRaw({ changePasswordRequest: { currentPassword, newPassword } }));
|
||||
return { ok: result.ok, status: result.status, data: result.data };
|
||||
}
|
||||
|
||||
async function getPasswordPolicy() {
|
||||
export async function getPasswordPolicy() {
|
||||
const api = new AuthApi(configFor(undefined));
|
||||
const result = await callApi(api.apiAuthPasswordPolicyGetRaw());
|
||||
if (!result.ok) return { ok: false, status: result.status };
|
||||
return { ok: true, minLength: result.data.minLength };
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
login,
|
||||
refresh,
|
||||
logout,
|
||||
me,
|
||||
requestPasswordReset,
|
||||
verifyPasswordResetCode,
|
||||
resetPassword,
|
||||
changePassword,
|
||||
getPasswordPolicy
|
||||
};
|
||||
@@ -0,0 +1,4 @@
|
||||
// Einzige Stelle im Projekt, die die Adresse von omsorgCore kennt.
|
||||
// Default passt zum lokalen `dotnet run --project src/OmsorgCore.Api` (http-Profil, Port 5245),
|
||||
// überschreibbar per Vite-Env-Variable (VITE_OMSORG_CORE_URL) für andere Umgebungen.
|
||||
export const API_BASE = import.meta.env.VITE_OMSORG_CORE_URL || "http://localhost:5245";
|
||||
@@ -0,0 +1,25 @@
|
||||
import { ContractsApi } from "omsorgcore-client-ts";
|
||||
import { configFor, callApi } from "./apiClientHelpers.js";
|
||||
|
||||
// Kapselt /api/contracts von omsorgCore (ContractsController) über den generierten
|
||||
// Client (omsorgcore-client-ts). Feldnamen sind camelCase, da ASP.NET Core
|
||||
// standardmäßig camelCase-JSON ausgibt.
|
||||
export async function listContracts(accessToken, { employeeId, facilityId, search, status, page = 1, pageSize = 20 } = {}) {
|
||||
const api = new ContractsApi(configFor(accessToken));
|
||||
return callApi(api.apiContractsGetRaw({ employeeId, facilityId, search, status, page, pageSize }));
|
||||
}
|
||||
|
||||
export async function createContract(accessToken, payload) {
|
||||
const api = new ContractsApi(configFor(accessToken));
|
||||
return callApi(api.apiContractsPostRaw({ createContractRequest: payload }));
|
||||
}
|
||||
|
||||
export async function updateContract(accessToken, id, payload) {
|
||||
const api = new ContractsApi(configFor(accessToken));
|
||||
return callApi(api.apiContractsIdPutRaw({ id, updateContractRequest: payload }));
|
||||
}
|
||||
|
||||
export async function deleteContract(accessToken, id) {
|
||||
const api = new ContractsApi(configFor(accessToken));
|
||||
return callApi(api.apiContractsIdDeleteRaw({ id }));
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
import { DocumentsApi } from "omsorgcore-client-ts";
|
||||
import { configFor, callApi } from "./apiClientHelpers.js";
|
||||
import { API_BASE } from "./config.js";
|
||||
|
||||
// Kapselt /api/documents von omsorgCore (DocumentsController). Der generierte Client wird für
|
||||
// list/upload/delete genutzt; der Download-Endpoint NICHT über DocumentsApi (dessen
|
||||
// apiDocumentsIdDownloadGetRaw ist als VoidApiResponse generiert und verwirft den Response-Body),
|
||||
// sondern per direktem fetch, analog zu genericApi.js für nicht-generierte Endpunkte.
|
||||
export async function listDocuments(accessToken, { entityType, entityId } = {}) {
|
||||
const api = new DocumentsApi(configFor(accessToken));
|
||||
return callApi(api.apiDocumentsGetRaw({ entityType, entityId }));
|
||||
}
|
||||
|
||||
export async function uploadDocument(accessToken, { entityType, entityId, category, description, fileName, contentType, data }) {
|
||||
const api = new DocumentsApi(configFor(accessToken));
|
||||
// data ist ein ArrayBuffer (aus file.arrayBuffer() im UploadDocumentDialog) - Blob
|
||||
// akzeptiert das im Browser direkt, kein Buffer.from(...) nötig (das war Node-spezifisch).
|
||||
const file = new Blob([data], { type: contentType || "application/octet-stream" });
|
||||
return callApi(api.apiDocumentsPostRaw({ entityType, entityId, category, description, file }));
|
||||
}
|
||||
|
||||
export async function updateDocument(accessToken, id, payload) {
|
||||
const api = new DocumentsApi(configFor(accessToken));
|
||||
return callApi(api.apiDocumentsIdPutRaw({ id, updateDocumentRequest: payload }));
|
||||
}
|
||||
|
||||
export async function deleteDocument(accessToken, id) {
|
||||
const api = new DocumentsApi(configFor(accessToken));
|
||||
return callApi(api.apiDocumentsIdDeleteRaw({ id }));
|
||||
}
|
||||
|
||||
export async function downloadDocument(accessToken, id) {
|
||||
const headers = {};
|
||||
if (accessToken) headers.Authorization = `Bearer ${accessToken}`;
|
||||
|
||||
let response;
|
||||
try {
|
||||
response = await fetch(`${API_BASE}/api/documents/${id}/download`, { headers });
|
||||
} catch (err) {
|
||||
return { ok: false, status: 0, data: null, error: err.message };
|
||||
}
|
||||
|
||||
if (!response.ok) {
|
||||
return { ok: false, status: response.status, data: null };
|
||||
}
|
||||
|
||||
const blob = await response.blob();
|
||||
return { ok: true, status: response.status, data: { blob } };
|
||||
}
|
||||
@@ -1,27 +1,30 @@
|
||||
const { EmployeesApi } = require('omsorgcore-client-ts');
|
||||
const { configFor, callApi } = require('./apiClientHelpers.cjs');
|
||||
import { EmployeesApi } from "omsorgcore-client-ts";
|
||||
import { configFor, callApi } from "./apiClientHelpers.js";
|
||||
|
||||
// Kapselt /api/employees von omsorgCore (EmployeesController) über den generierten
|
||||
// Client (omsorgcore-client-ts). Feldnamen sind camelCase, da ASP.NET Core
|
||||
// standardmäßig camelCase-JSON ausgibt.
|
||||
async function listEmployees(accessToken, { search, status, employmentType, page = 1, pageSize = 20 } = {}) {
|
||||
export async function listEmployees(accessToken, { search, status, employmentType, page = 1, pageSize = 20 } = {}) {
|
||||
const api = new EmployeesApi(configFor(accessToken));
|
||||
return callApi(api.apiEmployeesGetRaw({ search, status, employmentType, page, pageSize }));
|
||||
}
|
||||
|
||||
async function createEmployee(accessToken, payload) {
|
||||
export async function createEmployee(accessToken, payload) {
|
||||
const api = new EmployeesApi(configFor(accessToken));
|
||||
return callApi(api.apiEmployeesPostRaw({ createEmployeeRequest: payload }));
|
||||
}
|
||||
|
||||
async function getEmployee(accessToken, id) {
|
||||
export async function getEmployee(accessToken, id) {
|
||||
const api = new EmployeesApi(configFor(accessToken));
|
||||
return callApi(api.apiEmployeesIdGetRaw({ id }));
|
||||
}
|
||||
|
||||
async function updateEmployee(accessToken, id, payload) {
|
||||
export async function updateEmployee(accessToken, id, payload) {
|
||||
const api = new EmployeesApi(configFor(accessToken));
|
||||
return callApi(api.apiEmployeesIdPutRaw({ id, updateEmployeeRequest: payload }));
|
||||
}
|
||||
|
||||
module.exports = { listEmployees, createEmployee, getEmployee, updateEmployee };
|
||||
export async function deleteEmployee(accessToken, id) {
|
||||
const api = new EmployeesApi(configFor(accessToken));
|
||||
return callApi(api.apiEmployeesIdDeleteRaw({ id }));
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
import { FacilitiesApi } from "omsorgcore-client-ts";
|
||||
import { configFor, callApi } from "./apiClientHelpers.js";
|
||||
|
||||
// Kapselt /api/facilities von omsorgCore (FacilitiesController) über den generierten
|
||||
// Client (omsorgcore-client-ts). Feldnamen sind camelCase, da ASP.NET Core
|
||||
// standardmäßig camelCase-JSON ausgibt.
|
||||
export async function listFacilities(accessToken, { search, crmStatus, followUpDueOnly, page = 1, pageSize = 20 } = {}) {
|
||||
const api = new FacilitiesApi(configFor(accessToken));
|
||||
return callApi(api.apiFacilitiesGetRaw({ search, crmStatus, followUpDueOnly, page, pageSize }));
|
||||
}
|
||||
|
||||
export async function createFacility(accessToken, payload) {
|
||||
const api = new FacilitiesApi(configFor(accessToken));
|
||||
return callApi(api.apiFacilitiesPostRaw({ createFacilityRequest: payload }));
|
||||
}
|
||||
|
||||
export async function getFacility(accessToken, id) {
|
||||
const api = new FacilitiesApi(configFor(accessToken));
|
||||
return callApi(api.apiFacilitiesIdGetRaw({ id }));
|
||||
}
|
||||
|
||||
export async function updateFacility(accessToken, id, payload) {
|
||||
const api = new FacilitiesApi(configFor(accessToken));
|
||||
return callApi(api.apiFacilitiesIdPutRaw({ id, updateFacilityRequest: payload }));
|
||||
}
|
||||
|
||||
export async function deleteFacility(accessToken, id) {
|
||||
const api = new FacilitiesApi(configFor(accessToken));
|
||||
return callApi(api.apiFacilitiesIdDeleteRaw({ id }));
|
||||
}
|
||||
+9
-6
@@ -1,22 +1,25 @@
|
||||
const { FacilityContactsApi } = require('omsorgcore-client-ts');
|
||||
const { configFor, callApi } = require('./apiClientHelpers.cjs');
|
||||
import { FacilityContactsApi } from "omsorgcore-client-ts";
|
||||
import { configFor, callApi } from "./apiClientHelpers.js";
|
||||
|
||||
// Kapselt /api/facilities/{facilityId}/contacts von omsorgCore (FacilityContactsController)
|
||||
// über den generierten Client (omsorgcore-client-ts). Ansprechpartner sind eine
|
||||
// 1:n-Unterressource von Facility, kein eigenständiger Endpunkt.
|
||||
async function listFacilityContacts(accessToken, facilityId) {
|
||||
export async function listFacilityContacts(accessToken, facilityId) {
|
||||
const api = new FacilityContactsApi(configFor(accessToken));
|
||||
return callApi(api.apiFacilitiesFacilityIdContactsGetRaw({ facilityId }));
|
||||
}
|
||||
|
||||
async function createFacilityContact(accessToken, facilityId, payload) {
|
||||
export async function createFacilityContact(accessToken, facilityId, payload) {
|
||||
const api = new FacilityContactsApi(configFor(accessToken));
|
||||
return callApi(api.apiFacilitiesFacilityIdContactsPostRaw({ facilityId, createFacilityContactRequest: payload }));
|
||||
}
|
||||
|
||||
async function updateFacilityContact(accessToken, facilityId, id, payload) {
|
||||
export async function updateFacilityContact(accessToken, facilityId, id, payload) {
|
||||
const api = new FacilityContactsApi(configFor(accessToken));
|
||||
return callApi(api.apiFacilitiesFacilityIdContactsIdPutRaw({ facilityId, id, updateFacilityContactRequest: payload }));
|
||||
}
|
||||
|
||||
module.exports = { listFacilityContacts, createFacilityContact, updateFacilityContact };
|
||||
export async function deleteFacilityContact(accessToken, facilityId, id) {
|
||||
const api = new FacilityContactsApi(configFor(accessToken));
|
||||
return callApi(api.apiFacilitiesFacilityIdContactsIdDeleteRaw({ facilityId, id }));
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
import { FacilityQualificationRatesApi } from "omsorgcore-client-ts";
|
||||
import { configFor, callApi } from "./apiClientHelpers.js";
|
||||
|
||||
// Kapselt /api/facilities/{facilityId}/qualification-rates von omsorgCore
|
||||
// (FacilityQualificationRatesController) über den generierten Client (omsorgcore-client-ts).
|
||||
// Qualifikationsabhängige Preise sind eine 1:n-Unterressource von Facility (FR-EIN-4).
|
||||
export async function listFacilityQualificationRates(accessToken, facilityId) {
|
||||
const api = new FacilityQualificationRatesApi(configFor(accessToken));
|
||||
return callApi(api.apiFacilitiesFacilityIdQualificationRatesGetRaw({ facilityId }));
|
||||
}
|
||||
|
||||
export async function createFacilityQualificationRate(accessToken, facilityId, payload) {
|
||||
const api = new FacilityQualificationRatesApi(configFor(accessToken));
|
||||
return callApi(api.apiFacilitiesFacilityIdQualificationRatesPostRaw({ facilityId, createFacilityQualificationRateRequest: payload }));
|
||||
}
|
||||
|
||||
export async function updateFacilityQualificationRate(accessToken, facilityId, id, payload) {
|
||||
const api = new FacilityQualificationRatesApi(configFor(accessToken));
|
||||
return callApi(api.apiFacilitiesFacilityIdQualificationRatesIdPutRaw({ facilityId, id, updateFacilityQualificationRateRequest: payload }));
|
||||
}
|
||||
|
||||
export async function deleteFacilityQualificationRate(accessToken, facilityId, id) {
|
||||
const api = new FacilityQualificationRatesApi(configFor(accessToken));
|
||||
return callApi(api.apiFacilitiesFacilityIdQualificationRatesIdDeleteRaw({ facilityId, id }));
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
const { API_BASE } = require('./config.cjs');
|
||||
import { API_BASE } from "./config.js";
|
||||
|
||||
// Einzige Stelle, die fetch/API_BASE/Authorization-Header kennt. Kennt keine konkreten
|
||||
// Endpunkte - die kommen aus den <kategorie>Client.cjs-Dateien (z.B. authClient.cjs).
|
||||
async function request(method, path, { body, accessToken } = {}) {
|
||||
const headers = { 'Content-Type': 'application/json' };
|
||||
// Ersatz für httpClient.cjs + den generischen api:get/api:post-IPC-Proxy - für Ressourcen
|
||||
// ohne eigene <kategorie>Api.js-Datei (aktuell nur /api/admin/sessions*, /api/admin/email/*,
|
||||
// siehe DebugSessionsPage.jsx).
|
||||
export async function request(method, path, accessToken, body) {
|
||||
const headers = { "Content-Type": "application/json" };
|
||||
if (accessToken) headers.Authorization = `Bearer ${accessToken}`;
|
||||
|
||||
let response;
|
||||
@@ -30,5 +31,3 @@ async function request(method, path, { body, accessToken } = {}) {
|
||||
|
||||
return { ok: response.ok, status: response.status, data };
|
||||
}
|
||||
|
||||
module.exports = { request };
|
||||
@@ -0,0 +1,213 @@
|
||||
import * as session from "./session.js";
|
||||
import * as authApi from "./authApi.js";
|
||||
import * as genericApi from "./genericApi.js";
|
||||
import * as employeesApi from "./employeesApi.js";
|
||||
import * as facilitiesApi from "./facilitiesApi.js";
|
||||
import * as facilityContactsApi from "./facilityContactsApi.js";
|
||||
import * as facilityQualificationRatesApi from "./facilityQualificationRatesApi.js";
|
||||
import * as ordersApi from "./ordersApi.js";
|
||||
import * as absencesApi from "./absencesApi.js";
|
||||
import * as timeEntriesApi from "./timeEntriesApi.js";
|
||||
import * as usersApi from "./usersApi.js";
|
||||
import * as rolesApi from "./rolesApi.js";
|
||||
import * as auditLogApi from "./auditLogApi.js";
|
||||
import * as valueListsApi from "./valueListsApi.js";
|
||||
import * as trashApi from "./trashApi.js";
|
||||
import * as contractsApi from "./contractsApi.js";
|
||||
import * as documentsApi from "./documentsApi.js";
|
||||
|
||||
// Ersetzt electron/preload.cjs' contextBridge.exposeInMainWorld('omsorg', {...}) - dieselbe
|
||||
// Oberfläche als reines Browser-Objekt statt IPC-Bridge, damit keine der 76+ Aufrufstellen
|
||||
// unter src/modules/** angefasst werden muss (siehe Plan "Electron -> Browser-SPA-Migration").
|
||||
function withAuth(fn) {
|
||||
return (...args) => session.withAuthRetry(() => fn(session.getAccessToken(), ...args));
|
||||
}
|
||||
|
||||
// Ersetzt main.cjs' documents:download-Handler (dort: dialog.showSaveDialog + fs.writeFileSync).
|
||||
async function downloadDocumentAsFile(id, fileName) {
|
||||
const result = await session.withAuthRetry(() => documentsApi.downloadDocument(session.getAccessToken(), id));
|
||||
if (!result.ok) return result;
|
||||
const url = URL.createObjectURL(result.data.blob);
|
||||
const link = document.createElement("a");
|
||||
link.href = url;
|
||||
link.download = fileName;
|
||||
link.click();
|
||||
URL.revokeObjectURL(url);
|
||||
return { ok: true };
|
||||
}
|
||||
|
||||
export function buildOmsorgApi() {
|
||||
return {
|
||||
auth: {
|
||||
login: async (username, password) => {
|
||||
const result = await authApi.login(username, password);
|
||||
if (!result.ok) {
|
||||
const error = result.status === 0 ? "network_error" : result.status === 429 ? "too_many_attempts" : "invalid_credentials";
|
||||
return { success: false, error };
|
||||
}
|
||||
session.applySession(result);
|
||||
const snapshot = session.getSessionSnapshot();
|
||||
return { success: true, user: snapshot.user, mustChangePassword: snapshot.mustChangePassword };
|
||||
},
|
||||
logout: async () => {
|
||||
try {
|
||||
await authApi.logout();
|
||||
} catch {
|
||||
/* best effort */
|
||||
}
|
||||
session.clearSession();
|
||||
return { success: true };
|
||||
},
|
||||
getSession: async () => {
|
||||
if (!session.getAccessToken()) {
|
||||
await session.bootstrapSession();
|
||||
}
|
||||
return session.getSessionSnapshot();
|
||||
},
|
||||
onSessionChanged: session.onSessionChanged,
|
||||
requestPasswordReset: async (username) => {
|
||||
const result = await authApi.requestPasswordReset(username);
|
||||
if (!result.ok) return { success: false, error: "network_error" };
|
||||
return { success: true, status: result.status };
|
||||
},
|
||||
verifyPasswordResetCode: async (username, pin) => {
|
||||
const result = await authApi.verifyPasswordResetCode(username, pin);
|
||||
if (!result.ok) return { success: false, error: result.error || "invalid_or_expired" };
|
||||
return { success: true, resetToken: result.resetToken };
|
||||
},
|
||||
resetPassword: async (resetToken, newPassword) => {
|
||||
const result = await authApi.resetPassword(resetToken, newPassword);
|
||||
if (!result.ok) {
|
||||
const error = result.status === 400 ? "password_too_short" : "invalid_or_expired";
|
||||
return { success: false, error, message: result.status === 400 && typeof result.data === "string" ? result.data : undefined };
|
||||
}
|
||||
return { success: true };
|
||||
},
|
||||
changePassword: async (currentPassword, newPassword) => {
|
||||
if (!session.getAccessToken()) return { success: false, error: "not_authenticated" };
|
||||
const result = await authApi.changePassword(session.getAccessToken(), currentPassword, newPassword);
|
||||
if (!result.ok) {
|
||||
const error = result.status === 401 ? "invalid_current_password" : result.status === 400 ? "password_too_short" : "unknown";
|
||||
return { success: false, error, message: result.status === 400 && typeof result.data === "string" ? result.data : undefined };
|
||||
}
|
||||
session.clearSession();
|
||||
return { success: true };
|
||||
},
|
||||
getPasswordPolicy: async () => {
|
||||
const result = await authApi.getPasswordPolicy();
|
||||
if (!result.ok) return { success: false };
|
||||
return { success: true, minLength: result.minLength };
|
||||
}
|
||||
},
|
||||
api: {
|
||||
get: (path) => session.withAuthRetry(() => genericApi.request("GET", path, session.getAccessToken())),
|
||||
post: (path, body) => session.withAuthRetry(() => genericApi.request("POST", path, session.getAccessToken(), body))
|
||||
},
|
||||
employees: {
|
||||
list: withAuth(employeesApi.listEmployees),
|
||||
create: withAuth(employeesApi.createEmployee),
|
||||
update: withAuth(employeesApi.updateEmployee),
|
||||
delete: withAuth(employeesApi.deleteEmployee)
|
||||
},
|
||||
facilities: {
|
||||
list: withAuth(facilitiesApi.listFacilities),
|
||||
create: withAuth(facilitiesApi.createFacility),
|
||||
update: withAuth(facilitiesApi.updateFacility),
|
||||
delete: withAuth(facilitiesApi.deleteFacility)
|
||||
},
|
||||
facilityContacts: {
|
||||
list: withAuth(facilityContactsApi.listFacilityContacts),
|
||||
create: withAuth(facilityContactsApi.createFacilityContact),
|
||||
update: withAuth(facilityContactsApi.updateFacilityContact),
|
||||
delete: withAuth(facilityContactsApi.deleteFacilityContact)
|
||||
},
|
||||
facilityQualificationRates: {
|
||||
list: withAuth(facilityQualificationRatesApi.listFacilityQualificationRates),
|
||||
create: withAuth(facilityQualificationRatesApi.createFacilityQualificationRate),
|
||||
update: withAuth(facilityQualificationRatesApi.updateFacilityQualificationRate),
|
||||
delete: withAuth(facilityQualificationRatesApi.deleteFacilityQualificationRate)
|
||||
},
|
||||
orders: {
|
||||
list: withAuth(ordersApi.listOrders),
|
||||
create: withAuth(ordersApi.createOrder),
|
||||
get: withAuth(ordersApi.getOrder),
|
||||
update: withAuth(ordersApi.updateOrder),
|
||||
delete: withAuth(ordersApi.deleteOrder)
|
||||
},
|
||||
absences: {
|
||||
list: withAuth(absencesApi.listAbsences),
|
||||
get: withAuth(absencesApi.getAbsence),
|
||||
update: withAuth(absencesApi.updateAbsence),
|
||||
decide: withAuth(absencesApi.decideAbsence),
|
||||
delete: withAuth(absencesApi.deleteAbsence)
|
||||
},
|
||||
timeEntries: {
|
||||
list: withAuth(timeEntriesApi.listTimeEntries),
|
||||
get: withAuth(timeEntriesApi.getTimeEntry),
|
||||
update: withAuth(timeEntriesApi.updateTimeEntry),
|
||||
submit: withAuth(timeEntriesApi.submitTimeEntry),
|
||||
decide: withAuth(timeEntriesApi.decideTimeEntry),
|
||||
delete: withAuth(timeEntriesApi.deleteTimeEntry)
|
||||
},
|
||||
users: {
|
||||
list: withAuth(usersApi.listUsers),
|
||||
create: withAuth(usersApi.createUser),
|
||||
listPermissionOverrides: withAuth(usersApi.listPermissionOverrides),
|
||||
addPermissionOverride: withAuth(usersApi.addPermissionOverride),
|
||||
deletePermissionOverride: withAuth(usersApi.deletePermissionOverride),
|
||||
update: withAuth(usersApi.updateUser),
|
||||
resetPassword: withAuth(usersApi.resetPassword)
|
||||
},
|
||||
roles: {
|
||||
list: withAuth(rolesApi.listRoles),
|
||||
get: withAuth(rolesApi.getRole),
|
||||
create: withAuth(rolesApi.createRole),
|
||||
updatePermissions: withAuth(rolesApi.updateRolePermissions)
|
||||
},
|
||||
auditLog: {
|
||||
list: withAuth(auditLogApi.listAuditLog)
|
||||
},
|
||||
valueLists: {
|
||||
list: withAuth(valueListsApi.listValueLists),
|
||||
listItems: withAuth(valueListsApi.listItems),
|
||||
createItem: withAuth(valueListsApi.createItem),
|
||||
updateItem: withAuth(valueListsApi.updateItem),
|
||||
deleteItem: withAuth(valueListsApi.deleteItem),
|
||||
getUsages: withAuth(valueListsApi.getUsages),
|
||||
listTransitions: withAuth(valueListsApi.listTransitions),
|
||||
replaceTransitions: withAuth(valueListsApi.replaceTransitions)
|
||||
},
|
||||
trash: {
|
||||
listEmployees: withAuth(trashApi.listDeletedEmployees),
|
||||
restoreEmployee: withAuth(trashApi.restoreEmployee),
|
||||
listFacilities: withAuth(trashApi.listDeletedFacilities),
|
||||
restoreFacility: withAuth(trashApi.restoreFacility),
|
||||
listContracts: withAuth(trashApi.listDeletedContracts),
|
||||
restoreContract: withAuth(trashApi.restoreContract),
|
||||
listOrders: withAuth(trashApi.listDeletedOrders),
|
||||
restoreOrder: withAuth(trashApi.restoreOrder),
|
||||
listFacilityContacts: withAuth(trashApi.listDeletedFacilityContacts),
|
||||
restoreFacilityContact: withAuth(trashApi.restoreFacilityContact),
|
||||
listFacilityQualificationRates: withAuth(trashApi.listDeletedFacilityQualificationRates),
|
||||
restoreFacilityQualificationRate: withAuth(trashApi.restoreFacilityQualificationRate),
|
||||
listAbsences: withAuth(trashApi.listDeletedAbsences),
|
||||
restoreAbsence: withAuth(trashApi.restoreAbsence),
|
||||
listTimeEntries: withAuth(trashApi.listDeletedTimeEntries),
|
||||
restoreTimeEntry: withAuth(trashApi.restoreTimeEntry)
|
||||
},
|
||||
contracts: {
|
||||
list: withAuth(contractsApi.listContracts),
|
||||
create: withAuth(contractsApi.createContract),
|
||||
update: withAuth(contractsApi.updateContract),
|
||||
delete: withAuth(contractsApi.deleteContract)
|
||||
},
|
||||
documents: {
|
||||
list: withAuth(documentsApi.listDocuments),
|
||||
upload: withAuth(documentsApi.uploadDocument),
|
||||
update: withAuth(documentsApi.updateDocument),
|
||||
delete: withAuth(documentsApi.deleteDocument),
|
||||
download: (id, fileName) => downloadDocumentAsFile(id, fileName),
|
||||
view: withAuth(documentsApi.downloadDocument)
|
||||
}
|
||||
};
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
import { OrdersApi } from "omsorgcore-client-ts";
|
||||
import { configFor, callApi } from "./apiClientHelpers.js";
|
||||
|
||||
// Kapselt /api/orders von omsorgCore (OrdersController) über den generierten
|
||||
// Client (omsorgcore-client-ts). startDate/endDate müssen als Date-Objekte
|
||||
// übergeben werden - die generierten ...ToJSON-Funktionen rufen .toISOString()
|
||||
// darauf auf, ein reiner "YYYY-MM-DD"-String aus einem <input type="date">
|
||||
// würde dabei crashen (siehe auditLogApi.js für dasselbe Muster bei Filtern).
|
||||
function toDatePayload(payload) {
|
||||
return {
|
||||
...payload,
|
||||
startDate: payload.startDate ? new Date(payload.startDate) : payload.startDate,
|
||||
endDate: payload.endDate ? new Date(payload.endDate) : payload.endDate
|
||||
};
|
||||
}
|
||||
|
||||
export async function listOrders(
|
||||
accessToken,
|
||||
{ search, statusId, facilityId, priority, requiredQualification, shiftType, page = 1, pageSize = 20 } = {}
|
||||
) {
|
||||
const api = new OrdersApi(configFor(accessToken));
|
||||
return callApi(
|
||||
api.apiOrdersGetRaw({ search, statusId, facilityId, priority, requiredQualification, shiftType, page, pageSize })
|
||||
);
|
||||
}
|
||||
|
||||
export async function createOrder(accessToken, payload) {
|
||||
const api = new OrdersApi(configFor(accessToken));
|
||||
return callApi(api.apiOrdersPostRaw({ createOrderRequest: toDatePayload(payload) }));
|
||||
}
|
||||
|
||||
export async function getOrder(accessToken, id) {
|
||||
const api = new OrdersApi(configFor(accessToken));
|
||||
return callApi(api.apiOrdersIdGetRaw({ id }));
|
||||
}
|
||||
|
||||
export async function updateOrder(accessToken, id, payload) {
|
||||
const api = new OrdersApi(configFor(accessToken));
|
||||
return callApi(api.apiOrdersIdPutRaw({ id, updateOrderRequest: toDatePayload(payload) }));
|
||||
}
|
||||
|
||||
export async function deleteOrder(accessToken, id) {
|
||||
const api = new OrdersApi(configFor(accessToken));
|
||||
return callApi(api.apiOrdersIdDeleteRaw({ id }));
|
||||
}
|
||||
@@ -1,26 +1,24 @@
|
||||
const { RolesApi } = require('omsorgcore-client-ts');
|
||||
const { configFor, callApi } = require('./apiClientHelpers.cjs');
|
||||
import { RolesApi } from "omsorgcore-client-ts";
|
||||
import { configFor, callApi } from "./apiClientHelpers.js";
|
||||
|
||||
// Kapselt /api/roles von omsorgCore (RolesController) über den generierten Client
|
||||
// (omsorgcore-client-ts).
|
||||
async function listRoles(accessToken) {
|
||||
export async function listRoles(accessToken) {
|
||||
const api = new RolesApi(configFor(accessToken));
|
||||
return callApi(api.apiRolesGetRaw());
|
||||
}
|
||||
|
||||
async function getRole(accessToken, roleId) {
|
||||
export async function getRole(accessToken, roleId) {
|
||||
const api = new RolesApi(configFor(accessToken));
|
||||
return callApi(api.apiRolesIdGetRaw({ id: roleId }));
|
||||
}
|
||||
|
||||
async function createRole(accessToken, payload) {
|
||||
export async function createRole(accessToken, payload) {
|
||||
const api = new RolesApi(configFor(accessToken));
|
||||
return callApi(api.apiRolesPostRaw({ createRoleRequest: payload }));
|
||||
}
|
||||
|
||||
async function updateRolePermissions(accessToken, roleId, payload) {
|
||||
export async function updateRolePermissions(accessToken, roleId, payload) {
|
||||
const api = new RolesApi(configFor(accessToken));
|
||||
return callApi(api.apiRolesIdPermissionsPutRaw({ id: roleId, updateRolePermissionsRequest: payload }));
|
||||
}
|
||||
|
||||
module.exports = { listRoles, getRole, createRole, updateRolePermissions };
|
||||
@@ -0,0 +1,128 @@
|
||||
// Browser-Ersatz für das frühere Session-Management im Electron-Hauptprozess (main.cjs):
|
||||
// Access-Token nur als Modul-Variable im Speicher (verschwindet bei Reload/Tab-Schließen),
|
||||
// Refresh-Token liegt jetzt als HttpOnly-Cookie beim Server (nie per JS lesbar, siehe
|
||||
// omsorgCore/CLAUDE.md "Auth-Flow") - refreshSilently() schickt dafür nur noch
|
||||
// credentials:"include" (via authApi.refresh()), ohne den Token selbst zu kennen.
|
||||
import { refresh as refreshRequest, me as meRequest } from "./authApi.js";
|
||||
|
||||
const REFRESH_BUFFER_MS = 2 * 60 * 1000;
|
||||
|
||||
let accessToken = null;
|
||||
let expiresAt = null;
|
||||
let user = null;
|
||||
let mustChangePassword = false;
|
||||
let refreshTimer = null;
|
||||
const listeners = new Set();
|
||||
|
||||
export function getSessionSnapshot() {
|
||||
return { isAuthenticated: !!accessToken, user, mustChangePassword };
|
||||
}
|
||||
|
||||
function notify() {
|
||||
const snapshot = getSessionSnapshot();
|
||||
listeners.forEach((cb) => cb(snapshot));
|
||||
}
|
||||
|
||||
export function getAccessToken() {
|
||||
return accessToken;
|
||||
}
|
||||
|
||||
export function onSessionChanged(callback) {
|
||||
listeners.add(callback);
|
||||
return () => listeners.delete(callback);
|
||||
}
|
||||
|
||||
// Rein für die Anzeige "angemeldet als ..." - die Signaturprüfung passiert serverseitig
|
||||
// bei jedem authentifizierten Aufruf, hier wird nichts sicherheitsrelevantes entschieden.
|
||||
function decodeJwtClaims(token) {
|
||||
try {
|
||||
const payload = token.split(".")[1];
|
||||
const base64 = payload.replace(/-/g, "+").replace(/_/g, "/");
|
||||
const json = decodeURIComponent(
|
||||
atob(base64)
|
||||
.split("")
|
||||
.map((c) => "%" + c.charCodeAt(0).toString(16).padStart(2, "0"))
|
||||
.join("")
|
||||
);
|
||||
return JSON.parse(json);
|
||||
} catch {
|
||||
return {};
|
||||
}
|
||||
}
|
||||
|
||||
function userFromAccessToken(token) {
|
||||
const claims = decodeJwtClaims(token);
|
||||
return {
|
||||
username: claims["name"] || claims["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name"] || null,
|
||||
role: claims["role"] || claims["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/role"] || null
|
||||
};
|
||||
}
|
||||
|
||||
function scheduleRefresh() {
|
||||
if (refreshTimer) clearTimeout(refreshTimer);
|
||||
if (!expiresAt) return;
|
||||
const delay = Math.max(new Date(expiresAt).getTime() - Date.now() - REFRESH_BUFFER_MS, 5000);
|
||||
refreshTimer = setTimeout(refreshSilently, delay);
|
||||
}
|
||||
|
||||
export function applySession(tokenPair) {
|
||||
accessToken = tokenPair.accessToken;
|
||||
expiresAt = tokenPair.expiresAt;
|
||||
user = userFromAccessToken(tokenPair.accessToken);
|
||||
mustChangePassword = !!tokenPair.mustChangePassword;
|
||||
scheduleRefresh();
|
||||
notify();
|
||||
refreshPermissions();
|
||||
}
|
||||
|
||||
// Rechte kommen nicht aus dem JWT (das trägt nur den Rollennamen), sondern aus /api/auth/me -
|
||||
// läuft nach dem schnellen JWT-basierten Zwischenstand nach und broadcastet erneut, sobald da.
|
||||
async function refreshPermissions() {
|
||||
const tokenAtCallTime = accessToken;
|
||||
if (!tokenAtCallTime) return;
|
||||
const profile = await meRequest(tokenAtCallTime);
|
||||
if (!profile.ok || accessToken !== tokenAtCallTime) return;
|
||||
user = { username: profile.username, role: profile.role, permissions: profile.permissions };
|
||||
notify();
|
||||
}
|
||||
|
||||
export function clearSession() {
|
||||
accessToken = null;
|
||||
expiresAt = null;
|
||||
user = null;
|
||||
mustChangePassword = false;
|
||||
if (refreshTimer) clearTimeout(refreshTimer);
|
||||
refreshTimer = null;
|
||||
notify();
|
||||
}
|
||||
|
||||
// Proaktiver Timer kurz vor Ablauf UND Fallback bei 401 (z.B. nach langer Inaktivität) -
|
||||
// schickt keinen Token mehr mit, die HttpOnly-Cookie übernimmt das.
|
||||
export async function refreshSilently() {
|
||||
const result = await refreshRequest();
|
||||
if (!result.ok) {
|
||||
clearSession();
|
||||
return false;
|
||||
}
|
||||
applySession(result);
|
||||
return true;
|
||||
}
|
||||
|
||||
// Ersetzt main.cjs' bootstrapSession(): läuft einmal beim App-Start, damit ein Reload
|
||||
// (der die Modul-Variable oben leert) die Session über die noch gültige HttpOnly-Cookie
|
||||
// transparent wiederherstellt, statt den Nutzer erneut einloggen zu lassen.
|
||||
export async function bootstrapSession() {
|
||||
if (accessToken) return true;
|
||||
return refreshSilently();
|
||||
}
|
||||
|
||||
// Ruft callFn() auf und wiederholt einmal nach Silent-Refresh bei 401 - gemeinsame
|
||||
// Grundlage für alle <resource>Api.js-Aufrufe und den generischen api:*-Proxy.
|
||||
export async function withAuthRetry(callFn) {
|
||||
if (!accessToken) return { ok: false, status: 401, data: null };
|
||||
let result = await callFn();
|
||||
if (result.status === 401 && (await refreshSilently())) {
|
||||
result = await callFn();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
import { TimeEntriesApi } from "omsorgcore-client-ts";
|
||||
import { configFor, callApi } from "./apiClientHelpers.js";
|
||||
|
||||
// Kapselt /api/time-entries von omsorgCore (TimeEntriesController) über den generierten Client
|
||||
// (omsorgcore-client-ts). Anlegen (mit Date-Feldern) passiert nur über omsorgWeb/mitarbeiter-app,
|
||||
// omsorgapp braucht hier Lesen + Bearbeiten (solange status.isEditableByOwner) + Prüfungs-Entscheidungen.
|
||||
|
||||
// date muss als Date-Objekt übergeben werden - siehe absencesApi.js für dasselbe Muster.
|
||||
function toDatePayload(payload) {
|
||||
return {
|
||||
...payload,
|
||||
date: payload.date ? new Date(payload.date) : payload.date
|
||||
};
|
||||
}
|
||||
|
||||
export async function listTimeEntries(accessToken, { statusId, employeeId, orderId, page = 1, pageSize = 20 } = {}) {
|
||||
const api = new TimeEntriesApi(configFor(accessToken));
|
||||
return callApi(api.apiTimeEntriesGetRaw({ statusId, employeeId, orderId, page, pageSize }));
|
||||
}
|
||||
|
||||
export async function getTimeEntry(accessToken, id) {
|
||||
const api = new TimeEntriesApi(configFor(accessToken));
|
||||
return callApi(api.apiTimeEntriesIdGetRaw({ id }));
|
||||
}
|
||||
|
||||
export async function updateTimeEntry(accessToken, id, payload) {
|
||||
const api = new TimeEntriesApi(configFor(accessToken));
|
||||
return callApi(api.apiTimeEntriesIdPutRaw({ id, updateTimeEntryRequest: toDatePayload(payload) }));
|
||||
}
|
||||
|
||||
export async function submitTimeEntry(accessToken, id) {
|
||||
const api = new TimeEntriesApi(configFor(accessToken));
|
||||
return callApi(api.apiTimeEntriesIdSubmitPostRaw({ id }));
|
||||
}
|
||||
|
||||
export async function decideTimeEntry(accessToken, id, payload) {
|
||||
const api = new TimeEntriesApi(configFor(accessToken));
|
||||
return callApi(api.apiTimeEntriesIdDecisionPostRaw({ id, timeEntryDecisionRequest: payload }));
|
||||
}
|
||||
|
||||
export async function deleteTimeEntry(accessToken, id) {
|
||||
const api = new TimeEntriesApi(configFor(accessToken));
|
||||
return callApi(api.apiTimeEntriesIdDeleteRaw({ id }));
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
import { TrashApi } from "omsorgcore-client-ts";
|
||||
import { configFor, callApi } from "./apiClientHelpers.js";
|
||||
|
||||
// Kapselt /api/trash von omsorgCore (TrashController) über den generierten Client
|
||||
// (omsorgcore-client-ts) - Papierkorb für die Objekte mit Soft-Delete.
|
||||
|
||||
export async function listDeletedEmployees(accessToken, search) {
|
||||
const api = new TrashApi(configFor(accessToken));
|
||||
return callApi(api.apiTrashEmployeesGetRaw({ search }));
|
||||
}
|
||||
|
||||
export async function restoreEmployee(accessToken, id) {
|
||||
const api = new TrashApi(configFor(accessToken));
|
||||
return callApi(api.apiTrashEmployeesIdRestorePostRaw({ id }));
|
||||
}
|
||||
|
||||
export async function listDeletedFacilities(accessToken, search) {
|
||||
const api = new TrashApi(configFor(accessToken));
|
||||
return callApi(api.apiTrashFacilitiesGetRaw({ search }));
|
||||
}
|
||||
|
||||
export async function restoreFacility(accessToken, id) {
|
||||
const api = new TrashApi(configFor(accessToken));
|
||||
return callApi(api.apiTrashFacilitiesIdRestorePostRaw({ id }));
|
||||
}
|
||||
|
||||
export async function listDeletedContracts(accessToken, search) {
|
||||
const api = new TrashApi(configFor(accessToken));
|
||||
return callApi(api.apiTrashContractsGetRaw({ search }));
|
||||
}
|
||||
|
||||
export async function restoreContract(accessToken, id) {
|
||||
const api = new TrashApi(configFor(accessToken));
|
||||
return callApi(api.apiTrashContractsIdRestorePostRaw({ id }));
|
||||
}
|
||||
|
||||
export async function listDeletedOrders(accessToken, search) {
|
||||
const api = new TrashApi(configFor(accessToken));
|
||||
return callApi(api.apiTrashOrdersGetRaw({ search }));
|
||||
}
|
||||
|
||||
export async function restoreOrder(accessToken, id) {
|
||||
const api = new TrashApi(configFor(accessToken));
|
||||
return callApi(api.apiTrashOrdersIdRestorePostRaw({ id }));
|
||||
}
|
||||
|
||||
export async function listDeletedFacilityContacts(accessToken, search) {
|
||||
const api = new TrashApi(configFor(accessToken));
|
||||
return callApi(api.apiTrashFacilityContactsGetRaw({ search }));
|
||||
}
|
||||
|
||||
export async function restoreFacilityContact(accessToken, id) {
|
||||
const api = new TrashApi(configFor(accessToken));
|
||||
return callApi(api.apiTrashFacilityContactsIdRestorePostRaw({ id }));
|
||||
}
|
||||
|
||||
export async function listDeletedFacilityQualificationRates(accessToken, search) {
|
||||
const api = new TrashApi(configFor(accessToken));
|
||||
return callApi(api.apiTrashFacilityQualificationRatesGetRaw({ search }));
|
||||
}
|
||||
|
||||
export async function restoreFacilityQualificationRate(accessToken, id) {
|
||||
const api = new TrashApi(configFor(accessToken));
|
||||
return callApi(api.apiTrashFacilityQualificationRatesIdRestorePostRaw({ id }));
|
||||
}
|
||||
|
||||
export async function listDeletedAbsences(accessToken, search) {
|
||||
const api = new TrashApi(configFor(accessToken));
|
||||
return callApi(api.apiTrashAbsencesGetRaw({ search }));
|
||||
}
|
||||
|
||||
export async function restoreAbsence(accessToken, id) {
|
||||
const api = new TrashApi(configFor(accessToken));
|
||||
return callApi(api.apiTrashAbsencesIdRestorePostRaw({ id }));
|
||||
}
|
||||
|
||||
export async function listDeletedTimeEntries(accessToken, search) {
|
||||
const api = new TrashApi(configFor(accessToken));
|
||||
return callApi(api.apiTrashTimeEntriesGetRaw({ search }));
|
||||
}
|
||||
|
||||
export async function restoreTimeEntry(accessToken, id) {
|
||||
const api = new TrashApi(configFor(accessToken));
|
||||
return callApi(api.apiTrashTimeEntriesIdRestorePostRaw({ id }));
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import { UsersApi } from "omsorgcore-client-ts";
|
||||
import { configFor, callApi } from "./apiClientHelpers.js";
|
||||
|
||||
// Kapselt /api/users von omsorgCore (UsersController) über den generierten Client
|
||||
// (omsorgcore-client-ts).
|
||||
export async function listUsers(accessToken) {
|
||||
const api = new UsersApi(configFor(accessToken));
|
||||
return callApi(api.apiUsersGetRaw());
|
||||
}
|
||||
|
||||
export async function createUser(accessToken, payload) {
|
||||
const api = new UsersApi(configFor(accessToken));
|
||||
return callApi(api.apiUsersPostRaw({ createUserRequest: payload }));
|
||||
}
|
||||
|
||||
export async function listPermissionOverrides(accessToken, userId) {
|
||||
const api = new UsersApi(configFor(accessToken));
|
||||
return callApi(api.apiUsersIdPermissionOverridesGetRaw({ id: userId }));
|
||||
}
|
||||
|
||||
export async function addPermissionOverride(accessToken, userId, payload) {
|
||||
const api = new UsersApi(configFor(accessToken));
|
||||
return callApi(api.apiUsersIdPermissionOverridesPostRaw({ id: userId, addUserPermissionOverrideRequest: payload }));
|
||||
}
|
||||
|
||||
export async function deletePermissionOverride(accessToken, userId, overrideId) {
|
||||
const api = new UsersApi(configFor(accessToken));
|
||||
return callApi(api.apiUsersIdPermissionOverridesOverrideIdDeleteRaw({ id: userId, overrideId }));
|
||||
}
|
||||
|
||||
export async function updateUser(accessToken, userId, payload) {
|
||||
const api = new UsersApi(configFor(accessToken));
|
||||
return callApi(api.apiUsersIdPutRaw({ id: userId, updateUserRequest: payload }));
|
||||
}
|
||||
|
||||
export async function resetPassword(accessToken, userId, payload) {
|
||||
const api = new UsersApi(configFor(accessToken));
|
||||
return callApi(api.apiUsersIdResetPasswordPostRaw({ id: userId, resetUserPasswordRequest: payload }));
|
||||
}
|
||||
+10
-21
@@ -1,56 +1,45 @@
|
||||
const { ValueListsApi } = require('omsorgcore-client-ts');
|
||||
const { configFor, callApi } = require('./apiClientHelpers.cjs');
|
||||
import { ValueListsApi } from "omsorgcore-client-ts";
|
||||
import { configFor, callApi } from "./apiClientHelpers.js";
|
||||
|
||||
// Kapselt /api/value-lists von omsorgCore (ValueListsController) über den generierten
|
||||
// Client (omsorgcore-client-ts) - konfigurierbare Auswahllisten (Mitarbeiterstatus,
|
||||
// Beschäftigungsart, CRM-Status, Einrichtungstyp, Vertragstyp/-status, Auftragsstatus).
|
||||
async function listValueLists(accessToken) {
|
||||
export async function listValueLists(accessToken) {
|
||||
const api = new ValueListsApi(configFor(accessToken));
|
||||
return callApi(api.apiValueListsGetRaw());
|
||||
}
|
||||
|
||||
async function listItems(accessToken, key) {
|
||||
export async function listItems(accessToken, key) {
|
||||
const api = new ValueListsApi(configFor(accessToken));
|
||||
return callApi(api.apiValueListsKeyItemsGetRaw({ key }));
|
||||
}
|
||||
|
||||
async function createItem(accessToken, key, payload) {
|
||||
export async function createItem(accessToken, key, payload) {
|
||||
const api = new ValueListsApi(configFor(accessToken));
|
||||
return callApi(api.apiValueListsKeyItemsPostRaw({ key, createValueListItemRequest: payload }));
|
||||
}
|
||||
|
||||
async function updateItem(accessToken, key, id, payload) {
|
||||
export async function updateItem(accessToken, key, id, payload) {
|
||||
const api = new ValueListsApi(configFor(accessToken));
|
||||
return callApi(api.apiValueListsKeyItemsIdPutRaw({ key, id, updateValueListItemRequest: payload }));
|
||||
}
|
||||
|
||||
async function deleteItem(accessToken, key, id) {
|
||||
export async function deleteItem(accessToken, key, id) {
|
||||
const api = new ValueListsApi(configFor(accessToken));
|
||||
return callApi(api.apiValueListsKeyItemsIdDeleteRaw({ key, id }));
|
||||
}
|
||||
|
||||
async function getUsages(accessToken, key, id) {
|
||||
export async function getUsages(accessToken, key, id) {
|
||||
const api = new ValueListsApi(configFor(accessToken));
|
||||
return callApi(api.apiValueListsKeyItemsIdUsagesGetRaw({ key, id }));
|
||||
}
|
||||
|
||||
async function listTransitions(accessToken, key) {
|
||||
export async function listTransitions(accessToken, key) {
|
||||
const api = new ValueListsApi(configFor(accessToken));
|
||||
return callApi(api.apiValueListsKeyTransitionsGetRaw({ key }));
|
||||
}
|
||||
|
||||
async function replaceTransitions(accessToken, key, payload) {
|
||||
export async function replaceTransitions(accessToken, key, payload) {
|
||||
const api = new ValueListsApi(configFor(accessToken));
|
||||
return callApi(api.apiValueListsKeyTransitionsPutRaw({ key, valueListTransitionRequest: payload }));
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
listValueLists,
|
||||
listItems,
|
||||
createItem,
|
||||
updateItem,
|
||||
deleteItem,
|
||||
getUsages,
|
||||
listTransitions,
|
||||
replaceTransitions
|
||||
};
|
||||
@@ -77,6 +77,14 @@ export function AuthProvider({ children }) {
|
||||
[user]
|
||||
);
|
||||
|
||||
// Rein kosmetisch (z.B. Suchfeld ausblenden, wenn ohnehin nur der eigene Datensatz zurückkommt) -
|
||||
// die eigentliche Durchsetzung von "nur eigene Daten" passiert serverseitig (siehe omsorgCore/
|
||||
// CLAUDE.md, "Datenebenen-Scope"), nicht hier.
|
||||
const getScope = useCallback(
|
||||
(module, action) => user?.permissions?.find((p) => p.module === module && p.action === action)?.scope ?? null,
|
||||
[user]
|
||||
);
|
||||
|
||||
return (
|
||||
<AuthContext.Provider
|
||||
value={{
|
||||
@@ -88,7 +96,8 @@ export function AuthProvider({ children }) {
|
||||
login,
|
||||
logout,
|
||||
changePassword,
|
||||
hasPermission
|
||||
hasPermission,
|
||||
getScope
|
||||
}}
|
||||
>
|
||||
{children}
|
||||
|
||||
@@ -3,6 +3,9 @@ import AppLayout from "../layouts/AppLayout";
|
||||
import HomePage from "../modules/home/HomePage";
|
||||
import EmployeesPage from "../modules/employees/EmployeesPage";
|
||||
import FacilitiesPage from "../modules/facilities/FacilitiesPage";
|
||||
import OrdersPage from "../modules/orders/OrdersPage";
|
||||
import AbsencesPage from "../modules/absences/AbsencesPage";
|
||||
import TimeEntriesPage from "../modules/timeEntries/TimeEntriesPage";
|
||||
import LoginPage from "../modules/auth/LoginPage";
|
||||
import ChangePasswordScreen from "../modules/auth/ChangePasswordScreen";
|
||||
import ForgotPasswordUsernamePage from "../modules/auth/ForgotPasswordUsernamePage";
|
||||
@@ -11,6 +14,7 @@ import ForgotPasswordNewPasswordPage from "../modules/auth/ForgotPasswordNewPass
|
||||
import DebugSessionsPage from "../modules/debug/DebugSessionsPage";
|
||||
import SettingsPage from "../modules/settings/SettingsPage";
|
||||
import AuditLogPage from "../modules/auditLog/AuditLogPage";
|
||||
import TrashPage from "../modules/trash/TrashPage";
|
||||
import { useAuth } from "./AuthContext";
|
||||
import { isNavItemVisible } from "./navPermissions";
|
||||
function PlaceholderPage({ title }) {
|
||||
@@ -77,11 +81,15 @@ export default function App() {
|
||||
case "Home":
|
||||
return <HomePage />;
|
||||
case "Mitarbeiter":
|
||||
return <EmployeesPage />;
|
||||
return <EmployeesPage />;
|
||||
case "Kunden":
|
||||
return <FacilitiesPage />;
|
||||
case "Disposition":
|
||||
return <PlaceholderPage title="Disposition" />;
|
||||
return <OrdersPage />;
|
||||
case "Abwesenheiten":
|
||||
return <AbsencesPage />;
|
||||
case "Zeiterfassung":
|
||||
return <TimeEntriesPage />;
|
||||
case "Kalkulation":
|
||||
return <PlaceholderPage title="Kalkulation" />;
|
||||
case "Fahrzeuge":
|
||||
@@ -96,6 +104,8 @@ export default function App() {
|
||||
return <DebugSessionsPage />;
|
||||
case "Audit-Log":
|
||||
return <AuditLogPage />;
|
||||
case "Papierkorb":
|
||||
return <TrashPage />;
|
||||
default:
|
||||
return <HomePage />;
|
||||
}
|
||||
|
||||
@@ -4,14 +4,39 @@ export const NAV_MODULES = {
|
||||
Mitarbeiter: ModuleType.Employees,
|
||||
Kunden: ModuleType.Facilities,
|
||||
Disposition: ModuleType.Orders,
|
||||
Abwesenheiten: ModuleType.Absences,
|
||||
Zeiterfassung: ModuleType.TimeEntries,
|
||||
Rechnungen: ModuleType.Invoices,
|
||||
Controlling: ModuleType.Controlling,
|
||||
Einstellungen: ModuleType.UserManagement,
|
||||
Debug: ModuleType.UserManagement,
|
||||
"Audit-Log": ModuleType.AuditLog
|
||||
};
|
||||
|
||||
// Papierkorb hat kein eigenes Modul-Recht - sichtbar, sobald irgendein "Recover"-Recht auf einem
|
||||
// der Objekte mit Soft-Delete besteht (siehe TrashController in omsorgCore).
|
||||
export const TRASH_MODULES = [
|
||||
ModuleType.Employees,
|
||||
ModuleType.Facilities,
|
||||
ModuleType.Contracts,
|
||||
ModuleType.Orders,
|
||||
ModuleType.Absences,
|
||||
ModuleType.TimeEntries
|
||||
];
|
||||
|
||||
// Einstellungen bündelt drei unabhängige Rechte (siehe SettingsPage.jsx, die jeden Tab einzeln
|
||||
// gegen sein eigenes Modul prüft) - der Sidebar-Tab selbst ist sichtbar, sobald irgendeines davon
|
||||
// View gewährt, analog zum Papierkorb-Muster oben.
|
||||
export const SETTINGS_MODULES = [ModuleType.Users, ModuleType.UserManagement, ModuleType.Configuration];
|
||||
|
||||
export function isNavItemVisible(label, hasPermission) {
|
||||
if (label === "Papierkorb") {
|
||||
return TRASH_MODULES.some((module) => hasPermission(module, "Recover"));
|
||||
}
|
||||
|
||||
if (label === "Einstellungen") {
|
||||
return SETTINGS_MODULES.some((module) => hasPermission(module, "View"));
|
||||
}
|
||||
|
||||
const module = NAV_MODULES[label];
|
||||
return !module || hasPermission(module, "View");
|
||||
}
|
||||
|
||||
@@ -4,23 +4,69 @@ import { useEffect, useState } from "react";
|
||||
// Abschnitt "Konfigurierbare Auswahllisten") über window.omsorg.valueLists.listItems.
|
||||
// Ersetzt die früher hier hartcodierten Options-Arrays (Mitarbeiterstatus,
|
||||
// Beschäftigungsart, CRM-Status, Einrichtungstyp, ...).
|
||||
//
|
||||
// Modul-weiter Cache: dieselbe Liste wird oft von mehreren gleichzeitig
|
||||
// gemounteten Komponenten gebraucht (z.B. EmployeesPage + EmployeeForm) und
|
||||
// ändert sich fast nie (nur über die "Status-Verwaltung"). Ein kurzlebiger
|
||||
// TTL-Cache erspart wiederholte Netzwerk-Roundtrips bei jedem Seitenaufruf,
|
||||
// ohne echte Änderungen lange zu verzögern (siehe invalidateValueListCache).
|
||||
const CACHE_TTL_MS = 60_000;
|
||||
const cache = new Map(); // key -> { items, fetchedAt }
|
||||
const inflight = new Map(); // key -> Promise<items>
|
||||
|
||||
async function fetchItems(key) {
|
||||
let promise = inflight.get(key);
|
||||
if (!promise) {
|
||||
promise = window.omsorg.valueLists.listItems(key).then((result) => {
|
||||
const items = result.ok ? result.data ?? [] : [];
|
||||
cache.set(key, { items, fetchedAt: Date.now() });
|
||||
return items;
|
||||
}).finally(() => {
|
||||
inflight.delete(key);
|
||||
});
|
||||
inflight.set(key, promise);
|
||||
}
|
||||
return promise;
|
||||
}
|
||||
|
||||
function getCached(key) {
|
||||
const entry = cache.get(key);
|
||||
if (!entry) return undefined;
|
||||
if (Date.now() - entry.fetchedAt > CACHE_TTL_MS) return undefined;
|
||||
return entry.items;
|
||||
}
|
||||
|
||||
export function invalidateValueListCache(key) {
|
||||
if (key === undefined) {
|
||||
cache.clear();
|
||||
} else {
|
||||
cache.delete(key);
|
||||
}
|
||||
}
|
||||
|
||||
export function useValueListItems(key) {
|
||||
const [items, setItems] = useState([]);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const cached = getCached(key);
|
||||
const [items, setItems] = useState(cached ?? []);
|
||||
const [isLoading, setIsLoading] = useState(cached === undefined);
|
||||
|
||||
useEffect(() => {
|
||||
let cancelled = false;
|
||||
|
||||
async function load() {
|
||||
setIsLoading(true);
|
||||
const result = await window.omsorg.valueLists.listItems(key);
|
||||
if (!cancelled) {
|
||||
setItems(result.ok ? result.data ?? [] : []);
|
||||
setIsLoading(false);
|
||||
}
|
||||
const fresh = getCached(key);
|
||||
if (fresh !== undefined) {
|
||||
setItems(fresh);
|
||||
setIsLoading(false);
|
||||
return undefined;
|
||||
}
|
||||
|
||||
load();
|
||||
setIsLoading(true);
|
||||
fetchItems(key).then((result) => {
|
||||
if (!cancelled) {
|
||||
setItems(result);
|
||||
setIsLoading(false);
|
||||
}
|
||||
});
|
||||
|
||||
return () => {
|
||||
cancelled = true;
|
||||
};
|
||||
|
||||
@@ -10,7 +10,10 @@ import {
|
||||
BarChart3,
|
||||
Settings,
|
||||
Bug,
|
||||
ScrollText
|
||||
ScrollText,
|
||||
Trash2,
|
||||
CalendarOff,
|
||||
Clock
|
||||
} from "lucide-react";
|
||||
import { useAuth } from "../app/AuthContext";
|
||||
import { isNavItemVisible } from "../app/navPermissions";
|
||||
@@ -20,13 +23,16 @@ const menu = [
|
||||
{ icon: Users, label: "Mitarbeiter" },
|
||||
{ icon: Building2, label: "Kunden" },
|
||||
{ icon: CalendarDays, label: "Disposition" },
|
||||
{ icon: CalendarOff, label: "Abwesenheiten" },
|
||||
{ icon: Clock, label: "Zeiterfassung" },
|
||||
{ icon: Calculator, label: "Kalkulation" },
|
||||
{ icon: Car, label: "Fahrzeuge" },
|
||||
{ icon: FileText, label: "Rechnungen" },
|
||||
{ icon: BarChart3, label: "Controlling" },
|
||||
{ icon: Settings, label: "Einstellungen" },
|
||||
{ icon: Bug, label: "Debug" },
|
||||
{ icon: ScrollText, label: "Audit-Log" }
|
||||
{ icon: ScrollText, label: "Audit-Log" },
|
||||
{ icon: Trash2, label: "Papierkorb" }
|
||||
];
|
||||
|
||||
export default function Sidebar({
|
||||
|
||||
@@ -2,8 +2,13 @@ import React from "react";
|
||||
import { createRoot } from "react-dom/client";
|
||||
import App from "./app/app";
|
||||
import { AuthProvider } from "./app/AuthContext";
|
||||
import { buildOmsorgApi } from "./api/index.js";
|
||||
import "./style.css";
|
||||
|
||||
// Ersetzt electron/preload.cjs' contextBridge.exposeInMainWorld("omsorg", ...) - AuthContext.jsx
|
||||
// und alle src/modules/**-Aufrufstellen greifen unverändert auf window.omsorg zu.
|
||||
window.omsorg = buildOmsorgApi();
|
||||
|
||||
createRoot(document.getElementById("root")).render(
|
||||
<React.StrictMode>
|
||||
<AuthProvider>
|
||||
|
||||
@@ -0,0 +1,151 @@
|
||||
import { useState } from "react";
|
||||
import { Check, Pencil, X } from "lucide-react";
|
||||
|
||||
import OmsorgCard from "../../components/OmsorgCard";
|
||||
import OmsorgButton from "../../components/ui/OmsorgButton";
|
||||
import { useAuth } from "../../app/AuthContext";
|
||||
import { useValueListItems } from "../../app/useValueListItems";
|
||||
import EditAbsenceDialog from "./EditAbsenceDialog";
|
||||
|
||||
function formatDate(value) {
|
||||
if (!value) {
|
||||
return "—";
|
||||
}
|
||||
return new Date(value).toLocaleDateString("de-DE");
|
||||
}
|
||||
|
||||
export default function AbsenceDetailPanel({ absence, onChanged }) {
|
||||
const { hasPermission } = useAuth();
|
||||
const canDecide = hasPermission("Absences", "Approve");
|
||||
const canEdit = hasPermission("Absences", "Edit");
|
||||
const [adminNote, setAdminNote] = useState("");
|
||||
const [isSaving, setIsSaving] = useState(false);
|
||||
const [error, setError] = useState(null);
|
||||
const [isEditDialogOpen, setIsEditDialogOpen] = useState(false);
|
||||
const { items: statusItems } = useValueListItems("AbsenceStatus");
|
||||
|
||||
if (!absence) {
|
||||
return (
|
||||
<OmsorgCard>
|
||||
<div className="employee-detail-empty">
|
||||
<h2>Kein Antrag ausgewählt</h2>
|
||||
<p>Wähle links einen Antrag aus.</p>
|
||||
</div>
|
||||
</OmsorgCard>
|
||||
);
|
||||
}
|
||||
|
||||
// Nicht auf den Anzeigetext "Eingereicht" hartkodieren - der ist über die Status-Verwaltung
|
||||
// umbenennbar (siehe omsorgCore/CLAUDE.md, AbsenceService.GetInitialStatusValueAsync). Solange
|
||||
// die Liste noch lädt, gilt "nicht pending" (keine Aktionen anzeigen statt falsch-positiv).
|
||||
const initialStatus = statusItems.find((item) => item.isInitial)?.value;
|
||||
const isPending = absence.status === initialStatus;
|
||||
|
||||
async function handleDecision(status) {
|
||||
setIsSaving(true);
|
||||
setError(null);
|
||||
|
||||
const result = await window.omsorg.absences.decide(absence.id, { status, adminNote: adminNote.trim() || null });
|
||||
|
||||
setIsSaving(false);
|
||||
|
||||
if (!result.ok) {
|
||||
setError(result.status === 403 ? "Keine Berechtigung, diesen Antrag zu entscheiden." : "Entscheidung konnte nicht gespeichert werden.");
|
||||
return;
|
||||
}
|
||||
|
||||
setAdminNote("");
|
||||
onChanged?.(result.data);
|
||||
}
|
||||
|
||||
return (
|
||||
<OmsorgCard>
|
||||
<div className="employee-detail">
|
||||
<div className="employee-detail-header">
|
||||
<div>
|
||||
<h2>{absence.employeeName}</h2>
|
||||
<span className="omsorg-badge omsorg-badge--neutral">{absence.status}</span>
|
||||
</div>
|
||||
|
||||
{canEdit && isPending && (
|
||||
<OmsorgButton variant="secondary" icon={Pencil} onClick={() => setIsEditDialogOpen(true)}>
|
||||
Bearbeiten
|
||||
</OmsorgButton>
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="employee-detail-grid">
|
||||
<div>
|
||||
<strong>Art</strong>
|
||||
<p>{absence.type}</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<strong>Zeitraum</strong>
|
||||
<p>
|
||||
{formatDate(absence.startDate)} – {formatDate(absence.endDate)}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<strong>Grund</strong>
|
||||
<p>{absence.reason ?? "—"}</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<strong>Vertretung</strong>
|
||||
<p>{absence.substitute ?? "—"}</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<strong>Nachricht</strong>
|
||||
<p>{absence.note ?? "—"}</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<strong>Kommentar</strong>
|
||||
<p>{absence.adminNote ?? "—"}</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{canDecide && (
|
||||
<div className="form-grid">
|
||||
{!isPending && (
|
||||
<p style={{ color: "var(--omsorg-text-secondary)" }}>
|
||||
Bereits entschieden ({absence.status}) — hier lässt sich die Entscheidung bei Bedarf noch ändern.
|
||||
</p>
|
||||
)}
|
||||
|
||||
<label className="form-field">
|
||||
<span>Kommentar (optional)</span>
|
||||
<textarea value={adminNote} onChange={(event) => setAdminNote(event.target.value)} maxLength={500} />
|
||||
</label>
|
||||
|
||||
{error && <p className="login-error form-error">{error}</p>}
|
||||
|
||||
<div className="form-actions">
|
||||
<OmsorgButton variant="secondary" icon={X} disabled={isSaving} onClick={() => handleDecision("Abgelehnt")}>
|
||||
Ablehnen
|
||||
</OmsorgButton>
|
||||
|
||||
<OmsorgButton icon={Check} disabled={isSaving} onClick={() => handleDecision("Genehmigt")}>
|
||||
Genehmigen
|
||||
</OmsorgButton>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{isEditDialogOpen && (
|
||||
<EditAbsenceDialog
|
||||
absence={absence}
|
||||
onClose={() => setIsEditDialogOpen(false)}
|
||||
onUpdated={(updatedAbsence) => {
|
||||
setIsEditDialogOpen(false);
|
||||
onChanged?.(updatedAbsence);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
</OmsorgCard>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
import OmsorgButton from "../../components/ui/OmsorgButton";
|
||||
import { useValueListItems } from "../../app/useValueListItems";
|
||||
|
||||
export const emptyAbsenceForm = {
|
||||
type: "",
|
||||
startDate: "",
|
||||
endDate: "",
|
||||
reason: "",
|
||||
substitute: "",
|
||||
note: "",
|
||||
};
|
||||
|
||||
function toDateInputValue(value) {
|
||||
if (!value) {
|
||||
return "";
|
||||
}
|
||||
const date = value instanceof Date ? value : new Date(value);
|
||||
return Number.isNaN(date.getTime()) ? "" : date.toISOString().slice(0, 10);
|
||||
}
|
||||
|
||||
export function absenceToFormValues(absence) {
|
||||
return {
|
||||
type: absence.type ?? "",
|
||||
startDate: toDateInputValue(absence.startDate),
|
||||
endDate: toDateInputValue(absence.endDate),
|
||||
reason: absence.reason ?? "",
|
||||
substitute: absence.substitute ?? "",
|
||||
note: absence.note ?? "",
|
||||
};
|
||||
}
|
||||
|
||||
export function absenceFormToPayload(form) {
|
||||
return {
|
||||
type: form.type,
|
||||
startDate: form.startDate,
|
||||
endDate: form.endDate,
|
||||
reason: form.reason.trim() || null,
|
||||
substitute: form.substitute.trim() || null,
|
||||
note: form.note.trim() || null,
|
||||
};
|
||||
}
|
||||
|
||||
export default function AbsenceForm({ form, onChange }) {
|
||||
const { items: typeItems } = useValueListItems("AbsenceType");
|
||||
|
||||
function updateField(field) {
|
||||
return (event) => onChange({ ...form, [field]: event.target.value });
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="form-grid">
|
||||
<label className="form-field">
|
||||
<span>Art *</span>
|
||||
<select value={form.type} onChange={updateField("type")} required>
|
||||
<option value="">— auswählen —</option>
|
||||
{typeItems.map((option) => (
|
||||
<option key={option.id} value={option.value}>
|
||||
{option.value}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<div className="form-row">
|
||||
<label className="form-field">
|
||||
<span>Beginn *</span>
|
||||
<input type="date" value={form.startDate} onChange={updateField("startDate")} required />
|
||||
</label>
|
||||
|
||||
<label className="form-field">
|
||||
<span>Ende *</span>
|
||||
<input type="date" value={form.endDate} onChange={updateField("endDate")} required />
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<label className="form-field">
|
||||
<span>Grund (optional)</span>
|
||||
<input type="text" value={form.reason} onChange={updateField("reason")} maxLength={500} />
|
||||
</label>
|
||||
|
||||
<label className="form-field">
|
||||
<span>Vertretung (optional)</span>
|
||||
<input type="text" value={form.substitute} onChange={updateField("substitute")} maxLength={200} />
|
||||
</label>
|
||||
|
||||
<label className="form-field">
|
||||
<span>Nachricht (optional)</span>
|
||||
<textarea value={form.note} onChange={updateField("note")} maxLength={500} />
|
||||
</label>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function FormActions({ onCancel, isSaving, submitLabel }) {
|
||||
return (
|
||||
<div className="form-actions">
|
||||
<OmsorgButton variant="secondary" type="button" onClick={onCancel} disabled={isSaving}>
|
||||
Abbrechen
|
||||
</OmsorgButton>
|
||||
<OmsorgButton type="submit" disabled={isSaving}>
|
||||
{isSaving ? "Speichert..." : submitLabel}
|
||||
</OmsorgButton>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,184 @@
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { SlidersHorizontal } from "lucide-react";
|
||||
|
||||
import OmsorgCard from "../../components/OmsorgCard";
|
||||
import OmsorgButton from "../../components/ui/OmsorgButton";
|
||||
import OmsorgPagination from "../../components/ui/OmsorgPagination";
|
||||
import { useAuth } from "../../app/AuthContext";
|
||||
import { useValueListItems } from "../../app/useValueListItems";
|
||||
import AbsenceDetailPanel from "./AbsenceDetailPanel";
|
||||
|
||||
const PAGE_SIZE = 20;
|
||||
|
||||
export default function AbsencesPage() {
|
||||
const { hasPermission } = useAuth();
|
||||
const { items: statusOptions } = useValueListItems("AbsenceStatus");
|
||||
const { items: typeOptions } = useValueListItems("AbsenceType");
|
||||
|
||||
const [absences, setAbsences] = useState([]);
|
||||
const [totalCount, setTotalCount] = useState(0);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [error, setError] = useState(null);
|
||||
const [selectedAbsenceId, setSelectedAbsenceId] = useState(null);
|
||||
const [statusFilter, setStatusFilter] = useState("");
|
||||
const [typeFilter, setTypeFilter] = useState("");
|
||||
const [isFilterOpen, setIsFilterOpen] = useState(false);
|
||||
const [page, setPage] = useState(1);
|
||||
|
||||
useEffect(() => {
|
||||
setPage(1);
|
||||
}, [statusFilter, typeFilter]);
|
||||
|
||||
const loadAbsences = useCallback(async () => {
|
||||
setIsLoading(true);
|
||||
setError(null);
|
||||
|
||||
const result = await window.omsorg.absences.list({
|
||||
status: statusFilter || undefined,
|
||||
type: typeFilter || undefined,
|
||||
page,
|
||||
pageSize: PAGE_SIZE,
|
||||
});
|
||||
|
||||
if (result.ok) {
|
||||
const data = result.data ?? { items: [], totalCount: 0 };
|
||||
setAbsences(data.items ?? []);
|
||||
setTotalCount(data.totalCount ?? 0);
|
||||
setSelectedAbsenceId((current) =>
|
||||
(data.items ?? []).some((absence) => absence.id === current) ? current : data.items?.[0]?.id ?? null
|
||||
);
|
||||
} else {
|
||||
setError("Anträge konnten nicht geladen werden.");
|
||||
}
|
||||
|
||||
setIsLoading(false);
|
||||
}, [statusFilter, typeFilter, page]);
|
||||
|
||||
useEffect(() => {
|
||||
loadAbsences();
|
||||
}, [loadAbsences]);
|
||||
|
||||
const selectedAbsence = absences.find((absence) => absence.id === selectedAbsenceId) ?? null;
|
||||
const totalPages = Math.max(1, Math.ceil(totalCount / PAGE_SIZE));
|
||||
|
||||
function handleDecided() {
|
||||
loadAbsences();
|
||||
}
|
||||
|
||||
if (!hasPermission("Absences", "View")) {
|
||||
return (
|
||||
<OmsorgCard title="Abwesenheiten">
|
||||
<p>Keine Berechtigung, Abwesenheitsanträge einzusehen.</p>
|
||||
</OmsorgCard>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="employees-page">
|
||||
<div className="page-heading">
|
||||
<div>
|
||||
<p className="page-eyebrow">Personal</p>
|
||||
|
||||
<h1>Abwesenheiten</h1>
|
||||
|
||||
<p className="page-description">
|
||||
Urlaubs-, Krankmeldungs- und sonstige Abwesenheitsanträge des Außendienstes prüfen und entscheiden.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<OmsorgCard>
|
||||
<div className="employees-toolbar">
|
||||
<OmsorgButton
|
||||
variant="secondary"
|
||||
icon={SlidersHorizontal}
|
||||
onClick={() => setIsFilterOpen((open) => !open)}
|
||||
>
|
||||
Filter
|
||||
</OmsorgButton>
|
||||
</div>
|
||||
|
||||
{isFilterOpen && (
|
||||
<div className="employees-filter-panel">
|
||||
<label className="form-field">
|
||||
<span>Status</span>
|
||||
<select value={statusFilter} onChange={(event) => setStatusFilter(event.target.value)}>
|
||||
<option value="">Alle</option>
|
||||
{statusOptions.map((option) => (
|
||||
<option key={option.id} value={option.value}>
|
||||
{option.value}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
|
||||
<label className="form-field">
|
||||
<span>Art</span>
|
||||
<select value={typeFilter} onChange={(event) => setTypeFilter(event.target.value)}>
|
||||
<option value="">Alle</option>
|
||||
{typeOptions.map((option) => (
|
||||
<option key={option.id} value={option.value}>
|
||||
{option.value}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
</div>
|
||||
)}
|
||||
</OmsorgCard>
|
||||
|
||||
{error && <p className="login-error">{error}</p>}
|
||||
{isLoading && <p>Lädt...</p>}
|
||||
|
||||
{!isLoading && (
|
||||
<div className="employees-layout">
|
||||
<div className="employees-list">
|
||||
{absences.map((absence) => {
|
||||
const isSelected = absence.id === selectedAbsenceId;
|
||||
|
||||
return (
|
||||
<button
|
||||
key={absence.id}
|
||||
type="button"
|
||||
className={
|
||||
isSelected ? "employee-list-button employee-list-button--active" : "employee-list-button"
|
||||
}
|
||||
onClick={() => setSelectedAbsenceId(absence.id)}
|
||||
>
|
||||
<OmsorgCard>
|
||||
<div className="employee-row">
|
||||
<div className="employee-main">
|
||||
<strong>{absence.employeeName}</strong>
|
||||
<span> — {absence.type}</span>
|
||||
</div>
|
||||
|
||||
<div className="employee-status">
|
||||
<span className="omsorg-badge omsorg-badge--neutral">{absence.status}</span>
|
||||
</div>
|
||||
</div>
|
||||
</OmsorgCard>
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
|
||||
{absences.length === 0 && (
|
||||
<OmsorgCard>
|
||||
<div className="employees-empty-state">
|
||||
<strong>Keinen Antrag gefunden</strong>
|
||||
|
||||
<span>Prüfe die eingestellten Filter.</span>
|
||||
</div>
|
||||
</OmsorgCard>
|
||||
)}
|
||||
|
||||
{absences.length > 0 && (
|
||||
<OmsorgPagination page={page} totalPages={totalPages} onPageChange={setPage} />
|
||||
)}
|
||||
</div>
|
||||
|
||||
<AbsenceDetailPanel absence={selectedAbsence} onChanged={handleDecided} />
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
import { useState } from "react";
|
||||
|
||||
import AbsenceForm, { absenceFormToPayload, absenceToFormValues, FormActions } from "./AbsenceForm";
|
||||
import ModalPortal from "../../components/ui/ModalPortal";
|
||||
|
||||
function errorMessage(result) {
|
||||
if (result.status === 403) {
|
||||
return "Keine Berechtigung, diesen Antrag zu bearbeiten.";
|
||||
}
|
||||
if (result.status === 400) {
|
||||
return typeof result.data === "string" ? result.data : "Eingaben prüfen.";
|
||||
}
|
||||
return "Antrag konnte nicht gespeichert werden.";
|
||||
}
|
||||
|
||||
export default function EditAbsenceDialog({ absence, onClose, onUpdated }) {
|
||||
const [form, setForm] = useState(() => absenceToFormValues(absence));
|
||||
const [isSaving, setIsSaving] = useState(false);
|
||||
const [error, setError] = useState(null);
|
||||
|
||||
async function handleSubmit(event) {
|
||||
event.preventDefault();
|
||||
|
||||
if (!form.type || !form.startDate || !form.endDate) {
|
||||
setError("Art, Beginn und Ende sind erforderlich.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (form.endDate < form.startDate) {
|
||||
setError("Das Ende darf nicht vor dem Beginn liegen.");
|
||||
return;
|
||||
}
|
||||
|
||||
setIsSaving(true);
|
||||
setError(null);
|
||||
|
||||
const result = await window.omsorg.absences.update(absence.id, absenceFormToPayload(form));
|
||||
|
||||
setIsSaving(false);
|
||||
|
||||
if (!result.ok) {
|
||||
setError(errorMessage(result));
|
||||
return;
|
||||
}
|
||||
|
||||
onUpdated(result.data);
|
||||
}
|
||||
|
||||
return (
|
||||
<ModalPortal>
|
||||
<div className="modal-overlay" role="dialog" aria-modal="true" aria-label="Antrag bearbeiten">
|
||||
<div className="modal-panel">
|
||||
<h2>Antrag bearbeiten</h2>
|
||||
|
||||
<form onSubmit={handleSubmit}>
|
||||
<AbsenceForm form={form} onChange={setForm} />
|
||||
|
||||
{error && <p className="login-error form-error">{error}</p>}
|
||||
|
||||
<FormActions onCancel={onClose} isSaving={isSaving} submitLabel="Speichern" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</ModalPortal>
|
||||
);
|
||||
}
|
||||
@@ -33,7 +33,7 @@ function categoryLabel(category) {
|
||||
// Bearbeiten-/Löschen-Aktionen (siehe omsorgCore/CLAUDE.md, Abschnitt "Audit-Log").
|
||||
export default function AuditLogPage() {
|
||||
const { hasPermission } = useAuth();
|
||||
const canViewActor = hasPermission("UserManagement", "View");
|
||||
const canViewActor = hasPermission("Users", "View");
|
||||
|
||||
const [entries, setEntries] = useState([]);
|
||||
const [totalCount, setTotalCount] = useState(0);
|
||||
|
||||
@@ -24,6 +24,8 @@ export default function ForgotPasswordUsernamePage({ onNext, onBackToLogin }) {
|
||||
|
||||
if (result.status === "sent") {
|
||||
onNext(username);
|
||||
} else if (result.status === "email_unavailable") {
|
||||
setError("Der E-Mail-Versand ist gerade nicht verfügbar. Bitte später erneut versuchen oder einen Administrator kontaktieren.");
|
||||
} else {
|
||||
setCannotReset(true);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,12 @@ export default function DebugSessionsPage() {
|
||||
setTestEmailResult(
|
||||
result.ok
|
||||
? { ok: true, message: `Testmail an ${testEmailAddress} ausgelöst.` }
|
||||
: { ok: false, message: "Testmail konnte nicht versendet werden." }
|
||||
: {
|
||||
ok: false,
|
||||
message: result.data?.message
|
||||
? `Testmail konnte nicht versendet werden: ${result.data.message}`
|
||||
: "Testmail konnte nicht versendet werden.",
|
||||
}
|
||||
);
|
||||
setIsSendingTestEmail(false);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,159 @@
|
||||
import OmsorgButton from "../../components/ui/OmsorgButton";
|
||||
import { useValueListItems } from "../../app/useValueListItems";
|
||||
|
||||
export const emptyContractForm = {
|
||||
contractType: "",
|
||||
startDate: "",
|
||||
endDate: "",
|
||||
status: "",
|
||||
weeklyHours: "",
|
||||
hourlyWage: "",
|
||||
allowancesDescription: "",
|
||||
overtimeRules: "",
|
||||
vacationDaysPerYear: "",
|
||||
probationPeriodMonths: "",
|
||||
};
|
||||
|
||||
export function contractToFormValues(contract) {
|
||||
return {
|
||||
contractType: contract.contractType ?? "",
|
||||
startDate: contract.startDate ?? "",
|
||||
endDate: contract.endDate ?? "",
|
||||
status: contract.status ?? "",
|
||||
weeklyHours: contract.weeklyHours ?? "",
|
||||
hourlyWage: contract.hourlyWage ?? "",
|
||||
allowancesDescription: contract.allowancesDescription ?? "",
|
||||
overtimeRules: contract.overtimeRules ?? "",
|
||||
vacationDaysPerYear: contract.vacationDaysPerYear ?? "",
|
||||
probationPeriodMonths: contract.probationPeriodMonths ?? "",
|
||||
};
|
||||
}
|
||||
|
||||
export function contractFormToPayload(form, { employeeId, includeStatus = false } = {}) {
|
||||
const payload = {
|
||||
contractType: form.contractType,
|
||||
employeeId,
|
||||
facilityId: null,
|
||||
startDate: form.startDate,
|
||||
endDate: form.endDate || null,
|
||||
weeklyHours: form.weeklyHours === "" ? null : Number(form.weeklyHours),
|
||||
hourlyWage: form.hourlyWage === "" ? null : Number(form.hourlyWage),
|
||||
allowancesDescription: form.allowancesDescription.trim() || null,
|
||||
overtimeRules: form.overtimeRules.trim() || null,
|
||||
vacationDaysPerYear: form.vacationDaysPerYear === "" ? null : Number(form.vacationDaysPerYear),
|
||||
probationPeriodMonths: form.probationPeriodMonths === "" ? null : Number(form.probationPeriodMonths),
|
||||
};
|
||||
|
||||
if (includeStatus) {
|
||||
payload.status = form.status;
|
||||
}
|
||||
|
||||
return payload;
|
||||
}
|
||||
|
||||
export default function ContractForm({ form, onChange, includeStatus = false }) {
|
||||
const { items: contractTypes } = useValueListItems("ContractType");
|
||||
const { items: contractStatuses } = useValueListItems("ContractStatus");
|
||||
|
||||
function updateField(field) {
|
||||
return (event) => onChange({ ...form, [field]: event.target.value });
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="form-grid">
|
||||
<label className="form-field">
|
||||
<span>Vertragstyp *</span>
|
||||
<select value={form.contractType} onChange={updateField("contractType")} required>
|
||||
<option value="">— auswählen —</option>
|
||||
{contractTypes.map((option) => (
|
||||
<option key={option.id} value={option.value}>
|
||||
{option.value}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
|
||||
{includeStatus && (
|
||||
<label className="form-field">
|
||||
<span>Status</span>
|
||||
<select value={form.status} onChange={updateField("status")}>
|
||||
{contractStatuses.map((option) => (
|
||||
<option key={option.id} value={option.value}>
|
||||
{option.value}
|
||||
</option>
|
||||
))}
|
||||
</select>
|
||||
</label>
|
||||
)}
|
||||
|
||||
<div className="form-row">
|
||||
<label className="form-field">
|
||||
<span>Beginn *</span>
|
||||
<input type="date" value={form.startDate} onChange={updateField("startDate")} required />
|
||||
</label>
|
||||
|
||||
<label className="form-field">
|
||||
<span>Ende</span>
|
||||
<input type="date" value={form.endDate} onChange={updateField("endDate")} />
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<div className="form-row">
|
||||
<label className="form-field">
|
||||
<span>Arbeitszeit (Std./Woche)</span>
|
||||
<input type="number" min="0" step="0.5" value={form.weeklyHours} onChange={updateField("weeklyHours")} />
|
||||
</label>
|
||||
|
||||
<label className="form-field">
|
||||
<span>Stundenlohn (€)</span>
|
||||
<input type="number" min="0" step="0.01" value={form.hourlyWage} onChange={updateField("hourlyWage")} />
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<label className="form-field">
|
||||
<span>Zuschläge</span>
|
||||
<input value={form.allowancesDescription} onChange={updateField("allowancesDescription")} />
|
||||
</label>
|
||||
|
||||
<label className="form-field">
|
||||
<span>Überstundenregelung</span>
|
||||
<input value={form.overtimeRules} onChange={updateField("overtimeRules")} />
|
||||
</label>
|
||||
|
||||
<div className="form-row">
|
||||
<label className="form-field">
|
||||
<span>Urlaubsanspruch (Tage/Jahr)</span>
|
||||
<input
|
||||
type="number"
|
||||
min="0"
|
||||
value={form.vacationDaysPerYear}
|
||||
onChange={updateField("vacationDaysPerYear")}
|
||||
/>
|
||||
</label>
|
||||
|
||||
<label className="form-field">
|
||||
<span>Probezeit (Monate)</span>
|
||||
<input
|
||||
type="number"
|
||||
min="0"
|
||||
value={form.probationPeriodMonths}
|
||||
onChange={updateField("probationPeriodMonths")}
|
||||
/>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export function FormActions({ onCancel, isSaving, submitLabel }) {
|
||||
return (
|
||||
<div className="form-actions">
|
||||
<OmsorgButton variant="secondary" type="button" onClick={onCancel} disabled={isSaving}>
|
||||
Abbrechen
|
||||
</OmsorgButton>
|
||||
<OmsorgButton type="submit" disabled={isSaving}>
|
||||
{isSaving ? "Speichert..." : submitLabel}
|
||||
</OmsorgButton>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,154 @@
|
||||
import { useCallback, useEffect, useState } from "react";
|
||||
import { Pencil, Plus, Trash2 } from "lucide-react";
|
||||
|
||||
import OmsorgButton from "../../components/ui/OmsorgButton";
|
||||
import { useAuth } from "../../app/AuthContext";
|
||||
import CreateContractDialog from "./CreateContractDialog";
|
||||
import EditContractDialog from "./EditContractDialog";
|
||||
|
||||
function formatDate(value) {
|
||||
if (!value) return "—";
|
||||
return new Date(value).toLocaleDateString("de-DE");
|
||||
}
|
||||
|
||||
function formatPeriod(contract) {
|
||||
return `${formatDate(contract.startDate)} – ${contract.endDate ? formatDate(contract.endDate) : "unbefristet"}`;
|
||||
}
|
||||
|
||||
export default function ContractsList({ employeeId }) {
|
||||
const { hasPermission } = useAuth();
|
||||
const canCreate = hasPermission("Contracts", "Create");
|
||||
const canEdit = hasPermission("Contracts", "Edit");
|
||||
const canDelete = hasPermission("Contracts", "Delete");
|
||||
|
||||
const [contracts, setContracts] = useState([]);
|
||||
const [isLoading, setIsLoading] = useState(true);
|
||||
const [error, setError] = useState(null);
|
||||
const [isDialogOpen, setIsDialogOpen] = useState(false);
|
||||
const [editingContract, setEditingContract] = useState(null);
|
||||
const [deletingContractId, setDeletingContractId] = useState(null);
|
||||
|
||||
const loadContracts = useCallback(async () => {
|
||||
setIsLoading(true);
|
||||
setError(null);
|
||||
|
||||
const result = await window.omsorg.contracts.list({ employeeId, pageSize: 100 });
|
||||
|
||||
if (result.ok) {
|
||||
setContracts(result.data?.items ?? []);
|
||||
} else {
|
||||
setError("Verträge konnten nicht geladen werden.");
|
||||
}
|
||||
|
||||
setIsLoading(false);
|
||||
}, [employeeId]);
|
||||
|
||||
useEffect(() => {
|
||||
loadContracts();
|
||||
}, [loadContracts]);
|
||||
|
||||
function handleCreated() {
|
||||
setIsDialogOpen(false);
|
||||
loadContracts();
|
||||
}
|
||||
|
||||
function handleUpdated() {
|
||||
setEditingContract(null);
|
||||
loadContracts();
|
||||
}
|
||||
|
||||
async function handleDelete(contract) {
|
||||
if (!window.confirm(`Vertrag "${contract.contractType}" wirklich löschen?`)) {
|
||||
return;
|
||||
}
|
||||
|
||||
setDeletingContractId(contract.id);
|
||||
const result = await window.omsorg.contracts.delete(contract.id);
|
||||
setDeletingContractId(null);
|
||||
|
||||
if (result.ok) {
|
||||
loadContracts();
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="employee-tab-content">
|
||||
<div className="page-heading">
|
||||
<h3>Verträge</h3>
|
||||
|
||||
{canCreate && (
|
||||
<OmsorgButton icon={Plus} variant="secondary" onClick={() => setIsDialogOpen(true)}>
|
||||
Neuer Vertrag
|
||||
</OmsorgButton>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{error && <p className="login-error">{error}</p>}
|
||||
{isLoading && <p>Lädt...</p>}
|
||||
|
||||
{!isLoading && contracts.length === 0 && <p>Noch kein Vertrag erfasst.</p>}
|
||||
|
||||
{!isLoading && contracts.length > 0 && (
|
||||
<div className="facility-contacts-list">
|
||||
{contracts.map((contract) => (
|
||||
<div key={contract.id} className="facility-contact-row">
|
||||
<div>
|
||||
<strong>{contract.contractType}</strong>
|
||||
<span className="omsorg-badge omsorg-badge--neutral"> {contract.status}</span>
|
||||
<p>{formatPeriod(contract)}</p>
|
||||
<p>
|
||||
{[
|
||||
contract.weeklyHours != null ? `${contract.weeklyHours} Std./Woche` : null,
|
||||
contract.hourlyWage != null ? `${contract.hourlyWage} €/Std.` : null,
|
||||
]
|
||||
.filter(Boolean)
|
||||
.join(" · ") || "—"}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
{canEdit && (
|
||||
<OmsorgButton
|
||||
variant="secondary"
|
||||
icon={Pencil}
|
||||
onClick={() => setEditingContract(contract)}
|
||||
>
|
||||
Bearbeiten
|
||||
</OmsorgButton>
|
||||
)}
|
||||
|
||||
{canDelete && (
|
||||
<OmsorgButton
|
||||
variant="secondary"
|
||||
icon={Trash2}
|
||||
onClick={() => handleDelete(contract)}
|
||||
disabled={deletingContractId === contract.id}
|
||||
>
|
||||
Löschen
|
||||
</OmsorgButton>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{isDialogOpen && (
|
||||
<CreateContractDialog
|
||||
employeeId={employeeId}
|
||||
onClose={() => setIsDialogOpen(false)}
|
||||
onCreated={handleCreated}
|
||||
/>
|
||||
)}
|
||||
|
||||
{editingContract && (
|
||||
<EditContractDialog
|
||||
employeeId={employeeId}
|
||||
contract={editingContract}
|
||||
onClose={() => setEditingContract(null)}
|
||||
onUpdated={handleUpdated}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
import { useState } from "react";
|
||||
|
||||
import ContractForm, { emptyContractForm, contractFormToPayload, FormActions } from "./ContractForm";
|
||||
import ModalPortal from "../../components/ui/ModalPortal";
|
||||
|
||||
function errorMessage(result) {
|
||||
if (result.status === 403) {
|
||||
return "Keine Berechtigung, Verträge anzulegen.";
|
||||
}
|
||||
if (result.status === 400) {
|
||||
return typeof result.data === "string" ? result.data : "Eingaben prüfen.";
|
||||
}
|
||||
return "Vertrag konnte nicht angelegt werden.";
|
||||
}
|
||||
|
||||
export default function CreateContractDialog({ employeeId, onClose, onCreated }) {
|
||||
const [form, setForm] = useState(emptyContractForm);
|
||||
const [isSaving, setIsSaving] = useState(false);
|
||||
const [error, setError] = useState(null);
|
||||
|
||||
async function handleSubmit(event) {
|
||||
event.preventDefault();
|
||||
|
||||
if (!form.contractType) {
|
||||
setError("Vertragstyp ist erforderlich.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (!form.startDate) {
|
||||
setError("Beginn ist erforderlich.");
|
||||
return;
|
||||
}
|
||||
|
||||
setIsSaving(true);
|
||||
setError(null);
|
||||
|
||||
const result = await window.omsorg.contracts.create(contractFormToPayload(form, { employeeId }));
|
||||
|
||||
setIsSaving(false);
|
||||
|
||||
if (!result.ok) {
|
||||
setError(errorMessage(result));
|
||||
return;
|
||||
}
|
||||
|
||||
onCreated(result.data);
|
||||
}
|
||||
|
||||
return (
|
||||
<ModalPortal>
|
||||
<div className="modal-overlay" role="dialog" aria-modal="true" aria-label="Neuer Vertrag">
|
||||
<div className="modal-panel">
|
||||
<h2>Neuer Vertrag</h2>
|
||||
|
||||
<form onSubmit={handleSubmit}>
|
||||
<ContractForm form={form} onChange={setForm} />
|
||||
|
||||
{error && <p className="login-error form-error">{error}</p>}
|
||||
|
||||
<FormActions onCancel={onClose} isSaving={isSaving} submitLabel="Speichern" />
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</ModalPortal>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import { X } from "lucide-react";
|
||||
|
||||
import ModalPortal from "../../components/ui/ModalPortal";
|
||||
|
||||
export default function DocumentViewerDialog({ doc, onClose }) {
|
||||
const [objectUrl, setObjectUrl] = useState(null);
|
||||
const [error, setError] = useState(null);
|
||||
|
||||
useEffect(() => {
|
||||
let url = null;
|
||||
let cancelled = false;
|
||||
|
||||
async function load() {
|
||||
try {
|
||||
const result = await window.omsorg.documents.view(doc.id);
|
||||
|
||||
if (cancelled) return;
|
||||
|
||||
if (!result.ok) {
|
||||
setError("Dokument konnte nicht geladen werden.");
|
||||
return;
|
||||
}
|
||||
|
||||
url = URL.createObjectURL(result.data.blob);
|
||||
setObjectUrl(url);
|
||||
} catch (err) {
|
||||
if (!cancelled) {
|
||||
setError(`Dokument konnte nicht geladen werden: ${err.message}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
load();
|
||||
|
||||
return () => {
|
||||
cancelled = true;
|
||||
if (url) {
|
||||
URL.revokeObjectURL(url);
|
||||
}
|
||||
};
|
||||
}, [doc.id, doc.contentType]);
|
||||
|
||||
function renderContent() {
|
||||
if (error) {
|
||||
return <p className="login-error">{error}</p>;
|
||||
}
|
||||
|
||||
if (!objectUrl) {
|
||||
return <p>Lädt...</p>;
|
||||
}
|
||||
|
||||
if (doc.contentType === "application/pdf") {
|
||||
return <iframe src={objectUrl} title={doc.fileName} className="document-viewer-content" />;
|
||||
}
|
||||
|
||||
if (doc.contentType?.startsWith("image/")) {
|
||||
return <img src={objectUrl} alt={doc.fileName} className="document-viewer-content document-viewer-content--image" />;
|
||||
}
|
||||
|
||||
return <p>Keine Vorschau verfügbar, bitte herunterladen.</p>;
|
||||
}
|
||||
|
||||
return (
|
||||
<ModalPortal>
|
||||
<div className="modal-overlay" role="dialog" aria-modal="true" aria-label={`Vorschau: ${doc.fileName}`}>
|
||||
<div className="modal-panel modal-panel--viewer">
|
||||
<button type="button" className="modal-close-button" onClick={onClose} aria-label="Schließen">
|
||||
<X size={20} />
|
||||
</button>
|
||||
|
||||
<h2>{doc.fileName}</h2>
|
||||
|
||||
<div className="document-viewer-body">{renderContent()}</div>
|
||||
</div>
|
||||
</div>
|
||||
</ModalPortal>
|
||||
);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user