Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
3fb3f4d
Add new document management code
adamg-hmcts Nov 18, 2025
f90354b
Update controller tests
adamg-hmcts Nov 18, 2025
511ca11
Linter corrections
adamg-hmcts Nov 18, 2025
dbcea58
Update DocumentManagementController tests
adamg-hmcts Nov 18, 2025
ab19a2e
Remove changes that were pushed by mistake
adamg-hmcts Nov 18, 2025
93a5e32
Linter corrections
adamg-hmcts Nov 18, 2025
f9d662e
Reset file upload journey in get controller
adamg-hmcts Nov 19, 2025
9bdc5e7
Merge branch 'master' into nfdiv-5072-rework-frontend-document-manage…
adamg-hmcts Nov 19, 2025
602fded
Linter corrections
adamg-hmcts Nov 19, 2025
2c6ced9
Merge branch 'master' into nfdiv-5072-rework-frontend-document-manage…
adamg-hmcts Nov 19, 2025
7fbb7a9
Merge branch 'master' into nfdiv-5072-rework-frontend-document-manage…
adamg-hmcts Dec 3, 2025
7cc178c
[NFDIV-4990] Pre-issue alternative service applications (#4441)
adamg-hmcts Dec 3, 2025
4b0a23a
Sonar correction
adamg-hmcts Dec 3, 2025
5763a10
Merge branch 'nfdiv-5072-rework-frontend-document-management' into nf…
adamg-hmcts Dec 4, 2025
05c3a1e
Update backend PR references
adamg-hmcts Dec 4, 2025
d690661
Merge branch 'master' into nfdiv-5072-rework-frontend-document-manage…
eliswyndavies Dec 22, 2025
8d11bfc
Update error messages
adamg-hmcts Dec 23, 2025
922f7d2
Add text to indicate link opens in new tab
adamg-hmcts Dec 30, 2025
c951c2c
Merge branch 'nfdiv-5072-rework-frontend-document-management' into nf…
adamg-hmcts Dec 30, 2025
a8ff1c1
Merge branch 'master' into nfdiv-5072-rework-frontend-document-manage…
FaisalMoJ Jan 13, 2026
d9dc0c2
Merge branch 'nfdiv-5072-rework-frontend-document-management' into nf…
FaisalMoJ Jan 13, 2026
3386582
Avoid session reset when session is undefined
adamg-hmcts Jan 22, 2026
250aab2
Merge branch 'master' into nfdiv-5072-rework-frontend-document-manage…
FaisalMoJ Jan 26, 2026
b821f96
Merge branch 'nfdiv-5072-rework-frontend-document-management' into nf…
FaisalMoJ Jan 26, 2026
7efd1dd
Merge branch 'master' into nfdiv-5200-pre-issue-service-applications
BWeeks-JusticeGovUK Feb 10, 2026
fc5b915
Merge branch 'master' into nfdiv-5200-pre-issue-service-applications
BWeeks-JusticeGovUK Feb 10, 2026
2dad634
NFDIV-4992 Pre-Issue: Citizen - Apply to Search Govt Records / Dispen…
BWeeks-JusticeGovUK Feb 10, 2026
bb32ba2
[NFDIV-5145] Pre-issue search government records applications (#4545)
adamg-hmcts Feb 19, 2026
da272e1
Merge updates from master
adamg-hmcts Feb 27, 2026
0a201cb
Merge branch 'master' into nfdiv-5200-pre-issue-service-applications
adamg-hmcts Feb 27, 2026
745f37f
Merge branch 'master' into nfdiv-5200-pre-issue-service-applications
adamg-hmcts Feb 27, 2026
cf14767
Merge branch 'master' into nfdiv-5200-pre-issue-service-applications
FaisalMoJ Mar 2, 2026
a24a151
NFDIV-4922: Applicant2 address question pages (#4444)
FaisalMoJ Mar 4, 2026
9bcfa44
Merge branch 'master' into nfdiv-5200-pre-issue-service-applications
FaisalMoJ Mar 8, 2026
9658606
NFDIV-4922: Add Welsh translation comment
FaisalMoJ Mar 8, 2026
c020604
Merge branch 'master' into nfdiv-5200-pre-issue-service-applications
FaisalMoJ Mar 11, 2026
e761f49
NFDIV-5164: Add further action needed submitted page (#4472)
FaisalMoJ Mar 19, 2026
399551e
Merge branch 'master' into nfdiv-5200-pre-issue-service-applications
adamg-hmcts Mar 26, 2026
b083a96
[NFDIV-5354] Tweaks to no respondent address logic (#4714)
adamg-hmcts Mar 27, 2026
94b42f4
More tweaks for backwards compatibility
adamg-hmcts Apr 7, 2026
e30bec6
NFDIV-5328 - Stop citizens from accessing pages after submission (#4703)
pallavijustice Apr 13, 2026
f247c55
Merge branch 'master' into nfdiv-5200-pre-issue-service-applications
adamg-hmcts Apr 14, 2026
6e6b6c5
Update backend PR reference and unit tests
adamg-hmcts Apr 14, 2026
a861e7f
Merge branch 'master' into nfdiv-5200-pre-issue-service-applications
adamg-hmcts Apr 14, 2026
b7c6310
Merge branch 'master' into nfdiv-5200-pre-issue-service-applications
adamg-hmcts Apr 15, 2026
f373474
No respondent address updates based on E2E tests (#4757)
adamg-hmcts Apr 17, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Jenkinsfile_CNP
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ withPipeline(type, product, component) {
}

// uncomment to connect backend PR
//onPR {
// env.CASE_TYPE="NFD-4798"
//}
onPR {
env.CASE_TYPE="NFD-4806"
}
}
2 changes: 1 addition & 1 deletion charts/nfdiv-frontend/values.preview.template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ nodejs:
enabled: false
environment:
IDAM_TOKEN_CACHE: true
# CASE_TYPE: NFD-4798 # Uncomment to connect to backend PR, don't forget Jenkinsfile_CNP too
CASE_TYPE: NFD-4806 # Uncomment to connect to backend PR, don't forget Jenkinsfile_CNP too
keyVaults:
nfdiv:
resourceGroup: nfdiv
Expand Down
20 changes: 20 additions & 0 deletions src/main/app/case/case.ts
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,10 @@ export const formFieldsToCaseMapping: Partial<Record<keyof Case, keyof CaseData>
serviceApplicationAnswers: 'serviceApplicationAnswers',
applicant1InterimApplicationType: 'applicant1InterimApplicationType',
applicant1InterimAppsStatementOfTruth: 'applicant1InterimAppsStatementOfTruth',
applicant1NoRespAddressHasFoundAddress: 'applicant1NoRespAddressHasFoundAddress',
applicant1NoRespAddressHasWayToContact: 'applicant1NoRespAddressHasWayToContact',
applicant1NoRespAddressWillApplyAltService: 'applicant1NoRespAddressWillApplyAltService',
applicant1NoRespAddressEmail: 'applicant1NoRespAddressEmail',
applicant1NoResponseOwnSearches: 'applicant1NoResponseOwnSearches',
applicant1NoResponseRespondentAddressInEnglandWales: 'applicant1NoResponseRespondentAddressInEnglandWales',
applicant1NoResponsePartnerInUkOrReceivingBenefits: 'applicant1NoResponsePartnerInUkOrReceivingBenefits',
Expand Down Expand Up @@ -355,6 +359,7 @@ export const formFieldsToCaseMapping: Partial<Record<keyof Case, keyof CaseData>
withdrawApplicationReason: 'withdrawApplicationReason',
applicant2ConfirmWithdrawApplication: 'applicant2ConfirmWithdrawApplication',
applicant2WithdrawApplicationReason: 'applicant2WithdrawApplicationReason',
applicant1FoundApplicant2Address: 'applicant1FoundApplicant2Address',
};

export function formatCase<OutputFormat>(fields: FieldFormats, data: Partial<Case> | CaseData): OutputFormat {
Expand Down Expand Up @@ -666,6 +671,20 @@ export interface Case {
applicant1InterimApplicationType?: InterimApplicationType;
applicant2InterimApplicationType?: InterimApplicationType;
applicant1InterimAppsStatementOfTruth?: Checkbox;
applicant1NoRespAddressHasFoundAddress: YesOrNo;
applicant1NoRespAddressHasWayToContact: YesOrNo;
applicant1NoRespAddressWillApplyAltService: YesOrNo;
applicant1NoRespAddressAddress?: AddressGlobalUK;
applicant1NoRespAddressAddress1?: string;
applicant1NoRespAddressAddress2?: string;
applicant1NoRespAddressAddress3?: string;
applicant1NoRespAddressAddressTown?: string;
applicant1NoRespAddressAddressCounty?: string;
applicant1NoRespAddressAddressCountry?: string;
applicant1NoRespAddressAddressPostcode?: string;
applicant1NoRespAddressAddressOverseas?: YesOrNo;
applicant1NoRespAddressEmail?: string;
applicant1NoRespAddressDoesNotKnowEmailAddress?: Checkbox;
applicant1NoResponseOwnSearches?: NoResponseOwnSearches;
applicant1NoResponseRespondentAddressInEnglandWales?: Checkbox;
applicant1NoResponsePartnerInUkOrReceivingBenefits?: YesOrNo;
Expand Down Expand Up @@ -789,6 +808,7 @@ export interface Case {
withdrawApplicationReason?: string;
applicant2ConfirmWithdrawApplication?: YesOrNo;
applicant2WithdrawApplicationReason?: string;
applicant1FoundApplicant2Address: YesOrNo;
}

export interface CaseWithId extends Case {
Expand Down
9 changes: 9 additions & 0 deletions src/main/app/case/definition.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1124,6 +1124,13 @@ export interface CaseData {
applicant1SearchGovRecordsPartnerAdditionalAddressDates1: string;
applicant1SearchGovRecordsPartnerAdditionalAddress2?: string;
applicant1SearchGovRecordsPartnerAdditionalAddressDates2?: string;
applicant1NoRespAddressHasFoundAddress: YesOrNo;
applicant1NoRespAddressHasWayToContact: YesOrNo;
applicant1NoRespAddressWillApplyAltService: YesOrNo;
applicant1NoRespAddressAddress: AddressGlobalUK;
applicant1NoRespAddressAddressOverseas: YesOrNo;
applicant1NoRespAddressEmail: string;
applicant1NoRespAddressKnowsEmail: YesOrNo;
applicant1NoResponseOwnSearches: NoResponseOwnSearches;
applicant1NoResponseRespondentAddressInEnglandWales: YesOrNo;
applicant1NoResponsePartnerInUkOrReceivingBenefits: YesOrNo;
Expand Down Expand Up @@ -1183,6 +1190,7 @@ export interface CaseData {
withdrawApplicationReason: string;
applicant2ConfirmWithdrawApplication: YesOrNo;
applicant2WithdrawApplicationReason: string;
applicant1FoundApplicant2Address: YesOrNo;
}

export interface CaseDocuments {
Expand Down Expand Up @@ -3029,6 +3037,7 @@ export const CASEWORKER_REQUEST_FOR_INFORMATION = 'caseworker-request-for-inform
export const CASEWORKER_ISSUE_APPLICATION = 'caseworker-issue-application';
export const CASEWORKER_REISSUE_APPLICATION = 'caseworker-reissue-application';
export const UPDATE_CONTACT_DETAILS_AND_REISSUE = 'update-partner-details-or-reissue';
export const CITIZEN_ADD_PARTNER_DETAILS = 'citizen-add-partner-details';
export const SYSTEM_REMIND_APPLICANT2 = 'system-remind-applicant2';
export const SYSTEM_LINK_APPLICANT_2 = 'system-link-applicant2';
export const SYSTEM_LINK_APPLICANT_1 = 'system-link-applicant1';
Expand Down
6 changes: 6 additions & 0 deletions src/main/app/case/formatter/address.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ export const fromApi = (
| 'applicant1NoResponsePartner'
| 'applicant1DispenseLivedTogether'
| 'applicant1SearchGovRecordsPartnerLastKnown'
| 'applicant1NoRespAddress'
): Partial<Case> => {
const fullAddress = data[`${addressPrefix}Address`];

Expand All @@ -31,6 +32,7 @@ const toApiAddress = (
| 'applicant1NoResponsePartner'
| 'applicant1DispenseLivedTogether'
| 'applicant1SearchGovRecordsPartnerLastKnown'
| 'applicant1NoRespAddress'
): AddressGlobalUK => ({
AddressLine1: data[`${addressPrefix}Address1`] || '',
AddressLine2: data[`${addressPrefix}Address2`] || '',
Expand Down Expand Up @@ -60,3 +62,7 @@ export const applicant1NoResponsePartnerAddressToApi = (data: Partial<Case>): Pa
export const applicant1SearchGovRecordsPartnerLastKnownAddressToApi = (data: Partial<Case>): Partial<CaseData> => ({
applicant1SearchGovRecordsPartnerLastKnownAddress: toApiAddress(data, 'applicant1SearchGovRecordsPartnerLastKnown'),
});

export const applicant1NoRespAddressAddressToApi = (data: Partial<Case>): Partial<CaseData> => ({
applicant1NoRespAddressAddress: toApiAddress(data, 'applicant1NoRespAddress'),
});
30 changes: 30 additions & 0 deletions src/main/app/case/from-api-format.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ describe('from-api-format', () => {
applicant1ContactDetailsType: ContactDetailsType.PRIVATE,
applicant1InRefuge: YesOrNo.NO,
applicant1KnowsApplicant2EmailAddress: YesOrNo.NO,
applicant1NoRespAddressKnowsEmail: YesOrNo.NO,
applicant1WantsToHavePapersServedAnotherWay: undefined,
applicant1LanguagePreferenceWelsh: YesOrNo.YES,
applicant2LanguagePreferenceWelsh: YesOrNo.YES,
Expand Down Expand Up @@ -58,6 +59,7 @@ describe('from-api-format', () => {
applicant1LanguagePreferenceWelsh: YesOrNo.NO,
applicant2LanguagePreferenceWelsh: YesOrNo.NO,
applicant1KnowsApplicant2EmailAddress: YesOrNo.YES,
applicant1NoRespAddressKnowsEmail: YesOrNo.YES,
applicant1ContactDetailsType: ContactDetailsType.PUBLIC,
applicant2ContactDetailsType: ContactDetailsType.PUBLIC,
applicant1PrayerDissolveDivorce: [],
Expand All @@ -77,6 +79,7 @@ describe('from-api-format', () => {
applicant1AddressPrivate: YesOrNo.YES,
applicant1InRefuge: YesOrNo.NO,
applicant1DoesNotKnowApplicant2EmailAddress: Checkbox.Checked,
applicant1NoRespAddressDoesNotKnowEmailAddress: Checkbox.Checked,
applicant2AddressPrivate: YesOrNo.NO,
iWantToHavePapersServedAnotherWay: undefined,
applicant1EnglishOrWelsh: LanguagePreference.Welsh,
Expand Down Expand Up @@ -115,6 +118,7 @@ describe('from-api-format', () => {
applicant1EnglishOrWelsh: LanguagePreference.English,
applicant2EnglishOrWelsh: LanguagePreference.English,
applicant1DoesNotKnowApplicant2EmailAddress: Checkbox.Unchecked,
applicant1NoRespAddressDoesNotKnowEmailAddress: Checkbox.Unchecked,
applicant1AddressPrivate: YesOrNo.NO,
applicant2AddressPrivate: YesOrNo.NO,
applicant1IConfirmPrayer: Checkbox.Unchecked,
Expand Down Expand Up @@ -158,6 +162,7 @@ describe('from-api-format', () => {
applicant1AddressPrivate: YesOrNo.YES,
applicant1InRefuge: YesOrNo.NO,
applicant1DoesNotKnowApplicant2EmailAddress: Checkbox.Checked,
applicant1NoRespAddressDoesNotKnowEmailAddress: Checkbox.Checked,
applicant2AddressPrivate: YesOrNo.NO,
iWantToHavePapersServedAnotherWay: undefined,
disputeApplication: YesOrNo.YES,
Expand Down Expand Up @@ -230,6 +235,7 @@ describe('from-api-format', () => {
applicant1AddressPrivate: YesOrNo.YES,
applicant1InRefuge: YesOrNo.NO,
applicant1DoesNotKnowApplicant2EmailAddress: Checkbox.Checked,
applicant1NoRespAddressDoesNotKnowEmailAddress: Checkbox.Checked,
applicant2AddressPrivate: YesOrNo.NO,
iWantToHavePapersServedAnotherWay: undefined,
disputeApplication: null,
Expand Down Expand Up @@ -277,6 +283,7 @@ describe('from-api-format', () => {
applicant1AddressPrivate: YesOrNo.YES,
applicant1InRefuge: YesOrNo.NO,
applicant1DoesNotKnowApplicant2EmailAddress: Checkbox.Checked,
applicant1NoRespAddressDoesNotKnowEmailAddress: Checkbox.Checked,
applicant2AddressPrivate: YesOrNo.NO,
iWantToHavePapersServedAnotherWay: undefined,
disputeApplication: YesOrNo.NO,
Expand Down Expand Up @@ -380,6 +387,29 @@ describe('from-api-format', () => {
});
});

test('converts to UK format for applicant1NoRespAddress', () => {
const nfdivFormat = fromApiFormat({
...results,
applicant1NoRespAddressAddress: {
AddressLine1: 'Line 1',
AddressLine2: 'Line 2',
PostTown: 'Town',
County: 'County',
PostCode: 'Postcode',
},
applicant1NoRespAddressAddressOverseas: YesOrNo.NO,
} as unknown as CaseData);

expect(nfdivFormat).toMatchObject({
applicant1NoRespAddressAddress1: 'Line 1',
applicant1NoRespAddressAddress2: 'Line 2',
applicant1NoRespAddressAddressTown: 'Town',
applicant1NoRespAddressAddressCounty: 'County',
applicant1NoRespAddressAddressPostcode: 'Postcode',
applicant1NoRespAddressAddressOverseas: YesOrNo.NO,
});
});

test('converts to UK format for applicant1DispenseLivedTogether', () => {
const nfdivFormat = fromApiFormat({
...results,
Expand Down
8 changes: 8 additions & 0 deletions src/main/app/case/from-api-format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,14 @@ const fields: FromApiConverters = {
}),
applicant1SearchGovRecordsPartnerLastKnownAddress: data =>
formatAddress(data, 'applicant1SearchGovRecordsPartnerLastKnown'),
applicant1NoRespAddressAddressOverseas: ({ applicant1NoRespAddressAddressOverseas }) => ({
applicant1NoRespAddressAddressOverseas: applicant1NoRespAddressAddressOverseas ?? YesOrNo.NO,
}),
applicant1NoRespAddressKnowsEmail: data => ({
applicant1NoRespAddressDoesNotKnowEmailAddress:
data.applicant1NoRespAddressKnowsEmail === YesOrNo.YES ? Checkbox.Unchecked : Checkbox.Checked,
}),
applicant1NoRespAddressAddress: data => formatAddress(data, 'applicant1NoRespAddress'),
};

const fromApiDate = date => {
Expand Down
5 changes: 5 additions & 0 deletions src/main/app/case/to-api-format.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ describe('to-api-format', () => {
applicant2FoHelpPayingNeeded: YesOrNo.YES,
applicant1AgreeToReceiveEmails: Checkbox.Checked,
applicant1DoesNotKnowApplicant2EmailAddress: Checkbox.Checked,
applicant1NoRespAddressDoesNotKnowEmailAddress: Checkbox.Checked,
applicant1AddressPrivate: YesOrNo.YES,
applicant1InRefuge: YesOrNo.YES,
applicant1KnowsApplicant2Address: YesOrNo.NO,
Expand Down Expand Up @@ -103,6 +104,7 @@ describe('to-api-format', () => {

const resultsWithSecondaryValues: OrNull<Partial<Case>> = {
applicant1DoesNotKnowApplicant2EmailAddress: Checkbox.Unchecked,
applicant1NoRespAddressDoesNotKnowEmailAddress: Checkbox.Unchecked,
applicant1IConfirmPrayer: Checkbox.Unchecked,
applicant2IConfirmPrayer: Checkbox.Unchecked,
applicant1AddressPrivate: YesOrNo.NO,
Expand Down Expand Up @@ -169,7 +171,9 @@ describe('to-api-format', () => {
applicant1ContactDetailsType: ContactDetailsType.PRIVATE,
applicant1InRefuge: YesOrNo.YES,
applicant1KnowsApplicant2Address: YesOrNo.NO,
applicant1FoundApplicant2Address: YesOrNo.NO,
applicant1KnowsApplicant2EmailAddress: YesOrNo.NO,
applicant1NoRespAddressKnowsEmail: YesOrNo.NO,
applicant1WantsToHavePapersServedAnotherWay: null,
applicant1LanguagePreferenceWelsh: 'No',
applicant2LanguagePreferenceWelsh: 'No',
Expand Down Expand Up @@ -235,6 +239,7 @@ describe('to-api-format', () => {
expect(apiFormat).toStrictEqual({
applicant1ContactDetailsType: ContactDetailsType.PUBLIC,
applicant1KnowsApplicant2EmailAddress: YesOrNo.YES,
applicant1NoRespAddressKnowsEmail: YesOrNo.YES,
applicant2ContactDetailsType: ContactDetailsType.PUBLIC,
applicant1PrayerDissolveDivorce: [],
applicant1PrayerEndCivilPartnership: [],
Expand Down
22 changes: 22 additions & 0 deletions src/main/app/case/to-api-format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
import {
applicant1AddressToApi,
applicant1DispenseLivedTogetherAddressToApi,
applicant1NoRespAddressAddressToApi,
applicant1NoResponsePartnerAddressToApi,
applicant1SearchGovRecordsPartnerLastKnownAddressToApi,
applicant2AddressToApi,
Expand Down Expand Up @@ -182,6 +183,14 @@ const fields: ToApiConverters = {
iWantToHavePapersServedAnotherWay: data => ({
applicant1WantsToHavePapersServedAnotherWay: checkboxConverter(data.iWantToHavePapersServedAnotherWay),
}),
applicant1FoundApplicant2Address: data => ({
applicant1KnowsApplicant2Address: data.applicant1FoundApplicant2Address,
applicant1FoundApplicant2Address: data.applicant1FoundApplicant2Address,
applicant1WantsToHavePapersServedAnotherWay:
data.applicant1FoundApplicant2Address === YesOrNo.YES
? YesOrNo.NO
: checkboxConverter(data.iWantToHavePapersServedAnotherWay),
}),
applicant1NameChangedHowOtherDetails: data => ({
applicant1NameChangedHowOtherDetails: data.applicant1NameChangedHow?.includes(ChangedNameHow.OTHER)
? data.applicant1NameChangedHowOtherDetails
Expand Down Expand Up @@ -361,6 +370,11 @@ const fields: ToApiConverters = {
}),
applicant1KnowsApplicant2Address: data => ({
applicant1KnowsApplicant2Address: data.applicant1KnowsApplicant2Address,
applicant1FoundApplicant2Address: data.applicant1KnowsApplicant2Address,
applicant1WantsToHavePapersServedAnotherWay:
data.applicant1KnowsApplicant2Address === YesOrNo.YES
? YesOrNo.NO
: checkboxConverter(data.iWantToHavePapersServedAnotherWay),
...(data.applicant1KnowsApplicant2Address === YesOrNo.NO
? applicant2AddressToApi(
setUnreachableAnswersToNull([
Expand Down Expand Up @@ -725,6 +739,14 @@ const fields: ToApiConverters = {
? data.applicant1DispenseChildMaintenanceResults
: null,
}),
applicant1NoRespAddressDoesNotKnowEmailAddress: data => ({
applicant1NoRespAddressKnowsEmail:
data.applicant1NoRespAddressDoesNotKnowEmailAddress === Checkbox.Checked ? YesOrNo.NO : YesOrNo.YES,
}),
applicant1NoRespAddressAddressOverseas: ({ applicant1NoRespAddressAddressOverseas }) => ({
applicant1NoRespAddressAddressOverseas: applicant1NoRespAddressAddressOverseas ?? YesOrNo.NO,
}),
applicant1NoRespAddressAddressPostcode: applicant1NoRespAddressAddressToApi,
};

const toApiDate = (date: CaseDate | undefined | string) => {
Expand Down
8 changes: 7 additions & 1 deletion src/main/app/document/FileUploadJourneyConfiguration.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import { UPLOAD_EVIDENCE_ALTERNATIVE } from '../../steps/urls';
import { UPLOAD_EVIDENCE_ALTERNATIVE, UPLOAD_EVIDENCE_DISPENSE } from '../../steps/urls';
import { ApplicationType } from '../case/definition';
import type { AppRequest } from '../controller/AppRequest';

export enum FileUploadJourney {
ALTERNATIVE_SERVICE = 'alternativeService',
DISPENSE_SERVICE = 'dispenseService',
}

export enum FileUploadPath {
Expand All @@ -22,6 +23,11 @@ const FileUploadJourneyConfigurationMap: Record<FileUploadJourney, FileUploadJou
getRedirectPath: () => UPLOAD_EVIDENCE_ALTERNATIVE,
validateUpload: req => validateServiceApplicationDocumentUpload(req),
},
[FileUploadJourney.DISPENSE_SERVICE]: {
uploadPath: FileUploadPath.APPLICANT_1_INTERIM_APPS_EVIDENCE,
getRedirectPath: () => UPLOAD_EVIDENCE_DISPENSE,
validateUpload: req => validateServiceApplicationDocumentUpload(req),
},
};

export const validateServiceApplicationDocumentUpload = (req: AppRequest): boolean => {
Expand Down
10 changes: 9 additions & 1 deletion src/main/routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { getUserSequence, stepsWithContent } from './steps';
import { AccessibilityStatementGetController } from './steps/accessibility-statement/get';
import * as applicant1AccessCodeContent from './steps/applicant1/enter-your-access-code/content';
import { Applicant1AccessCodeGetController } from './steps/applicant1/enter-your-access-code/get';
import { PartnerContactDetailsUpdatedGetController } from './steps/applicant1/interim-applications/no-respondent-address/details-updated/get';
import { PostcodeLookupPostController } from './steps/applicant1/postcode-lookup/post';
import { ApplicationWithdrawnPreIssueGetController } from './steps/applicant1/withdraw-pre-issue/application-withdrawn/get';
import * as applicant2AccessCodeContent from './steps/applicant2/enter-your-access-code/content';
Expand Down Expand Up @@ -54,6 +55,7 @@ import {
HOME_URL,
HUB_PAGE,
NO_RESPONSE_YET,
NO_RESP_ADDRESS_DETAILS_UPDATED,
POSTCODE_LOOKUP,
PRIVACY_POLICY_URL,
REQUEST_FOR_INFORMATION_SAVE_AND_SIGN_OUT,
Expand Down Expand Up @@ -104,6 +106,8 @@ export class Routes {
app.get(CONTACT_US, errorHandler(new ContactUsGetController().get));
app.post(POSTCODE_LOOKUP, errorHandler(new PostcodeLookupPostController().post));

app.get(NO_RESP_ADDRESS_DETAILS_UPDATED, errorHandler(new PartnerContactDetailsUpdatedGetController().get));

const documentManagerController = new DocumentManagerController();
app.post(DOCUMENT_MANAGER, handleUploads.array('files[]', 5), errorHandler(documentManagerController.post));
app.get(`${DOCUMENT_MANAGER}/delete/:index`, errorHandler(documentManagerController.delete));
Expand All @@ -123,7 +127,11 @@ export class Routes {
const postController = fs.existsSync(`${step.stepDir}/post${ext}`)
? require(`${step.stepDir}/post${ext}`).default
: PostController;
app.post(step.url, errorHandler(new postController(step.form.fields).post));
app.post(
step.url,
this.isRouteForUser as RequestHandler,
errorHandler(new postController(step.form.fields).post)
);
}
}

Expand Down
Loading