Skip to content

Commit

Permalink
fix(driving-license): update driving-license payment code for BE lice…
Browse files Browse the repository at this point in the history
…nse (#15200)

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
juni-haukur and kodiakhq[bot] authored Jun 12, 2024
1 parent e9b5864 commit e7b9c5a
Showing 1 changed file with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit e7b9c5a

Please sign in to comment.