From a70bbbfe6ac8f31942b6e3410372ca415f638160 Mon Sep 17 00:00:00 2001 From: Stef Winterswijk Date: Tue, 6 Feb 2024 09:50:29 +0100 Subject: [PATCH 1/4] Generate types --- public/mockServiceWorker.js | 13 +- src/api/fetchers.msw.ts | 2654 +++++++++++++-- src/api/fetchers.schemas.ts | 613 +++- src/api/fetchers.ts | 6278 +++++++++++++++++++++++++---------- 4 files changed, 7380 insertions(+), 2178 deletions(-) diff --git a/public/mockServiceWorker.js b/public/mockServiceWorker.js index 8b96a421..e369128e 100644 --- a/public/mockServiceWorker.js +++ b/public/mockServiceWorker.js @@ -2,13 +2,13 @@ /* tslint:disable */ /** - * Mock Service Worker (2.0.6). + * Mock Service Worker (2.0.11). * @see https://github.com/mswjs/msw * - Please do NOT modify this file. * - Please do NOT serve this file on production. */ -const INTEGRITY_CHECKSUM = '0877fcdc026242810f5bfde0d7178db4' +const INTEGRITY_CHECKSUM = 'c5f7f8e188b673ea4e677df7ea3c5a39' const IS_MOCKED_RESPONSE = Symbol('isMockedResponse') const activeClientIds = new Set() @@ -121,11 +121,6 @@ async function handleRequest(event, requestId) { if (client && activeClientIds.has(client.id)) { ;(async function () { const responseClone = response.clone() - // When performing original requests, response body will - // always be a ReadableStream, even for 204 responses. - // But when creating a new Response instance on the client, - // the body for a 204 response must be null. - const responseBody = response.status === 204 ? null : responseClone.body sendToClient( client, @@ -137,11 +132,11 @@ async function handleRequest(event, requestId) { type: responseClone.type, status: responseClone.status, statusText: responseClone.statusText, - body: responseBody, + body: responseClone.body, headers: Object.fromEntries(responseClone.headers.entries()), }, }, - [responseBody], + [responseClone.body], ) })() } diff --git a/src/api/fetchers.msw.ts b/src/api/fetchers.msw.ts index ba32f381..6ae1c841 100644 --- a/src/api/fetchers.msw.ts +++ b/src/api/fetchers.msw.ts @@ -10,7 +10,12 @@ */ import { faker } from '@faker-js/faker' import { HttpResponse, delay, http } from 'msw' -import { GraphEdgeType } from './fetchers.schemas' +import { + DocumentType, + GraphEdgeType, + PackageEventType, + ProcedureType, +} from './fetchers.schemas' export const getAmbitiesValidGetMock = () => ({ limit: faker.helpers.arrayElement([ @@ -2890,6 +2895,19 @@ export const getBeleidskeuzesVersionObjectUuidGetMock = () => ({ ]), Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + Werkingsgebied_Code: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Werkingsgebied_Statics: faker.helpers.arrayElement([ + { + Cached_Title: faker.word.sample(), + Code: faker.word.sample(), + Object_ID: faker.number.int({ min: undefined, max: undefined }), + Object_Type: faker.word.sample(), + }, + undefined, + ]), WettelijkeTaken: faker.helpers.arrayElement([ Array.from( { length: faker.number.int({ min: 1, max: 10 }) }, @@ -3235,6 +3253,19 @@ export const getBeleidskeuzesLatestLineageIdGetMock = () => ({ ]), Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + Werkingsgebied_Code: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Werkingsgebied_Statics: faker.helpers.arrayElement([ + { + Cached_Title: faker.word.sample(), + Code: faker.word.sample(), + Object_ID: faker.number.int({ min: undefined, max: undefined }), + Object_Type: faker.word.sample(), + }, + undefined, + ]), WettelijkeTaken: faker.helpers.arrayElement([ Array.from( { length: faker.number.int({ min: 1, max: 10 }) }, @@ -3481,6 +3512,10 @@ export const getModulesModuleIdObjectBeleidskeuzeLineageIdGetMock = () => ({ ]), Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + Werkingsgebied_Code: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), })), total: faker.number.int({ min: undefined, max: undefined }), }) @@ -3813,6 +3848,19 @@ export const getModulesModuleIdObjectBeleidskeuzeLatestLineageIdGetMock = ]), Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + Werkingsgebied_Code: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Werkingsgebied_Statics: faker.helpers.arrayElement([ + { + Cached_Title: faker.word.sample(), + Code: faker.word.sample(), + Object_ID: faker.number.int({ min: undefined, max: undefined }), + Object_Type: faker.word.sample(), + }, + undefined, + ]), WettelijkeTaken: faker.helpers.arrayElement([ Array.from( { length: faker.number.int({ min: 1, max: 10 }) }, @@ -4184,6 +4232,19 @@ export const getModulesModuleIdObjectBeleidskeuzeVersionObjectUuidGetMock = ]), Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + Werkingsgebied_Code: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Werkingsgebied_Statics: faker.helpers.arrayElement([ + { + Cached_Title: faker.word.sample(), + Code: faker.word.sample(), + Object_ID: faker.number.int({ min: undefined, max: undefined }), + Object_Type: faker.word.sample(), + }, + undefined, + ]), WettelijkeTaken: faker.helpers.arrayElement([ Array.from( { length: faker.number.int({ min: 1, max: 10 }) }, @@ -4585,6 +4646,19 @@ export const getRevisionsModuleIdBeleidskeuzeVersionObjectUuidGetMock = () => ({ ]), Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + Werkingsgebied_Code: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Werkingsgebied_Statics: faker.helpers.arrayElement([ + { + Cached_Title: faker.word.sample(), + Code: faker.word.sample(), + Object_ID: faker.number.int({ min: undefined, max: undefined }), + Object_Type: faker.word.sample(), + }, + undefined, + ]), WettelijkeTaken: faker.helpers.arrayElement([ Array.from( { length: faker.number.int({ min: 1, max: 10 }) }, @@ -7087,6 +7161,19 @@ export const getMaatregelenVersionObjectUuidGetMock = () => ({ ]), Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + Werkingsgebied_Code: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Werkingsgebied_Statics: faker.helpers.arrayElement([ + { + Cached_Title: faker.word.sample(), + Code: faker.word.sample(), + Object_ID: faker.number.int({ min: undefined, max: undefined }), + Object_Type: faker.word.sample(), + }, + undefined, + ]), }) export const getMaatregelenLatestLineageIdGetMock = () => ({ @@ -7332,6 +7419,19 @@ export const getMaatregelenLatestLineageIdGetMock = () => ({ ]), Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + Werkingsgebied_Code: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Werkingsgebied_Statics: faker.helpers.arrayElement([ + { + Cached_Title: faker.word.sample(), + Code: faker.word.sample(), + Object_ID: faker.number.int({ min: undefined, max: undefined }), + Object_Type: faker.word.sample(), + }, + undefined, + ]), }) export const getMaatregelenRelationsLineageIdGetMock = () => @@ -7492,6 +7592,10 @@ export const getModulesModuleIdObjectMaatregelLineageIdGetMock = () => ({ ]), Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + Werkingsgebied_Code: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), })), total: faker.number.int({ min: undefined, max: undefined }), }) @@ -7747,6 +7851,19 @@ export const getModulesModuleIdObjectMaatregelLatestLineageIdGetMock = () => ({ ]), Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + Werkingsgebied_Code: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Werkingsgebied_Statics: faker.helpers.arrayElement([ + { + Cached_Title: faker.word.sample(), + Code: faker.word.sample(), + Object_ID: faker.number.int({ min: undefined, max: undefined }), + Object_Type: faker.word.sample(), + }, + undefined, + ]), }) export const getModulesModuleIdObjectMaatregelVersionObjectUuidGetMock = @@ -8009,6 +8126,19 @@ export const getModulesModuleIdObjectMaatregelVersionObjectUuidGetMock = ]), Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + Werkingsgebied_Code: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Werkingsgebied_Statics: faker.helpers.arrayElement([ + { + Cached_Title: faker.word.sample(), + Code: faker.word.sample(), + Object_ID: faker.number.int({ min: undefined, max: undefined }), + Object_Type: faker.word.sample(), + }, + undefined, + ]), }) export const getModulesObjectsMaatregelActiveLineageIdGetMock = () => @@ -8307,6 +8437,19 @@ export const getRevisionsModuleIdMaatregelVersionObjectUuidGetMock = () => ({ ]), Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + Werkingsgebied_Code: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Werkingsgebied_Statics: faker.helpers.arrayElement([ + { + Cached_Title: faker.word.sample(), + Code: faker.word.sample(), + Object_ID: faker.number.int({ min: undefined, max: undefined }), + Object_Type: faker.word.sample(), + }, + undefined, + ]), }) export const getNationaalBelangPostMock = () => ({ @@ -10075,23 +10218,58 @@ export const getRevisionsModuleIdVisieAlgemeenVersionObjectUuidGetMock = UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), }) -export const getWettelijkeTaakPostMock = () => ({ - Object_ID: faker.helpers.arrayElement([ +export const getWerkingsgebiedenValidGetMock = () => ({ + limit: faker.helpers.arrayElement([ faker.number.int({ min: undefined, max: undefined }), undefined, ]), - UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), -}) - -export const getWettelijkeTaakLineageIdPostMock = () => ({ - message: faker.word.sample(), -}) - -export const getWettelijkeTaakLineageIdDeleteMock = () => ({ - message: faker.word.sample(), + offset: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + results: Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ + Adjust_On: faker.helpers.arrayElement([ + faker.helpers.arrayElement([faker.string.uuid(), null]), + undefined, + ]), + Area_UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + Code: faker.helpers.arrayElement([faker.word.sample(), undefined]), + Created_Date: faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + undefined, + ]), + End_Validity: faker.helpers.arrayElement([ + faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + null, + ]), + undefined, + ]), + Modified_Date: faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + undefined, + ]), + Object_ID: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + Start_Validity: faker.helpers.arrayElement([ + faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + null, + ]), + undefined, + ]), + Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), + UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + })), + total: faker.number.int({ min: undefined, max: undefined }), }) -export const getWettelijkeTaakValidGetMock = () => ({ +export const getWerkingsgebiedenValidLineageIdGetMock = () => ({ limit: faker.helpers.arrayElement([ faker.number.int({ min: undefined, max: undefined }), undefined, @@ -10104,11 +10282,23 @@ export const getWettelijkeTaakValidGetMock = () => ({ { length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1 ).map(() => ({ + Adjust_On: faker.helpers.arrayElement([ + faker.helpers.arrayElement([faker.string.uuid(), null]), + undefined, + ]), + Area_UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), Code: faker.helpers.arrayElement([faker.word.sample(), undefined]), Created_Date: faker.helpers.arrayElement([ `${faker.date.past().toISOString().split('.')[0]}Z`, undefined, ]), + End_Validity: faker.helpers.arrayElement([ + faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + null, + ]), + undefined, + ]), Modified_Date: faker.helpers.arrayElement([ `${faker.date.past().toISOString().split('.')[0]}Z`, undefined, @@ -10117,52 +10307,38 @@ export const getWettelijkeTaakValidGetMock = () => ({ faker.number.int({ min: undefined, max: undefined }), undefined, ]), - Object_Type: faker.helpers.arrayElement([ - faker.word.sample(), + Start_Validity: faker.helpers.arrayElement([ + faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + null, + ]), undefined, ]), Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), - Weblink: faker.helpers.arrayElement([faker.word.sample(), undefined]), })), total: faker.number.int({ min: undefined, max: undefined }), }) -export const getWettelijkeTaakLatestLineageIdGetMock = () => ({ - Beleidskeuzes: faker.helpers.arrayElement([ - Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1 - ).map(() => ({ - Object: { - Object_ID: faker.helpers.arrayElement([ - faker.number.int({ min: undefined, max: undefined }), - undefined, - ]), - Object_Type: faker.helpers.arrayElement([ - faker.word.sample(), - undefined, - ]), - Title: faker.helpers.arrayElement([ - faker.word.sample(), - undefined, - ]), - UUID: faker.helpers.arrayElement([ - faker.string.uuid(), - undefined, - ]), - }, - Relation: { - Description: faker.helpers.arrayElement([ - faker.helpers.arrayElement([faker.word.sample(), null]), - undefined, - ]), - Object_ID: faker.number.int({ min: undefined, max: undefined }), - Object_Type: faker.word.sample(), - }, - })), +export const getWerkingsgebiedenVersionObjectUuidGetMock = () => ({ + Adjust_On: faker.helpers.arrayElement([ + faker.helpers.arrayElement([faker.string.uuid(), null]), + undefined, + ]), + Area: faker.helpers.arrayElement([ + { + Created_By_UUID: faker.string.uuid(), + Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Source_Modified_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + Source_Title: faker.word.sample(), + Source_UUID: faker.string.uuid(), + UUID: faker.string.uuid(), + }, undefined, ]), + Area_UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), Code: faker.helpers.arrayElement([faker.word.sample(), undefined]), Created_By: faker.helpers.arrayElement([ { @@ -10176,6 +10352,7 @@ export const getWettelijkeTaakLatestLineageIdGetMock = () => ({ `${faker.date.past().toISOString().split('.')[0]}Z`, undefined, ]), + Description: faker.helpers.arrayElement([faker.word.sample(), undefined]), End_Validity: faker.helpers.arrayElement([ faker.helpers.arrayElement([ `${faker.date.past().toISOString().split('.')[0]}Z`, @@ -10199,7 +10376,6 @@ export const getWettelijkeTaakLatestLineageIdGetMock = () => ({ faker.number.int({ min: undefined, max: undefined }), undefined, ]), - Object_Type: faker.helpers.arrayElement([faker.word.sample(), undefined]), ObjectStatics: faker.helpers.arrayElement([ { Owner_1: faker.helpers.arrayElement([ @@ -10230,131 +10406,101 @@ export const getWettelijkeTaakLatestLineageIdGetMock = () => ({ ]), Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), - VerplichtProgrammas: faker.helpers.arrayElement([ - Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1 - ).map(() => ({ - Code: faker.helpers.arrayElement([faker.word.sample(), undefined]), - Created_Date: faker.helpers.arrayElement([ - `${faker.date.past().toISOString().split('.')[0]}Z`, - undefined, - ]), - Modified_Date: faker.helpers.arrayElement([ - `${faker.date.past().toISOString().split('.')[0]}Z`, - undefined, - ]), - Object_ID: faker.helpers.arrayElement([ - faker.number.int({ min: undefined, max: undefined }), - undefined, - ]), - Object_Type: faker.helpers.arrayElement([ - faker.word.sample(), - undefined, - ]), - Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), - UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), - })), - undefined, - ]), - Weblink: faker.helpers.arrayElement([faker.word.sample(), undefined]), }) -export const getWettelijkeTaakRelationsLineageIdGetMock = () => - Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1 - ).map(() => ({ - Description: faker.helpers.arrayElement([ - faker.helpers.arrayElement([faker.word.sample(), null]), - undefined, - ]), - Object_ID: faker.number.int({ min: undefined, max: undefined }), - Object_Type: faker.word.sample(), - Title: faker.helpers.arrayElement([ - faker.helpers.arrayElement([faker.word.sample(), null]), - undefined, +export const getWerkingsgebiedenLatestLineageIdGetMock = () => ({ + Adjust_On: faker.helpers.arrayElement([ + faker.helpers.arrayElement([faker.string.uuid(), null]), + undefined, + ]), + Area: faker.helpers.arrayElement([ + { + Created_By_UUID: faker.string.uuid(), + Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Source_Modified_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + Source_Title: faker.word.sample(), + Source_UUID: faker.string.uuid(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Area_UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + Code: faker.helpers.arrayElement([faker.word.sample(), undefined]), + Created_By: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Created_Date: faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + undefined, + ]), + Description: faker.helpers.arrayElement([faker.word.sample(), undefined]), + End_Validity: faker.helpers.arrayElement([ + faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + null, ]), - })) - -export const getWettelijkeTaakRelationsLineageIdPutMock = () => ({ - message: faker.word.sample(), -}) - -export const getWettelijkeTaakStaticLineageIdPostMock = () => ({ - message: faker.word.sample(), -}) - -export const getUsersGetMock = () => ({ - limit: faker.helpers.arrayElement([ - faker.number.int({ min: undefined, max: undefined }), undefined, ]), - offset: faker.helpers.arrayElement([ - faker.number.int({ min: undefined, max: undefined }), + Modified_By: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, undefined, ]), - results: Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1 - ).map(() => ({ - Email: faker.word.sample(), - Gebruikersnaam: faker.word.sample(), - IsActive: faker.datatype.boolean(), - Rol: faker.word.sample(), - Status: faker.word.sample(), - UUID: faker.string.uuid(), - })), - total: faker.number.int({ min: undefined, max: undefined }), -}) - -export const getUsersPostMock = () => ({ - Email: faker.word.sample(), - Password: faker.word.sample(), - Rol: faker.word.sample(), - UUID: faker.string.uuid(), -}) - -export const getUsersSearchGetMock = () => ({ - limit: faker.helpers.arrayElement([ - faker.number.int({ min: undefined, max: undefined }), + Modified_Date: faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, undefined, ]), - offset: faker.helpers.arrayElement([ + Object_ID: faker.helpers.arrayElement([ faker.number.int({ min: undefined, max: undefined }), undefined, ]), - results: Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1 - ).map(() => ({ - Email: faker.word.sample(), - Gebruikersnaam: faker.word.sample(), - IsActive: faker.datatype.boolean(), - Rol: faker.word.sample(), - Status: faker.word.sample(), - UUID: faker.string.uuid(), - })), - total: faker.number.int({ min: undefined, max: undefined }), -}) - -export const getUsersUserUuidGetMock = () => ({ - Email: faker.word.sample(), - Gebruikersnaam: faker.word.sample(), - IsActive: faker.datatype.boolean(), - Rol: faker.word.sample(), - Status: faker.word.sample(), - UUID: faker.string.uuid(), + ObjectStatics: faker.helpers.arrayElement([ + { + Owner_1: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Owner_2: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + }, + undefined, + ]), + Start_Validity: faker.helpers.arrayElement([ + faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + null, + ]), + undefined, + ]), + Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), + UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), }) -export const getUsersUserUuidPostMock = () => ({ message: faker.word.sample() }) - -export const getUsersUserUuidResetPasswordPostMock = () => ({ - NewPassword: faker.word.sample(), - UUID: faker.string.uuid(), +export const getWerkingsgebiedStaticLineageIdPostMock = () => ({ + message: faker.word.sample(), }) -export const getWerkingsgebiedenGetMock = () => ({ +export const getModulesModuleIdObjectWerkingsgebiedLineageIdGetMock = () => ({ limit: faker.helpers.arrayElement([ faker.number.int({ min: undefined, max: undefined }), undefined, @@ -10367,66 +10513,776 @@ export const getWerkingsgebiedenGetMock = () => ({ { length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1 ).map(() => ({ - Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, - End_Validity: faker.helpers.arrayElement([ + Adjust_On: faker.helpers.arrayElement([ + faker.helpers.arrayElement([faker.string.uuid(), null]), + undefined, + ]), + Area_UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + Code: faker.helpers.arrayElement([faker.word.sample(), undefined]), + Created_By: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Created_Date: faker.helpers.arrayElement([ `${faker.date.past().toISOString().split('.')[0]}Z`, undefined, ]), - ID: faker.number.int({ min: undefined, max: undefined }), - Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, - Start_Validity: faker.helpers.arrayElement([ + End_Validity: faker.helpers.arrayElement([ + faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + null, + ]), + undefined, + ]), + Modified_By: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Modified_Date: faker.helpers.arrayElement([ `${faker.date.past().toISOString().split('.')[0]}Z`, undefined, ]), - Title: faker.word.sample(), - UUID: faker.string.uuid(), - })), - total: faker.number.int({ min: undefined, max: undefined }), -}) - -export const getSearchGeoPostMock = () => ({ - limit: faker.helpers.arrayElement([ - faker.number.int({ min: undefined, max: undefined }), - undefined, - ]), - offset: faker.helpers.arrayElement([ - faker.number.int({ min: undefined, max: undefined }), - undefined, - ]), - results: Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1 - ).map(() => ({ - Gebied: faker.helpers.arrayElement([ - faker.word.sample(), - faker.string.uuid(), + Object_ID: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, ]), - Omschrijving: faker.helpers.arrayElement([ - faker.word.sample(), + ObjectStatics: faker.helpers.arrayElement([ + { + Owner_1: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Owner_2: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + }, undefined, ]), - Titel: faker.helpers.arrayElement([faker.word.sample(), undefined]), - Type: faker.word.sample(), - UUID: faker.helpers.arrayElement([ - faker.word.sample(), - faker.string.uuid(), + Start_Validity: faker.helpers.arrayElement([ + faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + null, + ]), + undefined, ]), + Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), + UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), })), total: faker.number.int({ min: undefined, max: undefined }), }) -export const getSearchGeometryPostMock = () => ({ - limit: faker.helpers.arrayElement([ - faker.number.int({ min: undefined, max: undefined }), - undefined, - ]), - offset: faker.helpers.arrayElement([ +export const getModulesModuleIdObjectWerkingsgebiedLineageIdPatchMock = () => ({ + Object_ID: faker.helpers.arrayElement([ faker.number.int({ min: undefined, max: undefined }), undefined, ]), - results: Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1 + UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), +}) + +export const getModulesModuleIdObjectWerkingsgebiedLatestLineageIdGetMock = + () => ({ + Adjust_On: faker.helpers.arrayElement([ + faker.helpers.arrayElement([faker.string.uuid(), null]), + undefined, + ]), + Area: faker.helpers.arrayElement([ + { + Created_By_UUID: faker.string.uuid(), + Created_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + Source_Modified_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + Source_Title: faker.word.sample(), + Source_UUID: faker.string.uuid(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Area_UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + Code: faker.helpers.arrayElement([faker.word.sample(), undefined]), + Created_By: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Created_Date: faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + undefined, + ]), + Description: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + End_Validity: faker.helpers.arrayElement([ + faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + null, + ]), + undefined, + ]), + Modified_By: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Modified_Date: faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + undefined, + ]), + Object_ID: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + ObjectStatics: faker.helpers.arrayElement([ + { + Owner_1: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Owner_2: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + }, + undefined, + ]), + Start_Validity: faker.helpers.arrayElement([ + faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + null, + ]), + undefined, + ]), + Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), + UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + }) + +export const getModulesModuleIdObjectWerkingsgebiedVersionObjectUuidGetMock = + () => ({ + Adjust_On: faker.helpers.arrayElement([ + faker.helpers.arrayElement([faker.string.uuid(), null]), + undefined, + ]), + Area: faker.helpers.arrayElement([ + { + Created_By_UUID: faker.string.uuid(), + Created_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + Source_Modified_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + Source_Title: faker.word.sample(), + Source_UUID: faker.string.uuid(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Area_UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + Code: faker.helpers.arrayElement([faker.word.sample(), undefined]), + Created_By: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Created_Date: faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + undefined, + ]), + Description: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + End_Validity: faker.helpers.arrayElement([ + faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + null, + ]), + undefined, + ]), + Modified_By: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Modified_Date: faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + undefined, + ]), + Object_ID: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + ObjectStatics: faker.helpers.arrayElement([ + { + Owner_1: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Owner_2: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + }, + undefined, + ]), + Start_Validity: faker.helpers.arrayElement([ + faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + null, + ]), + undefined, + ]), + Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), + UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + }) + +export const getModulesObjectWerkingsgebiedActiveLineageIdGetMock = () => + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ + Module: { + Closed: faker.datatype.boolean(), + Description: faker.word.sample(), + Module_ID: faker.number.int({ min: undefined, max: undefined }), + Module_Manager_1: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Module_Manager_2: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Status: faker.helpers.arrayElement([ + { + Created_By_UUID: faker.string.uuid(), + Created_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + ID: faker.number.int({ min: undefined, max: undefined }), + Module_ID: faker.number.int({ + min: undefined, + max: undefined, + }), + Status: faker.word.sample(), + }, + undefined, + ]), + Title: faker.word.sample(), + }, + Module_Object: { + Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Module_ID: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + Title: faker.word.sample(), + UUID: faker.string.uuid(), + }, + })) + +export const getRevisionsModuleIdWerkingsgebiedVersionObjectUuidGetMock = + () => ({ + Adjust_On: faker.helpers.arrayElement([ + faker.helpers.arrayElement([faker.string.uuid(), null]), + undefined, + ]), + Area: faker.helpers.arrayElement([ + { + Created_By_UUID: faker.string.uuid(), + Created_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + Source_Modified_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + Source_Title: faker.word.sample(), + Source_UUID: faker.string.uuid(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Area_UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + Code: faker.helpers.arrayElement([faker.word.sample(), undefined]), + Created_By: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Created_Date: faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + undefined, + ]), + Description: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + End_Validity: faker.helpers.arrayElement([ + faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + null, + ]), + undefined, + ]), + Modified_By: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Modified_Date: faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + undefined, + ]), + Object_ID: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + ObjectStatics: faker.helpers.arrayElement([ + { + Owner_1: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Owner_2: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + }, + undefined, + ]), + Start_Validity: faker.helpers.arrayElement([ + faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + null, + ]), + undefined, + ]), + Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), + UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + }) + +export const getWettelijkeTaakPostMock = () => ({ + Object_ID: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), +}) + +export const getWettelijkeTaakLineageIdPostMock = () => ({ + message: faker.word.sample(), +}) + +export const getWettelijkeTaakLineageIdDeleteMock = () => ({ + message: faker.word.sample(), +}) + +export const getWettelijkeTaakValidGetMock = () => ({ + limit: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + offset: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + results: Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ + Code: faker.helpers.arrayElement([faker.word.sample(), undefined]), + Created_Date: faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + undefined, + ]), + Modified_Date: faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + undefined, + ]), + Object_ID: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + Object_Type: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), + UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + Weblink: faker.helpers.arrayElement([faker.word.sample(), undefined]), + })), + total: faker.number.int({ min: undefined, max: undefined }), +}) + +export const getWettelijkeTaakLatestLineageIdGetMock = () => ({ + Beleidskeuzes: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ + Object: { + Object_ID: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + Object_Type: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Title: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + UUID: faker.helpers.arrayElement([ + faker.string.uuid(), + undefined, + ]), + }, + Relation: { + Description: faker.helpers.arrayElement([ + faker.helpers.arrayElement([faker.word.sample(), null]), + undefined, + ]), + Object_ID: faker.number.int({ min: undefined, max: undefined }), + Object_Type: faker.word.sample(), + }, + })), + undefined, + ]), + Code: faker.helpers.arrayElement([faker.word.sample(), undefined]), + Created_By: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Created_Date: faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + undefined, + ]), + End_Validity: faker.helpers.arrayElement([ + faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + null, + ]), + undefined, + ]), + Modified_By: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Modified_Date: faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + undefined, + ]), + Object_ID: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + Object_Type: faker.helpers.arrayElement([faker.word.sample(), undefined]), + ObjectStatics: faker.helpers.arrayElement([ + { + Owner_1: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Owner_2: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + }, + undefined, + ]), + Start_Validity: faker.helpers.arrayElement([ + faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + null, + ]), + undefined, + ]), + Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), + UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + VerplichtProgrammas: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ + Code: faker.helpers.arrayElement([faker.word.sample(), undefined]), + Created_Date: faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + undefined, + ]), + Modified_Date: faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + undefined, + ]), + Object_ID: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + Object_Type: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), + UUID: faker.helpers.arrayElement([faker.string.uuid(), undefined]), + })), + undefined, + ]), + Weblink: faker.helpers.arrayElement([faker.word.sample(), undefined]), +}) + +export const getWettelijkeTaakRelationsLineageIdGetMock = () => + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ + Description: faker.helpers.arrayElement([ + faker.helpers.arrayElement([faker.word.sample(), null]), + undefined, + ]), + Object_ID: faker.number.int({ min: undefined, max: undefined }), + Object_Type: faker.word.sample(), + Title: faker.helpers.arrayElement([ + faker.helpers.arrayElement([faker.word.sample(), null]), + undefined, + ]), + })) + +export const getWettelijkeTaakRelationsLineageIdPutMock = () => ({ + message: faker.word.sample(), +}) + +export const getWettelijkeTaakStaticLineageIdPostMock = () => ({ + message: faker.word.sample(), +}) + +export const getUsersGetMock = () => ({ + limit: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + offset: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + results: Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ + Email: faker.word.sample(), + Gebruikersnaam: faker.word.sample(), + IsActive: faker.datatype.boolean(), + Rol: faker.word.sample(), + Status: faker.word.sample(), + UUID: faker.string.uuid(), + })), + total: faker.number.int({ min: undefined, max: undefined }), +}) + +export const getUsersPostMock = () => ({ + Email: faker.word.sample(), + Password: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), +}) + +export const getUsersSearchGetMock = () => ({ + limit: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + offset: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + results: Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ + Email: faker.word.sample(), + Gebruikersnaam: faker.word.sample(), + IsActive: faker.datatype.boolean(), + Rol: faker.word.sample(), + Status: faker.word.sample(), + UUID: faker.string.uuid(), + })), + total: faker.number.int({ min: undefined, max: undefined }), +}) + +export const getUsersUserUuidGetMock = () => ({ + Email: faker.word.sample(), + Gebruikersnaam: faker.word.sample(), + IsActive: faker.datatype.boolean(), + Rol: faker.word.sample(), + Status: faker.word.sample(), + UUID: faker.string.uuid(), +}) + +export const getUsersUserUuidPostMock = () => ({ message: faker.word.sample() }) + +export const getUsersUserUuidResetPasswordPostMock = () => ({ + NewPassword: faker.word.sample(), + UUID: faker.string.uuid(), +}) + +export const getSourceWerkingsgebiedenGetMock = () => ({ + limit: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + offset: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + results: Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ + Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + End_Validity: faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + undefined, + ]), + ID: faker.number.int({ min: undefined, max: undefined }), + Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Start_Validity: faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + undefined, + ]), + Title: faker.word.sample(), + UUID: faker.string.uuid(), + })), + total: faker.number.int({ min: undefined, max: undefined }), +}) + +export const getSearchSourceGeoPostMock = () => ({ + limit: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + offset: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + results: Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ + Gebied: faker.helpers.arrayElement([ + faker.word.sample(), + faker.string.uuid(), + ]), + Omschrijving: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Titel: faker.helpers.arrayElement([faker.word.sample(), undefined]), + Type: faker.word.sample(), + UUID: faker.helpers.arrayElement([ + faker.word.sample(), + faker.string.uuid(), + ]), + })), + total: faker.number.int({ min: undefined, max: undefined }), +}) + +export const getSearchSourceGeometryPostMock = () => ({ + limit: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + offset: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + results: Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 ).map(() => ({ Gebied: faker.helpers.arrayElement([ faker.word.sample(), @@ -10810,104 +11666,502 @@ export const getModulesModuleIdGetMock = () => ({ { length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1 ).map(() => ({ - Created_By_UUID: faker.string.uuid(), + Created_By_UUID: faker.string.uuid(), + Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + ID: faker.number.int({ min: undefined, max: undefined }), + Module_ID: faker.number.int({ min: undefined, max: undefined }), + Status: faker.word.sample(), + })), +}) + +export const getModulesModuleIdPostMock = () => ({ + message: faker.word.sample(), +}) + +export const getModulesModuleIdActivatePostMock = () => ({ + message: faker.word.sample(), +}) + +export const getModulesModuleIdCompletePostMock = () => ({ + message: faker.word.sample(), +}) + +export const getModulesModuleIdClosePostMock = () => ({ + message: faker.word.sample(), +}) + +export const getModulesModuleIdStatusGetMock = () => + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ + Created_By_UUID: faker.string.uuid(), + Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + ID: faker.number.int({ min: undefined, max: undefined }), + Module_ID: faker.number.int({ min: undefined, max: undefined }), + Status: faker.word.sample(), + })) + +export const getModulesModuleIdStatusPatchMock = () => ({ + message: faker.word.sample(), +}) + +export const getModulesModuleIdAddNewObjectPostMock = () => ({ + Code: faker.word.sample(), + Object_ID: faker.number.int({ min: undefined, max: undefined }), + Object_Type: faker.word.sample(), +}) + +export const getModulesModuleIdAddExistingObjectPostMock = () => ({ + message: faker.word.sample(), +}) + +export const getModulesModuleIdObjectContextObjectTypeLineageIdGetMock = + () => ({ + Action: faker.word.sample(), + Code: faker.word.sample(), + Conclusion: faker.word.sample(), + Created_By: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Explanation: faker.word.sample(), + Modified_By: faker.helpers.arrayElement([ + { + Gebruikersnaam: faker.word.sample(), + Rol: faker.word.sample(), + UUID: faker.string.uuid(), + }, + undefined, + ]), + Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Module_ID: faker.number.int({ min: undefined, max: undefined }), + Object_ID: faker.number.int({ min: undefined, max: undefined }), + Object_Type: faker.word.sample(), + Original_Adjust_On: faker.helpers.arrayElement([ + faker.string.uuid(), + undefined, + ]), + }) + +export const getModulesModuleIdObjectContextObjectTypeLineageIdPostMock = + () => ({ message: faker.word.sample() }) + +export const getModulesModuleIdRemoveObjectTypeLineageIdDeleteMock = () => ({ + message: faker.word.sample(), +}) + +export const getModulesModuleIdSnapshotStatusIdGetMock = () => ({ + Objects: Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({})), +}) + +export const getModulesObjectsLatestGetMock = () => ({ + limit: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + offset: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + results: Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ + Code: faker.word.sample(), + Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Module_ID: faker.number.int({ min: undefined, max: undefined }), + ModuleObjectContext: faker.helpers.arrayElement([ + { + Action: faker.word.sample(), + Original_Adjust_On: faker.helpers.arrayElement([ + faker.string.uuid(), + undefined, + ]), + }, + undefined, + ]), + Object_ID: faker.number.int({ min: undefined, max: undefined }), + Object_Type: faker.word.sample(), + ObjectStatics: faker.helpers.arrayElement([ + { + Client_1_UUID: faker.helpers.arrayElement([ + faker.string.uuid(), + undefined, + ]), + Owner_1_UUID: faker.helpers.arrayElement([ + faker.string.uuid(), + undefined, + ]), + Owner_2_UUID: faker.helpers.arrayElement([ + faker.string.uuid(), + undefined, + ]), + Portfolio_Holder_1_UUID: faker.helpers.arrayElement([ + faker.string.uuid(), + undefined, + ]), + Portfolio_Holder_2_UUID: faker.helpers.arrayElement([ + faker.string.uuid(), + undefined, + ]), + }, + undefined, + ]), + Status: faker.word.sample(), + Title: faker.word.sample(), + UUID: faker.string.uuid(), + })), + total: faker.number.int({ min: undefined, max: undefined }), +}) + +export const getObjectsValidCountGetMock = () => + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ + Count: faker.number.int({ min: undefined, max: undefined }), + Object_Type: faker.word.sample(), + })) + +export const getObjectsValidGetMock = () => ({ + limit: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + offset: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + results: Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ + Object_ID: faker.number.int({ min: undefined, max: undefined }), + Object_Type: faker.word.sample(), + Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), + UUID: faker.string.uuid(), + })), + total: faker.number.int({ min: undefined, max: undefined }), +}) + +export const getPublicationsGetMock = () => ({ + limit: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + offset: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + results: Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, - ID: faker.number.int({ min: undefined, max: undefined }), + Document_Type: faker.helpers.arrayElement(Object.values(DocumentType)), + Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, Module_ID: faker.number.int({ min: undefined, max: undefined }), - Status: faker.word.sample(), + Official_Title: faker.word.sample(), + Regulation_Title: faker.word.sample(), + Template_ID: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + UUID: faker.string.uuid(), + Work_ID: faker.number.int({ min: undefined, max: undefined }), })), + total: faker.number.int({ min: undefined, max: undefined }), }) -export const getModulesModuleIdPostMock = () => ({ - message: faker.word.sample(), -}) - -export const getModulesModuleIdActivatePostMock = () => ({ - message: faker.word.sample(), +export const getPublicationsPostMock = () => ({ + Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Document_Type: faker.helpers.arrayElement(Object.values(DocumentType)), + Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Module_ID: faker.number.int({ min: undefined, max: undefined }), + Official_Title: faker.word.sample(), + Regulation_Title: faker.word.sample(), + Template_ID: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + UUID: faker.string.uuid(), + Work_ID: faker.number.int({ min: undefined, max: undefined }), }) -export const getModulesModuleIdCompletePostMock = () => ({ - message: faker.word.sample(), +export const getPublicationsPublicationUuidGetMock = () => ({ + Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Document_Type: faker.helpers.arrayElement(Object.values(DocumentType)), + Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Module_ID: faker.number.int({ min: undefined, max: undefined }), + Official_Title: faker.word.sample(), + Regulation_Title: faker.word.sample(), + Template_ID: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + UUID: faker.string.uuid(), + Work_ID: faker.number.int({ min: undefined, max: undefined }), }) -export const getModulesModuleIdClosePostMock = () => ({ - message: faker.word.sample(), +export const getPublicationsPublicationUuidPatchMock = () => ({ + Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Document_Type: faker.helpers.arrayElement(Object.values(DocumentType)), + Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Module_ID: faker.number.int({ min: undefined, max: undefined }), + Official_Title: faker.word.sample(), + Regulation_Title: faker.word.sample(), + Template_ID: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + UUID: faker.string.uuid(), + Work_ID: faker.number.int({ min: undefined, max: undefined }), }) -export const getModulesModuleIdStatusGetMock = () => - Array.from( +export const getPublicationsPublicationUuidBillsGetMock = () => ({ + limit: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + offset: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + results: Array.from( { length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1 ).map(() => ({ - Created_By_UUID: faker.string.uuid(), - Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, - ID: faker.number.int({ min: undefined, max: undefined }), - Module_ID: faker.number.int({ min: undefined, max: undefined }), - Status: faker.word.sample(), - })) - -export const getModulesModuleIdStatusPatchMock = () => ({ - message: faker.word.sample(), -}) - -export const getModulesModuleIdAddNewObjectPostMock = () => ({ - Code: faker.word.sample(), - Object_ID: faker.number.int({ min: undefined, max: undefined }), - Object_Type: faker.word.sample(), -}) - -export const getModulesModuleIdAddExistingObjectPostMock = () => ({ - message: faker.word.sample(), -}) - -export const getModulesModuleIdObjectContextObjectTypeLineageIdGetMock = - () => ({ - Action: faker.word.sample(), - Code: faker.word.sample(), - Conclusion: faker.word.sample(), - Created_By: faker.helpers.arrayElement([ - { - Gebruikersnaam: faker.word.sample(), - Rol: faker.word.sample(), - UUID: faker.string.uuid(), - }, - undefined, - ]), Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, - Explanation: faker.word.sample(), - Modified_By: faker.helpers.arrayElement([ - { - Gebruikersnaam: faker.word.sample(), - Rol: faker.word.sample(), - UUID: faker.string.uuid(), - }, - undefined, - ]), + Is_Official: faker.datatype.boolean(), Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, - Module_ID: faker.number.int({ min: undefined, max: undefined }), - Object_ID: faker.number.int({ min: undefined, max: undefined }), - Object_Type: faker.word.sample(), - Original_Adjust_On: faker.helpers.arrayElement([ - faker.string.uuid(), + Module_Status_ID: faker.number.int({ min: undefined, max: undefined }), + Procedure_Type: faker.helpers.arrayElement( + Object.values(ProcedureType) + ), + Publication_UUID: faker.string.uuid(), + UUID: faker.string.uuid(), + Version_ID: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), undefined, ]), - }) + })), + total: faker.number.int({ min: undefined, max: undefined }), +}) -export const getModulesModuleIdObjectContextObjectTypeLineageIdPostMock = - () => ({ message: faker.word.sample() }) +export const getPublicationsPublicationUuidBillsPostMock = () => ({ + Announcement_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Bill_Data: faker.helpers.arrayElement([ + { + Amendment_Article: faker.helpers.arrayElement([ + { + Content: faker.word.sample(), + Label: faker.word.sample(), + Number: faker.word.sample(), + }, + undefined, + ]), + Articles: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ + Content: faker.word.sample(), + Label: faker.word.sample(), + Number: faker.word.sample(), + })), + undefined, + ]), + Bill_Title: faker.word.sample(), + Closing: faker.word.sample(), + Preamble: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Regulation_Title: faker.word.sample(), + Signature: faker.word.sample(), + }, + undefined, + ]), + Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Effective_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Is_Official: faker.datatype.boolean(), + Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Module_Status_ID: faker.number.int({ min: undefined, max: undefined }), + Procedure_Data: faker.helpers.arrayElement([ + { + Announcement_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + Steps: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ + Conclusion_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + Step_Type: faker.word.sample(), + })), + undefined, + ]), + }, + undefined, + ]), + Procedure_Type: faker.helpers.arrayElement(Object.values(ProcedureType)), + Publication_UUID: faker.string.uuid(), + UUID: faker.string.uuid(), + Version_ID: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), +}) -export const getModulesModuleIdRemoveObjectTypeLineageIdDeleteMock = () => ({ - message: faker.word.sample(), +export const getPublicationsPublicationUuidBillsBillUuidGetMock = () => ({ + Announcement_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Bill_Data: faker.helpers.arrayElement([ + { + Amendment_Article: faker.helpers.arrayElement([ + { + Content: faker.word.sample(), + Label: faker.word.sample(), + Number: faker.word.sample(), + }, + undefined, + ]), + Articles: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ + Content: faker.word.sample(), + Label: faker.word.sample(), + Number: faker.word.sample(), + })), + undefined, + ]), + Bill_Title: faker.word.sample(), + Closing: faker.word.sample(), + Preamble: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Regulation_Title: faker.word.sample(), + Signature: faker.word.sample(), + }, + undefined, + ]), + Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Effective_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Is_Official: faker.datatype.boolean(), + Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Module_Status_ID: faker.number.int({ min: undefined, max: undefined }), + Procedure_Data: faker.helpers.arrayElement([ + { + Announcement_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + Steps: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ + Conclusion_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + Step_Type: faker.word.sample(), + })), + undefined, + ]), + }, + undefined, + ]), + Procedure_Type: faker.helpers.arrayElement(Object.values(ProcedureType)), + Publication_UUID: faker.string.uuid(), + UUID: faker.string.uuid(), + Version_ID: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), }) -export const getModulesModuleIdSnapshotStatusIdGetMock = () => ({ - Objects: Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1 - ).map(() => ({})), +export const getPublicationsPublicationUuidBillsBillUuidPatchMock = () => ({ + Announcement_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Bill_Data: faker.helpers.arrayElement([ + { + Amendment_Article: faker.helpers.arrayElement([ + { + Content: faker.word.sample(), + Label: faker.word.sample(), + Number: faker.word.sample(), + }, + undefined, + ]), + Articles: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ + Content: faker.word.sample(), + Label: faker.word.sample(), + Number: faker.word.sample(), + })), + undefined, + ]), + Bill_Title: faker.word.sample(), + Closing: faker.word.sample(), + Preamble: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Regulation_Title: faker.word.sample(), + Signature: faker.word.sample(), + }, + undefined, + ]), + Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Effective_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Is_Official: faker.datatype.boolean(), + Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Module_Status_ID: faker.number.int({ min: undefined, max: undefined }), + Procedure_Data: faker.helpers.arrayElement([ + { + Announcement_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + Steps: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ + Conclusion_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + Step_Type: faker.word.sample(), + })), + undefined, + ]), + }, + undefined, + ]), + Procedure_Type: faker.helpers.arrayElement(Object.values(ProcedureType)), + Publication_UUID: faker.string.uuid(), + UUID: faker.string.uuid(), + Version_ID: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), }) -export const getModulesObjectsLatestGetMock = () => ({ +export const getPublicationBillsBillUuidPackagesGetMock = () => ({ limit: faker.helpers.arrayElement([ faker.number.int({ min: undefined, max: undefined }), undefined, @@ -10920,72 +12174,410 @@ export const getModulesObjectsLatestGetMock = () => ({ { length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1 ).map(() => ({ - Code: faker.word.sample(), + Announcement_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Bill_UUID: faker.string.uuid(), + Config_ID: faker.number.int({ min: undefined, max: undefined }), + Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + FRBR_ID: faker.number.int({ min: undefined, max: undefined }), + FRBR_Info: faker.helpers.arrayElement([ + { + act_expression_date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + act_expression_lang: faker.word.sample(), + act_expression_misc: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + act_expression_version: faker.word.sample(), + act_work_country: faker.word.sample(), + act_work_date: faker.word.sample(), + act_work_misc: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + bill_expression_date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + bill_expression_lang: faker.word.sample(), + bill_expression_misc: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + bill_expression_version: faker.word.sample(), + bill_work_country: faker.word.sample(), + bill_work_date: faker.word.sample(), + bill_work_misc: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Created_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + ID: faker.number.int({ min: undefined, max: undefined }), + }, + undefined, + ]), Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, - Module_ID: faker.number.int({ min: undefined, max: undefined }), - ModuleObjectContext: faker.helpers.arrayElement([ + Package_Event_Type: faker.helpers.arrayElement( + Object.values(PackageEventType) + ), + Publication_Bill: faker.helpers.arrayElement([ { - Action: faker.word.sample(), - Original_Adjust_On: faker.helpers.arrayElement([ - faker.string.uuid(), + Announcement_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + Bill_Data: faker.helpers.arrayElement([ + { + Amendment_Article: faker.helpers.arrayElement([ + { + Content: faker.word.sample(), + Label: faker.word.sample(), + Number: faker.word.sample(), + }, + undefined, + ]), + Articles: faker.helpers.arrayElement([ + Array.from( + { + length: faker.number.int({ + min: 1, + max: 10, + }), + }, + (_, i) => i + 1 + ).map(() => ({ + Content: faker.word.sample(), + Label: faker.word.sample(), + Number: faker.word.sample(), + })), + undefined, + ]), + Bill_Title: faker.word.sample(), + Closing: faker.word.sample(), + Preamble: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Regulation_Title: faker.word.sample(), + Signature: faker.word.sample(), + }, + undefined, + ]), + Created_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + Effective_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + Is_Official: faker.datatype.boolean(), + Modified_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + Module_Status_ID: faker.number.int({ + min: undefined, + max: undefined, + }), + Procedure_Data: faker.helpers.arrayElement([ + { + Announcement_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + Steps: faker.helpers.arrayElement([ + Array.from( + { + length: faker.number.int({ + min: 1, + max: 10, + }), + }, + (_, i) => i + 1 + ).map(() => ({ + Conclusion_Date: `${ + faker.date + .past() + .toISOString() + .split('.')[0] + }Z`, + Step_Type: faker.word.sample(), + })), + undefined, + ]), + }, + undefined, + ]), + Procedure_Type: faker.helpers.arrayElement( + Object.values(ProcedureType) + ), + Publication_UUID: faker.string.uuid(), + UUID: faker.string.uuid(), + Version_ID: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), undefined, ]), }, undefined, ]), - Object_ID: faker.number.int({ min: undefined, max: undefined }), - Object_Type: faker.word.sample(), - ObjectStatics: faker.helpers.arrayElement([ - { - Client_1_UUID: faker.helpers.arrayElement([ - faker.string.uuid(), - undefined, - ]), - Owner_1_UUID: faker.helpers.arrayElement([ - faker.string.uuid(), + Publication_Config: faker.helpers.arrayElement([ + { + Authority_ID: faker.word.sample(), + Created_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + DSO_BHKV_VERSION: faker.word.sample(), + DSO_STOP_VERSION: faker.word.sample(), + DSO_TPOD_VERSION: faker.word.sample(), + ID: faker.number.int({ min: undefined, max: undefined }), + Jurisdiction: faker.word.sample(), + Province_ID: faker.word.sample(), + Subjects: faker.word.sample(), + Submitter_ID: faker.word.sample(), + }, + undefined, + ]), + Publication_Filename: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Reports: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ + Created_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + ID: faker.number.int({ min: undefined, max: undefined }), + Messages: faker.helpers.arrayElement([ + faker.word.sample(), undefined, ]), - Owner_2_UUID: faker.helpers.arrayElement([ - faker.string.uuid(), + Package_UUID: faker.string.uuid(), + Report_Timestamp: faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, undefined, ]), - Portfolio_Holder_1_UUID: faker.helpers.arrayElement([ - faker.string.uuid(), + Report_Type: faker.helpers.arrayElement([ + faker.word.sample(), undefined, ]), - Portfolio_Holder_2_UUID: faker.helpers.arrayElement([ - faker.string.uuid(), + Result: faker.helpers.arrayElement([ + faker.word.sample(), undefined, ]), - }, + })), undefined, ]), - Status: faker.word.sample(), - Title: faker.word.sample(), UUID: faker.string.uuid(), + Validation_Status: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + ZIP_File_Checksum: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + ZIP_File_Name: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), })), total: faker.number.int({ min: undefined, max: undefined }), }) -export const getObjectsValidGetMock = () => ({ - limit: faker.helpers.arrayElement([ - faker.number.int({ min: undefined, max: undefined }), +export const getPublicationBillsBillUuidPackagesPostMock = () => ({ + Announcement_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Bill_UUID: faker.string.uuid(), + Config_ID: faker.number.int({ min: undefined, max: undefined }), + Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + FRBR_ID: faker.number.int({ min: undefined, max: undefined }), + FRBR_Info: faker.helpers.arrayElement([ + { + act_expression_date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + act_expression_lang: faker.word.sample(), + act_expression_misc: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + act_expression_version: faker.word.sample(), + act_work_country: faker.word.sample(), + act_work_date: faker.word.sample(), + act_work_misc: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + bill_expression_date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + bill_expression_lang: faker.word.sample(), + bill_expression_misc: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + bill_expression_version: faker.word.sample(), + bill_work_country: faker.word.sample(), + bill_work_date: faker.word.sample(), + bill_work_misc: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + ID: faker.number.int({ min: undefined, max: undefined }), + }, undefined, ]), - offset: faker.helpers.arrayElement([ - faker.number.int({ min: undefined, max: undefined }), + Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Package_Event_Type: faker.helpers.arrayElement( + Object.values(PackageEventType) + ), + Publication_Bill: faker.helpers.arrayElement([ + { + Announcement_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + Bill_Data: faker.helpers.arrayElement([ + { + Amendment_Article: faker.helpers.arrayElement([ + { + Content: faker.word.sample(), + Label: faker.word.sample(), + Number: faker.word.sample(), + }, + undefined, + ]), + Articles: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ + Content: faker.word.sample(), + Label: faker.word.sample(), + Number: faker.word.sample(), + })), + undefined, + ]), + Bill_Title: faker.word.sample(), + Closing: faker.word.sample(), + Preamble: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Regulation_Title: faker.word.sample(), + Signature: faker.word.sample(), + }, + undefined, + ]), + Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Effective_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Is_Official: faker.datatype.boolean(), + Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Module_Status_ID: faker.number.int({ + min: undefined, + max: undefined, + }), + Procedure_Data: faker.helpers.arrayElement([ + { + Announcement_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + Steps: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ + Conclusion_Date: `${ + faker.date.past().toISOString().split('.')[0] + }Z`, + Step_Type: faker.word.sample(), + })), + undefined, + ]), + }, + undefined, + ]), + Procedure_Type: faker.helpers.arrayElement( + Object.values(ProcedureType) + ), + Publication_UUID: faker.string.uuid(), + UUID: faker.string.uuid(), + Version_ID: faker.helpers.arrayElement([ + faker.number.int({ min: undefined, max: undefined }), + undefined, + ]), + }, undefined, ]), - results: Array.from( - { length: faker.number.int({ min: 1, max: 10 }) }, - (_, i) => i + 1 - ).map(() => ({ - Object_ID: faker.number.int({ min: undefined, max: undefined }), - Object_Type: faker.word.sample(), - Title: faker.helpers.arrayElement([faker.word.sample(), undefined]), - UUID: faker.string.uuid(), - })), - total: faker.number.int({ min: undefined, max: undefined }), + Publication_Config: faker.helpers.arrayElement([ + { + Authority_ID: faker.word.sample(), + Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + DSO_BHKV_VERSION: faker.word.sample(), + DSO_STOP_VERSION: faker.word.sample(), + DSO_TPOD_VERSION: faker.word.sample(), + ID: faker.number.int({ min: undefined, max: undefined }), + Jurisdiction: faker.word.sample(), + Province_ID: faker.word.sample(), + Subjects: faker.word.sample(), + Submitter_ID: faker.word.sample(), + }, + undefined, + ]), + Publication_Filename: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Reports: faker.helpers.arrayElement([ + Array.from( + { length: faker.number.int({ min: 1, max: 10 }) }, + (_, i) => i + 1 + ).map(() => ({ + Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + ID: faker.number.int({ min: undefined, max: undefined }), + Messages: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Package_UUID: faker.string.uuid(), + Report_Timestamp: faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + undefined, + ]), + Report_Type: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + Result: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + })), + undefined, + ]), + UUID: faker.string.uuid(), + Validation_Status: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + ZIP_File_Checksum: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), + ZIP_File_Name: faker.helpers.arrayElement([faker.word.sample(), undefined]), +}) + +export const getPublicationPackagesPackageUuidReportPostMock = () => ({ + Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + ID: faker.number.int({ min: undefined, max: undefined }), + Messages: faker.helpers.arrayElement([faker.word.sample(), undefined]), + Package_UUID: faker.string.uuid(), + Report_Timestamp: faker.helpers.arrayElement([ + `${faker.date.past().toISOString().split('.')[0]}Z`, + undefined, + ]), + Report_Type: faker.helpers.arrayElement([faker.word.sample(), undefined]), + Result: faker.helpers.arrayElement([faker.word.sample(), undefined]), }) export const getLoginAccessTokenPostMock = () => ({ @@ -12447,7 +14039,149 @@ export const getOmgevingsbeleidAPIMock = () => [ http.post('*/verplicht-programma/static/:lineageId', async () => { await delay(1000) return new HttpResponse( - JSON.stringify(getVerplichtProgrammaStaticLineageIdPostMock()), + JSON.stringify(getVerplichtProgrammaStaticLineageIdPostMock()), + { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + } + ) + }), + http.get('*/visies-algemeen/valid', async () => { + await delay(1000) + return new HttpResponse( + JSON.stringify(getVisiesAlgemeenValidGetMock()), + { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + } + ) + }), + http.get('*/visies-algemeen/valid/:lineageId', async () => { + await delay(1000) + return new HttpResponse( + JSON.stringify(getVisiesAlgemeenValidLineageIdGetMock()), + { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + } + ) + }), + http.get('*/visies-algemeen/version/:objectUuid', async () => { + await delay(1000) + return new HttpResponse( + JSON.stringify(getVisiesAlgemeenVersionObjectUuidGetMock()), + { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + } + ) + }), + http.get('*/visies-algemeen/latest/:lineageId', async () => { + await delay(1000) + return new HttpResponse( + JSON.stringify(getVisiesAlgemeenLatestLineageIdGetMock()), + { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + } + ) + }), + http.post('*/visie-algemeen/static/:lineageId', async () => { + await delay(1000) + return new HttpResponse( + JSON.stringify(getVisieAlgemeenStaticLineageIdPostMock()), + { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + } + ) + }), + http.get( + '*/modules/:moduleId/object/visie-algemeen/:lineageId', + async () => { + await delay(1000) + return new HttpResponse( + JSON.stringify( + getModulesModuleIdObjectVisieAlgemeenLineageIdGetMock() + ), + { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + } + ) + } + ), + http.patch( + '*/modules/:moduleId/object/visie-algemeen/:lineageId', + async () => { + await delay(1000) + return new HttpResponse( + JSON.stringify( + getModulesModuleIdObjectVisieAlgemeenLineageIdPatchMock() + ), + { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + } + ) + } + ), + http.get( + '*/modules/:moduleId/object/visie-algemeen/latest/:lineageId', + async () => { + await delay(1000) + return new HttpResponse( + JSON.stringify( + getModulesModuleIdObjectVisieAlgemeenLatestLineageIdGetMock() + ), + { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + } + ) + } + ), + http.get( + '*/modules/:moduleId/object/visie-algemeen/version/:objectUuid', + async () => { + await delay(1000) + return new HttpResponse( + JSON.stringify( + getModulesModuleIdObjectVisieAlgemeenVersionObjectUuidGetMock() + ), + { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + } + ) + } + ), + http.get('*/modules/object/visie-algemeen/active/:lineageId', async () => { + await delay(1000) + return new HttpResponse( + JSON.stringify( + getModulesObjectVisieAlgemeenActiveLineageIdGetMock() + ), { status: 200, headers: { @@ -12456,10 +14190,27 @@ export const getOmgevingsbeleidAPIMock = () => [ } ) }), - http.get('*/visies-algemeen/valid', async () => { + http.get( + '*/revisions/:moduleId/visie-algemeen/version/:objectUuid', + async () => { + await delay(1000) + return new HttpResponse( + JSON.stringify( + getRevisionsModuleIdVisieAlgemeenVersionObjectUuidGetMock() + ), + { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + } + ) + } + ), + http.get('*/werkingsgebieden/valid', async () => { await delay(1000) return new HttpResponse( - JSON.stringify(getVisiesAlgemeenValidGetMock()), + JSON.stringify(getWerkingsgebiedenValidGetMock()), { status: 200, headers: { @@ -12468,10 +14219,10 @@ export const getOmgevingsbeleidAPIMock = () => [ } ) }), - http.get('*/visies-algemeen/valid/:lineageId', async () => { + http.get('*/werkingsgebieden/valid/:lineageId', async () => { await delay(1000) return new HttpResponse( - JSON.stringify(getVisiesAlgemeenValidLineageIdGetMock()), + JSON.stringify(getWerkingsgebiedenValidLineageIdGetMock()), { status: 200, headers: { @@ -12480,10 +14231,10 @@ export const getOmgevingsbeleidAPIMock = () => [ } ) }), - http.get('*/visies-algemeen/version/:objectUuid', async () => { + http.get('*/werkingsgebieden/version/:objectUuid', async () => { await delay(1000) return new HttpResponse( - JSON.stringify(getVisiesAlgemeenVersionObjectUuidGetMock()), + JSON.stringify(getWerkingsgebiedenVersionObjectUuidGetMock()), { status: 200, headers: { @@ -12492,10 +14243,10 @@ export const getOmgevingsbeleidAPIMock = () => [ } ) }), - http.get('*/visies-algemeen/latest/:lineageId', async () => { + http.get('*/werkingsgebieden/latest/:lineageId', async () => { await delay(1000) return new HttpResponse( - JSON.stringify(getVisiesAlgemeenLatestLineageIdGetMock()), + JSON.stringify(getWerkingsgebiedenLatestLineageIdGetMock()), { status: 200, headers: { @@ -12504,10 +14255,10 @@ export const getOmgevingsbeleidAPIMock = () => [ } ) }), - http.post('*/visie-algemeen/static/:lineageId', async () => { + http.post('*/werkingsgebied/static/:lineageId', async () => { await delay(1000) return new HttpResponse( - JSON.stringify(getVisieAlgemeenStaticLineageIdPostMock()), + JSON.stringify(getWerkingsgebiedStaticLineageIdPostMock()), { status: 200, headers: { @@ -12517,12 +14268,12 @@ export const getOmgevingsbeleidAPIMock = () => [ ) }), http.get( - '*/modules/:moduleId/object/visie-algemeen/:lineageId', + '*/modules/:moduleId/object/werkingsgebied/:lineageId', async () => { await delay(1000) return new HttpResponse( JSON.stringify( - getModulesModuleIdObjectVisieAlgemeenLineageIdGetMock() + getModulesModuleIdObjectWerkingsgebiedLineageIdGetMock() ), { status: 200, @@ -12534,12 +14285,12 @@ export const getOmgevingsbeleidAPIMock = () => [ } ), http.patch( - '*/modules/:moduleId/object/visie-algemeen/:lineageId', + '*/modules/:moduleId/object/werkingsgebied/:lineageId', async () => { await delay(1000) return new HttpResponse( JSON.stringify( - getModulesModuleIdObjectVisieAlgemeenLineageIdPatchMock() + getModulesModuleIdObjectWerkingsgebiedLineageIdPatchMock() ), { status: 200, @@ -12551,12 +14302,12 @@ export const getOmgevingsbeleidAPIMock = () => [ } ), http.get( - '*/modules/:moduleId/object/visie-algemeen/latest/:lineageId', + '*/modules/:moduleId/object/werkingsgebied/latest/:lineageId', async () => { await delay(1000) return new HttpResponse( JSON.stringify( - getModulesModuleIdObjectVisieAlgemeenLatestLineageIdGetMock() + getModulesModuleIdObjectWerkingsgebiedLatestLineageIdGetMock() ), { status: 200, @@ -12568,12 +14319,12 @@ export const getOmgevingsbeleidAPIMock = () => [ } ), http.get( - '*/modules/:moduleId/object/visie-algemeen/version/:objectUuid', + '*/modules/:moduleId/object/werkingsgebied/version/:objectUuid', async () => { await delay(1000) return new HttpResponse( JSON.stringify( - getModulesModuleIdObjectVisieAlgemeenVersionObjectUuidGetMock() + getModulesModuleIdObjectWerkingsgebiedVersionObjectUuidGetMock() ), { status: 200, @@ -12584,11 +14335,11 @@ export const getOmgevingsbeleidAPIMock = () => [ ) } ), - http.get('*/modules/object/visie-algemeen/active/:lineageId', async () => { + http.get('*/modules/object/werkingsgebied/active/:lineageId', async () => { await delay(1000) return new HttpResponse( JSON.stringify( - getModulesObjectVisieAlgemeenActiveLineageIdGetMock() + getModulesObjectWerkingsgebiedActiveLineageIdGetMock() ), { status: 200, @@ -12599,12 +14350,12 @@ export const getOmgevingsbeleidAPIMock = () => [ ) }), http.get( - '*/revisions/:moduleId/visie-algemeen/version/:objectUuid', + '*/revisions/:moduleId/werkingsgebied/version/:objectUuid', async () => { await delay(1000) return new HttpResponse( JSON.stringify( - getRevisionsModuleIdVisieAlgemeenVersionObjectUuidGetMock() + getRevisionsModuleIdWerkingsgebiedVersionObjectUuidGetMock() ), { status: 200, @@ -12708,6 +14459,24 @@ export const getOmgevingsbeleidAPIMock = () => [ } ) }), + http.post('*/playground/do-dso/:moduleId', async () => { + await delay(1000) + return new HttpResponse(null, { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + }) + }), + http.get('*/playground/check-geo', async () => { + await delay(1000) + return new HttpResponse(null, { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + }) + }), http.get('*/users', async () => { await delay(1000) return new HttpResponse(JSON.stringify(getUsersGetMock()), { @@ -12765,32 +14534,38 @@ export const getOmgevingsbeleidAPIMock = () => [ } ) }), - http.get('*/werkingsgebieden', async () => { + http.get('*/source-werkingsgebieden', async () => { await delay(1000) - return new HttpResponse(JSON.stringify(getWerkingsgebiedenGetMock()), { - status: 200, - headers: { - 'Content-Type': 'application/json', - }, - }) + return new HttpResponse( + JSON.stringify(getSourceWerkingsgebiedenGetMock()), + { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + } + ) }), - http.post('*/search/geo', async () => { + http.post('*/search/source-geo', async () => { await delay(1000) - return new HttpResponse(JSON.stringify(getSearchGeoPostMock()), { + return new HttpResponse(JSON.stringify(getSearchSourceGeoPostMock()), { status: 200, headers: { 'Content-Type': 'application/json', }, }) }), - http.post('*/search/geometry', async () => { + http.post('*/search/source-geometry', async () => { await delay(1000) - return new HttpResponse(JSON.stringify(getSearchGeometryPostMock()), { - status: 200, - headers: { - 'Content-Type': 'application/json', - }, - }) + return new HttpResponse( + JSON.stringify(getSearchSourceGeometryPostMock()), + { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + } + ) }), http.post('*/search', async () => { await delay(1000) @@ -12942,6 +14717,15 @@ export const getOmgevingsbeleidAPIMock = () => [ } ) }), + http.get('*/modules/:moduleId/diff', async () => { + await delay(1000) + return new HttpResponse(null, { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + }) + }), http.post('*/modules/:moduleId/add-new-object', async () => { await delay(1000) return new HttpResponse( @@ -13041,6 +14825,15 @@ export const getOmgevingsbeleidAPIMock = () => [ } ) }), + http.get('*/objects/valid/count', async () => { + await delay(1000) + return new HttpResponse(JSON.stringify(getObjectsValidCountGetMock()), { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + }) + }), http.get('*/objects/valid', async () => { await delay(1000) return new HttpResponse(JSON.stringify(getObjectsValidGetMock()), { @@ -13050,6 +14843,157 @@ export const getOmgevingsbeleidAPIMock = () => [ }, }) }), + http.get('*/publications', async () => { + await delay(1000) + return new HttpResponse(JSON.stringify(getPublicationsGetMock()), { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + }) + }), + http.post('*/publications', async () => { + await delay(1000) + return new HttpResponse(JSON.stringify(getPublicationsPostMock()), { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + }) + }), + http.get('*/publications/:publicationUuid', async () => { + await delay(1000) + return new HttpResponse( + JSON.stringify(getPublicationsPublicationUuidGetMock()), + { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + } + ) + }), + http.patch('*/publications/:publicationUuid', async () => { + await delay(1000) + return new HttpResponse( + JSON.stringify(getPublicationsPublicationUuidPatchMock()), + { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + } + ) + }), + http.get('*/publications/:publicationUuid/bills', async () => { + await delay(1000) + return new HttpResponse( + JSON.stringify(getPublicationsPublicationUuidBillsGetMock()), + { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + } + ) + }), + http.post('*/publications/:publicationUuid/bills', async () => { + await delay(1000) + return new HttpResponse( + JSON.stringify(getPublicationsPublicationUuidBillsPostMock()), + { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + } + ) + }), + http.get('*/publications/:publicationUuid/bills/:billUuid', async () => { + await delay(1000) + return new HttpResponse( + JSON.stringify( + getPublicationsPublicationUuidBillsBillUuidGetMock() + ), + { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + } + ) + }), + http.patch('*/publications/:publicationUuid/bills/:billUuid', async () => { + await delay(1000) + return new HttpResponse( + JSON.stringify( + getPublicationsPublicationUuidBillsBillUuidPatchMock() + ), + { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + } + ) + }), + http.get('*/publication-bills/:billUuid/packages', async () => { + await delay(1000) + return new HttpResponse( + JSON.stringify(getPublicationBillsBillUuidPackagesGetMock()), + { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + } + ) + }), + http.post('*/publication-bills/:billUuid/packages', async () => { + await delay(1000) + return new HttpResponse( + JSON.stringify(getPublicationBillsBillUuidPackagesPostMock()), + { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + } + ) + }), + http.post('*/publication-packages/:packageUuid/report', async () => { + await delay(1000) + return new HttpResponse( + JSON.stringify(getPublicationPackagesPackageUuidReportPostMock()), + { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + } + ) + }), + http.get( + '*/publication-packages/:packageUuid/report/download', + async () => { + await delay(1000) + return new HttpResponse(null, { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + }) + } + ), + http.get('*/publication-packages/:packageUuid/download', async () => { + await delay(1000) + return new HttpResponse(null, { + status: 200, + headers: { + 'Content-Type': 'application/json', + }, + }) + }), http.post('*/login/access-token', async () => { await delay(1000) return new HttpResponse(JSON.stringify(getLoginAccessTokenPostMock()), { diff --git a/src/api/fetchers.schemas.ts b/src/api/fetchers.schemas.ts index e6b5f824..ce15a3dc 100644 --- a/src/api/fetchers.schemas.ts +++ b/src/api/fetchers.schemas.ts @@ -13,6 +13,27 @@ export type PasswordResetPostParams = { new_password: string } +export type PublicationBillsBillUuidPackagesGetParams = { + package_event_type?: PackageEventType + is_successful?: boolean + offset?: number + limit?: number +} + +export type PublicationsPublicationUuidBillsGetParams = { + version_id?: number + module_status?: ModuleStatusCode + offset?: number + limit?: number +} + +export type PublicationsGetParams = { + document_type?: DocumentType + module_ID?: number + offset?: number + limit?: number +} + export type ObjectsValidGetParams = { owner_uuid?: string object_type?: string @@ -35,6 +56,11 @@ export type ModulesObjectsLatestGetParams = { sort_order?: SortOrder } +export type ModulesModuleIdDiffGetParams = { + output_format?: Format + status_id?: number +} + export type ModulesGetParams = { only_mine?: boolean only_active?: boolean @@ -65,21 +91,21 @@ export type SearchPostParams = { limit?: number } -export type SearchGeometryPostParams = { +export type SearchSourceGeometryPostParams = { offset?: number limit?: number sort_column?: string sort_order?: SortOrder } -export type SearchGeoPostParams = { +export type SearchSourceGeoPostParams = { offset?: number limit?: number sort_column?: string sort_order?: SortOrder } -export type WerkingsgebiedenGetParams = { +export type SourceWerkingsgebiedenGetParams = { offset?: number limit?: number sort_column?: string @@ -103,6 +129,13 @@ export type UsersGetParams = { sort_order?: SortOrder } +export type PlaygroundDoDsoModuleIdPostParams = { + work_version: string + document_type: DocumentType + geo_new?: boolean + opdracht_type?: OpdrachtType +} + export type WettelijkeTaakValidGetParams = { all_filters?: string any_filters?: string @@ -112,6 +145,37 @@ export type WettelijkeTaakValidGetParams = { sort_order?: SortOrder } +export type ModulesObjectWerkingsgebiedActiveLineageIdGetParams = { + minimum_status?: ModuleStatusCode +} + +export type ModulesModuleIdObjectWerkingsgebiedLineageIdGetParams = { + all_filters?: string + any_filters?: string + offset?: number + limit?: number + sort_column?: string + sort_order?: SortOrder +} + +export type WerkingsgebiedenValidLineageIdGetParams = { + all_filters?: string + any_filters?: string + offset?: number + limit?: number + sort_column?: string + sort_order?: SortOrder +} + +export type WerkingsgebiedenValidGetParams = { + all_filters?: string + any_filters?: string + offset?: number + limit?: number + sort_column?: string + sort_order?: SortOrder +} + export type ModulesObjectVisieAlgemeenActiveLineageIdGetParams = { minimum_status?: ModuleStatusCode } @@ -465,6 +529,91 @@ export interface WettelijkeTaakBasic { Weblink?: string } +export interface WerkingsgebiedUUID { + Object_ID?: number + UUID?: string +} + +export interface WerkingsgebiedStatics { + Cached_Title: string + Code: string + Object_ID: number + Object_Type: string +} + +export interface WerkingsgebiedStaticPostStatics { + Owner_1_UUID?: string | null + Owner_2_UUID?: string | null +} + +export interface WerkingsgebiedPatch { + Area_UUID?: string | null + Description?: string | null + Title?: string | null +} + +export interface WerkingsgebiedFullStatics { + Owner_1?: UserShort + Owner_2?: UserShort +} + +export type WerkingsgebiedFullObjectStatics = WerkingsgebiedFullStatics | null + +export interface WerkingsgebiedFull { + Adjust_On?: string | null + Area?: AreaBasic + Area_UUID?: string + Code?: string + Created_By?: UserShort + Created_Date?: string + Description?: string + End_Validity?: string | null + Modified_By?: UserShort + Modified_Date?: string + Object_ID?: number + ObjectStatics?: WerkingsgebiedFullObjectStatics + Start_Validity?: string | null + Title?: string + UUID?: string +} + +export interface WerkingsgebiedExtendedStatics { + Owner_1?: UserShort + Owner_2?: UserShort +} + +export type WerkingsgebiedExtendedObjectStatics = + WerkingsgebiedExtendedStatics | null + +export interface WerkingsgebiedExtended { + Adjust_On?: string | null + Area_UUID?: string + Code?: string + Created_By?: UserShort + Created_Date?: string + End_Validity?: string | null + Modified_By?: UserShort + Modified_Date?: string + Object_ID?: number + ObjectStatics?: WerkingsgebiedExtendedObjectStatics + Start_Validity?: string | null + Title?: string + UUID?: string +} + +export interface WerkingsgebiedBasic { + Adjust_On?: string | null + Area_UUID?: string + Code?: string + Created_Date?: string + End_Validity?: string | null + Modified_Date?: string + Object_ID?: number + Start_Validity?: string | null + Title?: string + UUID?: string +} + export interface Werkingsgebied { Created_Date: string End_Validity?: string @@ -514,9 +663,29 @@ export interface VisieAlgemeenFull { UUID?: string } +export interface VisieAlgemeenExtendedStatics { + Owner_1?: UserShort + Owner_2?: UserShort +} + export type VisieAlgemeenExtendedObjectStatics = VisieAlgemeenExtendedStatics | null +export interface VisieAlgemeenExtended { + Adjust_On?: string | null + Code?: string + Created_By?: UserShort + Created_Date?: string + End_Validity?: string | null + Modified_By?: UserShort + Modified_Date?: string + Object_ID?: number + ObjectStatics?: VisieAlgemeenExtendedObjectStatics + Start_Validity?: string | null + Title?: string + UUID?: string +} + export interface VisieAlgemeenBasic { Adjust_On?: string | null Code?: string @@ -549,32 +718,9 @@ export interface VerplichtProgrammaMinimal { UUID?: string } -export interface VerplichtProgrammaFullStatics { - Owner_1?: UserShort - Owner_2?: UserShort -} - export type VerplichtProgrammaFullObjectStatics = VerplichtProgrammaFullStatics | null -export interface VerplichtProgrammaFull { - Code?: string - Created_By?: UserShort - Created_Date?: string - Description?: string - End_Validity?: string | null - Maatregelen?: ReadRelationShortMaatregelMinimal[] - Modified_By?: UserShort - Modified_Date?: string - Object_ID?: number - Object_Type?: string - ObjectStatics?: VerplichtProgrammaFullObjectStatics - Start_Validity?: string | null - Title?: string - UUID?: string - WettelijkeTaken?: WettelijkeTaakMinimal[] -} - export interface VerplichtProgrammaEdit { Description?: string | null Title?: string | null @@ -628,24 +774,27 @@ export interface UserShort { UUID: string } -export interface VisieAlgemeenExtendedStatics { +export interface VerplichtProgrammaFullStatics { Owner_1?: UserShort Owner_2?: UserShort } -export interface VisieAlgemeenExtended { - Adjust_On?: string | null +export interface VerplichtProgrammaFull { Code?: string Created_By?: UserShort Created_Date?: string + Description?: string End_Validity?: string | null + Maatregelen?: ReadRelationShortMaatregelMinimal[] Modified_By?: UserShort Modified_Date?: string Object_ID?: number - ObjectStatics?: VisieAlgemeenExtendedObjectStatics + Object_Type?: string + ObjectStatics?: VerplichtProgrammaFullObjectStatics Start_Validity?: string | null Title?: string UUID?: string + WettelijkeTaken?: WettelijkeTaakMinimal[] } export interface UserCreateResponse { @@ -682,6 +831,7 @@ export const SortOrder = { } as const export interface SearchRequestData { + Like?: boolean Object_Types?: string[] } @@ -769,6 +919,145 @@ export interface ReadRelation { Title?: string | null } +export interface PublicationPackageReport { + Created_Date: string + ID: number + Messages?: string + Package_UUID: string + Report_Timestamp?: string + Report_Type?: string + Result?: string +} + +export interface PublicationPackageCreate { + Announcement_Date?: string + Config_ID?: number + Package_Event_Type: PackageEventType +} + +export interface PublicationFRBR { + act_expression_date: string + act_expression_lang: string + act_expression_misc?: string + act_expression_version: string + act_work_country: string + act_work_date: string + act_work_misc?: string + bill_expression_date: string + bill_expression_lang: string + bill_expression_misc?: string + bill_expression_version: string + bill_work_country: string + bill_work_date: string + bill_work_misc?: string + Created_Date: string + ID: number +} + +export interface PublicationEdit { + Official_Title?: string + Regulation_Title?: string + Template_ID?: number +} + +export interface PublicationCreate { + Document_Type: DocumentType + Module_ID: number + Official_Title: string + Regulation_Title: string + Template_ID?: number +} + +export interface PublicationConfig { + Authority_ID: string + Created_Date: string + DSO_BHKV_VERSION: string + DSO_STOP_VERSION: string + DSO_TPOD_VERSION: string + ID: number + Jurisdiction: string + Province_ID: string + Subjects: string + Submitter_ID: string +} + +export interface PublicationPackage { + Announcement_Date: string + Bill_UUID: string + Config_ID: number + Created_Date: string + FRBR_ID: number + FRBR_Info?: PublicationFRBR + Modified_Date: string + Package_Event_Type: PackageEventType + Publication_Bill?: PublicationBill + Publication_Config?: PublicationConfig + Publication_Filename?: string + Reports?: PublicationPackageReport[] + UUID: string + Validation_Status?: string + ZIP_File_Checksum?: string + ZIP_File_Name?: string +} + +export interface PublicationBillShort { + Created_Date: string + Is_Official: boolean + Modified_Date: string + Module_Status_ID: number + Procedure_Type: ProcedureType + Publication_UUID: string + UUID: string + Version_ID?: number +} + +export interface PublicationBillEdit { + Announcement_Date?: string + Bill_Data?: BillData + Effective_Date?: string + Procedure_Data?: ProcedureData +} + +export interface PublicationBillCreate { + Announcement_Date?: string + Bill_Data?: BillData + Effective_Date?: string + Is_Official: boolean + Module_Status_ID: number + Procedure_Data?: ProcedureData + Procedure_Type: ProcedureType +} + +/** + * STOP Besluit + */ +export interface PublicationBill { + Announcement_Date: string + Bill_Data?: BillData + Created_Date: string + Effective_Date: string + Is_Official: boolean + Modified_Date: string + Module_Status_ID: number + Procedure_Data?: ProcedureData + Procedure_Type: ProcedureType + Publication_UUID: string + UUID: string + Version_ID?: number +} + +export interface Publication { + Created_Date: string + Document_Type: DocumentType + Modified_Date: string + Module_ID: number + Official_Title: string + Regulation_Title: string + Template_ID?: number + UUID: string + Work_ID: number +} + export interface PublicModuleShort { Description: string Module_ID: number @@ -880,6 +1169,33 @@ export interface ProgrammaAlgemeenBasic { UUID?: string } +/** + * An enumeration. + */ +export type ProcedureType = (typeof ProcedureType)[keyof typeof ProcedureType] + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const ProcedureType = { + Ontwerp: 'Ontwerp', + Definitief: 'Definitief', +} as const + +/** + * STOP Procedurestap + */ +export interface ProcedureStep { + Conclusion_Date: string + Step_Type: string +} + +/** + * STOP Procedureverloop + */ +export interface ProcedureData { + Announcement_Date: string + Steps?: ProcedureStep[] +} + /** * Wrap any response schema and add pagination metadata. */ @@ -900,6 +1216,26 @@ export interface PagedResponseWerkingsgebied { total: number } +/** + * Wrap any response schema and add pagination metadata. + */ +export interface PagedResponseWerkingsgebiedExtended { + limit?: number + offset?: number + results: WerkingsgebiedExtended[] + total: number +} + +/** + * Wrap any response schema and add pagination metadata. + */ +export interface PagedResponseWerkingsgebiedBasic { + limit?: number + offset?: number + results: WerkingsgebiedBasic[] + total: number +} + /** * Wrap any response schema and add pagination metadata. */ @@ -960,6 +1296,36 @@ export interface PagedResponseSearchObject { total: number } +/** + * Wrap any response schema and add pagination metadata. + */ +export interface PagedResponsePublication { + limit?: number + offset?: number + results: Publication[] + total: number +} + +/** + * Wrap any response schema and add pagination metadata. + */ +export interface PagedResponsePublicationPackage { + limit?: number + offset?: number + results: PublicationPackage[] + total: number +} + +/** + * Wrap any response schema and add pagination metadata. + */ +export interface PagedResponsePublicationBillShort { + limit?: number + offset?: number + results: PublicationBillShort[] + total: number +} + /** * Wrap any response schema and add pagination metadata. */ @@ -1160,6 +1526,30 @@ export interface PagedResponseAmbitieBasic { total: number } +/** + * An enumeration. + */ +export type PackageEventType = + (typeof PackageEventType)[keyof typeof PackageEventType] + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const PackageEventType = { + Validatie: 'Validatie', + Publicatie: 'Publicatie', + Afbreken: 'Afbreken', +} as const + +/** + * An enumeration. + */ +export type OpdrachtType = (typeof OpdrachtType)[keyof typeof OpdrachtType] + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const OpdrachtType = { + PUBLICATIE: 'PUBLICATIE', + VALIDATIE: 'VALIDATIE', +} as const + export interface ObjectStaticShort { Client_1_UUID?: string Owner_1_UUID?: string @@ -1174,6 +1564,11 @@ export interface ObjectSpecifiekeGeldigheid { Start_Validity?: string | null } +export interface ObjectCount { + Count: number + Object_Type: string +} + export interface NewObjectStaticResponse { Code: string Object_ID: number @@ -1331,12 +1726,6 @@ export interface ModuleObjectShort { UUID: string } -export interface ModuleOverview { - Module: Module - Objects: ModuleObjectShort[] - StatusHistory: ModuleStatus[] -} - export interface ModuleObjectContext { Action: string Code: string @@ -1442,6 +1831,12 @@ export interface Module { Title: string } +export interface ModuleOverview { + Module: Module + Objects: ModuleObjectShort[] + StatusHistory: ModuleStatus[] +} + export interface MaatregelUUID { Object_ID?: number UUID?: string @@ -1462,6 +1857,7 @@ export interface MaatregelPatch { Hierarchy_Code?: string | null Role?: string | null Title?: string | null + Werkingsgebied_Code?: string | null } export interface MaatregelMinimal { @@ -1481,6 +1877,33 @@ export interface MaatregelFullStatics { export type MaatregelFullObjectStatics = MaatregelFullStatics | null +export interface MaatregelFull { + Adjust_On?: string | null + Beleidsdoelen?: ReadRelationShortBeleidsdoelMinimal[] + Beleidskeuzes?: ReadRelationShortBeleidskeuzeMinimal[] + Code?: string + Created_By?: UserShort + Created_Date?: string + Description?: string + Effect?: string + End_Validity?: string | null + Gebied?: Werkingsgebied + Gebiedsprogrammas?: ReadRelationShortGebiedsprogrammaMinimal[] + Hierarchy_Code?: string + Hierarchy_Statics?: HierarchyStatics + Modified_By?: UserShort + Modified_Date?: string + Object_ID?: number + ObjectStatics?: MaatregelFullObjectStatics + Public_Revisions?: PublicModuleObjectRevision[] + Role?: string + Start_Validity?: string | null + Title?: string + UUID?: string + Werkingsgebied_Code?: string + Werkingsgebied_Statics?: WerkingsgebiedStatics +} + export interface MaatregelExtendedStatics { Client_1?: UserShort Owner_1?: UserShort @@ -1506,6 +1929,7 @@ export interface MaatregelExtended { Start_Validity?: string | null Title?: string UUID?: string + Werkingsgebied_Code?: string } export interface MaatregelBasic { @@ -1533,31 +1957,6 @@ export interface HierarchyStatics { Object_Type: string } -export interface MaatregelFull { - Adjust_On?: string | null - Beleidsdoelen?: ReadRelationShortBeleidsdoelMinimal[] - Beleidskeuzes?: ReadRelationShortBeleidskeuzeMinimal[] - Code?: string - Created_By?: UserShort - Created_Date?: string - Description?: string - Effect?: string - End_Validity?: string | null - Gebied?: Werkingsgebied - Gebiedsprogrammas?: ReadRelationShortGebiedsprogrammaMinimal[] - Hierarchy_Code?: string - Hierarchy_Statics?: HierarchyStatics - Modified_By?: UserShort - Modified_Date?: string - Object_ID?: number - ObjectStatics?: MaatregelFullObjectStatics - Public_Revisions?: PublicModuleObjectRevision[] - Role?: string - Start_Validity?: string | null - Title?: string - UUID?: string -} - export interface HTTPValidationError { detail?: ValidationError[] } @@ -1570,11 +1969,6 @@ export interface GraphVertice { UUID: string } -export interface GraphResponse { - Edges: GraphEdge[] - Vertices: GraphVertice[] -} - /** * An enumeration. */ @@ -1592,6 +1986,11 @@ export interface GraphEdge { Vertice_B_Code: string } +export interface GraphResponse { + Edges: GraphEdge[] + Vertices: GraphVertice[] +} + /** * An enumeration. */ @@ -1721,6 +2120,20 @@ export interface GebiedsprogrammaBasic { UUID?: string } +/** + * An enumeration. + */ +export type Format = (typeof Format)[keyof typeof Format] + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const Format = { + html: 'html', + odt: 'odt', + doc: 'doc', + docx: 'docx', + pdf: 'pdf', +} as const + export interface EditUser { Email?: string | null Gebruikersnaam?: string | null @@ -1737,6 +2150,29 @@ export interface EditAcknowledgedRelation { Object_Type: string } +/** + * An enumeration. + */ +export type DocumentType = (typeof DocumentType)[keyof typeof DocumentType] + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const DocumentType = { + Omgevingsvisie: 'Omgevingsvisie', + Omgevingsprogramma: 'Omgevingsprogramma', + Omgevingsverordening: 'Omgevingsverordening', +} as const + +/** + * An enumeration. + */ +export type DocumentType = (typeof DocumentType)[keyof typeof DocumentType] + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const DocumentType = { + Programma: 'Programma', + Omgevingsvisie: 'Omgevingsvisie', +} as const + export interface CompleteModule { Decision_Number: string Default_Start_Validity?: string | null @@ -1745,6 +2181,10 @@ export interface CompleteModule { ObjectSpecifiekeGeldigheden?: ObjectSpecifiekeGeldigheid[] } +export interface BodyFastapiHandlerPublicationPackagesPackageUuidReportPost { + xml_file: Blob +} + export interface BodyFastapiHandlerLoginAccessTokenPost { client_id?: string client_secret?: string @@ -1754,6 +2194,25 @@ export interface BodyFastapiHandlerLoginAccessTokenPost { username: string } +/** + * STOP Artikel + */ +export interface BillArticle { + Content: string + Label: string + Number: string +} + +export interface BillData { + Amendment_Article?: AmendmentArticle + Articles?: BillArticle[] + Bill_Title: string + Closing: string + Preamble?: string + Regulation_Title: string + Signature: string +} + export interface BeleidsregelUUID { Object_ID?: number UUID?: string @@ -1870,6 +2329,7 @@ export interface BeleidskeuzePatch { Hierarchy_Code?: string | null Provincial_Interest?: string | null Title?: string | null + Werkingsgebied_Code?: string | null } export interface BeleidskeuzeMinimal { @@ -1914,6 +2374,8 @@ export interface BeleidskeuzeFull { Start_Validity?: string | null Title?: string UUID?: string + Werkingsgebied_Code?: string + Werkingsgebied_Statics?: WerkingsgebiedStatics WettelijkeTaken?: ReadRelationShortWettelijkeTaakMinimal[] } @@ -1942,6 +2404,7 @@ export interface BeleidskeuzeExtended { Start_Validity?: string | null Title?: string UUID?: string + Werkingsgebied_Code?: string } export interface BeleidskeuzeBasic { @@ -2060,6 +2523,24 @@ export interface AuthToken { token_type: string } +export interface AreaBasic { + Created_By_UUID: string + Created_Date: string + Source_Modified_Date: string + Source_Title: string + Source_UUID: string + UUID: string +} + +/** + * STOP WijzigingArtikel + */ +export interface AmendmentArticle { + Content: string + Label: string + Number: string +} + export interface AmbitieUUID { Object_ID?: number UUID?: string diff --git a/src/api/fetchers.ts b/src/api/fetchers.ts index 4f0c93a7..10a60424 100644 --- a/src/api/fetchers.ts +++ b/src/api/fetchers.ts @@ -48,6 +48,7 @@ import type { BeleidsregelsValidGetParams, BeleidsregelsValidLineageIdGetParams, BodyFastapiHandlerLoginAccessTokenPost, + BodyFastapiHandlerPublicationPackagesPackageUuidReportPost, CompleteModule, EditAcknowledgedRelation, EditUser, @@ -78,6 +79,7 @@ import type { ModuleSnapshot, ModuleStatus, ModulesGetParams, + ModulesModuleIdDiffGetParams, ModulesModuleIdObjectAmbitieLineageIdGetParams, ModulesModuleIdObjectBeleidsdoelLineageIdGetParams, ModulesModuleIdObjectBeleidskeuzeLineageIdGetParams, @@ -86,10 +88,12 @@ import type { ModulesModuleIdObjectMaatregelLineageIdGetParams, ModulesModuleIdObjectProgrammaAlgemeenLineageIdGetParams, ModulesModuleIdObjectVisieAlgemeenLineageIdGetParams, + ModulesModuleIdObjectWerkingsgebiedLineageIdGetParams, ModulesObjectAmbitieActiveLineageIdGetParams, ModulesObjectBeleidsdoelActiveLineageIdGetParams, ModulesObjectProgrammaAlgemeenActiveLineageIdGetParams, ModulesObjectVisieAlgemeenActiveLineageIdGetParams, + ModulesObjectWerkingsgebiedActiveLineageIdGetParams, ModulesObjectsBeleidskeuzeActiveLineageIdGetParams, ModulesObjectsBeleidsregelActiveLineageIdGetParams, ModulesObjectsGebiedsprogrammaActiveLineageIdGetParams, @@ -102,6 +106,7 @@ import type { NationaalBelangUUID, NationaalBelangValidGetParams, NewObjectStaticResponse, + ObjectCount, ObjectGraphGetParams, ObjectsValidGetParams, PagedResponseAmbitieBasic, @@ -124,6 +129,9 @@ import type { PagedResponseProgrammaAlgemeenBasic, PagedResponseProgrammaAlgemeenExtended, PagedResponsePublicModuleShort, + PagedResponsePublication, + PagedResponsePublicationBillShort, + PagedResponsePublicationPackage, PagedResponseSearchObject, PagedResponseUser, PagedResponseValidSearchObject, @@ -131,8 +139,11 @@ import type { PagedResponseVisieAlgemeenBasic, PagedResponseVisieAlgemeenExtended, PagedResponseWerkingsgebied, + PagedResponseWerkingsgebiedBasic, + PagedResponseWerkingsgebiedExtended, PagedResponseWettelijkeTaakBasic, PasswordResetPostParams, + PlaygroundDoDsoModuleIdPostParams, ProgrammaAlgemeenFull, ProgrammaAlgemeenPatch, ProgrammaAlgemeenStaticPostStatics, @@ -140,17 +151,30 @@ import type { ProgrammasAlgemeenValidGetParams, ProgrammasAlgemeenValidLineageIdGetParams, PublicModuleOverview, + Publication, + PublicationBill, + PublicationBillCreate, + PublicationBillEdit, + PublicationBillsBillUuidPackagesGetParams, + PublicationCreate, + PublicationEdit, + PublicationPackage, + PublicationPackageCreate, + PublicationPackageReport, + PublicationsGetParams, + PublicationsPublicationUuidBillsGetParams, ReadRelation, RequestAcknowledgedRelation, ResetPasswordResponse, ResponseOK, RevisionsGetParams, - SearchGeoPostParams, SearchGeoRequestData, - SearchGeometryPostParams, SearchPostParams, SearchRequestData, + SearchSourceGeoPostParams, + SearchSourceGeometryPostParams, SearchValidPostParams, + SourceWerkingsgebiedenGetParams, User, UserCreate, UserCreateResponse, @@ -168,7 +192,12 @@ import type { VisieAlgemeenUUID, VisiesAlgemeenValidGetParams, VisiesAlgemeenValidLineageIdGetParams, - WerkingsgebiedenGetParams, + WerkingsgebiedFull, + WerkingsgebiedPatch, + WerkingsgebiedStaticPostStatics, + WerkingsgebiedUUID, + WerkingsgebiedenValidGetParams, + WerkingsgebiedenValidLineageIdGetParams, WettelijkeTaakCreate, WettelijkeTaakEdit, WettelijkeTaakFull, @@ -12464,241 +12493,35 @@ export const useRevisionsModuleIdVisieAlgemeenVersionObjectUuidGet = < } /** - * @summary Add new object - */ -export const wettelijkeTaakPost = ( - wettelijkeTaakCreate: WettelijkeTaakCreate -) => { - return customInstance({ - url: `/wettelijke-taak`, - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - data: wettelijkeTaakCreate, - }) -} - -export const getWettelijkeTaakPostMutationOptions = < - TError = HTTPValidationError, - TContext = unknown ->(options?: { - mutation?: UseMutationOptions< - Awaited>, - TError, - { data: WettelijkeTaakCreate }, - TContext - > -}): UseMutationOptions< - Awaited>, - TError, - { data: WettelijkeTaakCreate }, - TContext -> => { - const { mutation: mutationOptions } = options ?? {} - - const mutationFn: MutationFunction< - Awaited>, - { data: WettelijkeTaakCreate } - > = props => { - const { data } = props ?? {} - - return wettelijkeTaakPost(data) - } - - return { mutationFn, ...mutationOptions } -} - -export type WettelijkeTaakPostMutationResult = NonNullable< - Awaited> -> -export type WettelijkeTaakPostMutationBody = WettelijkeTaakCreate -export type WettelijkeTaakPostMutationError = HTTPValidationError - -/** - * @summary Add new object - */ -export const useWettelijkeTaakPost = < - TError = HTTPValidationError, - TContext = unknown ->(options?: { - mutation?: UseMutationOptions< - Awaited>, - TError, - { data: WettelijkeTaakCreate }, - TContext - > -}) => { - const mutationOptions = getWettelijkeTaakPostMutationOptions(options) - - return useMutation(mutationOptions) -} - -/** - * @summary Edit atemporal object - */ -export const wettelijkeTaakLineageIdPost = ( - lineageId: number, - wettelijkeTaakEdit: WettelijkeTaakEdit -) => { - return customInstance({ - url: `/wettelijke-taak/${lineageId}`, - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - data: wettelijkeTaakEdit, - }) -} - -export const getWettelijkeTaakLineageIdPostMutationOptions = < - TError = HTTPValidationError, - TContext = unknown ->(options?: { - mutation?: UseMutationOptions< - Awaited>, - TError, - { lineageId: number; data: WettelijkeTaakEdit }, - TContext - > -}): UseMutationOptions< - Awaited>, - TError, - { lineageId: number; data: WettelijkeTaakEdit }, - TContext -> => { - const { mutation: mutationOptions } = options ?? {} - - const mutationFn: MutationFunction< - Awaited>, - { lineageId: number; data: WettelijkeTaakEdit } - > = props => { - const { lineageId, data } = props ?? {} - - return wettelijkeTaakLineageIdPost(lineageId, data) - } - - return { mutationFn, ...mutationOptions } -} - -export type WettelijkeTaakLineageIdPostMutationResult = NonNullable< - Awaited> -> -export type WettelijkeTaakLineageIdPostMutationBody = WettelijkeTaakEdit -export type WettelijkeTaakLineageIdPostMutationError = HTTPValidationError - -/** - * @summary Edit atemporal object - */ -export const useWettelijkeTaakLineageIdPost = < - TError = HTTPValidationError, - TContext = unknown ->(options?: { - mutation?: UseMutationOptions< - Awaited>, - TError, - { lineageId: number; data: WettelijkeTaakEdit }, - TContext - > -}) => { - const mutationOptions = - getWettelijkeTaakLineageIdPostMutationOptions(options) - - return useMutation(mutationOptions) -} - -/** - * @summary Delete atemporal object - */ -export const wettelijkeTaakLineageIdDelete = (lineageId: number) => { - return customInstance({ - url: `/wettelijke-taak/${lineageId}`, - method: 'DELETE', - }) -} - -export const getWettelijkeTaakLineageIdDeleteMutationOptions = < - TError = HTTPValidationError, - TContext = unknown ->(options?: { - mutation?: UseMutationOptions< - Awaited>, - TError, - { lineageId: number }, - TContext - > -}): UseMutationOptions< - Awaited>, - TError, - { lineageId: number }, - TContext -> => { - const { mutation: mutationOptions } = options ?? {} - - const mutationFn: MutationFunction< - Awaited>, - { lineageId: number } - > = props => { - const { lineageId } = props ?? {} - - return wettelijkeTaakLineageIdDelete(lineageId) - } - - return { mutationFn, ...mutationOptions } -} - -export type WettelijkeTaakLineageIdDeleteMutationResult = NonNullable< - Awaited> -> - -export type WettelijkeTaakLineageIdDeleteMutationError = HTTPValidationError - -/** - * @summary Delete atemporal object - */ -export const useWettelijkeTaakLineageIdDelete = < - TError = HTTPValidationError, - TContext = unknown ->(options?: { - mutation?: UseMutationOptions< - Awaited>, - TError, - { lineageId: number }, - TContext - > -}) => { - const mutationOptions = - getWettelijkeTaakLineageIdDeleteMutationOptions(options) - - return useMutation(mutationOptions) -} - -/** - * @summary Get all the valid wettelijke_taak lineages and shows the latest object of each + * @summary Get all the valid werkingsgebied lineages and shows the latest object of each */ -export const wettelijkeTaakValidGet = ( - params?: WettelijkeTaakValidGetParams, +export const werkingsgebiedenValidGet = ( + params?: WerkingsgebiedenValidGetParams, signal?: AbortSignal ) => { - return customInstance({ - url: `/wettelijke-taak/valid`, + return customInstance({ + url: `/werkingsgebieden/valid`, method: 'GET', params, signal, }) } -export const getWettelijkeTaakValidGetQueryKey = ( - params?: WettelijkeTaakValidGetParams +export const getWerkingsgebiedenValidGetQueryKey = ( + params?: WerkingsgebiedenValidGetParams ) => { - return [`/wettelijke-taak/valid`, ...(params ? [params] : [])] as const + return [`/werkingsgebieden/valid`, ...(params ? [params] : [])] as const } -export const getWettelijkeTaakValidGetQueryOptions = < - TData = Awaited>, +export const getWerkingsgebiedenValidGetQueryOptions = < + TData = Awaited>, TError = HTTPValidationError >( - params?: WettelijkeTaakValidGetParams, + params?: WerkingsgebiedenValidGetParams, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited>, TError, TData > @@ -12708,43 +12531,46 @@ export const getWettelijkeTaakValidGetQueryOptions = < const { query: queryOptions } = options ?? {} const queryKey = - queryOptions?.queryKey ?? getWettelijkeTaakValidGetQueryKey(params) + queryOptions?.queryKey ?? getWerkingsgebiedenValidGetQueryKey(params) const queryFn: QueryFunction< - Awaited> - > = ({ signal }) => wettelijkeTaakValidGet(params, signal) + Awaited> + > = ({ signal }) => werkingsgebiedenValidGet(params, signal) return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< - Awaited>, + Awaited>, TError, TData > & { queryKey: QueryKey } } -export type WettelijkeTaakValidGetQueryResult = NonNullable< - Awaited> +export type WerkingsgebiedenValidGetQueryResult = NonNullable< + Awaited> > -export type WettelijkeTaakValidGetQueryError = HTTPValidationError +export type WerkingsgebiedenValidGetQueryError = HTTPValidationError /** - * @summary Get all the valid wettelijke_taak lineages and shows the latest object of each + * @summary Get all the valid werkingsgebied lineages and shows the latest object of each */ -export const useWettelijkeTaakValidGet = < - TData = Awaited>, +export const useWerkingsgebiedenValidGet = < + TData = Awaited>, TError = HTTPValidationError >( - params?: WettelijkeTaakValidGetParams, + params?: WerkingsgebiedenValidGetParams, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited>, TError, TData > > } ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getWettelijkeTaakValidGetQueryOptions(params, options) + const queryOptions = getWerkingsgebiedenValidGetQueryOptions( + params, + options + ) const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey @@ -12756,34 +12582,41 @@ export const useWettelijkeTaakValidGet = < } /** - * @summary Get latest lineage record for wettelijke_taak by their lineage id + * @summary Get all the valid werkingsgebied of a single lineage */ -export const wettelijkeTaakLatestLineageIdGet = ( +export const werkingsgebiedenValidLineageIdGet = ( lineageId: number, + params?: WerkingsgebiedenValidLineageIdGetParams, signal?: AbortSignal ) => { - return customInstance({ - url: `/wettelijke-taak/latest/${lineageId}`, + return customInstance({ + url: `/werkingsgebieden/valid/${lineageId}`, method: 'GET', + params, signal, }) } -export const getWettelijkeTaakLatestLineageIdGetQueryKey = ( - lineageId: number +export const getWerkingsgebiedenValidLineageIdGetQueryKey = ( + lineageId: number, + params?: WerkingsgebiedenValidLineageIdGetParams ) => { - return [`/wettelijke-taak/latest/${lineageId}`] as const + return [ + `/werkingsgebieden/valid/${lineageId}`, + ...(params ? [params] : []), + ] as const } -export const getWettelijkeTaakLatestLineageIdGetQueryOptions = < - TData = Awaited>, +export const getWerkingsgebiedenValidLineageIdGetQueryOptions = < + TData = Awaited>, TError = HTTPValidationError >( lineageId: number, + params?: WerkingsgebiedenValidLineageIdGetParams, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited>, TError, TData > @@ -12794,11 +12627,12 @@ export const getWettelijkeTaakLatestLineageIdGetQueryOptions = < const queryKey = queryOptions?.queryKey ?? - getWettelijkeTaakLatestLineageIdGetQueryKey(lineageId) + getWerkingsgebiedenValidLineageIdGetQueryKey(lineageId, params) const queryFn: QueryFunction< - Awaited> - > = ({ signal }) => wettelijkeTaakLatestLineageIdGet(lineageId, signal) + Awaited> + > = ({ signal }) => + werkingsgebiedenValidLineageIdGet(lineageId, params, signal) return { queryKey, @@ -12806,37 +12640,39 @@ export const getWettelijkeTaakLatestLineageIdGetQueryOptions = < enabled: !!lineageId, ...queryOptions, } as UseQueryOptions< - Awaited>, + Awaited>, TError, TData > & { queryKey: QueryKey } } -export type WettelijkeTaakLatestLineageIdGetQueryResult = NonNullable< - Awaited> +export type WerkingsgebiedenValidLineageIdGetQueryResult = NonNullable< + Awaited> > -export type WettelijkeTaakLatestLineageIdGetQueryError = HTTPValidationError +export type WerkingsgebiedenValidLineageIdGetQueryError = HTTPValidationError /** - * @summary Get latest lineage record for wettelijke_taak by their lineage id + * @summary Get all the valid werkingsgebied of a single lineage */ -export const useWettelijkeTaakLatestLineageIdGet = < - TData = Awaited>, +export const useWerkingsgebiedenValidLineageIdGet = < + TData = Awaited>, TError = HTTPValidationError >( lineageId: number, + params?: WerkingsgebiedenValidLineageIdGetParams, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited>, TError, TData > > } ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getWettelijkeTaakLatestLineageIdGetQueryOptions( + const queryOptions = getWerkingsgebiedenValidLineageIdGetQueryOptions( lineageId, + params, options ) @@ -12850,34 +12686,36 @@ export const useWettelijkeTaakLatestLineageIdGet = < } /** - * @summary Get all relation codes of the given wettelijke_taak lineage + * @summary Get specific werkingsgebied by uuid */ -export const wettelijkeTaakRelationsLineageIdGet = ( - lineageId: number, +export const werkingsgebiedenVersionObjectUuidGet = ( + objectUuid: string, signal?: AbortSignal ) => { - return customInstance({ - url: `/wettelijke-taak/relations/${lineageId}`, + return customInstance({ + url: `/werkingsgebieden/version/${objectUuid}`, method: 'GET', signal, }) } -export const getWettelijkeTaakRelationsLineageIdGetQueryKey = ( - lineageId: number +export const getWerkingsgebiedenVersionObjectUuidGetQueryKey = ( + objectUuid: string ) => { - return [`/wettelijke-taak/relations/${lineageId}`] as const + return [`/werkingsgebieden/version/${objectUuid}`] as const } -export const getWettelijkeTaakRelationsLineageIdGetQueryOptions = < - TData = Awaited>, +export const getWerkingsgebiedenVersionObjectUuidGetQueryOptions = < + TData = Awaited>, TError = HTTPValidationError >( - lineageId: number, + objectUuid: string, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited< + ReturnType + >, TError, TData > @@ -12888,49 +12726,51 @@ export const getWettelijkeTaakRelationsLineageIdGetQueryOptions = < const queryKey = queryOptions?.queryKey ?? - getWettelijkeTaakRelationsLineageIdGetQueryKey(lineageId) + getWerkingsgebiedenVersionObjectUuidGetQueryKey(objectUuid) const queryFn: QueryFunction< - Awaited> - > = ({ signal }) => wettelijkeTaakRelationsLineageIdGet(lineageId, signal) + Awaited> + > = ({ signal }) => werkingsgebiedenVersionObjectUuidGet(objectUuid, signal) return { queryKey, queryFn, - enabled: !!lineageId, + enabled: !!objectUuid, ...queryOptions, } as UseQueryOptions< - Awaited>, + Awaited>, TError, TData > & { queryKey: QueryKey } } -export type WettelijkeTaakRelationsLineageIdGetQueryResult = NonNullable< - Awaited> +export type WerkingsgebiedenVersionObjectUuidGetQueryResult = NonNullable< + Awaited> > -export type WettelijkeTaakRelationsLineageIdGetQueryError = HTTPValidationError +export type WerkingsgebiedenVersionObjectUuidGetQueryError = HTTPValidationError /** - * @summary Get all relation codes of the given wettelijke_taak lineage + * @summary Get specific werkingsgebied by uuid */ -export const useWettelijkeTaakRelationsLineageIdGet = < - TData = Awaited>, +export const useWerkingsgebiedenVersionObjectUuidGet = < + TData = Awaited>, TError = HTTPValidationError >( - lineageId: number, + objectUuid: string, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited< + ReturnType + >, TError, TData > > } ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getWettelijkeTaakRelationsLineageIdGetQueryOptions( - lineageId, + const queryOptions = getWerkingsgebiedenVersionObjectUuidGetQueryOptions( + objectUuid, options ) @@ -12944,212 +12784,301 @@ export const useWettelijkeTaakRelationsLineageIdGet = < } /** - * @summary Overwrite all relations of the given wettelijke_taak lineage + * @summary Get latest lineage record for werkingsgebied by their lineage id */ -export const wettelijkeTaakRelationsLineageIdPut = ( +export const werkingsgebiedenLatestLineageIdGet = ( lineageId: number, - writeRelation: WriteRelation[] + signal?: AbortSignal ) => { - return customInstance({ - url: `/wettelijke-taak/relations/${lineageId}`, - method: 'PUT', - headers: { 'Content-Type': 'application/json' }, - data: writeRelation, + return customInstance({ + url: `/werkingsgebieden/latest/${lineageId}`, + method: 'GET', + signal, }) } -export const getWettelijkeTaakRelationsLineageIdPutMutationOptions = < - TError = HTTPValidationError, - TContext = unknown ->(options?: { - mutation?: UseMutationOptions< - Awaited>, - TError, - { lineageId: number; data: WriteRelation[] }, - TContext - > -}): UseMutationOptions< - Awaited>, - TError, - { lineageId: number; data: WriteRelation[] }, - TContext -> => { - const { mutation: mutationOptions } = options ?? {} - - const mutationFn: MutationFunction< - Awaited>, - { lineageId: number; data: WriteRelation[] } - > = props => { - const { lineageId, data } = props ?? {} +export const getWerkingsgebiedenLatestLineageIdGetQueryKey = ( + lineageId: number +) => { + return [`/werkingsgebieden/latest/${lineageId}`] as const +} - return wettelijkeTaakRelationsLineageIdPut(lineageId, data) +export const getWerkingsgebiedenLatestLineageIdGetQueryOptions = < + TData = Awaited>, + TError = HTTPValidationError +>( + lineageId: number, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > } +) => { + const { query: queryOptions } = options ?? {} - return { mutationFn, ...mutationOptions } + const queryKey = + queryOptions?.queryKey ?? + getWerkingsgebiedenLatestLineageIdGetQueryKey(lineageId) + + const queryFn: QueryFunction< + Awaited> + > = ({ signal }) => werkingsgebiedenLatestLineageIdGet(lineageId, signal) + + return { + queryKey, + queryFn, + enabled: !!lineageId, + ...queryOptions, + } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: QueryKey } } -export type WettelijkeTaakRelationsLineageIdPutMutationResult = NonNullable< - Awaited> +export type WerkingsgebiedenLatestLineageIdGetQueryResult = NonNullable< + Awaited> > -export type WettelijkeTaakRelationsLineageIdPutMutationBody = WriteRelation[] -export type WettelijkeTaakRelationsLineageIdPutMutationError = - HTTPValidationError +export type WerkingsgebiedenLatestLineageIdGetQueryError = HTTPValidationError /** - * @summary Overwrite all relations of the given wettelijke_taak lineage + * @summary Get latest lineage record for werkingsgebied by their lineage id */ -export const useWettelijkeTaakRelationsLineageIdPut = < - TError = HTTPValidationError, - TContext = unknown ->(options?: { - mutation?: UseMutationOptions< - Awaited>, - TError, - { lineageId: number; data: WriteRelation[] }, - TContext - > -}) => { - const mutationOptions = - getWettelijkeTaakRelationsLineageIdPutMutationOptions(options) +export const useWerkingsgebiedenLatestLineageIdGet = < + TData = Awaited>, + TError = HTTPValidationError +>( + lineageId: number, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getWerkingsgebiedenLatestLineageIdGetQueryOptions( + lineageId, + options + ) - return useMutation(mutationOptions) + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey + } + + query.queryKey = queryOptions.queryKey + + return query } /** * @summary Edit static data of an object */ -export const wettelijkeTaakStaticLineageIdPost = ( +export const werkingsgebiedStaticLineageIdPost = ( lineageId: number, - wettelijkeTaakStaticPostStatics: WettelijkeTaakStaticPostStatics + werkingsgebiedStaticPostStatics: WerkingsgebiedStaticPostStatics ) => { return customInstance({ - url: `/wettelijke-taak/static/${lineageId}`, + url: `/werkingsgebied/static/${lineageId}`, method: 'POST', headers: { 'Content-Type': 'application/json' }, - data: wettelijkeTaakStaticPostStatics, + data: werkingsgebiedStaticPostStatics, }) } -export const getWettelijkeTaakStaticLineageIdPostMutationOptions = < +export const getWerkingsgebiedStaticLineageIdPostMutationOptions = < TError = HTTPValidationError, TContext = unknown >(options?: { mutation?: UseMutationOptions< - Awaited>, + Awaited>, TError, - { lineageId: number; data: WettelijkeTaakStaticPostStatics }, + { lineageId: number; data: WerkingsgebiedStaticPostStatics }, TContext > }): UseMutationOptions< - Awaited>, + Awaited>, TError, - { lineageId: number; data: WettelijkeTaakStaticPostStatics }, + { lineageId: number; data: WerkingsgebiedStaticPostStatics }, TContext > => { const { mutation: mutationOptions } = options ?? {} const mutationFn: MutationFunction< - Awaited>, - { lineageId: number; data: WettelijkeTaakStaticPostStatics } + Awaited>, + { lineageId: number; data: WerkingsgebiedStaticPostStatics } > = props => { const { lineageId, data } = props ?? {} - return wettelijkeTaakStaticLineageIdPost(lineageId, data) + return werkingsgebiedStaticLineageIdPost(lineageId, data) } return { mutationFn, ...mutationOptions } } -export type WettelijkeTaakStaticLineageIdPostMutationResult = NonNullable< - Awaited> +export type WerkingsgebiedStaticLineageIdPostMutationResult = NonNullable< + Awaited> > -export type WettelijkeTaakStaticLineageIdPostMutationBody = - WettelijkeTaakStaticPostStatics -export type WettelijkeTaakStaticLineageIdPostMutationError = HTTPValidationError +export type WerkingsgebiedStaticLineageIdPostMutationBody = + WerkingsgebiedStaticPostStatics +export type WerkingsgebiedStaticLineageIdPostMutationError = HTTPValidationError /** * @summary Edit static data of an object */ -export const useWettelijkeTaakStaticLineageIdPost = < +export const useWerkingsgebiedStaticLineageIdPost = < TError = HTTPValidationError, TContext = unknown >(options?: { mutation?: UseMutationOptions< - Awaited>, + Awaited>, TError, - { lineageId: number; data: WettelijkeTaakStaticPostStatics }, + { lineageId: number; data: WerkingsgebiedStaticPostStatics }, TContext > }) => { const mutationOptions = - getWettelijkeTaakStaticLineageIdPostMutationOptions(options) + getWerkingsgebiedStaticLineageIdPostMutationOptions(options) return useMutation(mutationOptions) } /** - * @summary List the users + * @summary Get all the werkingsgebied of a single lineage in a module */ -export const usersGet = (params?: UsersGetParams, signal?: AbortSignal) => { - return customInstance({ - url: `/users`, +export const modulesModuleIdObjectWerkingsgebiedLineageIdGet = ( + moduleId: number, + lineageId: number, + params?: ModulesModuleIdObjectWerkingsgebiedLineageIdGetParams, + signal?: AbortSignal +) => { + return customInstance({ + url: `/modules/${moduleId}/object/werkingsgebied/${lineageId}`, method: 'GET', params, signal, }) } -export const getUsersGetQueryKey = (params?: UsersGetParams) => { - return [`/users`, ...(params ? [params] : [])] as const +export const getModulesModuleIdObjectWerkingsgebiedLineageIdGetQueryKey = ( + moduleId: number, + lineageId: number, + params?: ModulesModuleIdObjectWerkingsgebiedLineageIdGetParams +) => { + return [ + `/modules/${moduleId}/object/werkingsgebied/${lineageId}`, + ...(params ? [params] : []), + ] as const } -export const getUsersGetQueryOptions = < - TData = Awaited>, +export const getModulesModuleIdObjectWerkingsgebiedLineageIdGetQueryOptions = < + TData = Awaited< + ReturnType + >, TError = HTTPValidationError >( - params?: UsersGetParams, + moduleId: number, + lineageId: number, + params?: ModulesModuleIdObjectWerkingsgebiedLineageIdGetParams, options?: { query?: Partial< - UseQueryOptions>, TError, TData> + UseQueryOptions< + Awaited< + ReturnType< + typeof modulesModuleIdObjectWerkingsgebiedLineageIdGet + > + >, + TError, + TData + > > } ) => { const { query: queryOptions } = options ?? {} - const queryKey = queryOptions?.queryKey ?? getUsersGetQueryKey(params) + const queryKey = + queryOptions?.queryKey ?? + getModulesModuleIdObjectWerkingsgebiedLineageIdGetQueryKey( + moduleId, + lineageId, + params + ) - const queryFn: QueryFunction>> = ({ - signal, - }) => usersGet(params, signal) + const queryFn: QueryFunction< + Awaited< + ReturnType + > + > = ({ signal }) => + modulesModuleIdObjectWerkingsgebiedLineageIdGet( + moduleId, + lineageId, + params, + signal + ) - return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< - Awaited>, + return { + queryKey, + queryFn, + enabled: !!(moduleId && lineageId), + ...queryOptions, + } as UseQueryOptions< + Awaited< + ReturnType + >, TError, TData > & { queryKey: QueryKey } } -export type UsersGetQueryResult = NonNullable< - Awaited> -> -export type UsersGetQueryError = HTTPValidationError +export type ModulesModuleIdObjectWerkingsgebiedLineageIdGetQueryResult = + NonNullable< + Awaited< + ReturnType + > + > +export type ModulesModuleIdObjectWerkingsgebiedLineageIdGetQueryError = + HTTPValidationError /** - * @summary List the users + * @summary Get all the werkingsgebied of a single lineage in a module */ -export const useUsersGet = < - TData = Awaited>, +export const useModulesModuleIdObjectWerkingsgebiedLineageIdGet = < + TData = Awaited< + ReturnType + >, TError = HTTPValidationError >( - params?: UsersGetParams, + moduleId: number, + lineageId: number, + params?: ModulesModuleIdObjectWerkingsgebiedLineageIdGetParams, options?: { query?: Partial< - UseQueryOptions>, TError, TData> - > - } -): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getUsersGetQueryOptions(params, options) - + UseQueryOptions< + Awaited< + ReturnType< + typeof modulesModuleIdObjectWerkingsgebiedLineageIdGet + > + >, + TError, + TData + > + > + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = + getModulesModuleIdObjectWerkingsgebiedLineageIdGetQueryOptions( + moduleId, + lineageId, + params, + options + ) + const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey } @@ -13160,145 +13089,225 @@ export const useUsersGet = < } /** - * @summary Create new user + * @summary Add a new version to the werkingsgebied lineage in a module */ -export const usersPost = (userCreate: UserCreate) => { - return customInstance({ - url: `/users`, - method: 'POST', +export const modulesModuleIdObjectWerkingsgebiedLineageIdPatch = ( + moduleId: number, + lineageId: number, + werkingsgebiedPatch: WerkingsgebiedPatch +) => { + return customInstance({ + url: `/modules/${moduleId}/object/werkingsgebied/${lineageId}`, + method: 'PATCH', headers: { 'Content-Type': 'application/json' }, - data: userCreate, + data: werkingsgebiedPatch, }) } -export const getUsersPostMutationOptions = < - TError = HTTPValidationError, - TContext = unknown ->(options?: { - mutation?: UseMutationOptions< - Awaited>, +export const getModulesModuleIdObjectWerkingsgebiedLineageIdPatchMutationOptions = + (options?: { + mutation?: UseMutationOptions< + Awaited< + ReturnType< + typeof modulesModuleIdObjectWerkingsgebiedLineageIdPatch + > + >, + TError, + { moduleId: number; lineageId: number; data: WerkingsgebiedPatch }, + TContext + > + }): UseMutationOptions< + Awaited< + ReturnType + >, TError, - { data: UserCreate }, + { moduleId: number; lineageId: number; data: WerkingsgebiedPatch }, TContext - > -}): UseMutationOptions< - Awaited>, - TError, - { data: UserCreate }, - TContext -> => { - const { mutation: mutationOptions } = options ?? {} + > => { + const { mutation: mutationOptions } = options ?? {} - const mutationFn: MutationFunction< - Awaited>, - { data: UserCreate } - > = props => { - const { data } = props ?? {} + const mutationFn: MutationFunction< + Awaited< + ReturnType< + typeof modulesModuleIdObjectWerkingsgebiedLineageIdPatch + > + >, + { moduleId: number; lineageId: number; data: WerkingsgebiedPatch } + > = props => { + const { moduleId, lineageId, data } = props ?? {} - return usersPost(data) - } + return modulesModuleIdObjectWerkingsgebiedLineageIdPatch( + moduleId, + lineageId, + data + ) + } - return { mutationFn, ...mutationOptions } -} + return { mutationFn, ...mutationOptions } + } -export type UsersPostMutationResult = NonNullable< - Awaited> -> -export type UsersPostMutationBody = UserCreate -export type UsersPostMutationError = HTTPValidationError +export type ModulesModuleIdObjectWerkingsgebiedLineageIdPatchMutationResult = + NonNullable< + Awaited< + ReturnType + > + > +export type ModulesModuleIdObjectWerkingsgebiedLineageIdPatchMutationBody = + WerkingsgebiedPatch +export type ModulesModuleIdObjectWerkingsgebiedLineageIdPatchMutationError = + HTTPValidationError /** - * @summary Create new user + * @summary Add a new version to the werkingsgebied lineage in a module */ -export const useUsersPost = < +export const useModulesModuleIdObjectWerkingsgebiedLineageIdPatch = < TError = HTTPValidationError, TContext = unknown >(options?: { mutation?: UseMutationOptions< - Awaited>, + Awaited< + ReturnType + >, TError, - { data: UserCreate }, + { moduleId: number; lineageId: number; data: WerkingsgebiedPatch }, TContext > }) => { - const mutationOptions = getUsersPostMutationOptions(options) + const mutationOptions = + getModulesModuleIdObjectWerkingsgebiedLineageIdPatchMutationOptions( + options + ) return useMutation(mutationOptions) } /** - * @summary Search the users + * @summary Get latest lineage record for werkingsgebied by their lineage id in a module */ -export const usersSearchGet = ( - params?: UsersSearchGetParams, +export const modulesModuleIdObjectWerkingsgebiedLatestLineageIdGet = ( + moduleId: number, + lineageId: number, signal?: AbortSignal ) => { - return customInstance({ - url: `/users/search`, + return customInstance({ + url: `/modules/${moduleId}/object/werkingsgebied/latest/${lineageId}`, method: 'GET', - params, signal, }) } -export const getUsersSearchGetQueryKey = (params?: UsersSearchGetParams) => { - return [`/users/search`, ...(params ? [params] : [])] as const -} +export const getModulesModuleIdObjectWerkingsgebiedLatestLineageIdGetQueryKey = + (moduleId: number, lineageId: number) => { + return [ + `/modules/${moduleId}/object/werkingsgebied/latest/${lineageId}`, + ] as const + } -export const getUsersSearchGetQueryOptions = < - TData = Awaited>, - TError = HTTPValidationError ->( - params?: UsersSearchGetParams, - options?: { - query?: Partial< - UseQueryOptions< - Awaited>, - TError, - TData +export const getModulesModuleIdObjectWerkingsgebiedLatestLineageIdGetQueryOptions = + < + TData = Awaited< + ReturnType< + typeof modulesModuleIdObjectWerkingsgebiedLatestLineageIdGet > - > - } -) => { - const { query: queryOptions } = options ?? {} + >, + TError = HTTPValidationError + >( + moduleId: number, + lineageId: number, + options?: { + query?: Partial< + UseQueryOptions< + Awaited< + ReturnType< + typeof modulesModuleIdObjectWerkingsgebiedLatestLineageIdGet + > + >, + TError, + TData + > + > + } + ) => { + const { query: queryOptions } = options ?? {} - const queryKey = queryOptions?.queryKey ?? getUsersSearchGetQueryKey(params) + const queryKey = + queryOptions?.queryKey ?? + getModulesModuleIdObjectWerkingsgebiedLatestLineageIdGetQueryKey( + moduleId, + lineageId + ) - const queryFn: QueryFunction< - Awaited> - > = ({ signal }) => usersSearchGet(params, signal) + const queryFn: QueryFunction< + Awaited< + ReturnType< + typeof modulesModuleIdObjectWerkingsgebiedLatestLineageIdGet + > + > + > = ({ signal }) => + modulesModuleIdObjectWerkingsgebiedLatestLineageIdGet( + moduleId, + lineageId, + signal + ) - return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< - Awaited>, - TError, - TData - > & { queryKey: QueryKey } -} + return { + queryKey, + queryFn, + enabled: !!(moduleId && lineageId), + ...queryOptions, + } as UseQueryOptions< + Awaited< + ReturnType< + typeof modulesModuleIdObjectWerkingsgebiedLatestLineageIdGet + > + >, + TError, + TData + > & { queryKey: QueryKey } + } -export type UsersSearchGetQueryResult = NonNullable< - Awaited> -> -export type UsersSearchGetQueryError = HTTPValidationError +export type ModulesModuleIdObjectWerkingsgebiedLatestLineageIdGetQueryResult = + NonNullable< + Awaited< + ReturnType< + typeof modulesModuleIdObjectWerkingsgebiedLatestLineageIdGet + > + > + > +export type ModulesModuleIdObjectWerkingsgebiedLatestLineageIdGetQueryError = + HTTPValidationError /** - * @summary Search the users + * @summary Get latest lineage record for werkingsgebied by their lineage id in a module */ -export const useUsersSearchGet = < - TData = Awaited>, +export const useModulesModuleIdObjectWerkingsgebiedLatestLineageIdGet = < + TData = Awaited< + ReturnType + >, TError = HTTPValidationError >( - params?: UsersSearchGetParams, + moduleId: number, + lineageId: number, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited< + ReturnType< + typeof modulesModuleIdObjectWerkingsgebiedLatestLineageIdGet + > + >, TError, TData > > } ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getUsersSearchGetQueryOptions(params, options) + const queryOptions = + getModulesModuleIdObjectWerkingsgebiedLatestLineageIdGetQueryOptions( + moduleId, + lineageId, + options + ) const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey @@ -13310,80 +13319,134 @@ export const useUsersSearchGet = < } /** - * @summary Get a user + * @summary Get specific werkingsgebied by uuid in a module */ -export const usersUserUuidGet = (userUuid: string, signal?: AbortSignal) => { - return customInstance({ - url: `/users/${userUuid}`, +export const modulesModuleIdObjectWerkingsgebiedVersionObjectUuidGet = ( + moduleId: number, + objectUuid: string, + signal?: AbortSignal +) => { + return customInstance({ + url: `/modules/${moduleId}/object/werkingsgebied/version/${objectUuid}`, method: 'GET', signal, }) } -export const getUsersUserUuidGetQueryKey = (userUuid: string) => { - return [`/users/${userUuid}`] as const -} - -export const getUsersUserUuidGetQueryOptions = < - TData = Awaited>, - TError = HTTPValidationError ->( - userUuid: string, - options?: { - query?: Partial< - UseQueryOptions< - Awaited>, - TError, - TData - > - > +export const getModulesModuleIdObjectWerkingsgebiedVersionObjectUuidGetQueryKey = + (moduleId: number, objectUuid: string) => { + return [ + `/modules/${moduleId}/object/werkingsgebied/version/${objectUuid}`, + ] as const } -) => { - const { query: queryOptions } = options ?? {} - - const queryKey = - queryOptions?.queryKey ?? getUsersUserUuidGetQueryKey(userUuid) - const queryFn: QueryFunction< - Awaited> - > = ({ signal }) => usersUserUuidGet(userUuid, signal) +export const getModulesModuleIdObjectWerkingsgebiedVersionObjectUuidGetQueryOptions = + < + TData = Awaited< + ReturnType< + typeof modulesModuleIdObjectWerkingsgebiedVersionObjectUuidGet + > + >, + TError = HTTPValidationError + >( + moduleId: number, + objectUuid: string, + options?: { + query?: Partial< + UseQueryOptions< + Awaited< + ReturnType< + typeof modulesModuleIdObjectWerkingsgebiedVersionObjectUuidGet + > + >, + TError, + TData + > + > + } + ) => { + const { query: queryOptions } = options ?? {} - return { - queryKey, - queryFn, - enabled: !!userUuid, - ...queryOptions, - } as UseQueryOptions< - Awaited>, - TError, - TData - > & { queryKey: QueryKey } -} + const queryKey = + queryOptions?.queryKey ?? + getModulesModuleIdObjectWerkingsgebiedVersionObjectUuidGetQueryKey( + moduleId, + objectUuid + ) -export type UsersUserUuidGetQueryResult = NonNullable< - Awaited> -> -export type UsersUserUuidGetQueryError = HTTPValidationError + const queryFn: QueryFunction< + Awaited< + ReturnType< + typeof modulesModuleIdObjectWerkingsgebiedVersionObjectUuidGet + > + > + > = ({ signal }) => + modulesModuleIdObjectWerkingsgebiedVersionObjectUuidGet( + moduleId, + objectUuid, + signal + ) + + return { + queryKey, + queryFn, + enabled: !!(moduleId && objectUuid), + ...queryOptions, + } as UseQueryOptions< + Awaited< + ReturnType< + typeof modulesModuleIdObjectWerkingsgebiedVersionObjectUuidGet + > + >, + TError, + TData + > & { queryKey: QueryKey } + } + +export type ModulesModuleIdObjectWerkingsgebiedVersionObjectUuidGetQueryResult = + NonNullable< + Awaited< + ReturnType< + typeof modulesModuleIdObjectWerkingsgebiedVersionObjectUuidGet + > + > + > +export type ModulesModuleIdObjectWerkingsgebiedVersionObjectUuidGetQueryError = + HTTPValidationError /** - * @summary Get a user + * @summary Get specific werkingsgebied by uuid in a module */ -export const useUsersUserUuidGet = < - TData = Awaited>, +export const useModulesModuleIdObjectWerkingsgebiedVersionObjectUuidGet = < + TData = Awaited< + ReturnType< + typeof modulesModuleIdObjectWerkingsgebiedVersionObjectUuidGet + > + >, TError = HTTPValidationError >( - userUuid: string, + moduleId: number, + objectUuid: string, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited< + ReturnType< + typeof modulesModuleIdObjectWerkingsgebiedVersionObjectUuidGet + > + >, TError, TData > > } ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getUsersUserUuidGetQueryOptions(userUuid, options) + const queryOptions = + getModulesModuleIdObjectWerkingsgebiedVersionObjectUuidGetQueryOptions( + moduleId, + objectUuid, + options + ) const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey @@ -13395,168 +13458,47 @@ export const useUsersUserUuidGet = < } /** - * @summary Edit user - */ -export const usersUserUuidPost = (userUuid: string, editUser: EditUser) => { - return customInstance({ - url: `/users/${userUuid}`, - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - data: editUser, - }) -} - -export const getUsersUserUuidPostMutationOptions = < - TError = HTTPValidationError, - TContext = unknown ->(options?: { - mutation?: UseMutationOptions< - Awaited>, - TError, - { userUuid: string; data: EditUser }, - TContext - > -}): UseMutationOptions< - Awaited>, - TError, - { userUuid: string; data: EditUser }, - TContext -> => { - const { mutation: mutationOptions } = options ?? {} - - const mutationFn: MutationFunction< - Awaited>, - { userUuid: string; data: EditUser } - > = props => { - const { userUuid, data } = props ?? {} - - return usersUserUuidPost(userUuid, data) - } - - return { mutationFn, ...mutationOptions } -} - -export type UsersUserUuidPostMutationResult = NonNullable< - Awaited> -> -export type UsersUserUuidPostMutationBody = EditUser -export type UsersUserUuidPostMutationError = HTTPValidationError - -/** - * @summary Edit user - */ -export const useUsersUserUuidPost = < - TError = HTTPValidationError, - TContext = unknown ->(options?: { - mutation?: UseMutationOptions< - Awaited>, - TError, - { userUuid: string; data: EditUser }, - TContext - > -}) => { - const mutationOptions = getUsersUserUuidPostMutationOptions(options) - - return useMutation(mutationOptions) -} - -/** - * @summary Reset user password - */ -export const usersUserUuidResetPasswordPost = (userUuid: string) => { - return customInstance({ - url: `/users/${userUuid}/reset-password`, - method: 'POST', - }) -} - -export const getUsersUserUuidResetPasswordPostMutationOptions = < - TError = HTTPValidationError, - TContext = unknown ->(options?: { - mutation?: UseMutationOptions< - Awaited>, - TError, - { userUuid: string }, - TContext - > -}): UseMutationOptions< - Awaited>, - TError, - { userUuid: string }, - TContext -> => { - const { mutation: mutationOptions } = options ?? {} - - const mutationFn: MutationFunction< - Awaited>, - { userUuid: string } - > = props => { - const { userUuid } = props ?? {} - - return usersUserUuidResetPasswordPost(userUuid) - } - - return { mutationFn, ...mutationOptions } -} - -export type UsersUserUuidResetPasswordPostMutationResult = NonNullable< - Awaited> -> - -export type UsersUserUuidResetPasswordPostMutationError = HTTPValidationError - -/** - * @summary Reset user password - */ -export const useUsersUserUuidResetPasswordPost = < - TError = HTTPValidationError, - TContext = unknown ->(options?: { - mutation?: UseMutationOptions< - Awaited>, - TError, - { userUuid: string }, - TContext - > -}) => { - const mutationOptions = - getUsersUserUuidResetPasswordPostMutationOptions(options) - - return useMutation(mutationOptions) -} - -/** - * @summary List the werkingsgebieden + * @summary List the last modified module object grouped per module ID */ -export const werkingsgebiedenGet = ( - params?: WerkingsgebiedenGetParams, +export const modulesObjectWerkingsgebiedActiveLineageIdGet = ( + lineageId: number, + params?: ModulesObjectWerkingsgebiedActiveLineageIdGetParams, signal?: AbortSignal ) => { - return customInstance({ - url: `/werkingsgebieden`, + return customInstance({ + url: `/modules/object/werkingsgebied/active/${lineageId}`, method: 'GET', params, signal, }) } -export const getWerkingsgebiedenGetQueryKey = ( - params?: WerkingsgebiedenGetParams +export const getModulesObjectWerkingsgebiedActiveLineageIdGetQueryKey = ( + lineageId: number, + params?: ModulesObjectWerkingsgebiedActiveLineageIdGetParams ) => { - return [`/werkingsgebieden`, ...(params ? [params] : [])] as const + return [ + `/modules/object/werkingsgebied/active/${lineageId}`, + ...(params ? [params] : []), + ] as const } -export const getWerkingsgebiedenGetQueryOptions = < - TData = Awaited>, +export const getModulesObjectWerkingsgebiedActiveLineageIdGetQueryOptions = < + TData = Awaited< + ReturnType + >, TError = HTTPValidationError >( - params?: WerkingsgebiedenGetParams, + lineageId: number, + params?: ModulesObjectWerkingsgebiedActiveLineageIdGetParams, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited< + ReturnType< + typeof modulesObjectWerkingsgebiedActiveLineageIdGet + > + >, TError, TData > @@ -13566,43 +13508,73 @@ export const getWerkingsgebiedenGetQueryOptions = < const { query: queryOptions } = options ?? {} const queryKey = - queryOptions?.queryKey ?? getWerkingsgebiedenGetQueryKey(params) + queryOptions?.queryKey ?? + getModulesObjectWerkingsgebiedActiveLineageIdGetQueryKey( + lineageId, + params + ) const queryFn: QueryFunction< - Awaited> - > = ({ signal }) => werkingsgebiedenGet(params, signal) + Awaited< + ReturnType + > + > = ({ signal }) => + modulesObjectWerkingsgebiedActiveLineageIdGet(lineageId, params, signal) - return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< - Awaited>, - TError, + return { + queryKey, + queryFn, + enabled: !!lineageId, + ...queryOptions, + } as UseQueryOptions< + Awaited< + ReturnType + >, + TError, TData > & { queryKey: QueryKey } } -export type WerkingsgebiedenGetQueryResult = NonNullable< - Awaited> -> -export type WerkingsgebiedenGetQueryError = HTTPValidationError +export type ModulesObjectWerkingsgebiedActiveLineageIdGetQueryResult = + NonNullable< + Awaited< + ReturnType + > + > +export type ModulesObjectWerkingsgebiedActiveLineageIdGetQueryError = + HTTPValidationError /** - * @summary List the werkingsgebieden + * @summary List the last modified module object grouped per module ID */ -export const useWerkingsgebiedenGet = < - TData = Awaited>, +export const useModulesObjectWerkingsgebiedActiveLineageIdGet = < + TData = Awaited< + ReturnType + >, TError = HTTPValidationError >( - params?: WerkingsgebiedenGetParams, + lineageId: number, + params?: ModulesObjectWerkingsgebiedActiveLineageIdGetParams, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited< + ReturnType< + typeof modulesObjectWerkingsgebiedActiveLineageIdGet + > + >, TError, TData > > } ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getWerkingsgebiedenGetQueryOptions(params, options) + const queryOptions = + getModulesObjectWerkingsgebiedActiveLineageIdGetQueryOptions( + lineageId, + params, + options + ) const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey @@ -13614,356 +13586,426 @@ export const useWerkingsgebiedenGet = < } /** - * @summary List the objects active in werkingsgebieden + * @summary Get specific werkingsgebied by uuid in a module */ -export const searchGeoPost = ( - searchGeoRequestData: SearchGeoRequestData, - params?: SearchGeoPostParams +export const revisionsModuleIdWerkingsgebiedVersionObjectUuidGet = ( + moduleId: number, + objectUuid: string, + signal?: AbortSignal ) => { - return customInstance({ - url: `/search/geo`, + return customInstance({ + url: `/revisions/${moduleId}/werkingsgebied/version/${objectUuid}`, + method: 'GET', + signal, + }) +} + +export const getRevisionsModuleIdWerkingsgebiedVersionObjectUuidGetQueryKey = ( + moduleId: number, + objectUuid: string +) => { + return [ + `/revisions/${moduleId}/werkingsgebied/version/${objectUuid}`, + ] as const +} + +export const getRevisionsModuleIdWerkingsgebiedVersionObjectUuidGetQueryOptions = + < + TData = Awaited< + ReturnType< + typeof revisionsModuleIdWerkingsgebiedVersionObjectUuidGet + > + >, + TError = HTTPValidationError + >( + moduleId: number, + objectUuid: string, + options?: { + query?: Partial< + UseQueryOptions< + Awaited< + ReturnType< + typeof revisionsModuleIdWerkingsgebiedVersionObjectUuidGet + > + >, + TError, + TData + > + > + } + ) => { + const { query: queryOptions } = options ?? {} + + const queryKey = + queryOptions?.queryKey ?? + getRevisionsModuleIdWerkingsgebiedVersionObjectUuidGetQueryKey( + moduleId, + objectUuid + ) + + const queryFn: QueryFunction< + Awaited< + ReturnType< + typeof revisionsModuleIdWerkingsgebiedVersionObjectUuidGet + > + > + > = ({ signal }) => + revisionsModuleIdWerkingsgebiedVersionObjectUuidGet( + moduleId, + objectUuid, + signal + ) + + return { + queryKey, + queryFn, + enabled: !!(moduleId && objectUuid), + ...queryOptions, + } as UseQueryOptions< + Awaited< + ReturnType< + typeof revisionsModuleIdWerkingsgebiedVersionObjectUuidGet + > + >, + TError, + TData + > & { queryKey: QueryKey } + } + +export type RevisionsModuleIdWerkingsgebiedVersionObjectUuidGetQueryResult = + NonNullable< + Awaited< + ReturnType< + typeof revisionsModuleIdWerkingsgebiedVersionObjectUuidGet + > + > + > +export type RevisionsModuleIdWerkingsgebiedVersionObjectUuidGetQueryError = + HTTPValidationError + +/** + * @summary Get specific werkingsgebied by uuid in a module + */ +export const useRevisionsModuleIdWerkingsgebiedVersionObjectUuidGet = < + TData = Awaited< + ReturnType + >, + TError = HTTPValidationError +>( + moduleId: number, + objectUuid: string, + options?: { + query?: Partial< + UseQueryOptions< + Awaited< + ReturnType< + typeof revisionsModuleIdWerkingsgebiedVersionObjectUuidGet + > + >, + TError, + TData + > + > + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = + getRevisionsModuleIdWerkingsgebiedVersionObjectUuidGetQueryOptions( + moduleId, + objectUuid, + options + ) + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey + } + + query.queryKey = queryOptions.queryKey + + return query +} + +/** + * @summary Add new object + */ +export const wettelijkeTaakPost = ( + wettelijkeTaakCreate: WettelijkeTaakCreate +) => { + return customInstance({ + url: `/wettelijke-taak`, method: 'POST', headers: { 'Content-Type': 'application/json' }, - data: searchGeoRequestData, - params, + data: wettelijkeTaakCreate, }) } -export const getSearchGeoPostMutationOptions = < +export const getWettelijkeTaakPostMutationOptions = < TError = HTTPValidationError, TContext = unknown >(options?: { mutation?: UseMutationOptions< - Awaited>, + Awaited>, TError, - { data: SearchGeoRequestData; params?: SearchGeoPostParams }, + { data: WettelijkeTaakCreate }, TContext > }): UseMutationOptions< - Awaited>, + Awaited>, TError, - { data: SearchGeoRequestData; params?: SearchGeoPostParams }, + { data: WettelijkeTaakCreate }, TContext > => { const { mutation: mutationOptions } = options ?? {} const mutationFn: MutationFunction< - Awaited>, - { data: SearchGeoRequestData; params?: SearchGeoPostParams } + Awaited>, + { data: WettelijkeTaakCreate } > = props => { - const { data, params } = props ?? {} + const { data } = props ?? {} - return searchGeoPost(data, params) + return wettelijkeTaakPost(data) } return { mutationFn, ...mutationOptions } } -export type SearchGeoPostMutationResult = NonNullable< - Awaited> +export type WettelijkeTaakPostMutationResult = NonNullable< + Awaited> > -export type SearchGeoPostMutationBody = SearchGeoRequestData -export type SearchGeoPostMutationError = HTTPValidationError +export type WettelijkeTaakPostMutationBody = WettelijkeTaakCreate +export type WettelijkeTaakPostMutationError = HTTPValidationError /** - * @summary List the objects active in werkingsgebieden + * @summary Add new object */ -export const useSearchGeoPost = < +export const useWettelijkeTaakPost = < TError = HTTPValidationError, TContext = unknown >(options?: { mutation?: UseMutationOptions< - Awaited>, + Awaited>, TError, - { data: SearchGeoRequestData; params?: SearchGeoPostParams }, + { data: WettelijkeTaakCreate }, TContext > }) => { - const mutationOptions = getSearchGeoPostMutationOptions(options) + const mutationOptions = getWettelijkeTaakPostMutationOptions(options) return useMutation(mutationOptions) } /** - * @summary List the objects in werkingsgebieden by a geometry + * @summary Edit atemporal object */ -export const searchGeometryPost = ( - listObjectsByGeometryRequestData: ListObjectsByGeometryRequestData, - params?: SearchGeometryPostParams +export const wettelijkeTaakLineageIdPost = ( + lineageId: number, + wettelijkeTaakEdit: WettelijkeTaakEdit ) => { - return customInstance({ - url: `/search/geometry`, + return customInstance({ + url: `/wettelijke-taak/${lineageId}`, method: 'POST', headers: { 'Content-Type': 'application/json' }, - data: listObjectsByGeometryRequestData, - params, + data: wettelijkeTaakEdit, }) } -export const getSearchGeometryPostMutationOptions = < +export const getWettelijkeTaakLineageIdPostMutationOptions = < TError = HTTPValidationError, TContext = unknown >(options?: { mutation?: UseMutationOptions< - Awaited>, + Awaited>, TError, - { - data: ListObjectsByGeometryRequestData - params?: SearchGeometryPostParams - }, + { lineageId: number; data: WettelijkeTaakEdit }, TContext > }): UseMutationOptions< - Awaited>, + Awaited>, TError, - { - data: ListObjectsByGeometryRequestData - params?: SearchGeometryPostParams - }, + { lineageId: number; data: WettelijkeTaakEdit }, TContext > => { const { mutation: mutationOptions } = options ?? {} const mutationFn: MutationFunction< - Awaited>, - { - data: ListObjectsByGeometryRequestData - params?: SearchGeometryPostParams - } + Awaited>, + { lineageId: number; data: WettelijkeTaakEdit } > = props => { - const { data, params } = props ?? {} + const { lineageId, data } = props ?? {} - return searchGeometryPost(data, params) + return wettelijkeTaakLineageIdPost(lineageId, data) } return { mutationFn, ...mutationOptions } } -export type SearchGeometryPostMutationResult = NonNullable< - Awaited> +export type WettelijkeTaakLineageIdPostMutationResult = NonNullable< + Awaited> > -export type SearchGeometryPostMutationBody = ListObjectsByGeometryRequestData -export type SearchGeometryPostMutationError = HTTPValidationError +export type WettelijkeTaakLineageIdPostMutationBody = WettelijkeTaakEdit +export type WettelijkeTaakLineageIdPostMutationError = HTTPValidationError /** - * @summary List the objects in werkingsgebieden by a geometry + * @summary Edit atemporal object */ -export const useSearchGeometryPost = < +export const useWettelijkeTaakLineageIdPost = < TError = HTTPValidationError, TContext = unknown >(options?: { mutation?: UseMutationOptions< - Awaited>, + Awaited>, TError, - { - data: ListObjectsByGeometryRequestData - params?: SearchGeometryPostParams - }, + { lineageId: number; data: WettelijkeTaakEdit }, TContext > }) => { - const mutationOptions = getSearchGeometryPostMutationOptions(options) + const mutationOptions = + getWettelijkeTaakLineageIdPostMutationOptions(options) return useMutation(mutationOptions) } /** - * @summary Search for objects + * @summary Delete atemporal object */ -export const searchPost = ( - searchRequestData: SearchRequestData, - params: SearchPostParams -) => { - return customInstance({ - url: `/search`, - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - data: searchRequestData, - params, +export const wettelijkeTaakLineageIdDelete = (lineageId: number) => { + return customInstance({ + url: `/wettelijke-taak/${lineageId}`, + method: 'DELETE', }) } -export const getSearchPostMutationOptions = < +export const getWettelijkeTaakLineageIdDeleteMutationOptions = < TError = HTTPValidationError, TContext = unknown >(options?: { mutation?: UseMutationOptions< - Awaited>, + Awaited>, TError, - { data: SearchRequestData; params: SearchPostParams }, + { lineageId: number }, TContext > }): UseMutationOptions< - Awaited>, + Awaited>, TError, - { data: SearchRequestData; params: SearchPostParams }, + { lineageId: number }, TContext > => { const { mutation: mutationOptions } = options ?? {} const mutationFn: MutationFunction< - Awaited>, - { data: SearchRequestData; params: SearchPostParams } + Awaited>, + { lineageId: number } > = props => { - const { data, params } = props ?? {} + const { lineageId } = props ?? {} - return searchPost(data, params) + return wettelijkeTaakLineageIdDelete(lineageId) } return { mutationFn, ...mutationOptions } } -export type SearchPostMutationResult = NonNullable< - Awaited> +export type WettelijkeTaakLineageIdDeleteMutationResult = NonNullable< + Awaited> > -export type SearchPostMutationBody = SearchRequestData -export type SearchPostMutationError = HTTPValidationError - -/** - * @summary Search for objects - */ -export const useSearchPost = < - TError = HTTPValidationError, - TContext = unknown ->(options?: { - mutation?: UseMutationOptions< - Awaited>, - TError, - { data: SearchRequestData; params: SearchPostParams }, - TContext - > -}) => { - const mutationOptions = getSearchPostMutationOptions(options) - - return useMutation(mutationOptions) -} - -/** - * @summary Search for valid objects - */ -export const searchValidPost = ( - searchRequestData: SearchRequestData, - params: SearchValidPostParams -) => { - return customInstance({ - url: `/search/valid`, - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - data: searchRequestData, - params, - }) -} - -export const getSearchValidPostMutationOptions = < - TError = HTTPValidationError, - TContext = unknown ->(options?: { - mutation?: UseMutationOptions< - Awaited>, - TError, - { data: SearchRequestData; params: SearchValidPostParams }, - TContext - > -}): UseMutationOptions< - Awaited>, - TError, - { data: SearchRequestData; params: SearchValidPostParams }, - TContext -> => { - const { mutation: mutationOptions } = options ?? {} - - const mutationFn: MutationFunction< - Awaited>, - { data: SearchRequestData; params: SearchValidPostParams } - > = props => { - const { data, params } = props ?? {} - - return searchValidPost(data, params) - } - - return { mutationFn, ...mutationOptions } -} -export type SearchValidPostMutationResult = NonNullable< - Awaited> -> -export type SearchValidPostMutationBody = SearchRequestData -export type SearchValidPostMutationError = HTTPValidationError +export type WettelijkeTaakLineageIdDeleteMutationError = HTTPValidationError /** - * @summary Search for valid objects + * @summary Delete atemporal object */ -export const useSearchValidPost = < +export const useWettelijkeTaakLineageIdDelete = < TError = HTTPValidationError, TContext = unknown >(options?: { mutation?: UseMutationOptions< - Awaited>, + Awaited>, TError, - { data: SearchRequestData; params: SearchValidPostParams }, + { lineageId: number }, TContext > }) => { - const mutationOptions = getSearchValidPostMutationOptions(options) + const mutationOptions = + getWettelijkeTaakLineageIdDeleteMutationOptions(options) return useMutation(mutationOptions) } /** - * @summary A graph representation + * @summary Get all the valid wettelijke_taak lineages and shows the latest object of each */ -export const fullGraphGet = (signal?: AbortSignal) => { - return customInstance({ - url: `/full-graph`, +export const wettelijkeTaakValidGet = ( + params?: WettelijkeTaakValidGetParams, + signal?: AbortSignal +) => { + return customInstance({ + url: `/wettelijke-taak/valid`, method: 'GET', + params, signal, }) } -export const getFullGraphGetQueryKey = () => { - return [`/full-graph`] as const +export const getWettelijkeTaakValidGetQueryKey = ( + params?: WettelijkeTaakValidGetParams +) => { + return [`/wettelijke-taak/valid`, ...(params ? [params] : [])] as const } -export const getFullGraphGetQueryOptions = < - TData = Awaited>, - TError = unknown ->(options?: { - query?: Partial< - UseQueryOptions>, TError, TData> - > -}) => { +export const getWettelijkeTaakValidGetQueryOptions = < + TData = Awaited>, + TError = HTTPValidationError +>( + params?: WettelijkeTaakValidGetParams, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +) => { const { query: queryOptions } = options ?? {} - const queryKey = queryOptions?.queryKey ?? getFullGraphGetQueryKey() + const queryKey = + queryOptions?.queryKey ?? getWettelijkeTaakValidGetQueryKey(params) - const queryFn: QueryFunction>> = ({ - signal, - }) => fullGraphGet(signal) + const queryFn: QueryFunction< + Awaited> + > = ({ signal }) => wettelijkeTaakValidGet(params, signal) return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< - Awaited>, + Awaited>, TError, TData > & { queryKey: QueryKey } } -export type FullGraphGetQueryResult = NonNullable< - Awaited> +export type WettelijkeTaakValidGetQueryResult = NonNullable< + Awaited> > -export type FullGraphGetQueryError = unknown +export type WettelijkeTaakValidGetQueryError = HTTPValidationError /** - * @summary A graph representation + * @summary Get all the valid wettelijke_taak lineages and shows the latest object of each */ -export const useFullGraphGet = < - TData = Awaited>, - TError = unknown ->(options?: { - query?: Partial< - UseQueryOptions>, TError, TData> - > -}): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getFullGraphGetQueryOptions(options) +export const useWettelijkeTaakValidGet = < + TData = Awaited>, + TError = HTTPValidationError +>( + params?: WettelijkeTaakValidGetParams, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getWettelijkeTaakValidGetQueryOptions(params, options) const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey @@ -13975,33 +14017,34 @@ export const useFullGraphGet = < } /** - * @summary A graph representation of an object + * @summary Get latest lineage record for wettelijke_taak by their lineage id */ -export const objectGraphGet = ( - params: ObjectGraphGetParams, +export const wettelijkeTaakLatestLineageIdGet = ( + lineageId: number, signal?: AbortSignal ) => { - return customInstance({ - url: `/object-graph`, + return customInstance({ + url: `/wettelijke-taak/latest/${lineageId}`, method: 'GET', - params, signal, }) } -export const getObjectGraphGetQueryKey = (params: ObjectGraphGetParams) => { - return [`/object-graph`, ...(params ? [params] : [])] as const +export const getWettelijkeTaakLatestLineageIdGetQueryKey = ( + lineageId: number +) => { + return [`/wettelijke-taak/latest/${lineageId}`] as const } -export const getObjectGraphGetQueryOptions = < - TData = Awaited>, +export const getWettelijkeTaakLatestLineageIdGetQueryOptions = < + TData = Awaited>, TError = HTTPValidationError >( - params: ObjectGraphGetParams, + lineageId: number, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited>, TError, TData > @@ -14010,43 +14053,53 @@ export const getObjectGraphGetQueryOptions = < ) => { const { query: queryOptions } = options ?? {} - const queryKey = queryOptions?.queryKey ?? getObjectGraphGetQueryKey(params) + const queryKey = + queryOptions?.queryKey ?? + getWettelijkeTaakLatestLineageIdGetQueryKey(lineageId) const queryFn: QueryFunction< - Awaited> - > = ({ signal }) => objectGraphGet(params, signal) + Awaited> + > = ({ signal }) => wettelijkeTaakLatestLineageIdGet(lineageId, signal) - return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< - Awaited>, + return { + queryKey, + queryFn, + enabled: !!lineageId, + ...queryOptions, + } as UseQueryOptions< + Awaited>, TError, TData > & { queryKey: QueryKey } } -export type ObjectGraphGetQueryResult = NonNullable< - Awaited> +export type WettelijkeTaakLatestLineageIdGetQueryResult = NonNullable< + Awaited> > -export type ObjectGraphGetQueryError = HTTPValidationError +export type WettelijkeTaakLatestLineageIdGetQueryError = HTTPValidationError /** - * @summary A graph representation of an object + * @summary Get latest lineage record for wettelijke_taak by their lineage id */ -export const useObjectGraphGet = < - TData = Awaited>, +export const useWettelijkeTaakLatestLineageIdGet = < + TData = Awaited>, TError = HTTPValidationError >( - params: ObjectGraphGetParams, + lineageId: number, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited>, TError, TData > > } ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getObjectGraphGetQueryOptions(params, options) + const queryOptions = getWettelijkeTaakLatestLineageIdGetQueryOptions( + lineageId, + options + ) const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey @@ -14058,33 +14111,34 @@ export const useObjectGraphGet = < } /** - * @summary List the public modules + * @summary Get all relation codes of the given wettelijke_taak lineage */ -export const revisionsGet = ( - params?: RevisionsGetParams, +export const wettelijkeTaakRelationsLineageIdGet = ( + lineageId: number, signal?: AbortSignal ) => { - return customInstance({ - url: `/revisions`, + return customInstance({ + url: `/wettelijke-taak/relations/${lineageId}`, method: 'GET', - params, signal, }) } -export const getRevisionsGetQueryKey = (params?: RevisionsGetParams) => { - return [`/revisions`, ...(params ? [params] : [])] as const +export const getWettelijkeTaakRelationsLineageIdGetQueryKey = ( + lineageId: number +) => { + return [`/wettelijke-taak/relations/${lineageId}`] as const } -export const getRevisionsGetQueryOptions = < - TData = Awaited>, +export const getWettelijkeTaakRelationsLineageIdGetQueryOptions = < + TData = Awaited>, TError = HTTPValidationError >( - params?: RevisionsGetParams, + lineageId: number, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited>, TError, TData > @@ -14093,80 +14147,2795 @@ export const getRevisionsGetQueryOptions = < ) => { const { query: queryOptions } = options ?? {} - const queryKey = queryOptions?.queryKey ?? getRevisionsGetQueryKey(params) + const queryKey = + queryOptions?.queryKey ?? + getWettelijkeTaakRelationsLineageIdGetQueryKey(lineageId) - const queryFn: QueryFunction>> = ({ - signal, - }) => revisionsGet(params, signal) + const queryFn: QueryFunction< + Awaited> + > = ({ signal }) => wettelijkeTaakRelationsLineageIdGet(lineageId, signal) - return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< - Awaited>, + return { + queryKey, + queryFn, + enabled: !!lineageId, + ...queryOptions, + } as UseQueryOptions< + Awaited>, TError, TData > & { queryKey: QueryKey } } -export type RevisionsGetQueryResult = NonNullable< - Awaited> +export type WettelijkeTaakRelationsLineageIdGetQueryResult = NonNullable< + Awaited> > -export type RevisionsGetQueryError = HTTPValidationError +export type WettelijkeTaakRelationsLineageIdGetQueryError = HTTPValidationError + +/** + * @summary Get all relation codes of the given wettelijke_taak lineage + */ +export const useWettelijkeTaakRelationsLineageIdGet = < + TData = Awaited>, + TError = HTTPValidationError +>( + lineageId: number, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getWettelijkeTaakRelationsLineageIdGetQueryOptions( + lineageId, + options + ) + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey + } + + query.queryKey = queryOptions.queryKey + + return query +} + +/** + * @summary Overwrite all relations of the given wettelijke_taak lineage + */ +export const wettelijkeTaakRelationsLineageIdPut = ( + lineageId: number, + writeRelation: WriteRelation[] +) => { + return customInstance({ + url: `/wettelijke-taak/relations/${lineageId}`, + method: 'PUT', + headers: { 'Content-Type': 'application/json' }, + data: writeRelation, + }) +} + +export const getWettelijkeTaakRelationsLineageIdPutMutationOptions = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { lineageId: number; data: WriteRelation[] }, + TContext + > +}): UseMutationOptions< + Awaited>, + TError, + { lineageId: number; data: WriteRelation[] }, + TContext +> => { + const { mutation: mutationOptions } = options ?? {} + + const mutationFn: MutationFunction< + Awaited>, + { lineageId: number; data: WriteRelation[] } + > = props => { + const { lineageId, data } = props ?? {} + + return wettelijkeTaakRelationsLineageIdPut(lineageId, data) + } + + return { mutationFn, ...mutationOptions } +} + +export type WettelijkeTaakRelationsLineageIdPutMutationResult = NonNullable< + Awaited> +> +export type WettelijkeTaakRelationsLineageIdPutMutationBody = WriteRelation[] +export type WettelijkeTaakRelationsLineageIdPutMutationError = + HTTPValidationError + +/** + * @summary Overwrite all relations of the given wettelijke_taak lineage + */ +export const useWettelijkeTaakRelationsLineageIdPut = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { lineageId: number; data: WriteRelation[] }, + TContext + > +}) => { + const mutationOptions = + getWettelijkeTaakRelationsLineageIdPutMutationOptions(options) + + return useMutation(mutationOptions) +} + +/** + * @summary Edit static data of an object + */ +export const wettelijkeTaakStaticLineageIdPost = ( + lineageId: number, + wettelijkeTaakStaticPostStatics: WettelijkeTaakStaticPostStatics +) => { + return customInstance({ + url: `/wettelijke-taak/static/${lineageId}`, + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + data: wettelijkeTaakStaticPostStatics, + }) +} + +export const getWettelijkeTaakStaticLineageIdPostMutationOptions = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { lineageId: number; data: WettelijkeTaakStaticPostStatics }, + TContext + > +}): UseMutationOptions< + Awaited>, + TError, + { lineageId: number; data: WettelijkeTaakStaticPostStatics }, + TContext +> => { + const { mutation: mutationOptions } = options ?? {} + + const mutationFn: MutationFunction< + Awaited>, + { lineageId: number; data: WettelijkeTaakStaticPostStatics } + > = props => { + const { lineageId, data } = props ?? {} + + return wettelijkeTaakStaticLineageIdPost(lineageId, data) + } + + return { mutationFn, ...mutationOptions } +} + +export type WettelijkeTaakStaticLineageIdPostMutationResult = NonNullable< + Awaited> +> +export type WettelijkeTaakStaticLineageIdPostMutationBody = + WettelijkeTaakStaticPostStatics +export type WettelijkeTaakStaticLineageIdPostMutationError = HTTPValidationError + +/** + * @summary Edit static data of an object + */ +export const useWettelijkeTaakStaticLineageIdPost = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { lineageId: number; data: WettelijkeTaakStaticPostStatics }, + TContext + > +}) => { + const mutationOptions = + getWettelijkeTaakStaticLineageIdPostMutationOptions(options) + + return useMutation(mutationOptions) +} + +/** + * @summary Download DSO + */ +export const playgroundDoDsoModuleIdPost = ( + moduleId: number, + params: PlaygroundDoDsoModuleIdPostParams +) => { + return customInstance({ + url: `/playground/do-dso/${moduleId}`, + method: 'POST', + params, + }) +} + +export const getPlaygroundDoDsoModuleIdPostMutationOptions = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { moduleId: number; params: PlaygroundDoDsoModuleIdPostParams }, + TContext + > +}): UseMutationOptions< + Awaited>, + TError, + { moduleId: number; params: PlaygroundDoDsoModuleIdPostParams }, + TContext +> => { + const { mutation: mutationOptions } = options ?? {} + + const mutationFn: MutationFunction< + Awaited>, + { moduleId: number; params: PlaygroundDoDsoModuleIdPostParams } + > = props => { + const { moduleId, params } = props ?? {} + + return playgroundDoDsoModuleIdPost(moduleId, params) + } + + return { mutationFn, ...mutationOptions } +} + +export type PlaygroundDoDsoModuleIdPostMutationResult = NonNullable< + Awaited> +> + +export type PlaygroundDoDsoModuleIdPostMutationError = HTTPValidationError + +/** + * @summary Download DSO + */ +export const usePlaygroundDoDsoModuleIdPost = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { moduleId: number; params: PlaygroundDoDsoModuleIdPostParams }, + TContext + > +}) => { + const mutationOptions = + getPlaygroundDoDsoModuleIdPostMutationOptions(options) + + return useMutation(mutationOptions) +} + +/** + * @summary Check GEO + */ +export const playgroundCheckGeoGet = (signal?: AbortSignal) => { + return customInstance({ + url: `/playground/check-geo`, + method: 'GET', + signal, + }) +} + +export const getPlaygroundCheckGeoGetQueryKey = () => { + return [`/playground/check-geo`] as const +} + +export const getPlaygroundCheckGeoGetQueryOptions = < + TData = Awaited>, + TError = unknown +>(options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > +}) => { + const { query: queryOptions } = options ?? {} + + const queryKey = + queryOptions?.queryKey ?? getPlaygroundCheckGeoGetQueryKey() + + const queryFn: QueryFunction< + Awaited> + > = ({ signal }) => playgroundCheckGeoGet(signal) + + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: QueryKey } +} + +export type PlaygroundCheckGeoGetQueryResult = NonNullable< + Awaited> +> +export type PlaygroundCheckGeoGetQueryError = unknown + +/** + * @summary Check GEO + */ +export const usePlaygroundCheckGeoGet = < + TData = Awaited>, + TError = unknown +>(options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > +}): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getPlaygroundCheckGeoGetQueryOptions(options) + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey + } + + query.queryKey = queryOptions.queryKey + + return query +} + +/** + * @summary List the users + */ +export const usersGet = (params?: UsersGetParams, signal?: AbortSignal) => { + return customInstance({ + url: `/users`, + method: 'GET', + params, + signal, + }) +} + +export const getUsersGetQueryKey = (params?: UsersGetParams) => { + return [`/users`, ...(params ? [params] : [])] as const +} + +export const getUsersGetQueryOptions = < + TData = Awaited>, + TError = HTTPValidationError +>( + params?: UsersGetParams, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + > + } +) => { + const { query: queryOptions } = options ?? {} + + const queryKey = queryOptions?.queryKey ?? getUsersGetQueryKey(params) + + const queryFn: QueryFunction>> = ({ + signal, + }) => usersGet(params, signal) + + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: QueryKey } +} + +export type UsersGetQueryResult = NonNullable< + Awaited> +> +export type UsersGetQueryError = HTTPValidationError + +/** + * @summary List the users + */ +export const useUsersGet = < + TData = Awaited>, + TError = HTTPValidationError +>( + params?: UsersGetParams, + options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + > + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getUsersGetQueryOptions(params, options) + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey + } + + query.queryKey = queryOptions.queryKey + + return query +} + +/** + * @summary Create new user + */ +export const usersPost = (userCreate: UserCreate) => { + return customInstance({ + url: `/users`, + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + data: userCreate, + }) +} + +export const getUsersPostMutationOptions = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { data: UserCreate }, + TContext + > +}): UseMutationOptions< + Awaited>, + TError, + { data: UserCreate }, + TContext +> => { + const { mutation: mutationOptions } = options ?? {} + + const mutationFn: MutationFunction< + Awaited>, + { data: UserCreate } + > = props => { + const { data } = props ?? {} + + return usersPost(data) + } + + return { mutationFn, ...mutationOptions } +} + +export type UsersPostMutationResult = NonNullable< + Awaited> +> +export type UsersPostMutationBody = UserCreate +export type UsersPostMutationError = HTTPValidationError + +/** + * @summary Create new user + */ +export const useUsersPost = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { data: UserCreate }, + TContext + > +}) => { + const mutationOptions = getUsersPostMutationOptions(options) + + return useMutation(mutationOptions) +} + +/** + * @summary Search the users + */ +export const usersSearchGet = ( + params?: UsersSearchGetParams, + signal?: AbortSignal +) => { + return customInstance({ + url: `/users/search`, + method: 'GET', + params, + signal, + }) +} + +export const getUsersSearchGetQueryKey = (params?: UsersSearchGetParams) => { + return [`/users/search`, ...(params ? [params] : [])] as const +} + +export const getUsersSearchGetQueryOptions = < + TData = Awaited>, + TError = HTTPValidationError +>( + params?: UsersSearchGetParams, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +) => { + const { query: queryOptions } = options ?? {} + + const queryKey = queryOptions?.queryKey ?? getUsersSearchGetQueryKey(params) + + const queryFn: QueryFunction< + Awaited> + > = ({ signal }) => usersSearchGet(params, signal) + + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: QueryKey } +} + +export type UsersSearchGetQueryResult = NonNullable< + Awaited> +> +export type UsersSearchGetQueryError = HTTPValidationError + +/** + * @summary Search the users + */ +export const useUsersSearchGet = < + TData = Awaited>, + TError = HTTPValidationError +>( + params?: UsersSearchGetParams, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getUsersSearchGetQueryOptions(params, options) + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey + } + + query.queryKey = queryOptions.queryKey + + return query +} + +/** + * @summary Get a user + */ +export const usersUserUuidGet = (userUuid: string, signal?: AbortSignal) => { + return customInstance({ + url: `/users/${userUuid}`, + method: 'GET', + signal, + }) +} + +export const getUsersUserUuidGetQueryKey = (userUuid: string) => { + return [`/users/${userUuid}`] as const +} + +export const getUsersUserUuidGetQueryOptions = < + TData = Awaited>, + TError = HTTPValidationError +>( + userUuid: string, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +) => { + const { query: queryOptions } = options ?? {} + + const queryKey = + queryOptions?.queryKey ?? getUsersUserUuidGetQueryKey(userUuid) + + const queryFn: QueryFunction< + Awaited> + > = ({ signal }) => usersUserUuidGet(userUuid, signal) + + return { + queryKey, + queryFn, + enabled: !!userUuid, + ...queryOptions, + } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: QueryKey } +} + +export type UsersUserUuidGetQueryResult = NonNullable< + Awaited> +> +export type UsersUserUuidGetQueryError = HTTPValidationError + +/** + * @summary Get a user + */ +export const useUsersUserUuidGet = < + TData = Awaited>, + TError = HTTPValidationError +>( + userUuid: string, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getUsersUserUuidGetQueryOptions(userUuid, options) + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey + } + + query.queryKey = queryOptions.queryKey + + return query +} + +/** + * @summary Edit user + */ +export const usersUserUuidPost = (userUuid: string, editUser: EditUser) => { + return customInstance({ + url: `/users/${userUuid}`, + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + data: editUser, + }) +} + +export const getUsersUserUuidPostMutationOptions = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { userUuid: string; data: EditUser }, + TContext + > +}): UseMutationOptions< + Awaited>, + TError, + { userUuid: string; data: EditUser }, + TContext +> => { + const { mutation: mutationOptions } = options ?? {} + + const mutationFn: MutationFunction< + Awaited>, + { userUuid: string; data: EditUser } + > = props => { + const { userUuid, data } = props ?? {} + + return usersUserUuidPost(userUuid, data) + } + + return { mutationFn, ...mutationOptions } +} + +export type UsersUserUuidPostMutationResult = NonNullable< + Awaited> +> +export type UsersUserUuidPostMutationBody = EditUser +export type UsersUserUuidPostMutationError = HTTPValidationError + +/** + * @summary Edit user + */ +export const useUsersUserUuidPost = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { userUuid: string; data: EditUser }, + TContext + > +}) => { + const mutationOptions = getUsersUserUuidPostMutationOptions(options) + + return useMutation(mutationOptions) +} + +/** + * @summary Reset user password + */ +export const usersUserUuidResetPasswordPost = (userUuid: string) => { + return customInstance({ + url: `/users/${userUuid}/reset-password`, + method: 'POST', + }) +} + +export const getUsersUserUuidResetPasswordPostMutationOptions = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { userUuid: string }, + TContext + > +}): UseMutationOptions< + Awaited>, + TError, + { userUuid: string }, + TContext +> => { + const { mutation: mutationOptions } = options ?? {} + + const mutationFn: MutationFunction< + Awaited>, + { userUuid: string } + > = props => { + const { userUuid } = props ?? {} + + return usersUserUuidResetPasswordPost(userUuid) + } + + return { mutationFn, ...mutationOptions } +} + +export type UsersUserUuidResetPasswordPostMutationResult = NonNullable< + Awaited> +> + +export type UsersUserUuidResetPasswordPostMutationError = HTTPValidationError + +/** + * @summary Reset user password + */ +export const useUsersUserUuidResetPasswordPost = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { userUuid: string }, + TContext + > +}) => { + const mutationOptions = + getUsersUserUuidResetPasswordPostMutationOptions(options) + + return useMutation(mutationOptions) +} + +/** + * @summary List the werkingsgebieden + */ +export const sourceWerkingsgebiedenGet = ( + params?: SourceWerkingsgebiedenGetParams, + signal?: AbortSignal +) => { + return customInstance({ + url: `/source-werkingsgebieden`, + method: 'GET', + params, + signal, + }) +} + +export const getSourceWerkingsgebiedenGetQueryKey = ( + params?: SourceWerkingsgebiedenGetParams +) => { + return [`/source-werkingsgebieden`, ...(params ? [params] : [])] as const +} + +export const getSourceWerkingsgebiedenGetQueryOptions = < + TData = Awaited>, + TError = HTTPValidationError +>( + params?: SourceWerkingsgebiedenGetParams, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +) => { + const { query: queryOptions } = options ?? {} + + const queryKey = + queryOptions?.queryKey ?? getSourceWerkingsgebiedenGetQueryKey(params) + + const queryFn: QueryFunction< + Awaited> + > = ({ signal }) => sourceWerkingsgebiedenGet(params, signal) + + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: QueryKey } +} + +export type SourceWerkingsgebiedenGetQueryResult = NonNullable< + Awaited> +> +export type SourceWerkingsgebiedenGetQueryError = HTTPValidationError + +/** + * @summary List the werkingsgebieden + */ +export const useSourceWerkingsgebiedenGet = < + TData = Awaited>, + TError = HTTPValidationError +>( + params?: SourceWerkingsgebiedenGetParams, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getSourceWerkingsgebiedenGetQueryOptions( + params, + options + ) + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey + } + + query.queryKey = queryOptions.queryKey + + return query +} + +/** + * @summary List the objects active in werkingsgebieden + */ +export const searchSourceGeoPost = ( + searchGeoRequestData: SearchGeoRequestData, + params?: SearchSourceGeoPostParams +) => { + return customInstance({ + url: `/search/source-geo`, + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + data: searchGeoRequestData, + params, + }) +} + +export const getSearchSourceGeoPostMutationOptions = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { data: SearchGeoRequestData; params?: SearchSourceGeoPostParams }, + TContext + > +}): UseMutationOptions< + Awaited>, + TError, + { data: SearchGeoRequestData; params?: SearchSourceGeoPostParams }, + TContext +> => { + const { mutation: mutationOptions } = options ?? {} + + const mutationFn: MutationFunction< + Awaited>, + { data: SearchGeoRequestData; params?: SearchSourceGeoPostParams } + > = props => { + const { data, params } = props ?? {} + + return searchSourceGeoPost(data, params) + } + + return { mutationFn, ...mutationOptions } +} + +export type SearchSourceGeoPostMutationResult = NonNullable< + Awaited> +> +export type SearchSourceGeoPostMutationBody = SearchGeoRequestData +export type SearchSourceGeoPostMutationError = HTTPValidationError + +/** + * @summary List the objects active in werkingsgebieden + */ +export const useSearchSourceGeoPost = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { data: SearchGeoRequestData; params?: SearchSourceGeoPostParams }, + TContext + > +}) => { + const mutationOptions = getSearchSourceGeoPostMutationOptions(options) + + return useMutation(mutationOptions) +} + +/** + * @summary List the objects in werkingsgebieden by a geometry + */ +export const searchSourceGeometryPost = ( + listObjectsByGeometryRequestData: ListObjectsByGeometryRequestData, + params?: SearchSourceGeometryPostParams +) => { + return customInstance({ + url: `/search/source-geometry`, + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + data: listObjectsByGeometryRequestData, + params, + }) +} + +export const getSearchSourceGeometryPostMutationOptions = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { + data: ListObjectsByGeometryRequestData + params?: SearchSourceGeometryPostParams + }, + TContext + > +}): UseMutationOptions< + Awaited>, + TError, + { + data: ListObjectsByGeometryRequestData + params?: SearchSourceGeometryPostParams + }, + TContext +> => { + const { mutation: mutationOptions } = options ?? {} + + const mutationFn: MutationFunction< + Awaited>, + { + data: ListObjectsByGeometryRequestData + params?: SearchSourceGeometryPostParams + } + > = props => { + const { data, params } = props ?? {} + + return searchSourceGeometryPost(data, params) + } + + return { mutationFn, ...mutationOptions } +} + +export type SearchSourceGeometryPostMutationResult = NonNullable< + Awaited> +> +export type SearchSourceGeometryPostMutationBody = + ListObjectsByGeometryRequestData +export type SearchSourceGeometryPostMutationError = HTTPValidationError + +/** + * @summary List the objects in werkingsgebieden by a geometry + */ +export const useSearchSourceGeometryPost = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { + data: ListObjectsByGeometryRequestData + params?: SearchSourceGeometryPostParams + }, + TContext + > +}) => { + const mutationOptions = getSearchSourceGeometryPostMutationOptions(options) + + return useMutation(mutationOptions) +} + +/** + * @summary Search for objects + */ +export const searchPost = ( + searchRequestData: SearchRequestData, + params: SearchPostParams +) => { + return customInstance({ + url: `/search`, + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + data: searchRequestData, + params, + }) +} + +export const getSearchPostMutationOptions = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { data: SearchRequestData; params: SearchPostParams }, + TContext + > +}): UseMutationOptions< + Awaited>, + TError, + { data: SearchRequestData; params: SearchPostParams }, + TContext +> => { + const { mutation: mutationOptions } = options ?? {} + + const mutationFn: MutationFunction< + Awaited>, + { data: SearchRequestData; params: SearchPostParams } + > = props => { + const { data, params } = props ?? {} + + return searchPost(data, params) + } + + return { mutationFn, ...mutationOptions } +} + +export type SearchPostMutationResult = NonNullable< + Awaited> +> +export type SearchPostMutationBody = SearchRequestData +export type SearchPostMutationError = HTTPValidationError + +/** + * @summary Search for objects + */ +export const useSearchPost = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { data: SearchRequestData; params: SearchPostParams }, + TContext + > +}) => { + const mutationOptions = getSearchPostMutationOptions(options) + + return useMutation(mutationOptions) +} + +/** + * @summary Search for valid objects + */ +export const searchValidPost = ( + searchRequestData: SearchRequestData, + params: SearchValidPostParams +) => { + return customInstance({ + url: `/search/valid`, + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + data: searchRequestData, + params, + }) +} + +export const getSearchValidPostMutationOptions = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { data: SearchRequestData; params: SearchValidPostParams }, + TContext + > +}): UseMutationOptions< + Awaited>, + TError, + { data: SearchRequestData; params: SearchValidPostParams }, + TContext +> => { + const { mutation: mutationOptions } = options ?? {} + + const mutationFn: MutationFunction< + Awaited>, + { data: SearchRequestData; params: SearchValidPostParams } + > = props => { + const { data, params } = props ?? {} + + return searchValidPost(data, params) + } + + return { mutationFn, ...mutationOptions } +} + +export type SearchValidPostMutationResult = NonNullable< + Awaited> +> +export type SearchValidPostMutationBody = SearchRequestData +export type SearchValidPostMutationError = HTTPValidationError + +/** + * @summary Search for valid objects + */ +export const useSearchValidPost = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { data: SearchRequestData; params: SearchValidPostParams }, + TContext + > +}) => { + const mutationOptions = getSearchValidPostMutationOptions(options) + + return useMutation(mutationOptions) +} + +/** + * @summary A graph representation + */ +export const fullGraphGet = (signal?: AbortSignal) => { + return customInstance({ + url: `/full-graph`, + method: 'GET', + signal, + }) +} + +export const getFullGraphGetQueryKey = () => { + return [`/full-graph`] as const +} + +export const getFullGraphGetQueryOptions = < + TData = Awaited>, + TError = unknown +>(options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + > +}) => { + const { query: queryOptions } = options ?? {} + + const queryKey = queryOptions?.queryKey ?? getFullGraphGetQueryKey() + + const queryFn: QueryFunction>> = ({ + signal, + }) => fullGraphGet(signal) + + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: QueryKey } +} + +export type FullGraphGetQueryResult = NonNullable< + Awaited> +> +export type FullGraphGetQueryError = unknown + +/** + * @summary A graph representation + */ +export const useFullGraphGet = < + TData = Awaited>, + TError = unknown +>(options?: { + query?: Partial< + UseQueryOptions>, TError, TData> + > +}): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getFullGraphGetQueryOptions(options) + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey + } + + query.queryKey = queryOptions.queryKey + + return query +} + +/** + * @summary A graph representation of an object + */ +export const objectGraphGet = ( + params: ObjectGraphGetParams, + signal?: AbortSignal +) => { + return customInstance({ + url: `/object-graph`, + method: 'GET', + params, + signal, + }) +} + +export const getObjectGraphGetQueryKey = (params: ObjectGraphGetParams) => { + return [`/object-graph`, ...(params ? [params] : [])] as const +} + +export const getObjectGraphGetQueryOptions = < + TData = Awaited>, + TError = HTTPValidationError +>( + params: ObjectGraphGetParams, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +) => { + const { query: queryOptions } = options ?? {} + + const queryKey = queryOptions?.queryKey ?? getObjectGraphGetQueryKey(params) + + const queryFn: QueryFunction< + Awaited> + > = ({ signal }) => objectGraphGet(params, signal) + + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: QueryKey } +} + +export type ObjectGraphGetQueryResult = NonNullable< + Awaited> +> +export type ObjectGraphGetQueryError = HTTPValidationError + +/** + * @summary A graph representation of an object + */ +export const useObjectGraphGet = < + TData = Awaited>, + TError = HTTPValidationError +>( + params: ObjectGraphGetParams, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getObjectGraphGetQueryOptions(params, options) + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey + } + + query.queryKey = queryOptions.queryKey + + return query +} + +/** + * @summary List the public modules + */ +export const revisionsGet = ( + params?: RevisionsGetParams, + signal?: AbortSignal +) => { + return customInstance({ + url: `/revisions`, + method: 'GET', + params, + signal, + }) +} + +export const getRevisionsGetQueryKey = (params?: RevisionsGetParams) => { + return [`/revisions`, ...(params ? [params] : [])] as const +} + +export const getRevisionsGetQueryOptions = < + TData = Awaited>, + TError = HTTPValidationError +>( + params?: RevisionsGetParams, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +) => { + const { query: queryOptions } = options ?? {} + + const queryKey = queryOptions?.queryKey ?? getRevisionsGetQueryKey(params) + + const queryFn: QueryFunction>> = ({ + signal, + }) => revisionsGet(params, signal) + + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: QueryKey } +} + +export type RevisionsGetQueryResult = NonNullable< + Awaited> +> +export type RevisionsGetQueryError = HTTPValidationError + +/** + * @summary List the public modules + */ +export const useRevisionsGet = < + TData = Awaited>, + TError = HTTPValidationError +>( + params?: RevisionsGetParams, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getRevisionsGetQueryOptions(params, options) + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey + } + + query.queryKey = queryOptions.queryKey + + return query +} + +/** + * @summary Get overview of a public module + */ +export const revisionsModuleIdGet = ( + moduleId: number, + signal?: AbortSignal +) => { + return customInstance({ + url: `/revisions/${moduleId}`, + method: 'GET', + signal, + }) +} + +export const getRevisionsModuleIdGetQueryKey = (moduleId: number) => { + return [`/revisions/${moduleId}`] as const +} + +export const getRevisionsModuleIdGetQueryOptions = < + TData = Awaited>, + TError = HTTPValidationError +>( + moduleId: number, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +) => { + const { query: queryOptions } = options ?? {} + + const queryKey = + queryOptions?.queryKey ?? getRevisionsModuleIdGetQueryKey(moduleId) + + const queryFn: QueryFunction< + Awaited> + > = ({ signal }) => revisionsModuleIdGet(moduleId, signal) + + return { + queryKey, + queryFn, + enabled: !!moduleId, + ...queryOptions, + } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: QueryKey } +} + +export type RevisionsModuleIdGetQueryResult = NonNullable< + Awaited> +> +export type RevisionsModuleIdGetQueryError = HTTPValidationError + +/** + * @summary Get overview of a public module + */ +export const useRevisionsModuleIdGet = < + TData = Awaited>, + TError = HTTPValidationError +>( + moduleId: number, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getRevisionsModuleIdGetQueryOptions(moduleId, options) + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey + } + + query.queryKey = queryOptions.queryKey + + return query +} + +/** + * @summary List the modules + */ +export const modulesGet = (params?: ModulesGetParams, signal?: AbortSignal) => { + return customInstance({ + url: `/modules`, + method: 'GET', + params, + signal, + }) +} + +export const getModulesGetQueryKey = (params?: ModulesGetParams) => { + return [`/modules`, ...(params ? [params] : [])] as const +} + +export const getModulesGetQueryOptions = < + TData = Awaited>, + TError = HTTPValidationError +>( + params?: ModulesGetParams, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +) => { + const { query: queryOptions } = options ?? {} + + const queryKey = queryOptions?.queryKey ?? getModulesGetQueryKey(params) + + const queryFn: QueryFunction>> = ({ + signal, + }) => modulesGet(params, signal) + + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: QueryKey } +} + +export type ModulesGetQueryResult = NonNullable< + Awaited> +> +export type ModulesGetQueryError = HTTPValidationError + +/** + * @summary List the modules + */ +export const useModulesGet = < + TData = Awaited>, + TError = HTTPValidationError +>( + params?: ModulesGetParams, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getModulesGetQueryOptions(params, options) + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey + } + + query.queryKey = queryOptions.queryKey + + return query +} + +/** + * @summary Create new module + */ +export const modulesPost = (moduleCreate: ModuleCreate) => { + return customInstance({ + url: `/modules`, + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + data: moduleCreate, + }) +} + +export const getModulesPostMutationOptions = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { data: ModuleCreate }, + TContext + > +}): UseMutationOptions< + Awaited>, + TError, + { data: ModuleCreate }, + TContext +> => { + const { mutation: mutationOptions } = options ?? {} + + const mutationFn: MutationFunction< + Awaited>, + { data: ModuleCreate } + > = props => { + const { data } = props ?? {} + + return modulesPost(data) + } + + return { mutationFn, ...mutationOptions } +} + +export type ModulesPostMutationResult = NonNullable< + Awaited> +> +export type ModulesPostMutationBody = ModuleCreate +export type ModulesPostMutationError = HTTPValidationError + +/** + * @summary Create new module + */ +export const useModulesPost = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { data: ModuleCreate }, + TContext + > +}) => { + const mutationOptions = getModulesPostMutationOptions(options) + + return useMutation(mutationOptions) +} + +/** + * @summary Get overview of a module + */ +export const modulesModuleIdGet = (moduleId: number, signal?: AbortSignal) => { + return customInstance({ + url: `/modules/${moduleId}`, + method: 'GET', + signal, + }) +} + +export const getModulesModuleIdGetQueryKey = (moduleId: number) => { + return [`/modules/${moduleId}`] as const +} + +export const getModulesModuleIdGetQueryOptions = < + TData = Awaited>, + TError = HTTPValidationError +>( + moduleId: number, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +) => { + const { query: queryOptions } = options ?? {} + + const queryKey = + queryOptions?.queryKey ?? getModulesModuleIdGetQueryKey(moduleId) + + const queryFn: QueryFunction< + Awaited> + > = ({ signal }) => modulesModuleIdGet(moduleId, signal) + + return { + queryKey, + queryFn, + enabled: !!moduleId, + ...queryOptions, + } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: QueryKey } +} + +export type ModulesModuleIdGetQueryResult = NonNullable< + Awaited> +> +export type ModulesModuleIdGetQueryError = HTTPValidationError + +/** + * @summary Get overview of a module + */ +export const useModulesModuleIdGet = < + TData = Awaited>, + TError = HTTPValidationError +>( + moduleId: number, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getModulesModuleIdGetQueryOptions(moduleId, options) + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey + } + + query.queryKey = queryOptions.queryKey + + return query +} + +/** + * @summary Edit module + */ +export const modulesModuleIdPost = ( + moduleId: number, + moduleEdit: ModuleEdit +) => { + return customInstance({ + url: `/modules/${moduleId}`, + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + data: moduleEdit, + }) +} + +export const getModulesModuleIdPostMutationOptions = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { moduleId: number; data: ModuleEdit }, + TContext + > +}): UseMutationOptions< + Awaited>, + TError, + { moduleId: number; data: ModuleEdit }, + TContext +> => { + const { mutation: mutationOptions } = options ?? {} + + const mutationFn: MutationFunction< + Awaited>, + { moduleId: number; data: ModuleEdit } + > = props => { + const { moduleId, data } = props ?? {} + + return modulesModuleIdPost(moduleId, data) + } + + return { mutationFn, ...mutationOptions } +} + +export type ModulesModuleIdPostMutationResult = NonNullable< + Awaited> +> +export type ModulesModuleIdPostMutationBody = ModuleEdit +export type ModulesModuleIdPostMutationError = HTTPValidationError + +/** + * @summary Edit module + */ +export const useModulesModuleIdPost = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { moduleId: number; data: ModuleEdit }, + TContext + > +}) => { + const mutationOptions = getModulesModuleIdPostMutationOptions(options) + + return useMutation(mutationOptions) +} + +/** + * @summary Activate a module + */ +export const modulesModuleIdActivatePost = (moduleId: number) => { + return customInstance({ + url: `/modules/${moduleId}/activate`, + method: 'POST', + }) +} + +export const getModulesModuleIdActivatePostMutationOptions = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { moduleId: number }, + TContext + > +}): UseMutationOptions< + Awaited>, + TError, + { moduleId: number }, + TContext +> => { + const { mutation: mutationOptions } = options ?? {} + + const mutationFn: MutationFunction< + Awaited>, + { moduleId: number } + > = props => { + const { moduleId } = props ?? {} + + return modulesModuleIdActivatePost(moduleId) + } + + return { mutationFn, ...mutationOptions } +} + +export type ModulesModuleIdActivatePostMutationResult = NonNullable< + Awaited> +> + +export type ModulesModuleIdActivatePostMutationError = HTTPValidationError + +/** + * @summary Activate a module + */ +export const useModulesModuleIdActivatePost = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { moduleId: number }, + TContext + > +}) => { + const mutationOptions = + getModulesModuleIdActivatePostMutationOptions(options) + + return useMutation(mutationOptions) +} + +/** + * @summary Complete a module (Successful) + */ +export const modulesModuleIdCompletePost = ( + moduleId: number, + completeModule: CompleteModule +) => { + return customInstance({ + url: `/modules/${moduleId}/complete`, + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + data: completeModule, + }) +} + +export const getModulesModuleIdCompletePostMutationOptions = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { moduleId: number; data: CompleteModule }, + TContext + > +}): UseMutationOptions< + Awaited>, + TError, + { moduleId: number; data: CompleteModule }, + TContext +> => { + const { mutation: mutationOptions } = options ?? {} + + const mutationFn: MutationFunction< + Awaited>, + { moduleId: number; data: CompleteModule } + > = props => { + const { moduleId, data } = props ?? {} + + return modulesModuleIdCompletePost(moduleId, data) + } + + return { mutationFn, ...mutationOptions } +} + +export type ModulesModuleIdCompletePostMutationResult = NonNullable< + Awaited> +> +export type ModulesModuleIdCompletePostMutationBody = CompleteModule +export type ModulesModuleIdCompletePostMutationError = HTTPValidationError + +/** + * @summary Complete a module (Successful) + */ +export const useModulesModuleIdCompletePost = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { moduleId: number; data: CompleteModule }, + TContext + > +}) => { + const mutationOptions = + getModulesModuleIdCompletePostMutationOptions(options) + + return useMutation(mutationOptions) +} + +/** + * @summary Close a module (Unsuccessful) + */ +export const modulesModuleIdClosePost = (moduleId: number) => { + return customInstance({ + url: `/modules/${moduleId}/close`, + method: 'POST', + }) +} + +export const getModulesModuleIdClosePostMutationOptions = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { moduleId: number }, + TContext + > +}): UseMutationOptions< + Awaited>, + TError, + { moduleId: number }, + TContext +> => { + const { mutation: mutationOptions } = options ?? {} + + const mutationFn: MutationFunction< + Awaited>, + { moduleId: number } + > = props => { + const { moduleId } = props ?? {} + + return modulesModuleIdClosePost(moduleId) + } + + return { mutationFn, ...mutationOptions } +} + +export type ModulesModuleIdClosePostMutationResult = NonNullable< + Awaited> +> + +export type ModulesModuleIdClosePostMutationError = HTTPValidationError + +/** + * @summary Close a module (Unsuccessful) + */ +export const useModulesModuleIdClosePost = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { moduleId: number }, + TContext + > +}) => { + const mutationOptions = getModulesModuleIdClosePostMutationOptions(options) + + return useMutation(mutationOptions) +} + +/** + * @summary Get status history of the module + */ +export const modulesModuleIdStatusGet = ( + moduleId: number, + signal?: AbortSignal +) => { + return customInstance({ + url: `/modules/${moduleId}/status`, + method: 'GET', + signal, + }) +} + +export const getModulesModuleIdStatusGetQueryKey = (moduleId: number) => { + return [`/modules/${moduleId}/status`] as const +} + +export const getModulesModuleIdStatusGetQueryOptions = < + TData = Awaited>, + TError = HTTPValidationError +>( + moduleId: number, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +) => { + const { query: queryOptions } = options ?? {} + + const queryKey = + queryOptions?.queryKey ?? getModulesModuleIdStatusGetQueryKey(moduleId) + + const queryFn: QueryFunction< + Awaited> + > = ({ signal }) => modulesModuleIdStatusGet(moduleId, signal) + + return { + queryKey, + queryFn, + enabled: !!moduleId, + ...queryOptions, + } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: QueryKey } +} + +export type ModulesModuleIdStatusGetQueryResult = NonNullable< + Awaited> +> +export type ModulesModuleIdStatusGetQueryError = HTTPValidationError + +/** + * @summary Get status history of the module + */ +export const useModulesModuleIdStatusGet = < + TData = Awaited>, + TError = HTTPValidationError +>( + moduleId: number, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getModulesModuleIdStatusGetQueryOptions( + moduleId, + options + ) + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey + } + + query.queryKey = queryOptions.queryKey + + return query +} + +/** + * @summary Patch the status of the module + */ +export const modulesModuleIdStatusPatch = ( + moduleId: number, + modulePatchStatus: ModulePatchStatus +) => { + return customInstance({ + url: `/modules/${moduleId}/status`, + method: 'PATCH', + headers: { 'Content-Type': 'application/json' }, + data: modulePatchStatus, + }) +} + +export const getModulesModuleIdStatusPatchMutationOptions = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { moduleId: number; data: ModulePatchStatus }, + TContext + > +}): UseMutationOptions< + Awaited>, + TError, + { moduleId: number; data: ModulePatchStatus }, + TContext +> => { + const { mutation: mutationOptions } = options ?? {} + + const mutationFn: MutationFunction< + Awaited>, + { moduleId: number; data: ModulePatchStatus } + > = props => { + const { moduleId, data } = props ?? {} + + return modulesModuleIdStatusPatch(moduleId, data) + } + + return { mutationFn, ...mutationOptions } +} + +export type ModulesModuleIdStatusPatchMutationResult = NonNullable< + Awaited> +> +export type ModulesModuleIdStatusPatchMutationBody = ModulePatchStatus +export type ModulesModuleIdStatusPatchMutationError = HTTPValidationError + +/** + * @summary Patch the status of the module + */ +export const useModulesModuleIdStatusPatch = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { moduleId: number; data: ModulePatchStatus }, + TContext + > +}) => { + const mutationOptions = + getModulesModuleIdStatusPatchMutationOptions(options) + + return useMutation(mutationOptions) +} + +/** + * @summary Get difference of module to Vigerend + */ +export const modulesModuleIdDiffGet = ( + moduleId: number, + params?: ModulesModuleIdDiffGetParams, + signal?: AbortSignal +) => { + return customInstance({ + url: `/modules/${moduleId}/diff`, + method: 'GET', + params, + signal, + }) +} + +export const getModulesModuleIdDiffGetQueryKey = ( + moduleId: number, + params?: ModulesModuleIdDiffGetParams +) => { + return [`/modules/${moduleId}/diff`, ...(params ? [params] : [])] as const +} + +export const getModulesModuleIdDiffGetQueryOptions = < + TData = Awaited>, + TError = HTTPValidationError +>( + moduleId: number, + params?: ModulesModuleIdDiffGetParams, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +) => { + const { query: queryOptions } = options ?? {} + + const queryKey = + queryOptions?.queryKey ?? + getModulesModuleIdDiffGetQueryKey(moduleId, params) + + const queryFn: QueryFunction< + Awaited> + > = ({ signal }) => modulesModuleIdDiffGet(moduleId, params, signal) + + return { + queryKey, + queryFn, + enabled: !!moduleId, + ...queryOptions, + } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: QueryKey } +} + +export type ModulesModuleIdDiffGetQueryResult = NonNullable< + Awaited> +> +export type ModulesModuleIdDiffGetQueryError = HTTPValidationError + +/** + * @summary Get difference of module to Vigerend + */ +export const useModulesModuleIdDiffGet = < + TData = Awaited>, + TError = HTTPValidationError +>( + moduleId: number, + params?: ModulesModuleIdDiffGetParams, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getModulesModuleIdDiffGetQueryOptions( + moduleId, + params, + options + ) + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey + } + + query.queryKey = queryOptions.queryKey + + return query +} + +/** + * @summary Add new object to the module + */ +export const modulesModuleIdAddNewObjectPost = ( + moduleId: number, + moduleAddNewObject: ModuleAddNewObject +) => { + return customInstance({ + url: `/modules/${moduleId}/add-new-object`, + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + data: moduleAddNewObject, + }) +} + +export const getModulesModuleIdAddNewObjectPostMutationOptions = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { moduleId: number; data: ModuleAddNewObject }, + TContext + > +}): UseMutationOptions< + Awaited>, + TError, + { moduleId: number; data: ModuleAddNewObject }, + TContext +> => { + const { mutation: mutationOptions } = options ?? {} + + const mutationFn: MutationFunction< + Awaited>, + { moduleId: number; data: ModuleAddNewObject } + > = props => { + const { moduleId, data } = props ?? {} + + return modulesModuleIdAddNewObjectPost(moduleId, data) + } + + return { mutationFn, ...mutationOptions } +} + +export type ModulesModuleIdAddNewObjectPostMutationResult = NonNullable< + Awaited> +> +export type ModulesModuleIdAddNewObjectPostMutationBody = ModuleAddNewObject +export type ModulesModuleIdAddNewObjectPostMutationError = HTTPValidationError + +/** + * @summary Add new object to the module + */ +export const useModulesModuleIdAddNewObjectPost = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { moduleId: number; data: ModuleAddNewObject }, + TContext + > +}) => { + const mutationOptions = + getModulesModuleIdAddNewObjectPostMutationOptions(options) + + return useMutation(mutationOptions) +} + +/** + * @summary Add existing object to the module + */ +export const modulesModuleIdAddExistingObjectPost = ( + moduleId: number, + moduleAddExistingObject: ModuleAddExistingObject +) => { + return customInstance({ + url: `/modules/${moduleId}/add-existing-object`, + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + data: moduleAddExistingObject, + }) +} + +export const getModulesModuleIdAddExistingObjectPostMutationOptions = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { moduleId: number; data: ModuleAddExistingObject }, + TContext + > +}): UseMutationOptions< + Awaited>, + TError, + { moduleId: number; data: ModuleAddExistingObject }, + TContext +> => { + const { mutation: mutationOptions } = options ?? {} + + const mutationFn: MutationFunction< + Awaited>, + { moduleId: number; data: ModuleAddExistingObject } + > = props => { + const { moduleId, data } = props ?? {} + + return modulesModuleIdAddExistingObjectPost(moduleId, data) + } + + return { mutationFn, ...mutationOptions } +} + +export type ModulesModuleIdAddExistingObjectPostMutationResult = NonNullable< + Awaited> +> +export type ModulesModuleIdAddExistingObjectPostMutationBody = + ModuleAddExistingObject +export type ModulesModuleIdAddExistingObjectPostMutationError = + HTTPValidationError + +/** + * @summary Add existing object to the module + */ +export const useModulesModuleIdAddExistingObjectPost = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { moduleId: number; data: ModuleAddExistingObject }, + TContext + > +}) => { + const mutationOptions = + getModulesModuleIdAddExistingObjectPostMutationOptions(options) + + return useMutation(mutationOptions) +} + +/** + * @summary Get context of object in the module + */ +export const modulesModuleIdObjectContextObjectTypeLineageIdGet = ( + moduleId: number, + objectType: string, + lineageId: number, + signal?: AbortSignal +) => { + return customInstance({ + url: `/modules/${moduleId}/object-context/${objectType}/${lineageId}`, + method: 'GET', + signal, + }) +} + +export const getModulesModuleIdObjectContextObjectTypeLineageIdGetQueryKey = ( + moduleId: number, + objectType: string, + lineageId: number +) => { + return [ + `/modules/${moduleId}/object-context/${objectType}/${lineageId}`, + ] as const +} + +export const getModulesModuleIdObjectContextObjectTypeLineageIdGetQueryOptions = + < + TData = Awaited< + ReturnType< + typeof modulesModuleIdObjectContextObjectTypeLineageIdGet + > + >, + TError = HTTPValidationError + >( + moduleId: number, + objectType: string, + lineageId: number, + options?: { + query?: Partial< + UseQueryOptions< + Awaited< + ReturnType< + typeof modulesModuleIdObjectContextObjectTypeLineageIdGet + > + >, + TError, + TData + > + > + } + ) => { + const { query: queryOptions } = options ?? {} + + const queryKey = + queryOptions?.queryKey ?? + getModulesModuleIdObjectContextObjectTypeLineageIdGetQueryKey( + moduleId, + objectType, + lineageId + ) + + const queryFn: QueryFunction< + Awaited< + ReturnType< + typeof modulesModuleIdObjectContextObjectTypeLineageIdGet + > + > + > = ({ signal }) => + modulesModuleIdObjectContextObjectTypeLineageIdGet( + moduleId, + objectType, + lineageId, + signal + ) + + return { + queryKey, + queryFn, + enabled: !!(moduleId && objectType && lineageId), + ...queryOptions, + } as UseQueryOptions< + Awaited< + ReturnType< + typeof modulesModuleIdObjectContextObjectTypeLineageIdGet + > + >, + TError, + TData + > & { queryKey: QueryKey } + } + +export type ModulesModuleIdObjectContextObjectTypeLineageIdGetQueryResult = + NonNullable< + Awaited< + ReturnType< + typeof modulesModuleIdObjectContextObjectTypeLineageIdGet + > + > + > +export type ModulesModuleIdObjectContextObjectTypeLineageIdGetQueryError = + HTTPValidationError + +/** + * @summary Get context of object in the module + */ +export const useModulesModuleIdObjectContextObjectTypeLineageIdGet = < + TData = Awaited< + ReturnType + >, + TError = HTTPValidationError +>( + moduleId: number, + objectType: string, + lineageId: number, + options?: { + query?: Partial< + UseQueryOptions< + Awaited< + ReturnType< + typeof modulesModuleIdObjectContextObjectTypeLineageIdGet + > + >, + TError, + TData + > + > + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = + getModulesModuleIdObjectContextObjectTypeLineageIdGetQueryOptions( + moduleId, + objectType, + lineageId, + options + ) + + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey + } + + query.queryKey = queryOptions.queryKey + + return query +} + +/** + * @summary Edit context of object in the module + */ +export const modulesModuleIdObjectContextObjectTypeLineageIdPost = ( + moduleId: number, + objectType: string, + lineageId: number, + moduleEditObjectContext: ModuleEditObjectContext +) => { + return customInstance({ + url: `/modules/${moduleId}/object-context/${objectType}/${lineageId}`, + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + data: moduleEditObjectContext, + }) +} + +export const getModulesModuleIdObjectContextObjectTypeLineageIdPostMutationOptions = + (options?: { + mutation?: UseMutationOptions< + Awaited< + ReturnType< + typeof modulesModuleIdObjectContextObjectTypeLineageIdPost + > + >, + TError, + { + moduleId: number + objectType: string + lineageId: number + data: ModuleEditObjectContext + }, + TContext + > + }): UseMutationOptions< + Awaited< + ReturnType< + typeof modulesModuleIdObjectContextObjectTypeLineageIdPost + > + >, + TError, + { + moduleId: number + objectType: string + lineageId: number + data: ModuleEditObjectContext + }, + TContext + > => { + const { mutation: mutationOptions } = options ?? {} + + const mutationFn: MutationFunction< + Awaited< + ReturnType< + typeof modulesModuleIdObjectContextObjectTypeLineageIdPost + > + >, + { + moduleId: number + objectType: string + lineageId: number + data: ModuleEditObjectContext + } + > = props => { + const { moduleId, objectType, lineageId, data } = props ?? {} + + return modulesModuleIdObjectContextObjectTypeLineageIdPost( + moduleId, + objectType, + lineageId, + data + ) + } + + return { mutationFn, ...mutationOptions } + } + +export type ModulesModuleIdObjectContextObjectTypeLineageIdPostMutationResult = + NonNullable< + Awaited< + ReturnType< + typeof modulesModuleIdObjectContextObjectTypeLineageIdPost + > + > + > +export type ModulesModuleIdObjectContextObjectTypeLineageIdPostMutationBody = + ModuleEditObjectContext +export type ModulesModuleIdObjectContextObjectTypeLineageIdPostMutationError = + HTTPValidationError + +/** + * @summary Edit context of object in the module + */ +export const useModulesModuleIdObjectContextObjectTypeLineageIdPost = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited< + ReturnType< + typeof modulesModuleIdObjectContextObjectTypeLineageIdPost + > + >, + TError, + { + moduleId: number + objectType: string + lineageId: number + data: ModuleEditObjectContext + }, + TContext + > +}) => { + const mutationOptions = + getModulesModuleIdObjectContextObjectTypeLineageIdPostMutationOptions( + options + ) + + return useMutation(mutationOptions) +} + +/** + * @summary Remove object from the module + */ +export const modulesModuleIdRemoveObjectTypeLineageIdDelete = ( + moduleId: number, + objectType: string, + lineageId: number +) => { + return customInstance({ + url: `/modules/${moduleId}/remove/${objectType}/${lineageId}`, + method: 'DELETE', + }) +} + +export const getModulesModuleIdRemoveObjectTypeLineageIdDeleteMutationOptions = + (options?: { + mutation?: UseMutationOptions< + Awaited< + ReturnType< + typeof modulesModuleIdRemoveObjectTypeLineageIdDelete + > + >, + TError, + { moduleId: number; objectType: string; lineageId: number }, + TContext + > + }): UseMutationOptions< + Awaited< + ReturnType + >, + TError, + { moduleId: number; objectType: string; lineageId: number }, + TContext + > => { + const { mutation: mutationOptions } = options ?? {} + + const mutationFn: MutationFunction< + Awaited< + ReturnType< + typeof modulesModuleIdRemoveObjectTypeLineageIdDelete + > + >, + { moduleId: number; objectType: string; lineageId: number } + > = props => { + const { moduleId, objectType, lineageId } = props ?? {} + + return modulesModuleIdRemoveObjectTypeLineageIdDelete( + moduleId, + objectType, + lineageId + ) + } + + return { mutationFn, ...mutationOptions } + } -/** - * @summary List the public modules - */ -export const useRevisionsGet = < - TData = Awaited>, - TError = HTTPValidationError ->( - params?: RevisionsGetParams, - options?: { - query?: Partial< - UseQueryOptions< - Awaited>, - TError, - TData - > +export type ModulesModuleIdRemoveObjectTypeLineageIdDeleteMutationResult = + NonNullable< + Awaited< + ReturnType > - } -): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getRevisionsGetQueryOptions(params, options) + > - const query = useQuery(queryOptions) as UseQueryResult & { - queryKey: QueryKey - } +export type ModulesModuleIdRemoveObjectTypeLineageIdDeleteMutationError = + HTTPValidationError - query.queryKey = queryOptions.queryKey +/** + * @summary Remove object from the module + */ +export const useModulesModuleIdRemoveObjectTypeLineageIdDelete = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited< + ReturnType + >, + TError, + { moduleId: number; objectType: string; lineageId: number }, + TContext + > +}) => { + const mutationOptions = + getModulesModuleIdRemoveObjectTypeLineageIdDeleteMutationOptions( + options + ) - return query + return useMutation(mutationOptions) } /** - * @summary Get overview of a public module + * @summary Get snapshot of a module by status id */ -export const revisionsModuleIdGet = ( +export const modulesModuleIdSnapshotStatusIdGet = ( moduleId: number, + statusId: number, signal?: AbortSignal ) => { - return customInstance({ - url: `/revisions/${moduleId}`, + return customInstance({ + url: `/modules/${moduleId}/snapshot/${statusId}`, method: 'GET', signal, }) } -export const getRevisionsModuleIdGetQueryKey = (moduleId: number) => { - return [`/revisions/${moduleId}`] as const +export const getModulesModuleIdSnapshotStatusIdGetQueryKey = ( + moduleId: number, + statusId: number +) => { + return [`/modules/${moduleId}/snapshot/${statusId}`] as const } -export const getRevisionsModuleIdGetQueryOptions = < - TData = Awaited>, +export const getModulesModuleIdSnapshotStatusIdGetQueryOptions = < + TData = Awaited>, TError = HTTPValidationError >( moduleId: number, + statusId: number, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited>, TError, TData > @@ -14176,48 +16945,55 @@ export const getRevisionsModuleIdGetQueryOptions = < const { query: queryOptions } = options ?? {} const queryKey = - queryOptions?.queryKey ?? getRevisionsModuleIdGetQueryKey(moduleId) + queryOptions?.queryKey ?? + getModulesModuleIdSnapshotStatusIdGetQueryKey(moduleId, statusId) const queryFn: QueryFunction< - Awaited> - > = ({ signal }) => revisionsModuleIdGet(moduleId, signal) + Awaited> + > = ({ signal }) => + modulesModuleIdSnapshotStatusIdGet(moduleId, statusId, signal) return { queryKey, queryFn, - enabled: !!moduleId, + enabled: !!(moduleId && statusId), ...queryOptions, } as UseQueryOptions< - Awaited>, + Awaited>, TError, TData > & { queryKey: QueryKey } } -export type RevisionsModuleIdGetQueryResult = NonNullable< - Awaited> +export type ModulesModuleIdSnapshotStatusIdGetQueryResult = NonNullable< + Awaited> > -export type RevisionsModuleIdGetQueryError = HTTPValidationError +export type ModulesModuleIdSnapshotStatusIdGetQueryError = HTTPValidationError /** - * @summary Get overview of a public module + * @summary Get snapshot of a module by status id */ -export const useRevisionsModuleIdGet = < - TData = Awaited>, +export const useModulesModuleIdSnapshotStatusIdGet = < + TData = Awaited>, TError = HTTPValidationError >( moduleId: number, + statusId: number, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited>, TError, TData > > } ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getRevisionsModuleIdGetQueryOptions(moduleId, options) + const queryOptions = getModulesModuleIdSnapshotStatusIdGetQueryOptions( + moduleId, + statusId, + options + ) const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey @@ -14229,30 +17005,35 @@ export const useRevisionsModuleIdGet = < } /** - * @summary List the modules + * @summary List latest module objects filtered by e.g. owner uuid, object type or minimum status */ -export const modulesGet = (params?: ModulesGetParams, signal?: AbortSignal) => { - return customInstance({ - url: `/modules`, +export const modulesObjectsLatestGet = ( + params?: ModulesObjectsLatestGetParams, + signal?: AbortSignal +) => { + return customInstance({ + url: `/modules/objects/latest`, method: 'GET', params, signal, }) } -export const getModulesGetQueryKey = (params?: ModulesGetParams) => { - return [`/modules`, ...(params ? [params] : [])] as const +export const getModulesObjectsLatestGetQueryKey = ( + params?: ModulesObjectsLatestGetParams +) => { + return [`/modules/objects/latest`, ...(params ? [params] : [])] as const } -export const getModulesGetQueryOptions = < - TData = Awaited>, +export const getModulesObjectsLatestGetQueryOptions = < + TData = Awaited>, TError = HTTPValidationError >( - params?: ModulesGetParams, + params?: ModulesObjectsLatestGetParams, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited>, TError, TData > @@ -14261,43 +17042,44 @@ export const getModulesGetQueryOptions = < ) => { const { query: queryOptions } = options ?? {} - const queryKey = queryOptions?.queryKey ?? getModulesGetQueryKey(params) + const queryKey = + queryOptions?.queryKey ?? getModulesObjectsLatestGetQueryKey(params) - const queryFn: QueryFunction>> = ({ - signal, - }) => modulesGet(params, signal) + const queryFn: QueryFunction< + Awaited> + > = ({ signal }) => modulesObjectsLatestGet(params, signal) return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< - Awaited>, + Awaited>, TError, TData > & { queryKey: QueryKey } } -export type ModulesGetQueryResult = NonNullable< - Awaited> +export type ModulesObjectsLatestGetQueryResult = NonNullable< + Awaited> > -export type ModulesGetQueryError = HTTPValidationError +export type ModulesObjectsLatestGetQueryError = HTTPValidationError /** - * @summary List the modules + * @summary List latest module objects filtered by e.g. owner uuid, object type or minimum status */ -export const useModulesGet = < - TData = Awaited>, +export const useModulesObjectsLatestGet = < + TData = Awaited>, TError = HTTPValidationError >( - params?: ModulesGetParams, + params?: ModulesObjectsLatestGetParams, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited>, TError, TData > > } ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getModulesGetQueryOptions(params, options) + const queryOptions = getModulesObjectsLatestGetQueryOptions(params, options) const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey @@ -14309,96 +17091,106 @@ export const useModulesGet = < } /** - * @summary Create new module + * @summary List object types with counts for loggedin user */ -export const modulesPost = (moduleCreate: ModuleCreate) => { - return customInstance({ - url: `/modules`, - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - data: moduleCreate, +export const objectsValidCountGet = (signal?: AbortSignal) => { + return customInstance({ + url: `/objects/valid/count`, + method: 'GET', + signal, }) } -export const getModulesPostMutationOptions = < - TError = HTTPValidationError, - TContext = unknown +export const getObjectsValidCountGetQueryKey = () => { + return [`/objects/valid/count`] as const +} + +export const getObjectsValidCountGetQueryOptions = < + TData = Awaited>, + TError = unknown >(options?: { - mutation?: UseMutationOptions< - Awaited>, - TError, - { data: ModuleCreate }, - TContext + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > > -}): UseMutationOptions< - Awaited>, - TError, - { data: ModuleCreate }, - TContext -> => { - const { mutation: mutationOptions } = options ?? {} +}) => { + const { query: queryOptions } = options ?? {} - const mutationFn: MutationFunction< - Awaited>, - { data: ModuleCreate } - > = props => { - const { data } = props ?? {} + const queryKey = queryOptions?.queryKey ?? getObjectsValidCountGetQueryKey() - return modulesPost(data) - } + const queryFn: QueryFunction< + Awaited> + > = ({ signal }) => objectsValidCountGet(signal) - return { mutationFn, ...mutationOptions } + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: QueryKey } } -export type ModulesPostMutationResult = NonNullable< - Awaited> +export type ObjectsValidCountGetQueryResult = NonNullable< + Awaited> > -export type ModulesPostMutationBody = ModuleCreate -export type ModulesPostMutationError = HTTPValidationError +export type ObjectsValidCountGetQueryError = unknown /** - * @summary Create new module + * @summary List object types with counts for loggedin user */ -export const useModulesPost = < - TError = HTTPValidationError, - TContext = unknown +export const useObjectsValidCountGet = < + TData = Awaited>, + TError = unknown >(options?: { - mutation?: UseMutationOptions< - Awaited>, - TError, - { data: ModuleCreate }, - TContext + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > > -}) => { - const mutationOptions = getModulesPostMutationOptions(options) +}): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getObjectsValidCountGetQueryOptions(options) - return useMutation(mutationOptions) + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey + } + + query.queryKey = queryOptions.queryKey + + return query } /** - * @summary Get overview of a module + * @summary List all objects filterable in short format */ -export const modulesModuleIdGet = (moduleId: number, signal?: AbortSignal) => { - return customInstance({ - url: `/modules/${moduleId}`, +export const objectsValidGet = ( + params?: ObjectsValidGetParams, + signal?: AbortSignal +) => { + return customInstance({ + url: `/objects/valid`, method: 'GET', + params, signal, }) } -export const getModulesModuleIdGetQueryKey = (moduleId: number) => { - return [`/modules/${moduleId}`] as const +export const getObjectsValidGetQueryKey = (params?: ObjectsValidGetParams) => { + return [`/objects/valid`, ...(params ? [params] : [])] as const } -export const getModulesModuleIdGetQueryOptions = < - TData = Awaited>, +export const getObjectsValidGetQueryOptions = < + TData = Awaited>, TError = HTTPValidationError >( - moduleId: number, + params?: ObjectsValidGetParams, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited>, TError, TData > @@ -14408,48 +17200,43 @@ export const getModulesModuleIdGetQueryOptions = < const { query: queryOptions } = options ?? {} const queryKey = - queryOptions?.queryKey ?? getModulesModuleIdGetQueryKey(moduleId) + queryOptions?.queryKey ?? getObjectsValidGetQueryKey(params) const queryFn: QueryFunction< - Awaited> - > = ({ signal }) => modulesModuleIdGet(moduleId, signal) + Awaited> + > = ({ signal }) => objectsValidGet(params, signal) - return { - queryKey, - queryFn, - enabled: !!moduleId, - ...queryOptions, - } as UseQueryOptions< - Awaited>, + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< + Awaited>, TError, TData > & { queryKey: QueryKey } } -export type ModulesModuleIdGetQueryResult = NonNullable< - Awaited> +export type ObjectsValidGetQueryResult = NonNullable< + Awaited> > -export type ModulesModuleIdGetQueryError = HTTPValidationError +export type ObjectsValidGetQueryError = HTTPValidationError /** - * @summary Get overview of a module + * @summary List all objects filterable in short format */ -export const useModulesModuleIdGet = < - TData = Awaited>, +export const useObjectsValidGet = < + TData = Awaited>, TError = HTTPValidationError >( - moduleId: number, + params?: ObjectsValidGetParams, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited>, TError, TData > > } ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getModulesModuleIdGetQueryOptions(moduleId, options) + const queryOptions = getObjectsValidGetQueryOptions(params, options) const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey @@ -14461,304 +17248,185 @@ export const useModulesModuleIdGet = < } /** - * @summary Edit module + * @summary List the existing Publication */ -export const modulesModuleIdPost = ( - moduleId: number, - moduleEdit: ModuleEdit +export const publicationsGet = ( + params?: PublicationsGetParams, + signal?: AbortSignal ) => { - return customInstance({ - url: `/modules/${moduleId}`, - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - data: moduleEdit, + return customInstance({ + url: `/publications`, + method: 'GET', + params, + signal, }) } -export const getModulesModuleIdPostMutationOptions = < - TError = HTTPValidationError, - TContext = unknown ->(options?: { - mutation?: UseMutationOptions< - Awaited>, - TError, - { moduleId: number; data: ModuleEdit }, - TContext - > -}): UseMutationOptions< - Awaited>, - TError, - { moduleId: number; data: ModuleEdit }, - TContext -> => { - const { mutation: mutationOptions } = options ?? {} - - const mutationFn: MutationFunction< - Awaited>, - { moduleId: number; data: ModuleEdit } - > = props => { - const { moduleId, data } = props ?? {} - - return modulesModuleIdPost(moduleId, data) - } - - return { mutationFn, ...mutationOptions } +export const getPublicationsGetQueryKey = (params?: PublicationsGetParams) => { + return [`/publications`, ...(params ? [params] : [])] as const } -export type ModulesModuleIdPostMutationResult = NonNullable< - Awaited> -> -export type ModulesModuleIdPostMutationBody = ModuleEdit -export type ModulesModuleIdPostMutationError = HTTPValidationError - -/** - * @summary Edit module - */ -export const useModulesModuleIdPost = < - TError = HTTPValidationError, - TContext = unknown ->(options?: { - mutation?: UseMutationOptions< - Awaited>, - TError, - { moduleId: number; data: ModuleEdit }, - TContext - > -}) => { - const mutationOptions = getModulesModuleIdPostMutationOptions(options) +export const getPublicationsGetQueryOptions = < + TData = Awaited>, + TError = HTTPValidationError +>( + params?: PublicationsGetParams, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +) => { + const { query: queryOptions } = options ?? {} - return useMutation(mutationOptions) -} + const queryKey = + queryOptions?.queryKey ?? getPublicationsGetQueryKey(params) -/** - * @summary Activate a module - */ -export const modulesModuleIdActivatePost = (moduleId: number) => { - return customInstance({ - url: `/modules/${moduleId}/activate`, - method: 'POST', - }) -} + const queryFn: QueryFunction< + Awaited> + > = ({ signal }) => publicationsGet(params, signal) -export const getModulesModuleIdActivatePostMutationOptions = < - TError = HTTPValidationError, - TContext = unknown ->(options?: { - mutation?: UseMutationOptions< - Awaited>, + return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< + Awaited>, TError, - { moduleId: number }, - TContext - > -}): UseMutationOptions< - Awaited>, - TError, - { moduleId: number }, - TContext -> => { - const { mutation: mutationOptions } = options ?? {} - - const mutationFn: MutationFunction< - Awaited>, - { moduleId: number } - > = props => { - const { moduleId } = props ?? {} - - return modulesModuleIdActivatePost(moduleId) - } - - return { mutationFn, ...mutationOptions } + TData + > & { queryKey: QueryKey } } -export type ModulesModuleIdActivatePostMutationResult = NonNullable< - Awaited> +export type PublicationsGetQueryResult = NonNullable< + Awaited> > - -export type ModulesModuleIdActivatePostMutationError = HTTPValidationError +export type PublicationsGetQueryError = HTTPValidationError /** - * @summary Activate a module - */ -export const useModulesModuleIdActivatePost = < - TError = HTTPValidationError, - TContext = unknown ->(options?: { - mutation?: UseMutationOptions< - Awaited>, - TError, - { moduleId: number }, - TContext - > -}) => { - const mutationOptions = - getModulesModuleIdActivatePostMutationOptions(options) - - return useMutation(mutationOptions) -} - -/** - * @summary Complete a module (Successful) + * @summary List the existing Publication */ -export const modulesModuleIdCompletePost = ( - moduleId: number, - completeModule: CompleteModule -) => { - return customInstance({ - url: `/modules/${moduleId}/complete`, - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - data: completeModule, - }) -} - -export const getModulesModuleIdCompletePostMutationOptions = < - TError = HTTPValidationError, - TContext = unknown ->(options?: { - mutation?: UseMutationOptions< - Awaited>, - TError, - { moduleId: number; data: CompleteModule }, - TContext - > -}): UseMutationOptions< - Awaited>, - TError, - { moduleId: number; data: CompleteModule }, - TContext -> => { - const { mutation: mutationOptions } = options ?? {} - - const mutationFn: MutationFunction< - Awaited>, - { moduleId: number; data: CompleteModule } - > = props => { - const { moduleId, data } = props ?? {} - - return modulesModuleIdCompletePost(moduleId, data) +export const usePublicationsGet = < + TData = Awaited>, + TError = HTTPValidationError +>( + params?: PublicationsGetParams, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getPublicationsGetQueryOptions(params, options) - return { mutationFn, ...mutationOptions } -} - -export type ModulesModuleIdCompletePostMutationResult = NonNullable< - Awaited> -> -export type ModulesModuleIdCompletePostMutationBody = CompleteModule -export type ModulesModuleIdCompletePostMutationError = HTTPValidationError - -/** - * @summary Complete a module (Successful) - */ -export const useModulesModuleIdCompletePost = < - TError = HTTPValidationError, - TContext = unknown ->(options?: { - mutation?: UseMutationOptions< - Awaited>, - TError, - { moduleId: number; data: CompleteModule }, - TContext - > -}) => { - const mutationOptions = - getModulesModuleIdCompletePostMutationOptions(options) + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey + } - return useMutation(mutationOptions) + query.queryKey = queryOptions.queryKey + + return query } /** - * @summary Close a module (Unsuccessful) + * @summary Create a new publication */ -export const modulesModuleIdClosePost = (moduleId: number) => { - return customInstance({ - url: `/modules/${moduleId}/close`, +export const publicationsPost = (publicationCreate: PublicationCreate) => { + return customInstance({ + url: `/publications`, method: 'POST', + headers: { 'Content-Type': 'application/json' }, + data: publicationCreate, }) } -export const getModulesModuleIdClosePostMutationOptions = < +export const getPublicationsPostMutationOptions = < TError = HTTPValidationError, TContext = unknown >(options?: { mutation?: UseMutationOptions< - Awaited>, + Awaited>, TError, - { moduleId: number }, + { data: PublicationCreate }, TContext > }): UseMutationOptions< - Awaited>, + Awaited>, TError, - { moduleId: number }, + { data: PublicationCreate }, TContext > => { const { mutation: mutationOptions } = options ?? {} const mutationFn: MutationFunction< - Awaited>, - { moduleId: number } + Awaited>, + { data: PublicationCreate } > = props => { - const { moduleId } = props ?? {} + const { data } = props ?? {} - return modulesModuleIdClosePost(moduleId) + return publicationsPost(data) } return { mutationFn, ...mutationOptions } } -export type ModulesModuleIdClosePostMutationResult = NonNullable< - Awaited> +export type PublicationsPostMutationResult = NonNullable< + Awaited> > - -export type ModulesModuleIdClosePostMutationError = HTTPValidationError +export type PublicationsPostMutationBody = PublicationCreate +export type PublicationsPostMutationError = HTTPValidationError /** - * @summary Close a module (Unsuccessful) + * @summary Create a new publication */ -export const useModulesModuleIdClosePost = < +export const usePublicationsPost = < TError = HTTPValidationError, TContext = unknown >(options?: { mutation?: UseMutationOptions< - Awaited>, + Awaited>, TError, - { moduleId: number }, + { data: PublicationCreate }, TContext > }) => { - const mutationOptions = getModulesModuleIdClosePostMutationOptions(options) + const mutationOptions = getPublicationsPostMutationOptions(options) return useMutation(mutationOptions) } /** - * @summary Get status history of the module + * @summary Get details of a publication */ -export const modulesModuleIdStatusGet = ( - moduleId: number, +export const publicationsPublicationUuidGet = ( + publicationUuid: string, signal?: AbortSignal ) => { - return customInstance({ - url: `/modules/${moduleId}/status`, + return customInstance({ + url: `/publications/${publicationUuid}`, method: 'GET', signal, }) } -export const getModulesModuleIdStatusGetQueryKey = (moduleId: number) => { - return [`/modules/${moduleId}/status`] as const +export const getPublicationsPublicationUuidGetQueryKey = ( + publicationUuid: string +) => { + return [`/publications/${publicationUuid}`] as const } -export const getModulesModuleIdStatusGetQueryOptions = < - TData = Awaited>, +export const getPublicationsPublicationUuidGetQueryOptions = < + TData = Awaited>, TError = HTTPValidationError >( - moduleId: number, + publicationUuid: string, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited>, TError, TData > @@ -14768,49 +17436,50 @@ export const getModulesModuleIdStatusGetQueryOptions = < const { query: queryOptions } = options ?? {} const queryKey = - queryOptions?.queryKey ?? getModulesModuleIdStatusGetQueryKey(moduleId) + queryOptions?.queryKey ?? + getPublicationsPublicationUuidGetQueryKey(publicationUuid) const queryFn: QueryFunction< - Awaited> - > = ({ signal }) => modulesModuleIdStatusGet(moduleId, signal) + Awaited> + > = ({ signal }) => publicationsPublicationUuidGet(publicationUuid, signal) return { queryKey, queryFn, - enabled: !!moduleId, + enabled: !!publicationUuid, ...queryOptions, } as UseQueryOptions< - Awaited>, + Awaited>, TError, TData > & { queryKey: QueryKey } } -export type ModulesModuleIdStatusGetQueryResult = NonNullable< - Awaited> +export type PublicationsPublicationUuidGetQueryResult = NonNullable< + Awaited> > -export type ModulesModuleIdStatusGetQueryError = HTTPValidationError +export type PublicationsPublicationUuidGetQueryError = HTTPValidationError /** - * @summary Get status history of the module + * @summary Get details of a publication */ -export const useModulesModuleIdStatusGet = < - TData = Awaited>, +export const usePublicationsPublicationUuidGet = < + TData = Awaited>, TError = HTTPValidationError >( - moduleId: number, + publicationUuid: string, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited>, TError, TData > > } ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getModulesModuleIdStatusGetQueryOptions( - moduleId, + const queryOptions = getPublicationsPublicationUuidGetQueryOptions( + publicationUuid, options ) @@ -14824,341 +17493,351 @@ export const useModulesModuleIdStatusGet = < } /** - * @summary Patch the status of the module + * @summary Edit an existing publication */ -export const modulesModuleIdStatusPatch = ( - moduleId: number, - modulePatchStatus: ModulePatchStatus +export const publicationsPublicationUuidPatch = ( + publicationUuid: string, + publicationEdit: PublicationEdit ) => { - return customInstance({ - url: `/modules/${moduleId}/status`, + return customInstance({ + url: `/publications/${publicationUuid}`, method: 'PATCH', headers: { 'Content-Type': 'application/json' }, - data: modulePatchStatus, + data: publicationEdit, }) } -export const getModulesModuleIdStatusPatchMutationOptions = < +export const getPublicationsPublicationUuidPatchMutationOptions = < TError = HTTPValidationError, TContext = unknown >(options?: { mutation?: UseMutationOptions< - Awaited>, + Awaited>, TError, - { moduleId: number; data: ModulePatchStatus }, + { publicationUuid: string; data: PublicationEdit }, TContext > }): UseMutationOptions< - Awaited>, + Awaited>, TError, - { moduleId: number; data: ModulePatchStatus }, + { publicationUuid: string; data: PublicationEdit }, TContext > => { const { mutation: mutationOptions } = options ?? {} const mutationFn: MutationFunction< - Awaited>, - { moduleId: number; data: ModulePatchStatus } + Awaited>, + { publicationUuid: string; data: PublicationEdit } > = props => { - const { moduleId, data } = props ?? {} + const { publicationUuid, data } = props ?? {} - return modulesModuleIdStatusPatch(moduleId, data) + return publicationsPublicationUuidPatch(publicationUuid, data) } return { mutationFn, ...mutationOptions } } -export type ModulesModuleIdStatusPatchMutationResult = NonNullable< - Awaited> +export type PublicationsPublicationUuidPatchMutationResult = NonNullable< + Awaited> > -export type ModulesModuleIdStatusPatchMutationBody = ModulePatchStatus -export type ModulesModuleIdStatusPatchMutationError = HTTPValidationError +export type PublicationsPublicationUuidPatchMutationBody = PublicationEdit +export type PublicationsPublicationUuidPatchMutationError = HTTPValidationError /** - * @summary Patch the status of the module + * @summary Edit an existing publication */ -export const useModulesModuleIdStatusPatch = < +export const usePublicationsPublicationUuidPatch = < TError = HTTPValidationError, TContext = unknown >(options?: { mutation?: UseMutationOptions< - Awaited>, + Awaited>, TError, - { moduleId: number; data: ModulePatchStatus }, + { publicationUuid: string; data: PublicationEdit }, TContext > }) => { const mutationOptions = - getModulesModuleIdStatusPatchMutationOptions(options) + getPublicationsPublicationUuidPatchMutationOptions(options) return useMutation(mutationOptions) } /** - * @summary Add new object to the module + * @summary List the existing Publication Bills */ -export const modulesModuleIdAddNewObjectPost = ( - moduleId: number, - moduleAddNewObject: ModuleAddNewObject +export const publicationsPublicationUuidBillsGet = ( + publicationUuid: string, + params?: PublicationsPublicationUuidBillsGetParams, + signal?: AbortSignal ) => { - return customInstance({ - url: `/modules/${moduleId}/add-new-object`, - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - data: moduleAddNewObject, + return customInstance({ + url: `/publications/${publicationUuid}/bills`, + method: 'GET', + params, + signal, }) } -export const getModulesModuleIdAddNewObjectPostMutationOptions = < - TError = HTTPValidationError, - TContext = unknown ->(options?: { - mutation?: UseMutationOptions< - Awaited>, - TError, - { moduleId: number; data: ModuleAddNewObject }, - TContext - > -}): UseMutationOptions< - Awaited>, - TError, - { moduleId: number; data: ModuleAddNewObject }, - TContext -> => { - const { mutation: mutationOptions } = options ?? {} - - const mutationFn: MutationFunction< - Awaited>, - { moduleId: number; data: ModuleAddNewObject } - > = props => { - const { moduleId, data } = props ?? {} +export const getPublicationsPublicationUuidBillsGetQueryKey = ( + publicationUuid: string, + params?: PublicationsPublicationUuidBillsGetParams +) => { + return [ + `/publications/${publicationUuid}/bills`, + ...(params ? [params] : []), + ] as const +} - return modulesModuleIdAddNewObjectPost(moduleId, data) +export const getPublicationsPublicationUuidBillsGetQueryOptions = < + TData = Awaited>, + TError = HTTPValidationError +>( + publicationUuid: string, + params?: PublicationsPublicationUuidBillsGetParams, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > } +) => { + const { query: queryOptions } = options ?? {} - return { mutationFn, ...mutationOptions } + const queryKey = + queryOptions?.queryKey ?? + getPublicationsPublicationUuidBillsGetQueryKey(publicationUuid, params) + + const queryFn: QueryFunction< + Awaited> + > = ({ signal }) => + publicationsPublicationUuidBillsGet(publicationUuid, params, signal) + + return { + queryKey, + queryFn, + enabled: !!publicationUuid, + ...queryOptions, + } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: QueryKey } } -export type ModulesModuleIdAddNewObjectPostMutationResult = NonNullable< - Awaited> +export type PublicationsPublicationUuidBillsGetQueryResult = NonNullable< + Awaited> > -export type ModulesModuleIdAddNewObjectPostMutationBody = ModuleAddNewObject -export type ModulesModuleIdAddNewObjectPostMutationError = HTTPValidationError +export type PublicationsPublicationUuidBillsGetQueryError = HTTPValidationError /** - * @summary Add new object to the module + * @summary List the existing Publication Bills */ -export const useModulesModuleIdAddNewObjectPost = < - TError = HTTPValidationError, - TContext = unknown ->(options?: { - mutation?: UseMutationOptions< - Awaited>, - TError, - { moduleId: number; data: ModuleAddNewObject }, - TContext - > -}) => { - const mutationOptions = - getModulesModuleIdAddNewObjectPostMutationOptions(options) +export const usePublicationsPublicationUuidBillsGet = < + TData = Awaited>, + TError = HTTPValidationError +>( + publicationUuid: string, + params?: PublicationsPublicationUuidBillsGetParams, + options?: { + query?: Partial< + UseQueryOptions< + Awaited>, + TError, + TData + > + > + } +): UseQueryResult & { queryKey: QueryKey } => { + const queryOptions = getPublicationsPublicationUuidBillsGetQueryOptions( + publicationUuid, + params, + options + ) - return useMutation(mutationOptions) + const query = useQuery(queryOptions) as UseQueryResult & { + queryKey: QueryKey + } + + query.queryKey = queryOptions.queryKey + + return query } /** - * @summary Add existing object to the module + * @summary Create new publication Bill or version */ -export const modulesModuleIdAddExistingObjectPost = ( - moduleId: number, - moduleAddExistingObject: ModuleAddExistingObject +export const publicationsPublicationUuidBillsPost = ( + publicationUuid: string, + publicationBillCreate: PublicationBillCreate ) => { - return customInstance({ - url: `/modules/${moduleId}/add-existing-object`, + return customInstance({ + url: `/publications/${publicationUuid}/bills`, method: 'POST', headers: { 'Content-Type': 'application/json' }, - data: moduleAddExistingObject, + data: publicationBillCreate, }) } -export const getModulesModuleIdAddExistingObjectPostMutationOptions = < +export const getPublicationsPublicationUuidBillsPostMutationOptions = < TError = HTTPValidationError, TContext = unknown >(options?: { mutation?: UseMutationOptions< - Awaited>, + Awaited>, TError, - { moduleId: number; data: ModuleAddExistingObject }, + { publicationUuid: string; data: PublicationBillCreate }, TContext > }): UseMutationOptions< - Awaited>, + Awaited>, TError, - { moduleId: number; data: ModuleAddExistingObject }, + { publicationUuid: string; data: PublicationBillCreate }, TContext > => { const { mutation: mutationOptions } = options ?? {} const mutationFn: MutationFunction< - Awaited>, - { moduleId: number; data: ModuleAddExistingObject } + Awaited>, + { publicationUuid: string; data: PublicationBillCreate } > = props => { - const { moduleId, data } = props ?? {} + const { publicationUuid, data } = props ?? {} - return modulesModuleIdAddExistingObjectPost(moduleId, data) + return publicationsPublicationUuidBillsPost(publicationUuid, data) } return { mutationFn, ...mutationOptions } } -export type ModulesModuleIdAddExistingObjectPostMutationResult = NonNullable< - Awaited> +export type PublicationsPublicationUuidBillsPostMutationResult = NonNullable< + Awaited> > -export type ModulesModuleIdAddExistingObjectPostMutationBody = - ModuleAddExistingObject -export type ModulesModuleIdAddExistingObjectPostMutationError = +export type PublicationsPublicationUuidBillsPostMutationBody = + PublicationBillCreate +export type PublicationsPublicationUuidBillsPostMutationError = HTTPValidationError /** - * @summary Add existing object to the module + * @summary Create new publication Bill or version */ -export const useModulesModuleIdAddExistingObjectPost = < +export const usePublicationsPublicationUuidBillsPost = < TError = HTTPValidationError, TContext = unknown >(options?: { mutation?: UseMutationOptions< - Awaited>, + Awaited>, TError, - { moduleId: number; data: ModuleAddExistingObject }, + { publicationUuid: string; data: PublicationBillCreate }, TContext > }) => { const mutationOptions = - getModulesModuleIdAddExistingObjectPostMutationOptions(options) + getPublicationsPublicationUuidBillsPostMutationOptions(options) return useMutation(mutationOptions) } /** - * @summary Get context of object in the module + * @summary Get details of a publication bill */ -export const modulesModuleIdObjectContextObjectTypeLineageIdGet = ( - moduleId: number, - objectType: string, - lineageId: number, +export const publicationsPublicationUuidBillsBillUuidGet = ( + publicationUuid: string, + billUuid: string, signal?: AbortSignal ) => { - return customInstance({ - url: `/modules/${moduleId}/object-context/${objectType}/${lineageId}`, + return customInstance({ + url: `/publications/${publicationUuid}/bills/${billUuid}`, method: 'GET', signal, }) } -export const getModulesModuleIdObjectContextObjectTypeLineageIdGetQueryKey = ( - moduleId: number, - objectType: string, - lineageId: number +export const getPublicationsPublicationUuidBillsBillUuidGetQueryKey = ( + publicationUuid: string, + billUuid: string ) => { - return [ - `/modules/${moduleId}/object-context/${objectType}/${lineageId}`, - ] as const + return [`/publications/${publicationUuid}/bills/${billUuid}`] as const } -export const getModulesModuleIdObjectContextObjectTypeLineageIdGetQueryOptions = - < - TData = Awaited< - ReturnType< - typeof modulesModuleIdObjectContextObjectTypeLineageIdGet - > - >, - TError = HTTPValidationError - >( - moduleId: number, - objectType: string, - lineageId: number, - options?: { - query?: Partial< - UseQueryOptions< - Awaited< - ReturnType< - typeof modulesModuleIdObjectContextObjectTypeLineageIdGet - > - >, - TError, - TData - > +export const getPublicationsPublicationUuidBillsBillUuidGetQueryOptions = < + TData = Awaited< + ReturnType + >, + TError = HTTPValidationError +>( + publicationUuid: string, + billUuid: string, + options?: { + query?: Partial< + UseQueryOptions< + Awaited< + ReturnType< + typeof publicationsPublicationUuidBillsBillUuidGet + > + >, + TError, + TData > - } - ) => { - const { query: queryOptions } = options ?? {} + > + } +) => { + const { query: queryOptions } = options ?? {} - const queryKey = - queryOptions?.queryKey ?? - getModulesModuleIdObjectContextObjectTypeLineageIdGetQueryKey( - moduleId, - objectType, - lineageId - ) + const queryKey = + queryOptions?.queryKey ?? + getPublicationsPublicationUuidBillsBillUuidGetQueryKey( + publicationUuid, + billUuid + ) - const queryFn: QueryFunction< - Awaited< - ReturnType< - typeof modulesModuleIdObjectContextObjectTypeLineageIdGet - > - > - > = ({ signal }) => - modulesModuleIdObjectContextObjectTypeLineageIdGet( - moduleId, - objectType, - lineageId, - signal - ) + const queryFn: QueryFunction< + Awaited> + > = ({ signal }) => + publicationsPublicationUuidBillsBillUuidGet( + publicationUuid, + billUuid, + signal + ) - return { - queryKey, - queryFn, - enabled: !!(moduleId && objectType && lineageId), - ...queryOptions, - } as UseQueryOptions< - Awaited< - ReturnType< - typeof modulesModuleIdObjectContextObjectTypeLineageIdGet - > - >, - TError, - TData - > & { queryKey: QueryKey } - } + return { + queryKey, + queryFn, + enabled: !!(publicationUuid && billUuid), + ...queryOptions, + } as UseQueryOptions< + Awaited>, + TError, + TData + > & { queryKey: QueryKey } +} -export type ModulesModuleIdObjectContextObjectTypeLineageIdGetQueryResult = +export type PublicationsPublicationUuidBillsBillUuidGetQueryResult = NonNullable< - Awaited< - ReturnType< - typeof modulesModuleIdObjectContextObjectTypeLineageIdGet - > - > + Awaited> > -export type ModulesModuleIdObjectContextObjectTypeLineageIdGetQueryError = +export type PublicationsPublicationUuidBillsBillUuidGetQueryError = HTTPValidationError /** - * @summary Get context of object in the module + * @summary Get details of a publication bill */ -export const useModulesModuleIdObjectContextObjectTypeLineageIdGet = < +export const usePublicationsPublicationUuidBillsBillUuidGet = < TData = Awaited< - ReturnType + ReturnType >, TError = HTTPValidationError >( - moduleId: number, - objectType: string, - lineageId: number, + publicationUuid: string, + billUuid: string, options?: { query?: Partial< UseQueryOptions< Awaited< ReturnType< - typeof modulesModuleIdObjectContextObjectTypeLineageIdGet + typeof publicationsPublicationUuidBillsBillUuidGet > >, TError, @@ -15168,10 +17847,9 @@ export const useModulesModuleIdObjectContextObjectTypeLineageIdGet = < } ): UseQueryResult & { queryKey: QueryKey } => { const queryOptions = - getModulesModuleIdObjectContextObjectTypeLineageIdGetQueryOptions( - moduleId, - objectType, - lineageId, + getPublicationsPublicationUuidBillsBillUuidGetQueryOptions( + publicationUuid, + billUuid, options ) @@ -15185,248 +17863,136 @@ export const useModulesModuleIdObjectContextObjectTypeLineageIdGet = < } /** - * @summary Edit context of object in the module + * @summary Edit an existing publication Bill or version */ -export const modulesModuleIdObjectContextObjectTypeLineageIdPost = ( - moduleId: number, - objectType: string, - lineageId: number, - moduleEditObjectContext: ModuleEditObjectContext +export const publicationsPublicationUuidBillsBillUuidPatch = ( + publicationUuid: string, + billUuid: string, + publicationBillEdit: PublicationBillEdit ) => { - return customInstance({ - url: `/modules/${moduleId}/object-context/${objectType}/${lineageId}`, - method: 'POST', + return customInstance({ + url: `/publications/${publicationUuid}/bills/${billUuid}`, + method: 'PATCH', headers: { 'Content-Type': 'application/json' }, - data: moduleEditObjectContext, + data: publicationBillEdit, }) } -export const getModulesModuleIdObjectContextObjectTypeLineageIdPostMutationOptions = - (options?: { - mutation?: UseMutationOptions< - Awaited< - ReturnType< - typeof modulesModuleIdObjectContextObjectTypeLineageIdPost - > - >, - TError, - { - moduleId: number - objectType: string - lineageId: number - data: ModuleEditObjectContext - }, - TContext - > - }): UseMutationOptions< - Awaited< - ReturnType< - typeof modulesModuleIdObjectContextObjectTypeLineageIdPost - > - >, - TError, - { - moduleId: number - objectType: string - lineageId: number - data: ModuleEditObjectContext - }, - TContext - > => { - const { mutation: mutationOptions } = options ?? {} - - const mutationFn: MutationFunction< - Awaited< - ReturnType< - typeof modulesModuleIdObjectContextObjectTypeLineageIdPost - > - >, - { - moduleId: number - objectType: string - lineageId: number - data: ModuleEditObjectContext - } - > = props => { - const { moduleId, objectType, lineageId, data } = props ?? {} - - return modulesModuleIdObjectContextObjectTypeLineageIdPost( - moduleId, - objectType, - lineageId, - data - ) - } - - return { mutationFn, ...mutationOptions } - } - -export type ModulesModuleIdObjectContextObjectTypeLineageIdPostMutationResult = - NonNullable< - Awaited< - ReturnType< - typeof modulesModuleIdObjectContextObjectTypeLineageIdPost - > - > - > -export type ModulesModuleIdObjectContextObjectTypeLineageIdPostMutationBody = - ModuleEditObjectContext -export type ModulesModuleIdObjectContextObjectTypeLineageIdPostMutationError = - HTTPValidationError - -/** - * @summary Edit context of object in the module - */ -export const useModulesModuleIdObjectContextObjectTypeLineageIdPost = < +export const getPublicationsPublicationUuidBillsBillUuidPatchMutationOptions = < TError = HTTPValidationError, TContext = unknown >(options?: { mutation?: UseMutationOptions< Awaited< - ReturnType< - typeof modulesModuleIdObjectContextObjectTypeLineageIdPost - > + ReturnType >, TError, { - moduleId: number - objectType: string - lineageId: number - data: ModuleEditObjectContext + publicationUuid: string + billUuid: string + data: PublicationBillEdit }, TContext > -}) => { - const mutationOptions = - getModulesModuleIdObjectContextObjectTypeLineageIdPostMutationOptions( - options - ) - - return useMutation(mutationOptions) -} - -/** - * @summary Remove object from the module - */ -export const modulesModuleIdRemoveObjectTypeLineageIdDelete = ( - moduleId: number, - objectType: string, - lineageId: number -) => { - return customInstance({ - url: `/modules/${moduleId}/remove/${objectType}/${lineageId}`, - method: 'DELETE', - }) -} +}): UseMutationOptions< + Awaited>, + TError, + { publicationUuid: string; billUuid: string; data: PublicationBillEdit }, + TContext +> => { + const { mutation: mutationOptions } = options ?? {} -export const getModulesModuleIdRemoveObjectTypeLineageIdDeleteMutationOptions = - (options?: { - mutation?: UseMutationOptions< - Awaited< - ReturnType< - typeof modulesModuleIdRemoveObjectTypeLineageIdDelete - > - >, - TError, - { moduleId: number; objectType: string; lineageId: number }, - TContext - > - }): UseMutationOptions< + const mutationFn: MutationFunction< Awaited< - ReturnType + ReturnType >, - TError, - { moduleId: number; objectType: string; lineageId: number }, - TContext - > => { - const { mutation: mutationOptions } = options ?? {} - - const mutationFn: MutationFunction< - Awaited< - ReturnType< - typeof modulesModuleIdRemoveObjectTypeLineageIdDelete - > - >, - { moduleId: number; objectType: string; lineageId: number } - > = props => { - const { moduleId, objectType, lineageId } = props ?? {} - - return modulesModuleIdRemoveObjectTypeLineageIdDelete( - moduleId, - objectType, - lineageId - ) - } + { publicationUuid: string; billUuid: string; data: PublicationBillEdit } + > = props => { + const { publicationUuid, billUuid, data } = props ?? {} - return { mutationFn, ...mutationOptions } + return publicationsPublicationUuidBillsBillUuidPatch( + publicationUuid, + billUuid, + data + ) } -export type ModulesModuleIdRemoveObjectTypeLineageIdDeleteMutationResult = + return { mutationFn, ...mutationOptions } +} + +export type PublicationsPublicationUuidBillsBillUuidPatchMutationResult = NonNullable< Awaited< - ReturnType + ReturnType > - > - -export type ModulesModuleIdRemoveObjectTypeLineageIdDeleteMutationError = + > +export type PublicationsPublicationUuidBillsBillUuidPatchMutationBody = + PublicationBillEdit +export type PublicationsPublicationUuidBillsBillUuidPatchMutationError = HTTPValidationError /** - * @summary Remove object from the module + * @summary Edit an existing publication Bill or version */ -export const useModulesModuleIdRemoveObjectTypeLineageIdDelete = < +export const usePublicationsPublicationUuidBillsBillUuidPatch = < TError = HTTPValidationError, TContext = unknown >(options?: { mutation?: UseMutationOptions< Awaited< - ReturnType + ReturnType >, TError, - { moduleId: number; objectType: string; lineageId: number }, + { + publicationUuid: string + billUuid: string + data: PublicationBillEdit + }, TContext > }) => { const mutationOptions = - getModulesModuleIdRemoveObjectTypeLineageIdDeleteMutationOptions( - options - ) + getPublicationsPublicationUuidBillsBillUuidPatchMutationOptions(options) return useMutation(mutationOptions) } /** - * @summary Get snapshot of a module by status id + * @summary List the existing publication Packages */ -export const modulesModuleIdSnapshotStatusIdGet = ( - moduleId: number, - statusId: number, +export const publicationBillsBillUuidPackagesGet = ( + billUuid: string, + params?: PublicationBillsBillUuidPackagesGetParams, signal?: AbortSignal ) => { - return customInstance({ - url: `/modules/${moduleId}/snapshot/${statusId}`, + return customInstance({ + url: `/publication-bills/${billUuid}/packages`, method: 'GET', + params, signal, }) } -export const getModulesModuleIdSnapshotStatusIdGetQueryKey = ( - moduleId: number, - statusId: number +export const getPublicationBillsBillUuidPackagesGetQueryKey = ( + billUuid: string, + params?: PublicationBillsBillUuidPackagesGetParams ) => { - return [`/modules/${moduleId}/snapshot/${statusId}`] as const + return [ + `/publication-bills/${billUuid}/packages`, + ...(params ? [params] : []), + ] as const } -export const getModulesModuleIdSnapshotStatusIdGetQueryOptions = < - TData = Awaited>, +export const getPublicationBillsBillUuidPackagesGetQueryOptions = < + TData = Awaited>, TError = HTTPValidationError >( - moduleId: number, - statusId: number, + billUuid: string, + params?: PublicationBillsBillUuidPackagesGetParams, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited>, TError, TData > @@ -15437,52 +18003,52 @@ export const getModulesModuleIdSnapshotStatusIdGetQueryOptions = < const queryKey = queryOptions?.queryKey ?? - getModulesModuleIdSnapshotStatusIdGetQueryKey(moduleId, statusId) + getPublicationBillsBillUuidPackagesGetQueryKey(billUuid, params) const queryFn: QueryFunction< - Awaited> + Awaited> > = ({ signal }) => - modulesModuleIdSnapshotStatusIdGet(moduleId, statusId, signal) + publicationBillsBillUuidPackagesGet(billUuid, params, signal) return { queryKey, queryFn, - enabled: !!(moduleId && statusId), + enabled: !!billUuid, ...queryOptions, } as UseQueryOptions< - Awaited>, + Awaited>, TError, TData > & { queryKey: QueryKey } } -export type ModulesModuleIdSnapshotStatusIdGetQueryResult = NonNullable< - Awaited> +export type PublicationBillsBillUuidPackagesGetQueryResult = NonNullable< + Awaited> > -export type ModulesModuleIdSnapshotStatusIdGetQueryError = HTTPValidationError +export type PublicationBillsBillUuidPackagesGetQueryError = HTTPValidationError /** - * @summary Get snapshot of a module by status id + * @summary List the existing publication Packages */ -export const useModulesModuleIdSnapshotStatusIdGet = < - TData = Awaited>, +export const usePublicationBillsBillUuidPackagesGet = < + TData = Awaited>, TError = HTTPValidationError >( - moduleId: number, - statusId: number, + billUuid: string, + params?: PublicationBillsBillUuidPackagesGetParams, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited>, TError, TData > > } ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getModulesModuleIdSnapshotStatusIdGetQueryOptions( - moduleId, - statusId, + const queryOptions = getPublicationBillsBillUuidPackagesGetQueryOptions( + billUuid, + params, options ) @@ -15496,35 +18062,205 @@ export const useModulesModuleIdSnapshotStatusIdGet = < } /** - * @summary List latest module objects filtered by e.g. owner uuid, object type or minimum status + * @summary Create new Publication Package */ -export const modulesObjectsLatestGet = ( - params?: ModulesObjectsLatestGetParams, +export const publicationBillsBillUuidPackagesPost = ( + billUuid: string, + publicationPackageCreate: PublicationPackageCreate +) => { + return customInstance({ + url: `/publication-bills/${billUuid}/packages`, + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + data: publicationPackageCreate, + }) +} + +export const getPublicationBillsBillUuidPackagesPostMutationOptions = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { billUuid: string; data: PublicationPackageCreate }, + TContext + > +}): UseMutationOptions< + Awaited>, + TError, + { billUuid: string; data: PublicationPackageCreate }, + TContext +> => { + const { mutation: mutationOptions } = options ?? {} + + const mutationFn: MutationFunction< + Awaited>, + { billUuid: string; data: PublicationPackageCreate } + > = props => { + const { billUuid, data } = props ?? {} + + return publicationBillsBillUuidPackagesPost(billUuid, data) + } + + return { mutationFn, ...mutationOptions } +} + +export type PublicationBillsBillUuidPackagesPostMutationResult = NonNullable< + Awaited> +> +export type PublicationBillsBillUuidPackagesPostMutationBody = + PublicationPackageCreate +export type PublicationBillsBillUuidPackagesPostMutationError = + HTTPValidationError + +/** + * @summary Create new Publication Package + */ +export const usePublicationBillsBillUuidPackagesPost = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { billUuid: string; data: PublicationPackageCreate }, + TContext + > +}) => { + const mutationOptions = + getPublicationBillsBillUuidPackagesPostMutationOptions(options) + + return useMutation(mutationOptions) +} + +/** + * @summary Record the submission response from lvbb of a publication package + */ +export const publicationPackagesPackageUuidReportPost = ( + packageUuid: string, + bodyFastapiHandlerPublicationPackagesPackageUuidReportPost: BodyFastapiHandlerPublicationPackagesPackageUuidReportPost +) => { + const formData = new FormData() + formData.append( + 'xml_file', + bodyFastapiHandlerPublicationPackagesPackageUuidReportPost.xml_file + ) + + return customInstance({ + url: `/publication-packages/${packageUuid}/report`, + method: 'POST', + headers: { 'Content-Type': 'multipart/form-data' }, + data: formData, + }) +} + +export const getPublicationPackagesPackageUuidReportPostMutationOptions = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { + packageUuid: string + data: BodyFastapiHandlerPublicationPackagesPackageUuidReportPost + }, + TContext + > +}): UseMutationOptions< + Awaited>, + TError, + { + packageUuid: string + data: BodyFastapiHandlerPublicationPackagesPackageUuidReportPost + }, + TContext +> => { + const { mutation: mutationOptions } = options ?? {} + + const mutationFn: MutationFunction< + Awaited>, + { + packageUuid: string + data: BodyFastapiHandlerPublicationPackagesPackageUuidReportPost + } + > = props => { + const { packageUuid, data } = props ?? {} + + return publicationPackagesPackageUuidReportPost(packageUuid, data) + } + + return { mutationFn, ...mutationOptions } +} + +export type PublicationPackagesPackageUuidReportPostMutationResult = + NonNullable< + Awaited> + > +export type PublicationPackagesPackageUuidReportPostMutationBody = + BodyFastapiHandlerPublicationPackagesPackageUuidReportPost +export type PublicationPackagesPackageUuidReportPostMutationError = + HTTPValidationError + +/** + * @summary Record the submission response from lvbb of a publication package + */ +export const usePublicationPackagesPackageUuidReportPost = < + TError = HTTPValidationError, + TContext = unknown +>(options?: { + mutation?: UseMutationOptions< + Awaited>, + TError, + { + packageUuid: string + data: BodyFastapiHandlerPublicationPackagesPackageUuidReportPost + }, + TContext + > +}) => { + const mutationOptions = + getPublicationPackagesPackageUuidReportPostMutationOptions(options) + + return useMutation(mutationOptions) +} + +/** + * @summary Download package reports + */ +export const publicationPackagesPackageUuidReportDownloadGet = ( + packageUuid: string, signal?: AbortSignal ) => { - return customInstance({ - url: `/modules/objects/latest`, + return customInstance({ + url: `/publication-packages/${packageUuid}/report/download`, method: 'GET', - params, signal, }) } -export const getModulesObjectsLatestGetQueryKey = ( - params?: ModulesObjectsLatestGetParams +export const getPublicationPackagesPackageUuidReportDownloadGetQueryKey = ( + packageUuid: string ) => { - return [`/modules/objects/latest`, ...(params ? [params] : [])] as const + return [`/publication-packages/${packageUuid}/report/download`] as const } -export const getModulesObjectsLatestGetQueryOptions = < - TData = Awaited>, +export const getPublicationPackagesPackageUuidReportDownloadGetQueryOptions = < + TData = Awaited< + ReturnType + >, TError = HTTPValidationError >( - params?: ModulesObjectsLatestGetParams, + packageUuid: string, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited< + ReturnType< + typeof publicationPackagesPackageUuidReportDownloadGet + > + >, TError, TData > @@ -15534,43 +18270,68 @@ export const getModulesObjectsLatestGetQueryOptions = < const { query: queryOptions } = options ?? {} const queryKey = - queryOptions?.queryKey ?? getModulesObjectsLatestGetQueryKey(params) + queryOptions?.queryKey ?? + getPublicationPackagesPackageUuidReportDownloadGetQueryKey(packageUuid) const queryFn: QueryFunction< - Awaited> - > = ({ signal }) => modulesObjectsLatestGet(params, signal) + Awaited< + ReturnType + > + > = ({ signal }) => + publicationPackagesPackageUuidReportDownloadGet(packageUuid, signal) - return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< - Awaited>, + return { + queryKey, + queryFn, + enabled: !!packageUuid, + ...queryOptions, + } as UseQueryOptions< + Awaited< + ReturnType + >, TError, TData > & { queryKey: QueryKey } } -export type ModulesObjectsLatestGetQueryResult = NonNullable< - Awaited> -> -export type ModulesObjectsLatestGetQueryError = HTTPValidationError +export type PublicationPackagesPackageUuidReportDownloadGetQueryResult = + NonNullable< + Awaited< + ReturnType + > + > +export type PublicationPackagesPackageUuidReportDownloadGetQueryError = + HTTPValidationError /** - * @summary List latest module objects filtered by e.g. owner uuid, object type or minimum status + * @summary Download package reports */ -export const useModulesObjectsLatestGet = < - TData = Awaited>, +export const usePublicationPackagesPackageUuidReportDownloadGet = < + TData = Awaited< + ReturnType + >, TError = HTTPValidationError >( - params?: ModulesObjectsLatestGetParams, + packageUuid: string, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited< + ReturnType< + typeof publicationPackagesPackageUuidReportDownloadGet + > + >, TError, TData > > } ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getModulesObjectsLatestGetQueryOptions(params, options) + const queryOptions = + getPublicationPackagesPackageUuidReportDownloadGetQueryOptions( + packageUuid, + options + ) const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey @@ -15582,33 +18343,38 @@ export const useModulesObjectsLatestGet = < } /** - * @summary List all objects filterable in short format + * @summary Download a generated publication package ZIP file */ -export const objectsValidGet = ( - params?: ObjectsValidGetParams, +export const publicationPackagesPackageUuidDownloadGet = ( + packageUuid: string, signal?: AbortSignal ) => { - return customInstance({ - url: `/objects/valid`, + return customInstance({ + url: `/publication-packages/${packageUuid}/download`, method: 'GET', - params, signal, }) } -export const getObjectsValidGetQueryKey = (params?: ObjectsValidGetParams) => { - return [`/objects/valid`, ...(params ? [params] : [])] as const +export const getPublicationPackagesPackageUuidDownloadGetQueryKey = ( + packageUuid: string +) => { + return [`/publication-packages/${packageUuid}/download`] as const } -export const getObjectsValidGetQueryOptions = < - TData = Awaited>, +export const getPublicationPackagesPackageUuidDownloadGetQueryOptions = < + TData = Awaited< + ReturnType + >, TError = HTTPValidationError >( - params?: ObjectsValidGetParams, + packageUuid: string, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited< + ReturnType + >, TError, TData > @@ -15618,43 +18384,59 @@ export const getObjectsValidGetQueryOptions = < const { query: queryOptions } = options ?? {} const queryKey = - queryOptions?.queryKey ?? getObjectsValidGetQueryKey(params) + queryOptions?.queryKey ?? + getPublicationPackagesPackageUuidDownloadGetQueryKey(packageUuid) const queryFn: QueryFunction< - Awaited> - > = ({ signal }) => objectsValidGet(params, signal) + Awaited> + > = ({ signal }) => + publicationPackagesPackageUuidDownloadGet(packageUuid, signal) - return { queryKey, queryFn, ...queryOptions } as UseQueryOptions< - Awaited>, + return { + queryKey, + queryFn, + enabled: !!packageUuid, + ...queryOptions, + } as UseQueryOptions< + Awaited>, TError, TData > & { queryKey: QueryKey } } -export type ObjectsValidGetQueryResult = NonNullable< - Awaited> +export type PublicationPackagesPackageUuidDownloadGetQueryResult = NonNullable< + Awaited> > -export type ObjectsValidGetQueryError = HTTPValidationError +export type PublicationPackagesPackageUuidDownloadGetQueryError = + HTTPValidationError /** - * @summary List all objects filterable in short format + * @summary Download a generated publication package ZIP file */ -export const useObjectsValidGet = < - TData = Awaited>, +export const usePublicationPackagesPackageUuidDownloadGet = < + TData = Awaited< + ReturnType + >, TError = HTTPValidationError >( - params?: ObjectsValidGetParams, + packageUuid: string, options?: { query?: Partial< UseQueryOptions< - Awaited>, + Awaited< + ReturnType + >, TError, TData > > } ): UseQueryResult & { queryKey: QueryKey } => { - const queryOptions = getObjectsValidGetQueryOptions(params, options) + const queryOptions = + getPublicationPackagesPackageUuidDownloadGetQueryOptions( + packageUuid, + options + ) const query = useQuery(queryOptions) as UseQueryResult & { queryKey: QueryKey From 37924b643504d2b1c37d5b6b18c864e9c542f48a Mon Sep 17 00:00:00 2001 From: Stef Winterswijk Date: Tue, 6 Feb 2024 14:50:30 +0100 Subject: [PATCH 2/4] Update Publications --- src/api/fetchers.schemas.ts | 11 --- .../Publications/Publication/Publication.tsx | 67 +++++++++++++++++++ .../Publications/Publication/index.ts | 1 + .../Modules/ModuleDetail/ModuleDetail.tsx | 21 ++++-- 4 files changed, 83 insertions(+), 17 deletions(-) create mode 100644 src/components/Publications/Publication/Publication.tsx create mode 100644 src/components/Publications/Publication/index.ts diff --git a/src/api/fetchers.schemas.ts b/src/api/fetchers.schemas.ts index c8989a82..174ada83 100644 --- a/src/api/fetchers.schemas.ts +++ b/src/api/fetchers.schemas.ts @@ -2192,17 +2192,6 @@ export const DocumentType = { Omgevingsverordening: 'Omgevingsverordening', } as const -/** - * An enumeration. - */ -export type DocumentType = (typeof DocumentType)[keyof typeof DocumentType] - -// eslint-disable-next-line @typescript-eslint/no-redeclare -export const DocumentType = { - Programma: 'Programma', - Omgevingsvisie: 'Omgevingsvisie', -} as const - export interface CompleteModule { Decision_Number: string Default_Start_Validity?: string | null diff --git a/src/components/Publications/Publication/Publication.tsx b/src/components/Publications/Publication/Publication.tsx new file mode 100644 index 00000000..908ffce5 --- /dev/null +++ b/src/components/Publications/Publication/Publication.tsx @@ -0,0 +1,67 @@ +import { Button, Heading } from '@pzh-ui/components' +import { Plus } from '@pzh-ui/icons' +import { useMemo } from 'react' + +import { usePublicationsGet } from '@/api/fetchers' +import { DocumentType } from '@/api/fetchers.schemas' +import ModuleVersionTable from '@/components/Modules/ModuleVersionTable' +import useModalStore from '@/store/modalStore' + +interface PublicationProps { + type: DocumentType +} + +const Publication = ({ type }: PublicationProps) => { + const setActiveModal = useModalStore(state => state.setActiveModal) + + const { data } = usePublicationsGet({ document_type: type }) + + const isEmpty = useMemo(() => !data?.results.length, [data]) + + return ( +
+ + {type} + + + {!isEmpty && ( + + )} + + {isEmpty ? ( + + ) : ( + + )} +
+ ) +} + +export default Publication diff --git a/src/components/Publications/Publication/index.ts b/src/components/Publications/Publication/index.ts new file mode 100644 index 00000000..869b92da --- /dev/null +++ b/src/components/Publications/Publication/index.ts @@ -0,0 +1 @@ +export { default } from './Publication' diff --git a/src/pages/protected/Modules/ModuleDetail/ModuleDetail.tsx b/src/pages/protected/Modules/ModuleDetail/ModuleDetail.tsx index 978e94d3..72823129 100644 --- a/src/pages/protected/Modules/ModuleDetail/ModuleDetail.tsx +++ b/src/pages/protected/Modules/ModuleDetail/ModuleDetail.tsx @@ -10,11 +10,10 @@ import { Tabs, Text, } from '@pzh-ui/components' -import { Plus } from '@pzh-ui/icons' import classNames from 'classnames' import { useState } from 'react' -import { Module, ModuleObjectShort } from '@/api/fetchers.schemas' +import { DocumentType, Module, ModuleObjectShort } from '@/api/fetchers.schemas' import Avatar from '@/components/Avatar' import { LoaderContent } from '@/components/Loader' import { @@ -32,7 +31,7 @@ import ModuleItemList from '@/components/Modules/ModuleItemList' import ModuleLock from '@/components/Modules/ModuleLock' import ModuleTimeline from '@/components/Modules/ModuleTimeline' import ModuleVersionCard from '@/components/Modules/ModuleVersionCard' -import ModuleVersionTable from '@/components/Modules/ModuleVersionTable' +import Publication from '@/components/Publications/Publication' import useModule from '@/hooks/useModule' import useModuleManagers from '@/hooks/useModuleManagers' import usePermissions from '@/hooks/usePermissions' @@ -239,7 +238,7 @@ const TabObjects = () => { } const TabDecisions = () => { - const setActiveModal = useModalStore(state => state.setActiveModal) + const documentTypes = Object.keys(DocumentType) as Array return ( <> @@ -254,7 +253,17 @@ const TabDecisions = () => { leveringen zie leveringen. -
+ {documentTypes.map((type, index) => ( + <> + + + {index + 1 !== documentTypes.length && ( + + )} + + ))} + + {/*
Visie @@ -325,7 +334,7 @@ const TabDecisions = () => { isDisabled> Nieuwe versie aanmaken -
+
*/} From 81ed9b109d466f77ba51b90a526caedf5085953c Mon Sep 17 00:00:00 2001 From: Stef Winterswijk Date: Tue, 13 Feb 2024 14:53:33 +0100 Subject: [PATCH 3/4] Add Word export button --- package.json | 6 +- src/api/fetchers.msw.ts | 130 +++++++---- src/api/fetchers.schemas.ts | 90 ++++--- src/api/instance.ts | 2 +- .../ModuleDecisionModal.tsx | 185 --------------- .../ModuleModals/ModuleDecisionModal/index.ts | 1 - .../PublicationAddModal.tsx | 105 +++++++++ .../PublicationAddModal/index.ts | 1 + .../PublicationVersionAddModal.tsx | 142 ++++++++++++ .../PublicationVersionAddModal/index.ts | 1 + .../PublicationVersionEditModal.tsx | 119 ++++++++++ .../PublicationVersionEditModal/index.ts | 1 + .../Modals/PublicationModals/index.ts | 9 + src/components/Modals/types.ts | 15 +- .../ModuleVersionTable/ModuleVersionTable.tsx | 98 -------- .../Modules/ModuleVersionTable/index.ts | 1 - .../Publications/Publication/Publication.tsx | 97 ++++---- .../PublicationVersionForm.tsx | 219 ++++++++++++++++++ .../PublicationVersionForm/index.ts | 1 + .../PublicationVersions.tsx | 145 ++++++++++++ .../Publications/PublicationVersions/index.ts | 1 + src/config/notifications.ts | 5 + .../Modules/ModuleDetail/ModuleDetail.tsx | 100 ++------ src/store/modalStore.ts | 29 ++- src/utils/downloadFile.ts | 40 ++++ yarn.lock | 32 +-- 26 files changed, 1070 insertions(+), 505 deletions(-) delete mode 100644 src/components/Modals/ModuleModals/ModuleDecisionModal/ModuleDecisionModal.tsx delete mode 100644 src/components/Modals/ModuleModals/ModuleDecisionModal/index.ts create mode 100644 src/components/Modals/PublicationModals/PublicationAddModal/PublicationAddModal.tsx create mode 100644 src/components/Modals/PublicationModals/PublicationAddModal/index.ts create mode 100644 src/components/Modals/PublicationModals/PublicationVersionAddModal/PublicationVersionAddModal.tsx create mode 100644 src/components/Modals/PublicationModals/PublicationVersionAddModal/index.ts create mode 100644 src/components/Modals/PublicationModals/PublicationVersionEditModal/PublicationVersionEditModal.tsx create mode 100644 src/components/Modals/PublicationModals/PublicationVersionEditModal/index.ts create mode 100644 src/components/Modals/PublicationModals/index.ts delete mode 100644 src/components/Modules/ModuleVersionTable/ModuleVersionTable.tsx delete mode 100644 src/components/Modules/ModuleVersionTable/index.ts create mode 100644 src/components/Publications/PublicationVersionForm/PublicationVersionForm.tsx create mode 100644 src/components/Publications/PublicationVersionForm/index.ts create mode 100644 src/components/Publications/PublicationVersions/PublicationVersions.tsx create mode 100644 src/components/Publications/PublicationVersions/index.ts create mode 100644 src/utils/downloadFile.ts diff --git a/package.json b/package.json index 3b2f1740..8c2736d5 100644 --- a/package.json +++ b/package.json @@ -6,10 +6,10 @@ "type": "module", "dependencies": { "@headlessui/react": "^1.7.17", - "@pzh-ui/components": "^0.0.461", + "@pzh-ui/components": "^0.0.465", "@pzh-ui/config": "^0.0.56", - "@pzh-ui/css": "^0.0.79", - "@pzh-ui/icons": "^0.0.48", + "@pzh-ui/css": "^0.0.80", + "@pzh-ui/icons": "^0.0.50", "@react-hookz/web": "^24.0.2", "@tanstack/react-query": "^5.14.2", "axios": "^1.6.2", diff --git a/src/api/fetchers.msw.ts b/src/api/fetchers.msw.ts index eb1626e4..29e913d3 100644 --- a/src/api/fetchers.msw.ts +++ b/src/api/fetchers.msw.ts @@ -11,10 +11,10 @@ import { faker } from '@faker-js/faker' import { HttpResponse, delay, http } from 'msw' import { - DocumentType, + AppExtensionsPublicationsEnumsDocumentType, GraphEdgeType, PackageEventType, - ProcedureStepTypeEnum, + ProcedureStepType, ProcedureType, } from './fetchers.schemas' @@ -11867,8 +11867,12 @@ export const getPublicationsGetMock = () => ({ { length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1 ).map(() => ({ + Created_By_UUID: faker.string.uuid(), Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, - Document_Type: faker.helpers.arrayElement(Object.values(DocumentType)), + Document_Type: faker.helpers.arrayElement( + Object.values(AppExtensionsPublicationsEnumsDocumentType) + ), + Modified_By_UUID: faker.string.uuid(), Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, Module_ID: faker.number.int({ min: undefined, max: undefined }), Official_Title: faker.word.sample(), @@ -11884,8 +11888,12 @@ export const getPublicationsGetMock = () => ({ }) export const getPublicationsPostMock = () => ({ + Created_By_UUID: faker.string.uuid(), Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, - Document_Type: faker.helpers.arrayElement(Object.values(DocumentType)), + Document_Type: faker.helpers.arrayElement( + Object.values(AppExtensionsPublicationsEnumsDocumentType) + ), + Modified_By_UUID: faker.string.uuid(), Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, Module_ID: faker.number.int({ min: undefined, max: undefined }), Official_Title: faker.word.sample(), @@ -11899,8 +11907,12 @@ export const getPublicationsPostMock = () => ({ }) export const getPublicationsPublicationUuidGetMock = () => ({ + Created_By_UUID: faker.string.uuid(), Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, - Document_Type: faker.helpers.arrayElement(Object.values(DocumentType)), + Document_Type: faker.helpers.arrayElement( + Object.values(AppExtensionsPublicationsEnumsDocumentType) + ), + Modified_By_UUID: faker.string.uuid(), Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, Module_ID: faker.number.int({ min: undefined, max: undefined }), Official_Title: faker.word.sample(), @@ -11914,8 +11926,12 @@ export const getPublicationsPublicationUuidGetMock = () => ({ }) export const getPublicationsPublicationUuidPatchMock = () => ({ + Created_By_UUID: faker.string.uuid(), Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, - Document_Type: faker.helpers.arrayElement(Object.values(DocumentType)), + Document_Type: faker.helpers.arrayElement( + Object.values(AppExtensionsPublicationsEnumsDocumentType) + ), + Modified_By_UUID: faker.string.uuid(), Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, Module_ID: faker.number.int({ min: undefined, max: undefined }), Official_Title: faker.word.sample(), @@ -11959,7 +11975,7 @@ export const getPublicationsPublicationUuidBillsGetMock = () => ({ }) export const getPublicationsPublicationUuidBillsPostMock = () => ({ - Announcement_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Announcement_Date: faker.date.past().toISOString().split('T')[0], Bill_Data: faker.helpers.arrayElement([ { Amendment_Article: faker.helpers.arrayElement([ @@ -12009,9 +12025,11 @@ export const getPublicationsPublicationUuidBillsPostMock = () => ({ }, undefined, ]), + Created_By_UUID: faker.string.uuid(), Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, - Effective_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Effective_Date: faker.date.past().toISOString().split('T')[0], Is_Official: faker.datatype.boolean(), + Modified_By_UUID: faker.string.uuid(), Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, Module_Status_ID: faker.number.int({ min: undefined, max: undefined }), Procedure_Data: faker.helpers.arrayElement([ @@ -12023,7 +12041,7 @@ export const getPublicationsPublicationUuidBillsPostMock = () => ({ ).map(() => ({ Conclusion_Date: faker.date.past().toISOString().split('T')[0], Step_Type: faker.helpers.arrayElement( - Object.values(ProcedureStepTypeEnum) + Object.values(ProcedureStepType) ), })), }, @@ -12031,6 +12049,10 @@ export const getPublicationsPublicationUuidBillsPostMock = () => ({ ]), Procedure_Type: faker.helpers.arrayElement(Object.values(ProcedureType)), Publication_UUID: faker.string.uuid(), + PZH_Bill_Identifier: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), UUID: faker.string.uuid(), Version_ID: faker.helpers.arrayElement([ faker.number.int({ min: undefined, max: undefined }), @@ -12039,7 +12061,7 @@ export const getPublicationsPublicationUuidBillsPostMock = () => ({ }) export const getPublicationsPublicationUuidBillsBillUuidGetMock = () => ({ - Announcement_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Announcement_Date: faker.date.past().toISOString().split('T')[0], Bill_Data: faker.helpers.arrayElement([ { Amendment_Article: faker.helpers.arrayElement([ @@ -12089,9 +12111,11 @@ export const getPublicationsPublicationUuidBillsBillUuidGetMock = () => ({ }, undefined, ]), + Created_By_UUID: faker.string.uuid(), Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, - Effective_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Effective_Date: faker.date.past().toISOString().split('T')[0], Is_Official: faker.datatype.boolean(), + Modified_By_UUID: faker.string.uuid(), Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, Module_Status_ID: faker.number.int({ min: undefined, max: undefined }), Procedure_Data: faker.helpers.arrayElement([ @@ -12103,7 +12127,7 @@ export const getPublicationsPublicationUuidBillsBillUuidGetMock = () => ({ ).map(() => ({ Conclusion_Date: faker.date.past().toISOString().split('T')[0], Step_Type: faker.helpers.arrayElement( - Object.values(ProcedureStepTypeEnum) + Object.values(ProcedureStepType) ), })), }, @@ -12111,6 +12135,10 @@ export const getPublicationsPublicationUuidBillsBillUuidGetMock = () => ({ ]), Procedure_Type: faker.helpers.arrayElement(Object.values(ProcedureType)), Publication_UUID: faker.string.uuid(), + PZH_Bill_Identifier: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), UUID: faker.string.uuid(), Version_ID: faker.helpers.arrayElement([ faker.number.int({ min: undefined, max: undefined }), @@ -12119,7 +12147,7 @@ export const getPublicationsPublicationUuidBillsBillUuidGetMock = () => ({ }) export const getPublicationsPublicationUuidBillsBillUuidPatchMock = () => ({ - Announcement_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Announcement_Date: faker.date.past().toISOString().split('T')[0], Bill_Data: faker.helpers.arrayElement([ { Amendment_Article: faker.helpers.arrayElement([ @@ -12169,9 +12197,11 @@ export const getPublicationsPublicationUuidBillsBillUuidPatchMock = () => ({ }, undefined, ]), + Created_By_UUID: faker.string.uuid(), Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, - Effective_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Effective_Date: faker.date.past().toISOString().split('T')[0], Is_Official: faker.datatype.boolean(), + Modified_By_UUID: faker.string.uuid(), Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, Module_Status_ID: faker.number.int({ min: undefined, max: undefined }), Procedure_Data: faker.helpers.arrayElement([ @@ -12183,7 +12213,7 @@ export const getPublicationsPublicationUuidBillsBillUuidPatchMock = () => ({ ).map(() => ({ Conclusion_Date: faker.date.past().toISOString().split('T')[0], Step_Type: faker.helpers.arrayElement( - Object.values(ProcedureStepTypeEnum) + Object.values(ProcedureStepType) ), })), }, @@ -12191,6 +12221,10 @@ export const getPublicationsPublicationUuidBillsBillUuidPatchMock = () => ({ ]), Procedure_Type: faker.helpers.arrayElement(Object.values(ProcedureType)), Publication_UUID: faker.string.uuid(), + PZH_Bill_Identifier: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), UUID: faker.string.uuid(), Version_ID: faker.helpers.arrayElement([ faker.number.int({ min: undefined, max: undefined }), @@ -12211,16 +12245,18 @@ export const getPublicationBillsBillUuidPackagesGetMock = () => ({ { length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1 ).map(() => ({ - Announcement_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Announcement_Date: faker.date.past().toISOString().split('T')[0], Bill_UUID: faker.string.uuid(), Config_ID: faker.number.int({ min: undefined, max: undefined }), + Created_By_UUID: faker.string.uuid(), Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, FRBR_ID: faker.number.int({ min: undefined, max: undefined }), FRBR_Info: faker.helpers.arrayElement([ { - act_expression_date: `${ - faker.date.past().toISOString().split('.')[0] - }Z`, + act_expression_date: faker.date + .past() + .toISOString() + .split('T')[0], act_expression_lang: faker.word.sample(), act_expression_misc: faker.helpers.arrayElement([ faker.word.sample(), @@ -12233,9 +12269,10 @@ export const getPublicationBillsBillUuidPackagesGetMock = () => ({ faker.word.sample(), undefined, ]), - bill_expression_date: `${ - faker.date.past().toISOString().split('.')[0] - }Z`, + bill_expression_date: faker.date + .past() + .toISOString() + .split('T')[0], bill_expression_lang: faker.word.sample(), bill_expression_misc: faker.helpers.arrayElement([ faker.word.sample(), @@ -12255,15 +12292,17 @@ export const getPublicationBillsBillUuidPackagesGetMock = () => ({ }, undefined, ]), + Modified_By_UUID: faker.string.uuid(), Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, Package_Event_Type: faker.helpers.arrayElement( Object.values(PackageEventType) ), Publication_Bill: faker.helpers.arrayElement([ { - Announcement_Date: `${ - faker.date.past().toISOString().split('.')[0] - }Z`, + Announcement_Date: faker.date + .past() + .toISOString() + .split('T')[0], Bill_Data: faker.helpers.arrayElement([ { Amendment_Article: faker.helpers.arrayElement([ @@ -12318,13 +12357,13 @@ export const getPublicationBillsBillUuidPackagesGetMock = () => ({ }, undefined, ]), + Created_By_UUID: faker.string.uuid(), Created_Date: `${ faker.date.past().toISOString().split('.')[0] }Z`, - Effective_Date: `${ - faker.date.past().toISOString().split('.')[0] - }Z`, + Effective_Date: faker.date.past().toISOString().split('T')[0], Is_Official: faker.datatype.boolean(), + Modified_By_UUID: faker.string.uuid(), Modified_Date: `${ faker.date.past().toISOString().split('.')[0] }Z`, @@ -12347,7 +12386,7 @@ export const getPublicationBillsBillUuidPackagesGetMock = () => ({ .toISOString() .split('T')[0], Step_Type: faker.helpers.arrayElement( - Object.values(ProcedureStepTypeEnum) + Object.values(ProcedureStepType) ), })), }, @@ -12357,6 +12396,10 @@ export const getPublicationBillsBillUuidPackagesGetMock = () => ({ Object.values(ProcedureType) ), Publication_UUID: faker.string.uuid(), + PZH_Bill_Identifier: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), UUID: faker.string.uuid(), Version_ID: faker.helpers.arrayElement([ faker.number.int({ min: undefined, max: undefined }), @@ -12393,6 +12436,7 @@ export const getPublicationBillsBillUuidPackagesGetMock = () => ({ { length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1 ).map(() => ({ + Created_By_UUID: faker.string.uuid(), Created_Date: `${ faker.date.past().toISOString().split('.')[0] }Z`, @@ -12435,16 +12479,15 @@ export const getPublicationBillsBillUuidPackagesGetMock = () => ({ }) export const getPublicationBillsBillUuidPackagesPostMock = () => ({ - Announcement_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Announcement_Date: faker.date.past().toISOString().split('T')[0], Bill_UUID: faker.string.uuid(), Config_ID: faker.number.int({ min: undefined, max: undefined }), + Created_By_UUID: faker.string.uuid(), Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, FRBR_ID: faker.number.int({ min: undefined, max: undefined }), FRBR_Info: faker.helpers.arrayElement([ { - act_expression_date: `${ - faker.date.past().toISOString().split('.')[0] - }Z`, + act_expression_date: faker.date.past().toISOString().split('T')[0], act_expression_lang: faker.word.sample(), act_expression_misc: faker.helpers.arrayElement([ faker.word.sample(), @@ -12457,9 +12500,7 @@ export const getPublicationBillsBillUuidPackagesPostMock = () => ({ faker.word.sample(), undefined, ]), - bill_expression_date: `${ - faker.date.past().toISOString().split('.')[0] - }Z`, + bill_expression_date: faker.date.past().toISOString().split('T')[0], bill_expression_lang: faker.word.sample(), bill_expression_misc: faker.helpers.arrayElement([ faker.word.sample(), @@ -12477,15 +12518,14 @@ export const getPublicationBillsBillUuidPackagesPostMock = () => ({ }, undefined, ]), + Modified_By_UUID: faker.string.uuid(), Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, Package_Event_Type: faker.helpers.arrayElement( Object.values(PackageEventType) ), Publication_Bill: faker.helpers.arrayElement([ { - Announcement_Date: `${ - faker.date.past().toISOString().split('.')[0] - }Z`, + Announcement_Date: faker.date.past().toISOString().split('T')[0], Bill_Data: faker.helpers.arrayElement([ { Amendment_Article: faker.helpers.arrayElement([ @@ -12535,9 +12575,11 @@ export const getPublicationBillsBillUuidPackagesPostMock = () => ({ }, undefined, ]), + Created_By_UUID: faker.string.uuid(), Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, - Effective_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, + Effective_Date: faker.date.past().toISOString().split('T')[0], Is_Official: faker.datatype.boolean(), + Modified_By_UUID: faker.string.uuid(), Modified_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, Module_Status_ID: faker.number.int({ min: undefined, @@ -12558,7 +12600,7 @@ export const getPublicationBillsBillUuidPackagesPostMock = () => ({ .toISOString() .split('T')[0], Step_Type: faker.helpers.arrayElement( - Object.values(ProcedureStepTypeEnum) + Object.values(ProcedureStepType) ), })), }, @@ -12568,6 +12610,10 @@ export const getPublicationBillsBillUuidPackagesPostMock = () => ({ Object.values(ProcedureType) ), Publication_UUID: faker.string.uuid(), + PZH_Bill_Identifier: faker.helpers.arrayElement([ + faker.word.sample(), + undefined, + ]), UUID: faker.string.uuid(), Version_ID: faker.helpers.arrayElement([ faker.number.int({ min: undefined, max: undefined }), @@ -12602,6 +12648,7 @@ export const getPublicationBillsBillUuidPackagesPostMock = () => ({ { length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1 ).map(() => ({ + Created_By_UUID: faker.string.uuid(), Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, ID: faker.number.int({ min: undefined, max: undefined }), Messages: faker.helpers.arrayElement([ @@ -12637,6 +12684,7 @@ export const getPublicationBillsBillUuidPackagesPostMock = () => ({ }) export const getPublicationPackagesPackageUuidReportPostMock = () => ({ + Created_By_UUID: faker.string.uuid(), Created_Date: `${faker.date.past().toISOString().split('.')[0]}Z`, ID: faker.number.int({ min: undefined, max: undefined }), Messages: faker.helpers.arrayElement([faker.word.sample(), undefined]), diff --git a/src/api/fetchers.schemas.ts b/src/api/fetchers.schemas.ts index 174ada83..bdf074b3 100644 --- a/src/api/fetchers.schemas.ts +++ b/src/api/fetchers.schemas.ts @@ -28,7 +28,7 @@ export type PublicationsPublicationUuidBillsGetParams = { } export type PublicationsGetParams = { - document_type?: DocumentType + document_type?: AppExtensionsPublicationsEnumsDocumentType module_ID?: number offset?: number limit?: number @@ -131,7 +131,7 @@ export type UsersGetParams = { export type PlaygroundDoDsoModuleIdPostParams = { work_version: string - document_type: DocumentType + document_type: DsoModelsDocumentType geo_new?: boolean opdracht_type?: OpdrachtType } @@ -448,6 +448,31 @@ export type AmbitiesValidGetParams = { sort_order?: SortOrder } +/** + * An enumeration. + */ +export type DsoModelsDocumentType = + (typeof DsoModelsDocumentType)[keyof typeof DsoModelsDocumentType] + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const DsoModelsDocumentType = { + Programma: 'Programma', + Omgevingsvisie: 'Omgevingsvisie', +} as const + +/** + * An enumeration. + */ +export type AppExtensionsPublicationsEnumsDocumentType = + (typeof AppExtensionsPublicationsEnumsDocumentType)[keyof typeof AppExtensionsPublicationsEnumsDocumentType] + +// eslint-disable-next-line @typescript-eslint/no-redeclare +export const AppExtensionsPublicationsEnumsDocumentType = { + Omgevingsvisie: 'Omgevingsvisie', + Omgevingsprogramma: 'Omgevingsprogramma', + Omgevingsverordening: 'Omgevingsverordening', +} as const + export interface WriteRelation { Description?: string | null Object_ID: number @@ -929,6 +954,7 @@ export interface ReadRelation { } export interface PublicationPackageReport { + Created_By_UUID: string Created_Date: string ID: number Messages?: string @@ -967,9 +993,11 @@ export interface PublicationPackage { Announcement_Date: string Bill_UUID: string Config_ID: number + Created_By_UUID: string Created_Date: string FRBR_ID: number FRBR_Info?: PublicationFRBR + Modified_By_UUID: string Modified_Date: string Package_Event_Type: PackageEventType Publication_Bill?: PublicationBill @@ -989,7 +1017,7 @@ export interface PublicationEdit { } export interface PublicationCreate { - Document_Type: DocumentType + Document_Type: AppExtensionsPublicationsEnumsDocumentType Module_ID: number Official_Title: string Regulation_Title: string @@ -1037,6 +1065,7 @@ export interface PublicationBillCreate { Module_Status_ID: number Procedure_Data?: ProcedureData Procedure_Type: ProcedureType + PZH_Bill_Identifier?: string } /** @@ -1045,21 +1074,26 @@ export interface PublicationBillCreate { export interface PublicationBill { Announcement_Date: string Bill_Data?: BillData + Created_By_UUID: string Created_Date: string Effective_Date: string Is_Official: boolean + Modified_By_UUID: string Modified_Date: string Module_Status_ID: number Procedure_Data?: ProcedureData Procedure_Type: ProcedureType Publication_UUID: string + PZH_Bill_Identifier?: string UUID: string Version_ID?: number } export interface Publication { + Created_By_UUID: string Created_Date: string - Document_Type: DocumentType + Document_Type: AppExtensionsPublicationsEnumsDocumentType + Modified_By_UUID: string Modified_Date: string Module_ID: number Official_Title: string @@ -1191,22 +1225,14 @@ export const ProcedureType = { Definitief: 'Definitief', } as const -/** - * STOP Procedureverloop - */ -export interface ProcedureData { - Announcement_Date: string - Steps: ProcedureStep[] -} - /** * STOP ProcedureStappenDefinitief */ -export type ProcedureStepTypeEnum = - (typeof ProcedureStepTypeEnum)[keyof typeof ProcedureStepTypeEnum] +export type ProcedureStepType = + (typeof ProcedureStepType)[keyof typeof ProcedureStepType] // eslint-disable-next-line @typescript-eslint/no-redeclare -export const ProcedureStepTypeEnum = { +export const ProcedureStepType = { Vaststelling: 'Vaststelling', Ondertekening: 'Ondertekening', Publicatie: 'Publicatie', @@ -1223,7 +1249,15 @@ export const ProcedureStepTypeEnum = { */ export interface ProcedureStep { Conclusion_Date: string - Step_Type: ProcedureStepTypeEnum + Step_Type: ProcedureStepType +} + +/** + * STOP Procedureverloop + */ +export interface ProcedureData { + Announcement_Date: string + Steps: ProcedureStep[] } /** @@ -1726,6 +1760,12 @@ export interface ModulePatchStatus { Status: ModuleStatusCode } +export interface ModuleOverview { + Module: Module + Objects: ModuleObjectShort[] + StatusHistory: ModuleStatus[] +} + export interface ModuleObjectContextShort { Action: string Original_Adjust_On?: string @@ -1861,12 +1901,6 @@ export interface Module { Title: string } -export interface ModuleOverview { - Module: Module - Objects: ModuleObjectShort[] - StatusHistory: ModuleStatus[] -} - export interface MaatregelUUID { Object_ID?: number UUID?: string @@ -2180,18 +2214,6 @@ export interface EditAcknowledgedRelation { Object_Type: string } -/** - * An enumeration. - */ -export type DocumentType = (typeof DocumentType)[keyof typeof DocumentType] - -// eslint-disable-next-line @typescript-eslint/no-redeclare -export const DocumentType = { - Omgevingsvisie: 'Omgevingsvisie', - Omgevingsprogramma: 'Omgevingsprogramma', - Omgevingsverordening: 'Omgevingsverordening', -} as const - export interface CompleteModule { Decision_Number: string Default_Start_Validity?: string | null diff --git a/src/api/instance.ts b/src/api/instance.ts index 6491530b..4e0996b3 100644 --- a/src/api/instance.ts +++ b/src/api/instance.ts @@ -6,7 +6,7 @@ export type Environment = 'dev' | 'test' | 'acc' | 'main' const environment = import.meta.env.VITE_API_ENV as Environment -const getAccessToken = () => +export const getAccessToken = () => localStorage.getItem(import.meta.env.VITE_KEY_API_ACCESS_TOKEN || '') const instance = axios.create({ diff --git a/src/components/Modals/ModuleModals/ModuleDecisionModal/ModuleDecisionModal.tsx b/src/components/Modals/ModuleModals/ModuleDecisionModal/ModuleDecisionModal.tsx deleted file mode 100644 index eaa8a0f2..00000000 --- a/src/components/Modals/ModuleModals/ModuleDecisionModal/ModuleDecisionModal.tsx +++ /dev/null @@ -1,185 +0,0 @@ -import { - Button, - Divider, - FormikDate, - FormikInput, - FormikRadioGroup, - FormikRte, - FormikSelect, - Text, -} from '@pzh-ui/components' -import { Form, Formik } from 'formik' - -import { - Accordion, - AccordionContent, - AccordionItem, - AccordionTrigger, -} from '@/components/Accordion' -import Modal from '@/components/Modal/Modal' -import useModalStore from '@/store/modalStore' - -const ModuleDecisionModal = () => { - const setActiveModal = useModalStore(state => state.setActiveModal) - - const handleFormSubmit = () => {} - - const initialValues = {} - - return ( - - -
-
- - -
- - -
- - - -
- Artikelen - -
- -
- - - - -
-
- -
- - -
- -
-
- ) -} - -const Articles = () => ( - - - - Artikel I - Genomen besluit ( wat het bestuursorgaan besluit - vast te stellen of te wijzigen ) - - - - - - - - Artikel II - Wijzigingen ( opsomming van gewijzigde artikelen ) - - - - - - - - Artikel III - Inwerkingtreding ( datum waarop het - wijzigingsbesluit geldig is ) - - - - - - -) - -export default ModuleDecisionModal diff --git a/src/components/Modals/ModuleModals/ModuleDecisionModal/index.ts b/src/components/Modals/ModuleModals/ModuleDecisionModal/index.ts deleted file mode 100644 index 830ed47a..00000000 --- a/src/components/Modals/ModuleModals/ModuleDecisionModal/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './ModuleDecisionModal' diff --git a/src/components/Modals/PublicationModals/PublicationAddModal/PublicationAddModal.tsx b/src/components/Modals/PublicationModals/PublicationAddModal/PublicationAddModal.tsx new file mode 100644 index 00000000..bc85b13e --- /dev/null +++ b/src/components/Modals/PublicationModals/PublicationAddModal/PublicationAddModal.tsx @@ -0,0 +1,105 @@ +import { Button, Divider, FormikInput, FormikSelect } from '@pzh-ui/components' +import { useQueryClient } from '@tanstack/react-query' +import { Form, Formik } from 'formik' +import { useParams } from 'react-router-dom' + +import { getPublicationsGetQueryKey, usePublicationsPost } from '@/api/fetchers' +import { + AppExtensionsPublicationsEnumsDocumentType, + PublicationCreate, +} from '@/api/fetchers.schemas' +import Modal from '@/components/Modal/Modal' +import useModalStore from '@/store/modalStore' + +import { ModalStateMap } from '../../types' + +const PublicationAddModal = () => { + const queryClient = useQueryClient() + const { moduleId } = useParams() + + const modalState = useModalStore( + state => state.modalStates['publicationAdd'] + ) as ModalStateMap['publicationAdd'] + const setActiveModal = useModalStore(state => state.setActiveModal) + + const { mutate } = usePublicationsPost({ + mutation: { + onSuccess: data => { + queryClient.invalidateQueries({ + queryKey: getPublicationsGetQueryKey({ + document_type: data.Document_Type, + }), + }) + + setActiveModal(null) + }, + }, + }) + + const initialValues = { + Module_ID: parseInt(moduleId!), + Document_Type: modalState?.type, + } as PublicationCreate + + const options = ( + Object.keys( + AppExtensionsPublicationsEnumsDocumentType + ) as Array + ).map(type => ({ label: type, value: type })) + + const handleFormSubmit = (payload: PublicationCreate) => { + mutate({ data: payload }) + } + + return ( + + + {({ isSubmitting }) => ( +
+
+ + + + +
+ +
+ + +
+ + )} +
+
+ ) +} + +export default PublicationAddModal diff --git a/src/components/Modals/PublicationModals/PublicationAddModal/index.ts b/src/components/Modals/PublicationModals/PublicationAddModal/index.ts new file mode 100644 index 00000000..cd83af75 --- /dev/null +++ b/src/components/Modals/PublicationModals/PublicationAddModal/index.ts @@ -0,0 +1 @@ +export { default } from './PublicationAddModal' diff --git a/src/components/Modals/PublicationModals/PublicationVersionAddModal/PublicationVersionAddModal.tsx b/src/components/Modals/PublicationModals/PublicationVersionAddModal/PublicationVersionAddModal.tsx new file mode 100644 index 00000000..8fd5df06 --- /dev/null +++ b/src/components/Modals/PublicationModals/PublicationVersionAddModal/PublicationVersionAddModal.tsx @@ -0,0 +1,142 @@ +import { formatDate } from '@pzh-ui/components' +import { useQueryClient } from '@tanstack/react-query' + +import { + getPublicationsPublicationUuidBillsGetQueryKey, + usePublicationsPublicationUuidBillsBillUuidGet, + usePublicationsPublicationUuidBillsPost, +} from '@/api/fetchers' +import { PublicationBillCreate } from '@/api/fetchers.schemas' +import { LoaderSpinner } from '@/components/Loader' +import Modal from '@/components/Modal/Modal' +import PublicationVersionForm from '@/components/Publications/PublicationVersionForm' +import useModalStore from '@/store/modalStore' + +import { ModalStateMap } from '../../types' + +const PublicationVersionAddModal = () => { + const queryClient = useQueryClient() + + const setActiveModal = useModalStore(state => state.setActiveModal) + const modalState = useModalStore( + state => state.modalStates['publicationVersionAdd'] + ) as ModalStateMap['publicationVersionAdd'] + + const { data: prefill, isFetching } = + usePublicationsPublicationUuidBillsBillUuidGet( + modalState?.publication.UUID, + modalState?.prevUUID || '', + { + query: { + enabled: + !!modalState?.publication.UUID && + !!modalState?.prevUUID, + }, + } + ) + + const { mutate } = usePublicationsPublicationUuidBillsPost({ + mutation: { + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: getPublicationsPublicationUuidBillsGetQueryKey( + modalState.publication.UUID + ), + }) + + setActiveModal(null) + }, + }, + }) + + const handleFormSubmit = (payload: PublicationBillCreate) => { + payload.Is_Official = (payload.Is_Official as unknown) === 'true' + + payload.Effective_Date = + payload.Effective_Date && + formatDate(new Date(payload.Effective_Date), 'yyyy-MM-dd') + + if (payload.Procedure_Data?.Announcement_Date) { + payload.Procedure_Data.Announcement_Date = + formatDate( + new Date(payload.Procedure_Data.Announcement_Date), + 'yyyy-MM-dd' + ) || '' + payload.Announcement_Date = + formatDate( + new Date(payload.Procedure_Data.Announcement_Date), + 'yyyy-MM-dd' + ) || '' + } + + if (payload.Procedure_Data?.Steps?.[0]?.Conclusion_Date) { + payload.Procedure_Data.Steps[0].Conclusion_Date = formatDate( + new Date(payload.Procedure_Data.Steps[0].Conclusion_Date), + 'yyyy-MM-dd' + ) + } + + if (payload.Procedure_Data?.Steps?.[1]?.Conclusion_Date) { + payload.Procedure_Data.Steps[1].Conclusion_Date = formatDate( + new Date(payload.Procedure_Data.Steps[1].Conclusion_Date), + 'yyyy-MM-dd' + ) + } + + mutate({ publicationUuid: modalState.publication.UUID, data: payload }) + } + + const initialValues = !!prefill + ? { + ...prefill, + Is_Official: prefill.Is_Official ? 'true' : 'false', + } + : ({ + Bill_Data: { + Bill_Title: modalState?.publication?.Official_Title, + Regulation_Title: modalState?.publication?.Regulation_Title, + Amendment_Article: { + Label: 'Genomen besluit', + Number: '1', + }, + Articles: [ + { + Label: 'Wijzigingen', + Number: '2', + }, + ], + Time_Article: { + Label: 'Inwerkingtreding', + Number: '3', + }, + }, + Procedure_Data: { + Steps: [ + { + Step_Type: 'Vaststelling', + }, + { + Step_Type: 'Ondertekening', + }, + ], + }, + } as PublicationBillCreate) + + return ( + + {isFetching ? ( +
+ +
+ ) : ( + + )} +
+ ) +} + +export default PublicationVersionAddModal diff --git a/src/components/Modals/PublicationModals/PublicationVersionAddModal/index.ts b/src/components/Modals/PublicationModals/PublicationVersionAddModal/index.ts new file mode 100644 index 00000000..7fe4fbd3 --- /dev/null +++ b/src/components/Modals/PublicationModals/PublicationVersionAddModal/index.ts @@ -0,0 +1 @@ +export { default } from './PublicationVersionAddModal' diff --git a/src/components/Modals/PublicationModals/PublicationVersionEditModal/PublicationVersionEditModal.tsx b/src/components/Modals/PublicationModals/PublicationVersionEditModal/PublicationVersionEditModal.tsx new file mode 100644 index 00000000..dc5463d7 --- /dev/null +++ b/src/components/Modals/PublicationModals/PublicationVersionEditModal/PublicationVersionEditModal.tsx @@ -0,0 +1,119 @@ +import { formatDate } from '@pzh-ui/components' +import { useQueryClient } from '@tanstack/react-query' + +import { + getPublicationsPublicationUuidBillsBillUuidGetQueryKey, + getPublicationsPublicationUuidBillsGetQueryKey, + usePublicationsPublicationUuidBillsBillUuidGet, + usePublicationsPublicationUuidBillsBillUuidPatch, +} from '@/api/fetchers' +import { PublicationBillEdit } from '@/api/fetchers.schemas' +import { LoaderSpinner } from '@/components/Loader' +import Modal from '@/components/Modal/Modal' +import PublicationVersionForm from '@/components/Publications/PublicationVersionForm' +import useModalStore from '@/store/modalStore' + +import { ModalStateMap } from '../../types' + +const PublicationVersionEditModal = () => { + const queryClient = useQueryClient() + + const setActiveModal = useModalStore(state => state.setActiveModal) + const modalState = useModalStore( + state => state.modalStates['publicationVersionEdit'] + ) as ModalStateMap['publicationVersionEdit'] + + const { data, isFetching } = usePublicationsPublicationUuidBillsBillUuidGet( + modalState?.publication.UUID, + modalState?.UUID, + { + query: { + enabled: !!modalState?.publication.UUID && !!modalState?.UUID, + }, + } + ) + + const { mutate } = usePublicationsPublicationUuidBillsBillUuidPatch({ + mutation: { + onSuccess: () => { + queryClient.invalidateQueries({ + queryKey: getPublicationsPublicationUuidBillsGetQueryKey( + modalState.publication.UUID + ), + }) + queryClient.invalidateQueries({ + queryKey: + getPublicationsPublicationUuidBillsBillUuidGetQueryKey( + modalState.publication.UUID, + modalState.UUID + ), + }) + + setActiveModal(null) + }, + }, + }) + + const handleFormSubmit = (payload: PublicationBillEdit) => { + payload.Effective_Date = + payload.Effective_Date && + formatDate(new Date(payload.Effective_Date), 'yyyy-MM-dd') + + if (payload.Procedure_Data?.Announcement_Date) { + payload.Procedure_Data.Announcement_Date = + formatDate( + new Date(payload.Procedure_Data.Announcement_Date), + 'yyyy-MM-dd' + ) || '' + payload.Announcement_Date = + formatDate( + new Date(payload.Procedure_Data.Announcement_Date), + 'yyyy-MM-dd' + ) || '' + } + + if (payload.Procedure_Data?.Steps?.[0]?.Conclusion_Date) { + payload.Procedure_Data.Steps[0].Conclusion_Date = formatDate( + new Date(payload.Procedure_Data.Steps[0].Conclusion_Date), + 'yyyy-MM-dd' + ) + } + + if (payload.Procedure_Data?.Steps?.[1]?.Conclusion_Date) { + payload.Procedure_Data.Steps[1].Conclusion_Date = formatDate( + new Date(payload.Procedure_Data.Steps[1].Conclusion_Date), + 'yyyy-MM-dd' + ) + } + + mutate({ + publicationUuid: modalState.publication.UUID, + billUuid: modalState.UUID, + data: payload, + }) + } + + const initialValues = { + ...data, + Is_Official: data?.Is_Official ? 'true' : 'false', + } + + return ( + + {isFetching ? ( +
+ +
+ ) : ( + + )} +
+ ) +} + +export default PublicationVersionEditModal diff --git a/src/components/Modals/PublicationModals/PublicationVersionEditModal/index.ts b/src/components/Modals/PublicationModals/PublicationVersionEditModal/index.ts new file mode 100644 index 00000000..3fdfc207 --- /dev/null +++ b/src/components/Modals/PublicationModals/PublicationVersionEditModal/index.ts @@ -0,0 +1 @@ +export { default } from './PublicationVersionEditModal' diff --git a/src/components/Modals/PublicationModals/index.ts b/src/components/Modals/PublicationModals/index.ts new file mode 100644 index 00000000..9211093b --- /dev/null +++ b/src/components/Modals/PublicationModals/index.ts @@ -0,0 +1,9 @@ +import PublicationAddModal from './PublicationAddModal' +import PublicationVersionAddModal from './PublicationVersionAddModal' +import PublicationVersionEditModal from './PublicationVersionEditModal' + +export { + PublicationAddModal, + PublicationVersionAddModal, + PublicationVersionEditModal, +} diff --git a/src/components/Modals/types.ts b/src/components/Modals/types.ts index 305c2df6..37dd588e 100644 --- a/src/components/Modals/types.ts +++ b/src/components/Modals/types.ts @@ -1,3 +1,8 @@ +import { + AppExtensionsPublicationsEnumsDocumentType, + Publication, +} from '@/api/fetchers.schemas' + export type ModalType = | 'regulationAdd' | 'regulationDelete' @@ -11,7 +16,6 @@ export type ModalType = | 'moduleAddObject' | 'moduleEditObject' | 'moduleDeleteObject' - | 'moduleDecision' | 'areaAdd' | 'objectDetails' | 'objectAddConnection' @@ -24,3 +28,12 @@ export type ModalType = | 'userAdd' | 'userEdit' | 'userPasswordReset' + | 'publicationAdd' + | 'publicationVersionAdd' + | 'publicationVersionEdit' + +export interface ModalStateMap { + publicationAdd: { type: AppExtensionsPublicationsEnumsDocumentType } + publicationVersionAdd: { publication: Publication; prevUUID?: string } + publicationVersionEdit: { publication: Publication; UUID: string } +} diff --git a/src/components/Modules/ModuleVersionTable/ModuleVersionTable.tsx b/src/components/Modules/ModuleVersionTable/ModuleVersionTable.tsx deleted file mode 100644 index 1d3fdc5c..00000000 --- a/src/components/Modules/ModuleVersionTable/ModuleVersionTable.tsx +++ /dev/null @@ -1,98 +0,0 @@ -import { Button } from '@pzh-ui/components' -import { Check, FileWord, Xmark } from '@pzh-ui/icons' - -interface ModuleVersion { - version: number - status: string - type: string - purpose: string - uploadDate?: string - isPending?: boolean -} - -interface ModuleVersionTableProps { - versions: ModuleVersion[] -} - -const ModuleVersionTable = ({ versions }: ModuleVersionTableProps) => ( - - - - - - - - - - - - {versions.map( - ({ version, status, type, purpose, uploadDate, isPending }) => ( - - - - - - - - ) - )} - -
VersieGebaseerd op ModulestatusType besluitDoelActie
{version}{status}{type}{purpose} -
- {uploadDate ? ( - `Levering succesvol geüpload op ${uploadDate}` - ) : isPending ? ( - <> - - -
-
- - ) : ( - <> - - - - )} -
-
-) - -export default ModuleVersionTable diff --git a/src/components/Modules/ModuleVersionTable/index.ts b/src/components/Modules/ModuleVersionTable/index.ts deleted file mode 100644 index d2cba5c7..00000000 --- a/src/components/Modules/ModuleVersionTable/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { default } from './ModuleVersionTable' diff --git a/src/components/Publications/Publication/Publication.tsx b/src/components/Publications/Publication/Publication.tsx index 908ffce5..b7ab4c02 100644 --- a/src/components/Publications/Publication/Publication.tsx +++ b/src/components/Publications/Publication/Publication.tsx @@ -1,22 +1,40 @@ import { Button, Heading } from '@pzh-ui/components' import { Plus } from '@pzh-ui/icons' -import { useMemo } from 'react' +import { useParams } from 'react-router-dom' -import { usePublicationsGet } from '@/api/fetchers' -import { DocumentType } from '@/api/fetchers.schemas' -import ModuleVersionTable from '@/components/Modules/ModuleVersionTable' +import { + usePublicationsGet, + usePublicationsPublicationUuidBillsGet, +} from '@/api/fetchers' +import { AppExtensionsPublicationsEnumsDocumentType } from '@/api/fetchers.schemas' +import { LoaderSpinner } from '@/components/Loader' import useModalStore from '@/store/modalStore' +import PublicationVersions from '../PublicationVersions' + interface PublicationProps { - type: DocumentType + type: AppExtensionsPublicationsEnumsDocumentType } const Publication = ({ type }: PublicationProps) => { + const { moduleId } = useParams() const setActiveModal = useModalStore(state => state.setActiveModal) - const { data } = usePublicationsGet({ document_type: type }) + const { data: publication, isPending } = usePublicationsGet( + { document_type: type, module_ID: parseInt(moduleId!) }, + { query: { enabled: !!moduleId, select: data => data.results?.[0] } } + ) - const isEmpty = useMemo(() => !data?.results.length, [data]) + const { data: latest } = usePublicationsPublicationUuidBillsGet( + publication?.UUID || '', + undefined, + { + query: { + enabled: !!publication?.UUID, + select: data => data.results?.slice(-1)[0], + }, + } + ) return (
@@ -24,41 +42,38 @@ const Publication = ({ type }: PublicationProps) => { {type} - {!isEmpty && ( - - )} - - {isEmpty ? ( - + {isPending ? ( + ) : ( - + <> + {!!publication && ( + + )} + + {!!!publication ? ( + + ) : ( + + )} + )}
) diff --git a/src/components/Publications/PublicationVersionForm/PublicationVersionForm.tsx b/src/components/Publications/PublicationVersionForm/PublicationVersionForm.tsx new file mode 100644 index 00000000..72e2b29f --- /dev/null +++ b/src/components/Publications/PublicationVersionForm/PublicationVersionForm.tsx @@ -0,0 +1,219 @@ +import { + Button, + Divider, + FormikDate, + FormikInput, + FormikRadioGroup, + FormikSelect, + FormikTextArea, + Text, + formatDate, +} from '@pzh-ui/components' +import { Form, Formik, FormikConfig, FormikValues } from 'formik' +import { useParams } from 'react-router-dom' + +import { useModulesModuleIdStatusGet } from '@/api/fetchers' +import { + Accordion, + AccordionContent, + AccordionItem, + AccordionTrigger, +} from '@/components/Accordion' +import useModalStore from '@/store/modalStore' + +interface PublicationVersionFormProps { + submitLabel: string + isEdit?: boolean +} + +const PublicationVersionForm = ({ + submitLabel, + isEdit, + ...rest +}: PublicationVersionFormProps & FormikConfig) => { + const { moduleId } = useParams() + + const setActiveModal = useModalStore(state => state.setActiveModal) + + const { data: statusOptions } = useModulesModuleIdStatusGet( + parseInt(moduleId!), + { + query: { + enabled: !!moduleId, + select: data => + data + .filter(status => status.Status !== 'Niet-Actief') + .map(status => ({ + label: `${status.Status} (${formatDate( + new Date(status.Created_Date + 'Z'), + 'dd-MM-yyyy' + )})`, + value: status.ID, + })), + }, + } + ) + + return ( + +
+
+ + +
+ + +
+ +
+ Artikelen + +
+ + +
+ + + + + +
+
+ +
+ + +
+ +
+ ) +} + +const Articles = () => ( + + + + Artikel I - Genomen besluit ( wat het bestuursorgaan besluit + vast te stellen of te wijzigen ) + + + + + + + + Artikel II - Wijzigingen ( opsomming van gewijzigde artikelen ) + + + + + + + + Artikel III - Inwerkingtreding ( datum waarop het + wijzigingsbesluit geldig is ) + + + + + + +) + +export default PublicationVersionForm diff --git a/src/components/Publications/PublicationVersionForm/index.ts b/src/components/Publications/PublicationVersionForm/index.ts new file mode 100644 index 00000000..73bbe06e --- /dev/null +++ b/src/components/Publications/PublicationVersionForm/index.ts @@ -0,0 +1 @@ +export { default } from './PublicationVersionForm' diff --git a/src/components/Publications/PublicationVersions/PublicationVersions.tsx b/src/components/Publications/PublicationVersions/PublicationVersions.tsx new file mode 100644 index 00000000..99853610 --- /dev/null +++ b/src/components/Publications/PublicationVersions/PublicationVersions.tsx @@ -0,0 +1,145 @@ +import { Button } from '@pzh-ui/components' +import { FileWord } from '@pzh-ui/icons' +import { useQuery } from '@tanstack/react-query' +import { useParams } from 'react-router-dom' + +import { + useModulesModuleIdStatusGet, + usePublicationsPublicationUuidBillsGet, +} from '@/api/fetchers' +import { Publication, PublicationBillShort } from '@/api/fetchers.schemas' +import useModalStore from '@/store/modalStore' +import downloadFile from '@/utils/downloadFile' +import { toastNotification } from '@/utils/toastNotification' + +interface PublicationVersionsProps { + publication: Publication +} + +const PublicationVersions = ({ publication }: PublicationVersionsProps) => { + const { moduleId } = useParams() + + const { data } = usePublicationsPublicationUuidBillsGet( + publication!.UUID, + undefined, + { + query: { + enabled: !!publication, + }, + } + ) + + const { data: statusOptions } = useModulesModuleIdStatusGet( + parseInt(moduleId!), + { + query: { + enabled: !!moduleId, + select: data => + data.map(status => ({ + label: status.Status, + value: status.ID, + })), + }, + } + ) + + return ( + + + + + + + + + + + + {data?.results.map(bill => { + const status = statusOptions?.find( + option => option.value === bill.Module_Status_ID + ) + + return ( + + ) + })} + +
VersieGebaseerd op ModulestatusType besluitDoelActie
+ ) +} + +const VersionRow = ({ + publication, + Version_ID, + Procedure_Type, + Is_Official, + status, + UUID, + Module_Status_ID, +}: PublicationBillShort & { publication: Publication; status?: string }) => { + const { moduleId } = useParams() + + const setActiveModal = useModalStore(state => state.setActiveModal) + + const downloadDiff = async ({ + moduleId, + Module_Status_ID, + }: { + moduleId?: string + Module_Status_ID: number + }) => { + toastNotification('downloadStarted') + + return downloadFile( + `modules/${moduleId}/diff?output_format=doc&status_id=${Module_Status_ID}` + ) + } + + const { isFetching, refetch: download } = useQuery({ + queryKey: ['downloadDiff', moduleId, Module_Status_ID, UUID], + queryFn: () => downloadDiff({ moduleId, Module_Status_ID }), + enabled: false, + }) + + return ( + + {Version_ID} + {status} + {Procedure_Type} + {Is_Official ? 'Officiële' : 'Interne'} publicatie + +
+ +
+ + + ) +} + +export default PublicationVersions diff --git a/src/components/Publications/PublicationVersions/index.ts b/src/components/Publications/PublicationVersions/index.ts new file mode 100644 index 00000000..fff16603 --- /dev/null +++ b/src/components/Publications/PublicationVersions/index.ts @@ -0,0 +1 @@ +export { default } from './PublicationVersions' diff --git a/src/config/notifications.ts b/src/config/notifications.ts index ffb96c02..0e1b23d3 100644 --- a/src/config/notifications.ts +++ b/src/config/notifications.ts @@ -20,6 +20,7 @@ export type ToastType = | 'userActivated' | 'userDeactivated' | 'userPasswordGenerated' + | 'downloadStarted' type MessageType = 'default' | 'success' | 'error' | 'warning' | 'info' @@ -108,4 +109,8 @@ export const notifications: Record< message: 'Het nieuwe wachtwoord voor de gebruiker is opgeslagen', type: 'success', }, + downloadStarted: { + message: 'De download wordt gegeneerd, dit kan even duren', + type: 'info', + }, } diff --git a/src/pages/protected/Modules/ModuleDetail/ModuleDetail.tsx b/src/pages/protected/Modules/ModuleDetail/ModuleDetail.tsx index 72823129..06dab5fb 100644 --- a/src/pages/protected/Modules/ModuleDetail/ModuleDetail.tsx +++ b/src/pages/protected/Modules/ModuleDetail/ModuleDetail.tsx @@ -11,9 +11,13 @@ import { Text, } from '@pzh-ui/components' import classNames from 'classnames' -import { useState } from 'react' +import { Fragment, useState } from 'react' -import { DocumentType, Module, ModuleObjectShort } from '@/api/fetchers.schemas' +import { + AppExtensionsPublicationsEnumsDocumentType, + Module, + ModuleObjectShort, +} from '@/api/fetchers.schemas' import Avatar from '@/components/Avatar' import { LoaderContent } from '@/components/Loader' import { @@ -24,7 +28,11 @@ import { ModuleLockModal, ModuleObjectDeleteConfirmationModal, } from '@/components/Modals/ModuleModals' -import ModuleDecisionModal from '@/components/Modals/ModuleModals/ModuleDecisionModal' +import { + PublicationAddModal, + PublicationVersionAddModal, + PublicationVersionEditModal, +} from '@/components/Modals/PublicationModals' import ModuleCompleteCard from '@/components/Modules/ModuleCompleteCard' import ModuleInactiveCard from '@/components/Modules/ModuleInactiveCard' import ModuleItemList from '@/components/Modules/ModuleItemList' @@ -238,7 +246,9 @@ const TabObjects = () => { } const TabDecisions = () => { - const documentTypes = Object.keys(DocumentType) as Array + const documentTypes = Object.keys( + AppExtensionsPublicationsEnumsDocumentType + ) as Array return ( <> @@ -254,89 +264,19 @@ const TabDecisions = () => { {documentTypes.map((type, index) => ( - <> + {index + 1 !== documentTypes.length && ( )} - + ))} - - {/*
- - Visie - - - - - -
- - - -
- - Programma - - - - - -
- - - -
- - Verordening - - -
*/} - + + + + ) } diff --git a/src/store/modalStore.ts b/src/store/modalStore.ts index 6bf248b0..bcab5784 100644 --- a/src/store/modalStore.ts +++ b/src/store/modalStore.ts @@ -1,17 +1,40 @@ import { create } from 'zustand' -import { ModalType } from '@/components/Modals/types' +import { ModalStateMap, ModalType } from '@/components/Modals/types' interface ModalState { /** Active modal id */ activeModal: ModalType | null + /** State of modals */ + modalStates: Partial> /** Set active modal id */ - setActiveModal: (id: ModalType | null) => void + setActiveModal: ( + id: ModalType | null, + state?: Partial + ) => void } const useModalStore = create(set => ({ activeModal: null, - setActiveModal: activeModal => set(state => ({ ...state, activeModal })), + modalStates: {}, + setActiveModal: (activeModal, modalState) => + set(state => ({ + ...state, + activeModal, + modalStates: { + ...state.modalStates, + ...(activeModal !== null + ? { + [activeModal]: state.modalStates[activeModal] + ? { + ...state.modalStates[activeModal], + ...modalState, + } + : modalState, + } + : {}), + }, + })), })) export default useModalStore diff --git a/src/utils/downloadFile.ts b/src/utils/downloadFile.ts new file mode 100644 index 00000000..833f2909 --- /dev/null +++ b/src/utils/downloadFile.ts @@ -0,0 +1,40 @@ +import { getAccessToken } from '@/api/instance' + +import getApiUrl from './getApiUrl' + +const downloadFile = async (path: string) => { + try { + const response = await fetch(`${getApiUrl()}/${path}`, { + method: 'GET', + headers: { + Authorization: `Bearer ${getAccessToken()}`, + }, + }) + + if (!response.ok) { + throw new Error(`HTTP error! status: ${response.status}`) + } + + const blob = await response.blob() + const contentDisposition = response.headers.get('content-disposition') + let fileName = 'downloaded_file' + if (contentDisposition) { + fileName = contentDisposition.split('=')[1] + } + + const url = URL.createObjectURL(blob) + const link = document.createElement('a') + link.href = url + link.setAttribute('download', fileName) + document.body.appendChild(link) + link.click() + + // Clean up + link.parentNode?.removeChild(link) + URL.revokeObjectURL(url) + } catch (error) { + console.error(`Error fetching data: ${error}`) + } +} + +export default downloadFile diff --git a/yarn.lock b/yarn.lock index 0d41c2ab..36e339a3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2479,13 +2479,13 @@ __metadata: languageName: node linkType: hard -"@pzh-ui/components@npm:^0.0.461": - version: 0.0.461 - resolution: "@pzh-ui/components@npm:0.0.461" +"@pzh-ui/components@npm:^0.0.465": + version: 0.0.465 + resolution: "@pzh-ui/components@npm:0.0.465" dependencies: "@floating-ui/react": "npm:^0.24.8" "@headlessui/react": "npm:^1.5.0" - "@pzh-ui/icons": "npm:^0.0.48" + "@pzh-ui/icons": "npm:^0.0.50" "@react-aria/utils": "npm:^3.19.0" "@react-hookz/web": "npm:^23.1.0" "@react-types/shared": "npm:^3.19.0" @@ -2531,7 +2531,7 @@ __metadata: react-stately: "npm:^3.18.0" react-table: "npm:^7.8.0" react-toastify: "npm:^9.1.2" - checksum: f69dc964ed3cc03cf9e7029286d796af24b0832da7a1e6975665f0ceef87339b1fb4cf049a473610c528612884a685855df604280f15eefd4e56edc01a6edb8c + checksum: c58dc32aa107819994b6240749e9871c0288a18c3d8baa30cc1714501f82a08c92481c8ce874bb2e0a5cb21055bc0041a939856c7a3cda22ff70cc7cb78e714c languageName: node linkType: hard @@ -2563,9 +2563,9 @@ __metadata: languageName: node linkType: hard -"@pzh-ui/css@npm:^0.0.79": - version: 0.0.79 - resolution: "@pzh-ui/css@npm:0.0.79" +"@pzh-ui/css@npm:^0.0.80": + version: 0.0.80 + resolution: "@pzh-ui/css@npm:0.0.80" dependencies: "@rollup/plugin-typescript": "npm:^8.3.1" "@tailwindcss/custom-forms": "npm:^0.2.1" @@ -2574,17 +2574,17 @@ __metadata: "@tailwindcss/typography": "npm:^0.5.9" react-datepicker: "npm:^4.7.0" react-toastify: "npm:^9.1.2" - checksum: 65f08cd2a33108adf63a83cbe680f6f72733385cff6608d082a7c47d93f5457cb595a15d90c8057553877737be658a21c670ca1693f96a8595c03da232b00614 + checksum: f33cfa8697ac1840659461e1bc574a74d7ce26a6194bd4c159c7256073734c5f72e20c6a19535e5d767f0997902bd632ecce8a95342aafff32177effc70a9211 languageName: node linkType: hard -"@pzh-ui/icons@npm:^0.0.48": - version: 0.0.48 - resolution: "@pzh-ui/icons@npm:0.0.48" +"@pzh-ui/icons@npm:^0.0.50": + version: 0.0.50 + resolution: "@pzh-ui/icons@npm:0.0.50" dependencies: react: "npm:^18.0.0" react-toastify: "npm:^9.1.2" - checksum: eb8892be79b09d5df82678ed8272b50973a5f93ea07158235a155044ca94db0caaf508a5001cc70e46142be6d2419dcc5540888d9230944f6cbf5690c0eb17ea + checksum: a94a31decee8c7d314e8befbd4139875700729c136704c4f49c1ccad4dc4e1f2190af5f794d98a27b7479b21fea8c7b7b0fda1bd319d1374b34e6defc2f119de languageName: node linkType: hard @@ -12375,10 +12375,10 @@ __metadata: "@axe-core/react": "npm:^4.8.2" "@faker-js/faker": "npm:^8.3.1" "@headlessui/react": "npm:^1.7.17" - "@pzh-ui/components": "npm:^0.0.461" + "@pzh-ui/components": "npm:^0.0.465" "@pzh-ui/config": "npm:^0.0.56" - "@pzh-ui/css": "npm:^0.0.79" - "@pzh-ui/icons": "npm:^0.0.48" + "@pzh-ui/css": "npm:^0.0.80" + "@pzh-ui/icons": "npm:^0.0.50" "@react-hookz/web": "npm:^24.0.2" "@tanstack/react-query": "npm:^5.14.2" "@testing-library/dom": "npm:^9.3.3" From cfd7b17531e55e862185c0b32d9b65b220ebeff8 Mon Sep 17 00:00:00 2001 From: Stef Winterswijk Date: Tue, 13 Feb 2024 14:56:47 +0100 Subject: [PATCH 4/4] Update Word export state --- .../PublicationVersions.tsx | 28 ++++++++++++------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/src/components/Publications/PublicationVersions/PublicationVersions.tsx b/src/components/Publications/PublicationVersions/PublicationVersions.tsx index 99853610..bf48f2cf 100644 --- a/src/components/Publications/PublicationVersions/PublicationVersions.tsx +++ b/src/components/Publications/PublicationVersions/PublicationVersions.tsx @@ -1,4 +1,4 @@ -import { Button } from '@pzh-ui/components' +import { Button, Tooltip } from '@pzh-ui/components' import { FileWord } from '@pzh-ui/icons' import { useQuery } from '@tanstack/react-query' import { useParams } from 'react-router-dom' @@ -127,15 +127,23 @@ const VersionRow = ({ }> Bewerken -