diff --git a/libs/application/template-api-modules/src/lib/modules/templates/social-insurance-administration/social-insurance-administration-utils.ts b/libs/application/template-api-modules/src/lib/modules/templates/social-insurance-administration/social-insurance-administration-utils.ts index 2f2bb8266982..6432e6e7f76b 100644 --- a/libs/application/template-api-modules/src/lib/modules/templates/social-insurance-administration/social-insurance-administration-utils.ts +++ b/libs/application/template-api-modules/src/lib/modules/templates/social-insurance-administration/social-insurance-administration-utils.ts @@ -35,6 +35,12 @@ import { getApplicationExternalData as getPSApplicationExternalData, } from '@island.is/application/templates/social-insurance-administration/pension-supplement' +import { + ChildInformation, + getApplicationAnswers as getDBApplicationAnswers, + getApplicationExternalData as getDBApplicationExternalData, +} from '@island.is/application/templates/social-insurance-administration/death-benefits' + import { INCOME, getApplicationAnswers as getIPApplicationAnswers, @@ -305,6 +311,77 @@ export const transformApplicationToPensionSupplementDTO = ( return pensionSupplementDTO } +export const transformApplicationToDeathBenefitsDTO = ( + application: Application, + uploads: Attachment[], +): ApplicationDTO => { + const { + applicantPhonenumber, + comment, + bankAccountType, + bank, + iban, + swift, + bankName, + bankAddress, + currency, + paymentInfo, + personalAllowance, + personalAllowanceUsage, + spouseAllowance, + spouseAllowanceUsage, + taxLevel, + deceasedSpouseNationalId, + } = getDBApplicationAnswers(application.answers) + const { bankInfo, userProfileEmail, children } = getDBApplicationExternalData( + application.externalData, + ) + + const deathBenefitsDTO: ApplicationDTO = { + deceasedNationalId: deceasedSpouseNationalId, + childrenNationalIds: getChildrenNationalIds(children), + spouseTaxCardUsage: { + usecard: spouseAllowance === YES, + ratio: Number(spouseAllowanceUsage), + }, + applicantInfo: { + email: userProfileEmail, + phonenumber: applicantPhonenumber, + }, + period: { + year: new Date().getFullYear(), + month: new Date().getMonth() + 1, + }, + comment, + applicationId: application.id, + uploads, + ...(!shouldNotUpdateBankAccount(bankInfo, paymentInfo) && { + ...((bankAccountType === undefined || + bankAccountType === BankAccountType.ICELANDIC) && { + domesticBankInfo: { + bank: formatBank(bank), + }, + }), + ...(bankAccountType === BankAccountType.FOREIGN && { + foreignBankInfo: { + iban: iban.replace(/[\s]+/g, ''), + swift: swift.replace(/[\s]+/g, ''), + foreignBankName: bankName, + foreignBankAddress: bankAddress, + foreignCurrency: currency, + }, + }), + }), + taxInfo: { + personalAllowance: YES === personalAllowance, + personalAllowanceUsage: + YES === personalAllowance ? +personalAllowanceUsage : 0, + taxLevel: +taxLevel, + }, + } + return deathBenefitsDTO +} + export const transformApplicationToIncomePlanDTO = ( application: Application, ): ApplicationDTO => { @@ -392,6 +469,10 @@ export const getMonthNumber = (monthName: string): number => { return monthNumber.getMonth() + 1 } +export const getChildrenNationalIds = ( + children: ChildInformation[], +): string[] => children.map(({ nationalId }) => nationalId) + export const getApplicationType = (application: Application): string => { const { applicationType } = getOAPApplicationAnswers(application.answers) diff --git a/libs/application/template-api-modules/src/lib/modules/templates/social-insurance-administration/social-insurance-administration.service.ts b/libs/application/template-api-modules/src/lib/modules/templates/social-insurance-administration/social-insurance-administration.service.ts index 490ff61e6a6d..aa88da28d195 100644 --- a/libs/application/template-api-modules/src/lib/modules/templates/social-insurance-administration/social-insurance-administration.service.ts +++ b/libs/application/template-api-modules/src/lib/modules/templates/social-insurance-administration/social-insurance-administration.service.ts @@ -11,6 +11,10 @@ import { isEarlyRetirement, } from '@island.is/application/templates/social-insurance-administration/old-age-pension' import { getApplicationAnswers as getPSApplicationAnswers } from '@island.is/application/templates/social-insurance-administration/pension-supplement' +import { + getApplicationAnswers as getDBApplicationAnswers, + ChildInformation, +} from '@island.is/application/templates/social-insurance-administration/death-benefits' import { Application, ApplicationTypes, @@ -35,7 +39,10 @@ import { transformApplicationToIncomePlanDTO, transformApplicationToOldAgePensionDTO, transformApplicationToPensionSupplementDTO, + transformApplicationToDeathBenefitsDTO, } from './social-insurance-administration-utils' +import { NationalRegistryClientService } from '@island.is/clients/national-registry-v2' +import * as kennitala from 'kennitala' import { sharedModuleConfig } from '../../shared' import { ConfigType } from '@nestjs/config' import { S3Service } from '@island.is/nest/aws' @@ -50,6 +57,7 @@ export class SocialInsuranceAdministrationService extends BaseTemplateApiService @Inject(sharedModuleConfig.KEY) private config: ConfigType, private readonly s3Service: S3Service, + private readonly nationalRegistryApi: NationalRegistryClientService, ) { super('SocialInsuranceAdministration') } @@ -106,6 +114,11 @@ export class SocialInsuranceAdministrationService extends BaseTemplateApiService application.answers, ).additionalAttachmentsRequired } + if (application.typeId === ApplicationTypes.DEATH_BENEFITS) { + additionalAttachmentsRequired = getDBApplicationAnswers( + application.answers, + ).additionalAttachmentsRequired + } if ( additionalAttachmentsRequired && @@ -377,6 +390,55 @@ export class SocialInsuranceAdministrationService extends BaseTemplateApiService return attachments } + private async getDBAttachments( + application: Application, + ): Promise { + const { + additionalAttachments, + expectingChildAttachments, + deathCertificateAttachments, + isExpectingChild, + } = getDBApplicationAnswers(application.answers) + + const attachments: Attachment[] = [] + + if (additionalAttachments && additionalAttachments.length > 0) { + attachments.push( + ...(await this.initAttachments( + application, + DocumentTypeEnum.OTHER, + additionalAttachments, + )), + ) + } + + if (deathCertificateAttachments && deathCertificateAttachments.length > 0) { + attachments.push( + ...(await this.initAttachments( + application, + DocumentTypeEnum.DEATH_CERTIFICATE, + deathCertificateAttachments, + )), + ) + } + + if ( + expectingChildAttachments && + expectingChildAttachments.length > 0 && + isExpectingChild === YES + ) { + attachments.push( + ...(await this.initAttachments( + application, + DocumentTypeEnum.EXPECTING_CHILD, + expectingChildAttachments, + )), + ) + } + + return attachments + } + async getPdf(key: string): Promise { const fileContent = await this.s3Service.getFileContent( { bucket: this.config.templateApi.attachmentBucket, key }, @@ -458,6 +520,22 @@ export class SocialInsuranceAdministrationService extends BaseTemplateApiService return response } + if (application.typeId === ApplicationTypes.DEATH_BENEFITS) { + const attachments = await this.getDBAttachments(application) + + const deathBenefitsDTO = transformApplicationToDeathBenefitsDTO( + application, + attachments, + ) + + const response = await this.siaClientService.sendApplication( + auth, + deathBenefitsDTO, + application.typeId.toLowerCase(), + ) + return response + } + if (application.typeId === ApplicationTypes.INCOME_PLAN) { const incomePlanDTO = transformApplicationToIncomePlanDTO(application) @@ -466,7 +544,6 @@ export class SocialInsuranceAdministrationService extends BaseTemplateApiService incomePlanDTO, application.typeId.toLowerCase(), ) - return response } } @@ -525,6 +602,47 @@ export class SocialInsuranceAdministrationService extends BaseTemplateApiService return await this.siaClientService.getCurrencies(auth) } + async getChildrenWithSameDomicile({ auth }: TemplateApiModuleActionProps) { + const cohabitants = await this.nationalRegistryApi.getCohabitants( + auth.nationalId, + ) + + const children: Array = await Promise.all( + cohabitants.map(async (cohabitantsNationalId) => { + if ( + cohabitantsNationalId !== auth.nationalId && + kennitala.info(cohabitantsNationalId).age < 18 + ) { + const child = await this.nationalRegistryApi.getIndividual( + cohabitantsNationalId, + ) + + if (!child) { + return null + } + + return ( + child && { + nationalId: child.nationalId, + fullName: child.name, + } + ) + } else { + return null + } + }), + ) + + const filteredChildren = children.filter( + (child): child is ChildInformation => child != null, + ) + return filteredChildren + } + + async getSpousalInfo({ auth }: TemplateApiModuleActionProps) { + return await this.siaClientService.getSpousalInfo(auth) + } + async getCategorizedIncomeTypes({ auth }: TemplateApiModuleActionProps) { return await this.siaClientService.getCategorizedIncomeTypes(auth) } diff --git a/libs/application/template-loader/src/lib/templateLoaders.ts b/libs/application/template-loader/src/lib/templateLoaders.ts index 5bf5164f814c..efdb9cb6f2ff 100644 --- a/libs/application/template-loader/src/lib/templateLoaders.ts +++ b/libs/application/template-loader/src/lib/templateLoaders.ts @@ -179,6 +179,10 @@ const templates: Record Promise> = { import( '@island.is/application/templates/aosh/transfer-of-machine-ownership' ), + [ApplicationTypes.DEATH_BENEFITS]: () => + import( + '@island.is/application/templates/social-insurance-administration/death-benefits' + ), [ApplicationTypes.HOME_SUPPORT]: () => import('@island.is/application/templates/home-support'), [ApplicationTypes.CHANGE_MACHINE_SUPERVISOR]: () => diff --git a/libs/application/templates/social-insurance-administration/core/src/lib/messages.ts b/libs/application/templates/social-insurance-administration/core/src/lib/messages.ts index 826def94616e..be227650ab13 100644 --- a/libs/application/templates/social-insurance-administration/core/src/lib/messages.ts +++ b/libs/application/templates/social-insurance-administration/core/src/lib/messages.ts @@ -384,6 +384,13 @@ export const socialInsuranceAdministrationMessage: MessageDir = { defaultMessage: 'Fylgiskjöl', description: 'Attachments', }, + additionalFileDescription: { + id: 'sia.application:fileUpload.additionalFile.description', + defaultMessage: + 'Hér getur þú skilað viðbótargögnum til Tryggingastofnunar ef þú telur þörf á.', + description: + 'Below you can submit additional data to the Social Insurance Administration, if need be.', + }, attachmentButton: { id: 'sia.application:fileUpload.attachment.button', defaultMessage: 'Veldu skjal', @@ -411,13 +418,7 @@ export const socialInsuranceAdministrationMessage: MessageDir = { defaultMessage: 'Fylgiskjöl viðbótargögn', description: 'Additional attachments', }, - additionalFileDescription: { - id: 'sia.application:fileUpload.additionalFile.description', - defaultMessage: - 'Hér getur þú skilað viðbótargögnum til Tryggingastofnunar ef þú telur þörf á.', - description: - 'Below you can submit additional data to the Social Insurance Administration, if need be.', - }, + additionalDocumentsEditSubmit: { id: 'sia.application:fileUpload.additionalDocumentsEditSubmit', defaultMessage: 'Senda inn', diff --git a/libs/application/templates/social-insurance-administration/death-benefits/.babelrc b/libs/application/templates/social-insurance-administration/death-benefits/.babelrc new file mode 100644 index 000000000000..1ea870ead410 --- /dev/null +++ b/libs/application/templates/social-insurance-administration/death-benefits/.babelrc @@ -0,0 +1,12 @@ +{ + "presets": [ + [ + "@nx/react/babel", + { + "runtime": "automatic", + "useBuiltIns": "usage" + } + ] + ], + "plugins": [] +} diff --git a/libs/application/templates/social-insurance-administration/death-benefits/.eslintrc.json b/libs/application/templates/social-insurance-administration/death-benefits/.eslintrc.json new file mode 100644 index 000000000000..1ac7686355e0 --- /dev/null +++ b/libs/application/templates/social-insurance-administration/death-benefits/.eslintrc.json @@ -0,0 +1,18 @@ +{ + "extends": ["plugin:@nx/react", "../../../../../.eslintrc.json"], + "ignorePatterns": ["!**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": {} + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ] +} diff --git a/libs/application/templates/social-insurance-administration/death-benefits/README.md b/libs/application/templates/social-insurance-administration/death-benefits/README.md new file mode 100644 index 000000000000..384e8d273db6 --- /dev/null +++ b/libs/application/templates/social-insurance-administration/death-benefits/README.md @@ -0,0 +1,54 @@ +# Application Templates Death Benefits + +## Description + +This application template allows applicants to apply for death benefits. + +![Death Benefits flow chart](./src/assets/death-benefits.png) + +### States + +#### Prerequisites + +This state is a temporary state that all new applications will be created in. It has a short lifespan and is unlisted. + +The purpose of this state is to be a guard into the actual application. Here the applicant reads general information on the processing and data collection for applications at TR. There is an external data step which fetches data from Þjóðskrá and TR. If the applicant has a living spouse, is over the age of 67 or does not have a registered domicile in Iceland, they cannot advance to the next step and make an application. + +#### Draft + +Valid applicant will be able to advance to this state where they can start the actual application and fill in all the relevant data. + +#### Tryggingastofnun submitted + +When the applicant has sent in the application to TR, the application is in this state. In this state the application can be edited. + +#### Tryggingastofnun in review + +For application to be in this state, TR need to make a state change when they start to review the application. In this state the application cannot be edited. + +#### Additional document required + +If TR needs additional documents to finish processing the application they can make a state change so the applicant can add any missing documents. + +#### Approved + +Application has been approved by TR. + +#### Rejected + +Application has been rejected by TR. + +### Localisation + +All localisation can be found on Contentful. + +- [Death benefits application translations](https://app.contentful.com/spaces/8k0h54kbe6bj/entries/db.application) +- [Application system translations](https://app.contentful.com/spaces/8k0h54kbe6bj/entries/application.system) + +When creating new text strings in the messages.ts file for the application, be sure to update Contentful, see [message extraction](../../../../localization/README.md#message-extraction). + +## Setup + +See [application-system](../../../../../apps/application-system/README.md) setup on how to get started. + +Once you have everything running you can navigate to [http://localhost:4242/umsoknir/danarbaetur](http://localhost:4242/umsoknir/danarbaetur) and start developing. diff --git a/libs/application/templates/social-insurance-administration/death-benefits/jest.config.ts b/libs/application/templates/social-insurance-administration/death-benefits/jest.config.ts new file mode 100644 index 000000000000..2428a02e3caa --- /dev/null +++ b/libs/application/templates/social-insurance-administration/death-benefits/jest.config.ts @@ -0,0 +1,13 @@ +/* eslint-disable */ +export default { + displayName: + 'application-templates-social-insurance-administration-death-benefits', + preset: '../../../../../jest.preset.js', + transform: { + '^(?!.*\\.(js|jsx|ts|tsx|css|json)$)': '@nx/react/plugins/jest', + '^.+\\.[tj]sx?$': ['babel-jest', { presets: ['@nx/react/babel'] }], + }, + moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'], + coverageDirectory: + '../../../../../coverage/libs/application/templates/social-insurance-administration/death-benefits', +} diff --git a/libs/application/templates/social-insurance-administration/death-benefits/project.json b/libs/application/templates/social-insurance-administration/death-benefits/project.json new file mode 100644 index 000000000000..736c061ded69 --- /dev/null +++ b/libs/application/templates/social-insurance-administration/death-benefits/project.json @@ -0,0 +1,38 @@ +{ + "name": "application-templates-social-insurance-administration-death-benefits", + "$schema": "../../../../../node_modules/nx/schemas/project-schema.json", + "sourceRoot": "libs/application/templates/social-insurance-administration/death-benefits/src", + "projectType": "library", + "targets": { + "lint": { + "executor": "@nx/linter:eslint", + "outputs": ["{options.outputFile}"], + "options": { + "lintFilePatterns": [ + "libs/application/templates/social-insurance-administration/death-benefits/**/*.{ts,tsx,js,jsx}" + ] + } + }, + "test": { + "executor": "@nx/jest:jest", + "outputs": ["{workspaceRoot}/coverage/{projectRoot}"], + "options": { + "jestConfig": "libs/application/templates/social-insurance-administration/death-benefits/jest.config.ts", + "passWithNoTests": true + }, + "configurations": { + "ci": { + "ci": true, + "codeCoverage": true + } + } + }, + "extract-strings": { + "executor": "nx:run-commands", + "options": { + "command": "yarn ts-node -P libs/localization/tsconfig.lib.json libs/localization/scripts/extract 'libs/application/templates/social-insurance-administration/death-benefits/src/lib/messages.ts'" + } + } + }, + "tags": ["scope:application-system", "lib:application-system"] +} diff --git a/libs/application/templates/social-insurance-administration/death-benefits/src/assets/death-benefits-flow-chart.drawio b/libs/application/templates/social-insurance-administration/death-benefits/src/assets/death-benefits-flow-chart.drawio new file mode 100644 index 000000000000..731bb490162c --- /dev/null +++ b/libs/application/templates/social-insurance-administration/death-benefits/src/assets/death-benefits-flow-chart.drawio @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/libs/application/templates/social-insurance-administration/death-benefits/src/assets/death-benefits-flow-chart.png b/libs/application/templates/social-insurance-administration/death-benefits/src/assets/death-benefits-flow-chart.png new file mode 100644 index 000000000000..f4259434ed6b Binary files /dev/null and b/libs/application/templates/social-insurance-administration/death-benefits/src/assets/death-benefits-flow-chart.png differ diff --git a/libs/application/templates/social-insurance-administration/death-benefits/src/dataProviders/index.ts b/libs/application/templates/social-insurance-administration/death-benefits/src/dataProviders/index.ts new file mode 100644 index 000000000000..3db3c79928bf --- /dev/null +++ b/libs/application/templates/social-insurance-administration/death-benefits/src/dataProviders/index.ts @@ -0,0 +1,38 @@ +import { defineTemplateApi } from '@island.is/application/types' + +export { + NationalRegistryUserApi, + NationalRegistrySpouseApi, + UserProfileApi, +} from '@island.is/application/types' + +export const SocialInsuranceAdministrationApplicantApi = defineTemplateApi({ + action: 'getApplicant', + externalDataId: 'socialInsuranceAdministrationApplicant', + namespace: 'SocialInsuranceAdministration', +}) + +export const SocialInsuranceAdministrationChildrenApi = defineTemplateApi({ + action: 'getChildrenWithSameDomicile', + externalDataId: 'socialInsuranceAdministrationChildren', + namespace: 'SocialInsuranceAdministration', +}) + +export const SocialInsuranceAdministrationCurrenciesApi = defineTemplateApi({ + action: 'getCurrencies', + externalDataId: 'socialInsuranceAdministrationCurrencies', + namespace: 'SocialInsuranceAdministration', +}) + +export const SocialInsuranceAdministrationIsApplicantEligibleApi = + defineTemplateApi({ + action: 'getIsEligible', + externalDataId: 'socialInsuranceAdministrationIsApplicantEligible', + namespace: 'SocialInsuranceAdministration', + }) + +export const SocialInsuranceAdministrationSpousalInfo = defineTemplateApi({ + action: 'getSpousalInfo', + externalDataId: 'socialInsuranceAdministrationSpousalInfo', + namespace: 'SocialInsuranceAdministration', +}) diff --git a/libs/application/templates/social-insurance-administration/death-benefits/src/fields/Children/ChildrenTable.tsx b/libs/application/templates/social-insurance-administration/death-benefits/src/fields/Children/ChildrenTable.tsx new file mode 100644 index 000000000000..d99a6775007b --- /dev/null +++ b/libs/application/templates/social-insurance-administration/death-benefits/src/fields/Children/ChildrenTable.tsx @@ -0,0 +1,48 @@ +import React, { FC } from 'react' +import { formatText } from '@island.is/application/core' +import { Application } from '@island.is/application/types' +import { useLocale } from '@island.is/localization' +import { socialInsuranceAdministrationMessage } from '@island.is/application/templates/social-insurance-administration-core/lib/messages' +import { Table } from '@island.is/application/ui-components' +import { getApplicationExternalData } from '../../lib/deathBenefitsUtils' +import { format as formatKennitala } from 'kennitala' + +interface ChildrenTableProps { + application: Application +} + +const ChildrenTable: FC = ({ application }) => { + const { formatMessage } = useLocale() + const { children } = getApplicationExternalData(application.externalData) + + const data = + children.map((child) => { + return { + fullName: child.fullName, + nationalId: formatKennitala(child.nationalId), + } + }) ?? [] + + const columns = [ + { + Header: formatText( + socialInsuranceAdministrationMessage.confirm.name, + application, + formatMessage, + ), + accessor: 'fullName', + } as const, + { + Header: formatText( + socialInsuranceAdministrationMessage.confirm.nationalId, + application, + formatMessage, + ), + accessor: 'nationalId', + } as const, + ] + + return +} + +export default ChildrenTable diff --git a/libs/application/templates/social-insurance-administration/death-benefits/src/fields/Children/index.tsx b/libs/application/templates/social-insurance-administration/death-benefits/src/fields/Children/index.tsx new file mode 100644 index 000000000000..a2767ef0f0fe --- /dev/null +++ b/libs/application/templates/social-insurance-administration/death-benefits/src/fields/Children/index.tsx @@ -0,0 +1,14 @@ +import React, { FC } from 'react' +import { FieldBaseProps } from '@island.is/application/types' +import { Box } from '@island.is/island-ui/core' +import ChildrenTable from './ChildrenTable' + +export const Children: FC = ({ application }) => { + return ( + + + + ) +} + +export default Children diff --git a/libs/application/templates/social-insurance-administration/death-benefits/src/fields/Review/index.tsx b/libs/application/templates/social-insurance-administration/death-benefits/src/fields/Review/index.tsx new file mode 100644 index 000000000000..f859ff6fbd5f --- /dev/null +++ b/libs/application/templates/social-insurance-administration/death-benefits/src/fields/Review/index.tsx @@ -0,0 +1,170 @@ +import { Application, Field, RecordObject } from '@island.is/application/types' +import { Box, Text, Button } from '@island.is/island-ui/core' +import { useLocale } from '@island.is/localization' +import { FC } from 'react' +import { useMutation } from '@apollo/client' +import get from 'lodash/get' +import has from 'lodash/has' +import { States } from '@island.is/application/templates/social-insurance-administration-core/lib/constants' +import { socialInsuranceAdministrationMessage } from '@island.is/application/templates/social-insurance-administration-core/lib/messages' +import { Comment } from './review-groups/Comment' +import { Attachments } from './review-groups/Attachments' +import { BaseInformation } from './review-groups/BaseInformation' +import { PaymentInformation } from './review-groups/PaymentInformation' +import { Children } from './review-groups/Children' +import { ExpectingChild } from './review-groups/ExpectingChild' +import { SUBMIT_APPLICATION } from '@island.is/application/graphql' +import { handleServerError } from '@island.is/application/ui-components' +import { DeceasedSpouse } from './review-groups/DeceasedSpouse' + +interface ReviewScreenProps { + application: Application + field: Field & { props?: { editable?: boolean } } + goToScreen?: (id: string) => void + refetch?: () => void + errors?: RecordObject + editable?: boolean +} + +export const Review: FC = ({ + application, + field, + goToScreen, + refetch, + errors, +}) => { + const editable = field.props?.editable ?? false + const { formatMessage } = useLocale() + const { state } = application + + const hasError = (id: string) => get(errors, id) as string + + const groupHasNoErrors = (ids: string[]) => + ids.every((id) => !has(errors, id)) + + const childProps = { + application, + editable, + groupHasNoErrors, + hasError, + goToScreen, + } + + const [submitApplication, { loading: loadingSubmit }] = useMutation( + SUBMIT_APPLICATION, + { + onError: (e) => handleServerError(e, formatMessage), + }, + ) + + const handleSubmit = async (event: string) => { + const res = await submitApplication({ + variables: { + input: { + id: application.id, + event, + answers: application.answers, + }, + }, + }) + + if (res?.data) { + // Takes them to the next state (which loads the relevant form) + refetch?.() + } + } + + const canView = + state === States.TRYGGINGASTOFNUN_SUBMITTED || + state === States.TRYGGINGASTOFNUN_IN_REVIEW || + state === States.APPROVED || + state === States.REJECTED + + return ( + <> + {state === `${States.DRAFT}` && ( + + + + + {formatMessage( + socialInsuranceAdministrationMessage.confirm.overviewTitle, + )} + + + + + {formatMessage( + socialInsuranceAdministrationMessage.confirm + .overviewDescription, + )} + + + + + + )} +