Skip to content

Commit 29f8f1f

Browse files
authored
Merge pull request #608 from companieshouse/feature/lp-1378-urls
Feature/lp 1378 urls
2 parents 143d89a + ba13a08 commit 29f8f1f

File tree

79 files changed

+398
-368
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+398
-368
lines changed

locales/cy/translations.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@
777777
}
778778
},
779779

780-
"whichTypePage": {
780+
"partnershipTypePage": {
781781
"title": "WELSH - Which type of partnership do you want to register?"
782782
},
783783

locales/en/translations.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@
778778
}
779779
},
780780

781-
"whichTypePage": {
781+
"partnershipTypePage": {
782782
"title": "Which type of partnership do you want to register?"
783783
},
784784

src/infrastructure/gateway/incorporation/IncorporationInMemoryGateway.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ class IncorporationGateway implements IIncorporationGateway {
1818
transactionId: string,
1919
kind: IncorporationKind
2020
): Promise<string> {
21-
if (pageType !== RegistrationPageType.name && pageType !== TransitionPageType.confirmLimitedPartnership) {
21+
if (
22+
pageType !== RegistrationPageType.partnershipName &&
23+
pageType !== TransitionPageType.confirmLimitedPartnership
24+
) {
2225
throw new Error("Wrong page type to create a new incorporation");
2326
}
2427

src/middlewares/authentication.middleware.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ import { Request, Response, NextFunction } from "express";
22

33
import { logger, checkUserSignedIn, getLoggedInUserEmail } from "../utils";
44
import { SIGN_OUT_URL } from "../presentation/controller/global/url";
5-
import { WHICH_TYPE_URL } from "../presentation/controller/registration/url";
5+
import { PARTNERSHIP_TYPE_URL } from "../presentation/controller/registration/url";
66

77
export const authentication = (req: Request, res: Response, next: NextFunction): void => {
88
try {
99
if (!checkUserSignedIn(req.session)) {
1010
logger.infoRequest(req, "User not authenticated, redirecting to sign in page, status_code=302");
1111

12-
const returnToUrl = req.originalUrl === SIGN_OUT_URL ? WHICH_TYPE_URL : req.originalUrl;
12+
const returnToUrl = req.originalUrl === SIGN_OUT_URL ? PARTNERSHIP_TYPE_URL : req.originalUrl;
1313

1414
return res.redirect(`/signin?return_to=${returnToUrl}`);
1515
}

src/middlewares/error.middleware.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { CsrfError } from "@companieshouse/web-security-node";
33

44
import { getLoggedInUserEmail, logger } from "../utils";
55
import * as config from "../config/constants";
6-
import { WHICH_TYPE_URL } from "../presentation/controller/registration/url";
6+
import { PARTNERSHIP_TYPE_URL } from "../presentation/controller/registration/url";
77

88
const pageNotFound = (req: Request, res: Response) => {
99
const headerData = getHeaderData(req);
@@ -55,7 +55,7 @@ const errorHandler = [pageNotFound, csrfErrorHandler, globalErrorHandler];
5555
export { errorHandler };
5656

5757
const getHeaderData = (req: Request) => {
58-
const previous = req.get("Referrer") ?? WHICH_TYPE_URL;
58+
const previous = req.get("Referrer") ?? PARTNERSHIP_TYPE_URL;
5959
const userEmail = getLoggedInUserEmail(req.session);
6060

6161
return {

src/presentation/controller/AbstractController.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
} from "../../config/constants";
1515
import { PageRouting, pageRoutingDefault, PagesRouting } from "./PageRouting";
1616
import PageType from "./PageType";
17-
import { WHICH_TYPE_URL } from "./registration/url";
17+
import { PARTNERSHIP_TYPE_URL } from "./registration/url";
1818
import UIErrors from "../../domain/entities/UIErrors";
1919
import { Ids, Tokens } from "../../domain/types";
2020

@@ -208,7 +208,7 @@ abstract class AbstractController {
208208
return previousPageUrlPostTransition.substring(startingIndexOfRelativePath);
209209
}
210210

211-
return WHICH_TYPE_URL;
211+
return PARTNERSHIP_TYPE_URL;
212212
}
213213
}
214214

src/presentation/controller/addressLookUp/PageType.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,29 @@ enum AddressPageType {
88
confirmRegisteredOfficeAddress = "confirm-registered-office-address",
99

1010
// principal place of business
11-
postcodePrincipalPlaceOfBusinessAddress = "postcode-principal-place-of-business-address",
12-
choosePrincipalPlaceOfBusinessAddress = "choose-principal-place-of-business-address",
13-
enterPrincipalPlaceOfBusinessAddress = "enter-principal-place-of-business-address",
14-
confirmPrincipalPlaceOfBusinessAddress = "confirm-principal-place-of-business-address",
11+
postcodePrincipalPlaceOfBusinessAddress = "postcode-principal-place-of-business",
12+
choosePrincipalPlaceOfBusinessAddress = "choose-principal-place-of-business",
13+
enterPrincipalPlaceOfBusinessAddress = "enter-principal-place-of-business",
14+
confirmPrincipalPlaceOfBusinessAddress = "confirm-principal-place-of-business",
1515

1616
// GENERAL PARTNER
1717

1818
// usual residential address - Person
19-
territoryChoiceGeneralPartnerUsualResidentialAddress = "territory-choice-general-partner-usual-residential-address",
19+
territoryChoiceGeneralPartnerUsualResidentialAddress = "uk-or-overseas-general-partner-usual-residential-address",
2020
postcodeGeneralPartnerUsualResidentialAddress = "postcode-general-partner-usual-residential-address",
2121
chooseGeneralPartnerUsualResidentialAddress = "choose-general-partner-usual-residential-address",
2222
enterGeneralPartnerUsualResidentialAddress = "enter-general-partner-usual-residential-address",
2323
confirmGeneralPartnerUsualResidentialAddress = "confirm-general-partner-usual-residential-address",
2424

2525
// correspondence address - Person
26-
territoryChoiceGeneralPartnerCorrespondenceAddress = "territory-choice-general-partner-correspondence-address",
26+
territoryChoiceGeneralPartnerCorrespondenceAddress = "uk-or-overseas-general-partner-correspondence-address",
2727
postcodeGeneralPartnerCorrespondenceAddress = "postcode-general-partner-correspondence-address",
2828
chooseGeneralPartnerCorrespondenceAddress = "choose-general-partner-correspondence-address",
2929
enterGeneralPartnerCorrespondenceAddress = "enter-general-partner-correspondence-address",
3030
confirmGeneralPartnerCorrespondenceAddress = "confirm-general-partner-correspondence-address",
3131

3232
// principal office address - Legal Entity
33-
territoryChoiceGeneralPartnerPrincipalOfficeAddress = "territory-choice-general-partner-principal-office-address",
33+
territoryChoiceGeneralPartnerPrincipalOfficeAddress = "uk-or-overseas-general-partner-principal-office-address",
3434
postcodeGeneralPartnerPrincipalOfficeAddress = "postcode-general-partner-principal-office-address",
3535
chooseGeneralPartnerPrincipalOfficeAddress = "choose-general-partner-principal-office-address",
3636
enterGeneralPartnerPrincipalOfficeAddress = "enter-general-partner-principal-office-address",
@@ -39,17 +39,18 @@ enum AddressPageType {
3939
// LIMITED PARTNER
4040

4141
// usual residential address - Person
42-
territoryChoiceLimitedPartnerUsualResidentialAddress = "territory-choice-limited-partner-usual-residential-address",
42+
territoryChoiceLimitedPartnerUsualResidentialAddress = "uk-or-overseas-limited-partner-usual-residential-address",
4343
postcodeLimitedPartnerUsualResidentialAddress = "postcode-limited-partner-usual-residential-address",
4444
chooseLimitedPartnerUsualResidentialAddress = "choose-limited-partner-usual-residential-address",
4545
enterLimitedPartnerUsualResidentialAddress = "enter-limited-partner-usual-residential-address",
4646
confirmLimitedPartnerUsualResidentialAddress = "confirm-limited-partner-usual-residential-address",
4747

4848
// principal office address - Legal entity
49-
territoryChoiceLimitedPartnerPrincipalOfficeAddress = "territory-choice-limited-partner-principal-office-address",
49+
territoryChoiceLimitedPartnerPrincipalOfficeAddress = "uk-or-overseas-limited-partner-principal-office-address",
5050
postcodeLimitedPartnerPrincipalOfficeAddress = "postcode-limited-partner-principal-office-address",
5151
chooseLimitedPartnerPrincipalOfficeAddress = "choose-limited-partner-principal-office-address",
5252
enterLimitedPartnerPrincipalOfficeAddress = "enter-limited-partner-principal-office-address",
5353
confirmLimitedPartnerPrincipalOfficeAddress = "confirm-limited-partner-principal-office-address"
5454
}
55+
5556
export default AddressPageType;

src/presentation/controller/common/PartnerController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ abstract class PartnerController extends AbstractController {
141141
};
142142
}
143143

144-
partnerChoice(urls: { addPersonUrl: string; addLegalEntityUrl: string }) {
144+
partnerType(urls: { addPersonUrl: string; addLegalEntityUrl: string }) {
145145
return (request: Request, response: Response, next: NextFunction) => {
146146
try {
147147
const { ids } = this.extractRequestData(request);

src/presentation/controller/global/resumeUrlMapping.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { TransactionKind } from "../../../domain/entities/TransactionTypes";
22
import { Journey } from "../../../domain/entities/journey";
3-
import { WHICH_TYPE_WITH_IDS_URL } from "../registration/url";
3+
import { PARTNERSHIP_TYPE_WITH_IDS_URL } from "../registration/url";
44
import { EMAIL_URL } from "../transition/url";
55
import { PartnerKind, PartnershipKind } from "@companieshouse/api-sdk-node/dist/services/limited-partnerships/types";
66
import {
@@ -17,7 +17,7 @@ import {
1717
export const RESUME_REGISTRATION_OR_TRANSITION_URL_MAP: Record<string, { journey: string; resumeUrl: string }> = {
1818
[TransactionKind.registration]: {
1919
journey: Journey.registration,
20-
resumeUrl: WHICH_TYPE_WITH_IDS_URL
20+
resumeUrl: PARTNERSHIP_TYPE_WITH_IDS_URL
2121
},
2222
[TransactionKind.transition]: {
2323
journey: Journey.transition,

src/presentation/controller/postTransition/GeneralPartnerController.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class GeneralPartnerPostTransitionController extends PartnerController {
3636
}
3737

3838
generalPartnerChoice() {
39-
return super.partnerChoice({
39+
return super.partnerType({
4040
addPersonUrl: ADD_GENERAL_PARTNER_PERSON_URL,
4141
addLegalEntityUrl: ADD_GENERAL_PARTNER_LEGAL_ENTITY_URL
4242
});

0 commit comments

Comments
 (0)