diff --git a/libs/application/template-api-modules/src/lib/modules/templates/directorate-of-immigration/citizenship/citizenship.service.ts b/libs/application/template-api-modules/src/lib/modules/templates/directorate-of-immigration/citizenship/citizenship.service.ts index 8a7996ac0047..089b595ffc9b 100644 --- a/libs/application/template-api-modules/src/lib/modules/templates/directorate-of-immigration/citizenship/citizenship.service.ts +++ b/libs/application/template-api-modules/src/lib/modules/templates/directorate-of-immigration/citizenship/citizenship.service.ts @@ -306,8 +306,11 @@ export class CitizenshipService extends BaseTemplateApiService { } }) || [], isFormerIcelandicCitizen: answers.formerIcelander === YES, - givenName: individual?.givenName, - familyName: individual?.familyName, + givenName: + individual?.givenName || + individual?.fullName.split(' ').slice(0, -1).join(' '), //if given name is not available then remove last name and return the rest of the name as the given name + familyName: + individual?.familyName || individual?.fullName.split(' ').pop(), fullName: individual?.fullName, address: individual?.address?.streetAddress, postalCode: individual?.address?.postalCode, diff --git a/libs/application/templates/directorate-of-immigration/citizenship/src/forms/CitizenshipForm/PersonalSection/UserInformationSubSection.ts b/libs/application/templates/directorate-of-immigration/citizenship/src/forms/CitizenshipForm/PersonalSection/UserInformationSubSection.ts index e092a4a2525d..5df130ebc371 100644 --- a/libs/application/templates/directorate-of-immigration/citizenship/src/forms/CitizenshipForm/PersonalSection/UserInformationSubSection.ts +++ b/libs/application/templates/directorate-of-immigration/citizenship/src/forms/CitizenshipForm/PersonalSection/UserInformationSubSection.ts @@ -58,7 +58,7 @@ export const UserInformationSubSection = buildSubSection({ undefined, ) as NationalRegistryIndividual | undefined - return `${individual?.givenName} ${individual?.familyName}` + return individual?.fullName }, }), buildTextField({ diff --git a/libs/application/templates/directorate-of-immigration/citizenship/src/lib/CitizenshipTemplate.ts b/libs/application/templates/directorate-of-immigration/citizenship/src/lib/CitizenshipTemplate.ts index 936f02db4cc2..f4473ae7f15d 100644 --- a/libs/application/templates/directorate-of-immigration/citizenship/src/lib/CitizenshipTemplate.ts +++ b/libs/application/templates/directorate-of-immigration/citizenship/src/lib/CitizenshipTemplate.ts @@ -120,7 +120,7 @@ const template: ApplicationTemplate< }, ], }, - lifecycle: pruneAfterDays(1), + lifecycle: pruneAfterDays(30), onExit: defineTemplateApi({ action: ApiActions.validateApplication, }),