From e7b9c5a4727d99fb5f46ffea2f30bdd657f8adc6 Mon Sep 17 00:00:00 2001 From: juni-haukur <158475136+juni-haukur@users.noreply.github.com> Date: Wed, 12 Jun 2024 14:12:55 +0000 Subject: [PATCH] fix(driving-license): update driving-license payment code for BE license (#15200) Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com> --- .../driving-license/src/lib/drivingLicenseTemplate.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/libs/application/templates/driving-license/src/lib/drivingLicenseTemplate.ts b/libs/application/templates/driving-license/src/lib/drivingLicenseTemplate.ts index 401e08de8b9b..309a5407913b 100644 --- a/libs/application/templates/driving-license/src/lib/drivingLicenseTemplate.ts +++ b/libs/application/templates/driving-license/src/lib/drivingLicenseTemplate.ts @@ -43,13 +43,18 @@ import { GlassesCheckApi, SyslumadurPaymentCatalogApi } from '../dataProviders' import { buildPaymentState } from '@island.is/application/utils' const getCodes = (application: Application) => { - const applicationFor = getValueViaPath<'B-full' | 'B-temp'>( + const applicationFor = getValueViaPath<'B-full' | 'B-temp' | 'BE'>( application.answers, 'applicationFor', 'B-full', ) - const chargeItemCode = applicationFor === 'B-full' ? 'AY110' : 'AY114' + const chargeItemCode = + applicationFor === 'B-full' + ? 'AY110' + : applicationFor === BE + ? 'AY115' + : 'AY114' if (!chargeItemCode) { throw new Error('No selected charge item code')