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>
57 lines
2.0 KiB
JavaScript
57 lines
2.0 KiB
JavaScript
const { ValueListsApi } = require('omsorgcore-client-ts');
|
|
const { configFor, callApi } = require('./apiClientHelpers.cjs');
|
|
|
|
// 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) {
|
|
const api = new ValueListsApi(configFor(accessToken));
|
|
return callApi(api.apiValueListsGetRaw());
|
|
}
|
|
|
|
async function listItems(accessToken, key) {
|
|
const api = new ValueListsApi(configFor(accessToken));
|
|
return callApi(api.apiValueListsKeyItemsGetRaw({ key }));
|
|
}
|
|
|
|
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) {
|
|
const api = new ValueListsApi(configFor(accessToken));
|
|
return callApi(api.apiValueListsKeyItemsIdPutRaw({ key, id, updateValueListItemRequest: payload }));
|
|
}
|
|
|
|
async function deleteItem(accessToken, key, id) {
|
|
const api = new ValueListsApi(configFor(accessToken));
|
|
return callApi(api.apiValueListsKeyItemsIdDeleteRaw({ key, id }));
|
|
}
|
|
|
|
async function getUsages(accessToken, key, id) {
|
|
const api = new ValueListsApi(configFor(accessToken));
|
|
return callApi(api.apiValueListsKeyItemsIdUsagesGetRaw({ key, id }));
|
|
}
|
|
|
|
async function listTransitions(accessToken, key) {
|
|
const api = new ValueListsApi(configFor(accessToken));
|
|
return callApi(api.apiValueListsKeyTransitionsGetRaw({ key }));
|
|
}
|
|
|
|
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
|
|
};
|