diff --git a/libs/application/templates/driving-license/src/forms/prerequisites/sectionApplicationFor.ts b/libs/application/templates/driving-license/src/forms/prerequisites/sectionApplicationFor.ts index 3fb187887287..1c4686790468 100644 --- a/libs/application/templates/driving-license/src/forms/prerequisites/sectionApplicationFor.ts +++ b/libs/application/templates/driving-license/src/forms/prerequisites/sectionApplicationFor.ts @@ -47,11 +47,16 @@ export const sectionApplicationFor = (allowBELicense = false) => if (fakeData?.useFakeData === 'yes') { currentLicense = fakeData.currentLicense ?? null categories = - fakeData.currentLicense === 'full' - ? [{ nr: 'B' }] + fakeData.currentLicense === 'temp' + ? [{ nr: 'B', validToCode: 8 }] + : fakeData.currentLicense === 'full' + ? [{ nr: 'B', validToCode: 9 }] : fakeData.currentLicense === 'BE' - ? [{ nr: 'B' }, { nr: 'BE' }] - : null + ? [ + { nr: 'B', validToCode: 9 }, + { nr: 'BE', validToCode: 9 }, + ] + : [] } let options = [ @@ -80,7 +85,10 @@ export const sectionApplicationFor = (allowBELicense = false) => !currentLicense || age < 18 || categories?.some((c) => c.nr.toUpperCase() === 'BE') || - !categories?.some((c) => c.nr.toUpperCase() === 'B'), + // validToCode === 8 is temporary license and should not be applicable for BE + !categories?.some( + (c) => c.nr.toUpperCase() === 'B' && c.validToCode !== 8, + ), }) } diff --git a/libs/application/templates/driving-license/src/lib/types.ts b/libs/application/templates/driving-license/src/lib/types.ts index 25009cc9ebba..9d6a0822279e 100644 --- a/libs/application/templates/driving-license/src/lib/types.ts +++ b/libs/application/templates/driving-license/src/lib/types.ts @@ -10,6 +10,7 @@ export type ConditionFn = (answer: FormValue) => boolean export type DrivingLicenseCategory = { nr: string + validToCode: number } export type DrivingLicense = {