Extends omsorgCore with full CRUD for Facility/Contract/Order plus configurable value lists and an audit trail, and wires the omsorgapp frontend up to the new facilities, settings, and audit-log modules; includes a sidebar active-nav-item highlight. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
248 lines
8.2 KiB
TypeScript
248 lines
8.2 KiB
TypeScript
/* 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 {
|
|
ContractResponse,
|
|
ContractResponsePagedResponse,
|
|
CreateContractRequest,
|
|
UpdateContractRequest,
|
|
} from '../models/index';
|
|
import {
|
|
ContractResponseFromJSON,
|
|
ContractResponseToJSON,
|
|
ContractResponsePagedResponseFromJSON,
|
|
ContractResponsePagedResponseToJSON,
|
|
CreateContractRequestFromJSON,
|
|
CreateContractRequestToJSON,
|
|
UpdateContractRequestFromJSON,
|
|
UpdateContractRequestToJSON,
|
|
} from '../models/index';
|
|
|
|
export interface ApiContractsGetRequest {
|
|
search?: string;
|
|
status?: string;
|
|
employeeId?: string;
|
|
facilityId?: string;
|
|
page?: number;
|
|
pageSize?: number;
|
|
}
|
|
|
|
export interface ApiContractsIdGetRequest {
|
|
id: string;
|
|
}
|
|
|
|
export interface ApiContractsIdPutRequest {
|
|
id: string;
|
|
updateContractRequest?: UpdateContractRequest;
|
|
}
|
|
|
|
export interface ApiContractsPostRequest {
|
|
createContractRequest?: CreateContractRequest;
|
|
}
|
|
|
|
/**
|
|
*
|
|
*/
|
|
export class ContractsApi extends runtime.BaseAPI {
|
|
|
|
/**
|
|
*/
|
|
async apiContractsGetRaw(requestParameters: ApiContractsGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ContractResponsePagedResponse>> {
|
|
const queryParameters: any = {};
|
|
|
|
if (requestParameters['search'] != null) {
|
|
queryParameters['search'] = requestParameters['search'];
|
|
}
|
|
|
|
if (requestParameters['status'] != null) {
|
|
queryParameters['status'] = requestParameters['status'];
|
|
}
|
|
|
|
if (requestParameters['employeeId'] != null) {
|
|
queryParameters['employeeId'] = requestParameters['employeeId'];
|
|
}
|
|
|
|
if (requestParameters['facilityId'] != null) {
|
|
queryParameters['facilityId'] = requestParameters['facilityId'];
|
|
}
|
|
|
|
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/contracts`;
|
|
|
|
const response = await this.request({
|
|
path: urlPath,
|
|
method: 'GET',
|
|
headers: headerParameters,
|
|
query: queryParameters,
|
|
}, initOverrides);
|
|
|
|
return new runtime.JSONApiResponse(response, (jsonValue) => ContractResponsePagedResponseFromJSON(jsonValue));
|
|
}
|
|
|
|
/**
|
|
*/
|
|
async apiContractsGet(requestParameters: ApiContractsGetRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ContractResponsePagedResponse> {
|
|
const response = await this.apiContractsGetRaw(requestParameters, initOverrides);
|
|
return await response.value();
|
|
}
|
|
|
|
/**
|
|
*/
|
|
async apiContractsIdGetRaw(requestParameters: ApiContractsIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ContractResponse>> {
|
|
if (requestParameters['id'] == null) {
|
|
throw new runtime.RequiredError(
|
|
'id',
|
|
'Required parameter "id" was null or undefined when calling apiContractsIdGet().'
|
|
);
|
|
}
|
|
|
|
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: 'GET',
|
|
headers: headerParameters,
|
|
query: queryParameters,
|
|
}, initOverrides);
|
|
|
|
return new runtime.JSONApiResponse(response, (jsonValue) => ContractResponseFromJSON(jsonValue));
|
|
}
|
|
|
|
/**
|
|
*/
|
|
async apiContractsIdGet(requestParameters: ApiContractsIdGetRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ContractResponse> {
|
|
const response = await this.apiContractsIdGetRaw(requestParameters, initOverrides);
|
|
return await response.value();
|
|
}
|
|
|
|
/**
|
|
*/
|
|
async apiContractsIdPutRaw(requestParameters: ApiContractsIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ContractResponse>> {
|
|
if (requestParameters['id'] == null) {
|
|
throw new runtime.RequiredError(
|
|
'id',
|
|
'Required parameter "id" was null or undefined when calling apiContractsIdPut().'
|
|
);
|
|
}
|
|
|
|
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/contracts/{id}`;
|
|
urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
|
|
|
|
const response = await this.request({
|
|
path: urlPath,
|
|
method: 'PUT',
|
|
headers: headerParameters,
|
|
query: queryParameters,
|
|
body: UpdateContractRequestToJSON(requestParameters['updateContractRequest']),
|
|
}, initOverrides);
|
|
|
|
return new runtime.JSONApiResponse(response, (jsonValue) => ContractResponseFromJSON(jsonValue));
|
|
}
|
|
|
|
/**
|
|
*/
|
|
async apiContractsIdPut(requestParameters: ApiContractsIdPutRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ContractResponse> {
|
|
const response = await this.apiContractsIdPutRaw(requestParameters, initOverrides);
|
|
return await response.value();
|
|
}
|
|
|
|
/**
|
|
*/
|
|
async apiContractsPostRaw(requestParameters: ApiContractsPostRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ContractResponse>> {
|
|
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/contracts`;
|
|
|
|
const response = await this.request({
|
|
path: urlPath,
|
|
method: 'POST',
|
|
headers: headerParameters,
|
|
query: queryParameters,
|
|
body: CreateContractRequestToJSON(requestParameters['createContractRequest']),
|
|
}, initOverrides);
|
|
|
|
return new runtime.JSONApiResponse(response, (jsonValue) => ContractResponseFromJSON(jsonValue));
|
|
}
|
|
|
|
/**
|
|
*/
|
|
async apiContractsPost(requestParameters: ApiContractsPostRequest = {}, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ContractResponse> {
|
|
const response = await this.apiContractsPostRaw(requestParameters, initOverrides);
|
|
return await response.value();
|
|
}
|
|
|
|
}
|