From 0f09a683909095c9fbbd4341131a5ac403e41eaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gunnlaugur=20Gu=C3=B0mundsson?= Date: Tue, 17 Sep 2024 10:43:29 +0000 Subject: [PATCH] add new model in graphql for general mandate --- .../domains/auth/src/lib/models/delegation.model.ts | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/libs/api/domains/auth/src/lib/models/delegation.model.ts b/libs/api/domains/auth/src/lib/models/delegation.model.ts index 783d5212889a..af3cf9cc5cd4 100644 --- a/libs/api/domains/auth/src/lib/models/delegation.model.ts +++ b/libs/api/domains/auth/src/lib/models/delegation.model.ts @@ -25,7 +25,6 @@ const exhaustiveCheck = (param: never) => { resolveType(delegation: Delegation) { switch (delegation.type) { case AuthDelegationType.LegalGuardian: - case AuthDelegationType.GeneralMandate: return LegalGuardianDelegation case AuthDelegationType.ProcurationHolder: return ProcuringHolderDelegation @@ -33,6 +32,8 @@ const exhaustiveCheck = (param: never) => { return PersonalRepresentativeDelegation case AuthDelegationType.Custom: return CustomDelegation + case AuthDelegationType.GeneralMandate: + return GeneralMandate case AuthDelegationType.LegalRepresentative: return LegalRepresentativeDelegation default: @@ -72,6 +73,14 @@ export class ProcuringHolderDelegation extends Delegation {} }) export class PersonalRepresentativeDelegation extends Delegation {} +@ObjectType('AuthGeneralMandate', { + implements: Delegation, +}) +export class GeneralMandate extends Delegation { + @Field(() => Date, { nullable: true }) + validTo?: Date +} + @ObjectType('AuthCustomDelegation', { implements: Delegation, })