Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/PC108-114/rol #146

Open
wants to merge 2 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion appinfo/routes.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
['name' => 'zaken#page', 'url' => '/zaken', 'verb' => 'GET'],
['name' => 'zaken#page', 'postfix' => 'details', 'url' => '/zaken/{id}', 'verb' => 'GET'],
['name' => 'rollen#page', 'url' => '/rollen', 'verb' => 'GET'],
['name' => 'rollen#page', 'postfix' => 'details', 'url' => '/rollen/{id}', 'verb' => 'GET'],
['name' => 'statussen#page', 'url' => '/statussen', 'verb' => 'GET'],
['name' => 'zaakinformatieobjecten#page', 'url' => '/zaakinformatieobjecten', 'verb' => 'GET'],
['name' => 'zaakTypen#page','url' => '/zaaktypen', 'verb' => 'GET'],
Expand All @@ -73,7 +74,7 @@
['name' => 'objects#create', 'url' => 'api/objects/{objectType}', 'verb' => 'POST'],
['name' => 'objects#show', 'url' => 'api/objects/{objectType}/{id}', 'verb' => 'GET'],
['name' => 'objects#update', 'url' => 'api/objects/{objectType}/{id}', 'verb' => 'PUT'],
['name' => 'objects#delete', 'url' => 'api/objects/{objectType}/{id}', 'verb' => 'DELETE'],
['name' => 'objects#destroy', 'url' => 'api/objects/{objectType}/{id}', 'verb' => 'DELETE'],
['name' => 'objects#getAuditTrail', 'url' => 'api/objects/{objectType}/{id}/audit', 'verb' => 'GET'],
['name' => 'objects#getRelations', 'url' => 'api/objects/{objectType}/{id}/relations', 'verb' => 'GET'],
['name' => 'objects#getUses', 'url' => 'api/objects/{objectType}/{id}/uses', 'verb' => 'GET']
Expand Down
8 changes: 4 additions & 4 deletions src/entities/rol/rol.mock.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@ export const mockRolData = (): TRol[] => [
id: '1',
uuid: '15551d6f-44e3-43f3-a9d2-59e583c91eb0',
omschrijving: 'Zaak 3',
omschrijvingGeneriek: 'Zaak 3',
omschrijvingGeneriek: 'adviseur',
url: 'http://example.com',
zaak: 'ZAAK-2024-3',
betrokkene: 'string',
betrokkeneType: 'string',
betrokkeneType: 'natuurlijk_persoon',
afwijkendeNaamBetrokkene: '0a3a0ffb-dc03-4aae-b207-0ed1502e60da',
roltype: 'gearchiveerd_procestermijn_onbekend',
roltoelichting: '2019-08-24',
registratiedatum: 'string',
indicatieMachtiging: '2019-08-24',
registratiedatum: '2019-08-24',
indicatieMachtiging: 'gemachtigde',
contactpersoonRol: {
emailadres: '[email protected]',
functie: 'something',
Expand Down
89 changes: 49 additions & 40 deletions src/entities/rol/rol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,23 @@ import { TRol } from './rol.types'
export class Rol implements TRol {

public id: string
public uuid: string
public omschrijving: string
public omschrijvingGeneriek: string
public url: string
public uuid: string
public zaak: string
public betrokkene: string
public betrokkeneType: string
public afwijkendeNaamBetrokkene: string
public betrokkene?: string
public betrokkeneType: 'natuurlijk_persoon' | 'niet_natuurlijk_persoon' | 'vestiging' | 'organisatorische_eenheid' | 'medewerker'
public afwijkendeNaamBetrokkene?: string
public roltype: string
public omschrijving: string
public omschrijvingGeneriek: 'adviseur' | 'behandelaar' | 'belanghebbende' | 'beslisser' | 'initiator' | 'klantcontacter' | 'zaakcoordinator' | 'mede_initiator'
public roltoelichting: string
public registratiedatum: string
public indicatieMachtiging: string
public contactpersoonRol: {
public indicatieMachtiging?: 'gemachtigde' | 'machtiginggever'
public contactpersoonRol?: {
emailadres?: string
functie?: string
telefoonnummer?: string
naam?: string
naam: string
}

public statussen: string[]
Expand All @@ -30,7 +30,7 @@ export class Rol implements TRol {
statussen?: string
}

public betrokkeneIdentificatie: {
public betrokkeneIdentificatie?: {
identificatie?: string
achternaam?: string
voorletters?: string
Expand All @@ -41,55 +41,64 @@ export class Rol implements TRol {
this.id = source.id || null
this.uuid = source.uuid || ''
this.omschrijving = source.omschrijving || ''
this.omschrijvingGeneriek = source.omschrijvingGeneriek || ''
this.omschrijvingGeneriek = source.omschrijvingGeneriek || 'adviseur'
this.url = source.url || ''
this.zaak = source.zaak || ''
this.betrokkene = source.betrokkene || ''
this.betrokkeneType = source.betrokkeneType || ''
this.betrokkeneType = source.betrokkeneType || 'natuurlijk_persoon'
this.afwijkendeNaamBetrokkene = source.afwijkendeNaamBetrokkene || ''
this.roltype = source.roltype || ''
this.roltoelichting = source.roltoelichting || ''
this.registratiedatum = source.registratiedatum || ''
this.indicatieMachtiging = source.indicatieMachtiging || ''
this.contactpersoonRol = source.contactpersoonRol || {}
this.indicatieMachtiging = source.indicatieMachtiging || 'gemachtigde'
this.contactpersoonRol = source.contactpersoonRol || null
this.statussen = source.statussen || []
this._expand = source._expand || {}
this.betrokkeneIdentificatie = source.betrokkeneIdentificatie || {}
}

public validate(): SafeParseReturnType<TRol, unknown> {
const schema = z.object({
id: z.string().optional(),
uuid: z.string().optional(),
omschrijving: z.string().min(1),
omschrijvingGeneriek: z.string(),
url: z.string().url(),
zaak: z.string(),
betrokkene: z.string(),
betrokkeneType: z.string(),
afwijkendeNaamBetrokkene: z.string(),
roltype: z.string(),
roltoelichting: z.string(),
registratiedatum: z.string(),
indicatieMachtiging: z.string(),
id: z.string(),
url: z.string().url().min(1).max(1000),
uuid: z.string().uuid(),
zaak: z.string().url().min(1).max(1000),
betrokkene: z.string().url().max(1000).optional(),
betrokkeneType: z.enum(['natuurlijk_persoon', 'niet_natuurlijk_persoon', 'vestiging', 'organisatorische_eenheid', 'medewerker']),
afwijkendeNaamBetrokkene: z.string().max(625).optional(),
roltype: z.string().url().max(1000),
omschrijving: z.string(),
omschrijvingGeneriek: z.enum(['adviseur', 'behandelaar', 'belanghebbende', 'beslisser', 'initiator', 'klantcontacter', 'zaakcoordinator', 'mede_initiator']),
roltoelichting: z.string().max(1000),
registratiedatum: z.string().datetime(),
indicatieMachtiging: z.enum(['gemachtigde', 'machtiginggever', '']).optional(),
contactpersoonRol: z.object({
emailadres: z.string(),
functie: z.string(),
telefoonnummer: z.string(),
naam: z.string(),
emailadres: z.string().max(254).optional(),
functie: z.string().max(50).optional(),
telefoonnummer: z.string().max(20).optional(),
naam: z.string().max(40),
}).optional(),
statussen: z.array(z.string().url().min(1).max(1000)).superRefine((val, ctx) => {
// statussen is supposed to be a unique array according to docs
// https://vng-realisatie.github.io/gemma-zaken/standaard/zaken/redoc-1.5.1#tag/rollen/operation/rol_retrieve
if (val.length !== new Set(val).size) {
ctx.addIssue({
code: z.ZodIssueCode.custom,
message: 'No duplicates allowed.',
})
}
}),
statussen: z.string().array(),
_expand: z.object({
zaak: z.string(),
roltype: z.string(),
statussen: z.string(),
zaak: z.record(z.any()),
roltype: z.record(z.any()),
statussen: z.record(z.any()),
}),
betrokkeneIdentificatie: z.object({
identificatie: z.string(),
achternaam: z.string(),
voorletters: z.string(),
voorvoegselAchternaam: z.string(),
}),
identificatie: z.string().optional(),
achternaam: z.string().optional(),
voorletters: z.string().optional(),
voorvoegselAchternaam: z.string().optional(),
}).optional(),
})

return schema.safeParse(this)
Expand Down
44 changes: 22 additions & 22 deletions src/entities/rol/rol.types.ts
Original file line number Diff line number Diff line change
@@ -1,33 +1,33 @@
export type TRol = {
id?: string;
uuid: string;
omschrijving: string;
omschrijvingGeneriek: string;
id: string;
url: string;
zaak: string; // zaak id
betrokkene: string;
betrokkeneType: string;
afwijkendeNaamBetrokkene: string;
uuid: string;
zaak: string;
betrokkene?: string;
betrokkeneType: 'natuurlijk_persoon' | 'niet_natuurlijk_persoon' | 'vestiging' | 'organisatorische_eenheid' | 'medewerker';
afwijkendeNaamBetrokkene?: string;
roltype: string;
omschrijving: string;
omschrijvingGeneriek: 'adviseur' | 'behandelaar' | 'belanghebbende' | 'beslisser' | 'initiator' | 'klantcontacter' | 'zaakcoordinator' | 'mede_initiator';
roltoelichting: string;
registratiedatum: string;
indicatieMachtiging: string;
contactpersoonRol: {
emailadres?: string
functie?: string
telefoonnummer?: string
naam?: string
indicatieMachtiging?: 'gemachtigde' | 'machtiginggever' | '';
contactpersoonRol?: {
emailadres?: string;
functie?: string;
telefoonnummer?: string;
naam: string;
};
statussen: string[];
_expand: {
zaak?: string
roltype?: string
statussen?: string
zaak?: string;
roltype?: string;
statussen?: string;
};
betrokkeneIdentificatie: {
identificatie?: string
achternaam?: string
voorletters?: string
voorvoegselAchternaam?: string
betrokkeneIdentificatie?: {
identificatie?: string;
achternaam?: string;
voorletters?: string;
voorvoegselAchternaam?: string;
};
}
11 changes: 7 additions & 4 deletions src/modals/Modals.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { navigationStore } from '../store/store.js'
import { navigationStore, rolStore } from '../store/store.js'
</script>

<template>
Expand Down Expand Up @@ -30,7 +30,8 @@ import { navigationStore } from '../store/store.js'
<EditTaak v-if="navigationStore.modal === 'editTaak'" />
<ViewTaakAuditTrail v-if="navigationStore.modal === 'viewTaakAuditTrail'" />
<!-- rollen -->
<EditRol />
<RolForm v-if="navigationStore.modal === 'rolForm'" :zaak-id="rolStore.zaakId" :redirect="rolStore.extraData?.redirect" />
<DeleteRol v-if="navigationStore.modal === 'deleteRol'" />
<!-- medewerkers -->
<EditMedewerker v-if="navigationStore.modal === 'editMedewerker'" />
<!-- resultaat -->
Expand All @@ -56,7 +57,6 @@ import EditBericht from './berichten/EditBericht.vue'
import ViewBerichtAuditTrail from './berichten/ViewBerichtAuditTrail.vue'
import EditTaak from './taken/EditTaak.vue'
import ViewTaakAuditTrail from './taken/ViewTaakAuditTrail.vue'
import EditRol from './rollen/EditRol.vue'
import ViewZaakAuditTrail from './zaken/ViewZaakAuditTrail.vue'
import ViewKlant from './klanten/ViewKlant.vue'
import DeleteContactMoment from './contactMomenten/DeleteContactMoment.vue'
Expand All @@ -72,6 +72,8 @@ import DeleteBesluit from './besluiten/DeleteBesluit.vue'
import ViewContactMoment from './contactMomenten/ViewContactMoment.vue'
import DocumentForm from './documenten/DocumentForm.vue'
import DeleteDocument from './documenten/DeleteDocument.vue'
import RolForm from './rollen/RolForm.vue'
import DeleteRol from './rollen/DeleteRol.vue'

export default {
name: 'Modals',
Expand All @@ -86,7 +88,6 @@ export default {
ViewBerichtAuditTrail,
EditTaak,
ViewTaakAuditTrail,
EditRol,
ViewZaakAuditTrail,
ViewKlant,
DeleteContactMoment,
Expand All @@ -102,6 +103,8 @@ export default {
ViewContactMoment,
DocumentForm,
DeleteDocument,
RolForm,
DeleteRol,
},
}
</script>
112 changes: 0 additions & 112 deletions src/modals/rollen/AddRol.vue

This file was deleted.

Loading