Add facilities, contracts, orders, value lists, audit log, and desktop app modules
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>
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
ee74ed65f5
commit
e9e96a57dc
@@ -1,28 +1,27 @@
|
||||
const { request } = require('./httpClient.cjs');
|
||||
const { EmployeesApi } = require('omsorgcore-client-ts');
|
||||
const { configFor, callApi } = require('./apiClientHelpers.cjs');
|
||||
|
||||
// Kapselt /api/employees von omsorgCore (EmployeesController). Feldnamen sind
|
||||
// camelCase, da ASP.NET Core standardmäßig camelCase-JSON ausgibt.
|
||||
// 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 } = {}) {
|
||||
const params = new URLSearchParams();
|
||||
if (search) params.set('search', search);
|
||||
if (status) params.set('status', status);
|
||||
if (employmentType) params.set('employmentType', employmentType);
|
||||
params.set('page', page);
|
||||
params.set('pageSize', pageSize);
|
||||
|
||||
return request('GET', `/api/employees?${params.toString()}`, { accessToken });
|
||||
const api = new EmployeesApi(configFor(accessToken));
|
||||
return callApi(api.apiEmployeesGetRaw({ search, status, employmentType, page, pageSize }));
|
||||
}
|
||||
|
||||
async function createEmployee(accessToken, payload) {
|
||||
return request('POST', '/api/employees', { body: payload, accessToken });
|
||||
const api = new EmployeesApi(configFor(accessToken));
|
||||
return callApi(api.apiEmployeesPostRaw({ createEmployeeRequest: payload }));
|
||||
}
|
||||
|
||||
async function getEmployee(accessToken, id) {
|
||||
return request('GET', `/api/employees/${id}`, { accessToken });
|
||||
const api = new EmployeesApi(configFor(accessToken));
|
||||
return callApi(api.apiEmployeesIdGetRaw({ id }));
|
||||
}
|
||||
|
||||
async function updateEmployee(accessToken, id, payload) {
|
||||
return request('PUT', `/api/employees/${id}`, { body: payload, accessToken });
|
||||
const api = new EmployeesApi(configFor(accessToken));
|
||||
return callApi(api.apiEmployeesIdPutRaw({ id, updateEmployeeRequest: payload }));
|
||||
}
|
||||
|
||||
module.exports = { listEmployees, createEmployee, getEmployee, updateEmployee };
|
||||
|
||||
Reference in New Issue
Block a user