-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Register Other Org - Sprint 31.4 (#1094)
* PBA validation * Display Error summary page * form Error * EUI-8801 Register other org - Contact details functionality * EUI-8801 Register other org - Contact details functionality * Add validation * EUI-8801 Register other org - Contact details functionality * fix lint * EUI-8811 Register other org - Individual regulator yes no functionality * EUI-8801 Register other org - Contact details functionality * EUI-8811 Register other org - Individual regulator yes no functionality * Update contact-details.component.spec.ts * Fix test * EUI-8811 Register other org - Individual regulator yes no functionality * Add validation * Add non-postcode validation and persistence * EUI-8797 Register other org - CYA display amendments * Fix merge conflicts * Update registered-address.component.spec.ts * PBA number persist functionality * fix unit tests * Make changes based on PR comments * EUI-8797 Register other org - CYA display amendments * Update contact-details.component.spec.ts * Add service down check * EUI-8797 Register other org - CYA display amendments * EUI-8797 Register other org - CYA display amendments * EUI-8797 Register other org - CYA display amendments * EUI-8797 Register other org - CYA display amendments * EUI-8797 Register other org - CYA display amendments * EUI-8797 Register other org - CYA display amendments * EUI-8797 Register other org - CYA display amendments * EUI-8797 Register other org - CYA display amendments * register other org workflow pages a11y tests added (#1103) * register other org workflow pages a11y tests added * a11y test name update * Add test fixes * Temporary fix for back link * postcode validator * EUI-8821 Register Other Org - Service not listed * Update organisation types value * fix typos * EUI-8821 Register Other Org - Service not listed * Update document-exchange-reference.component.ts * Update yarn-audit-known-issues * Update yarn-audit-known-issues * Merge from base branch * EUI-8821 Register Other Org - Service not listed * EUI-8797 Register other org - CYA display amendments * EUI-8838 Register Other Other - Back link not working * Create renovate.json * Create renovate.json * Create renovate.json * EUI-8838 Register Other Other - Back link not working * Update organisation-services-access.component.spec.ts * EUI-8838 Register Other Other - Back link not working * EUI-8838 Register Other Other - Back link not working * Update organisation-services-access.component.ts * EUI-8838 Register Other Other - Back link not working * fix the 7 digit PBA * Call Lov API for org type * initialise PBA * pba fix * EUI-8838 Register Other Other - Back link not working * Update organisation-services-access.component.ts * Update regulator-details.component.spec.ts * Update organisation-services-access.component.spec.ts * pba * Add value to preview yaml * register org automation test page object steps updates * EUI-8838 Register Other Other - Back link not working * Fix the unit tests * EUI-8838 Register Other Other - Back link not working * Feature/e UI 8771 postcode lookup validation (#1112) * Commit address component changes before merge * Finalise changes * Change version * Make changes to ensure back to address works correctly * Post Registration Data (#1122) * Post Registration Data * Add Validation for checkbox * Adding error handling * lint fix * Update company-house-details.component.spec.ts * code review comments * refactoring * fix ordering * Clear session * fix Organisation Type * yarn audit * add cancel Link --------- Co-authored-by: John Benjamin <john.benjamin@hmcts.net> Co-authored-by: connorpgpmcelroy <74015088+connorpgpmcelroy@users.noreply.github.com> * EUI-8835 Register Other Org - Organisation page changes (#1124) * EUI-8835 Register Other Org - Organisation page changes * EUI-8835 Register Other Org - Organisation page changes * EUI-8835 Register Other Org - Organisation page changes * EUI-8835 Register Other Org - Organisation page changes * EUI-8835 Register Other Org - Organisation page changes * EUI-8835 Register Other Org - Organisation page changes * e2e test for register other create scenario (#1128) * e2e test for register other create scenario * ROO basic flow fixes * Add required changes and test changes (#1131) * Add required changes and test changes * Add the previousUrl existence check * Make previousUrl change * system user auth for prd api * ROO e2e test fix for current change impact on test * new register org BDD scenarios * Feature/e UI 8869 (#1135) * Integrate Create Organisation * Organisation Type * remove dead code * Feature toggle Organisation Details * Update app.routes.ts (#1136) * Update app.routes.ts Blocks and redirects either of two routes to the other * Update app.routes.ts * Change common-lib for tag * Change tag * fix Address optional fields (#1142) * ROO functional tests (#1139) * emabled playwring as codecept driver * CVE suppress * hooks fix * more ROO tests * ROO test updates * yarn audit changes * playwright chromium install * functional test screenshot fix, invite user fix * test fixes * excluded in-dev and failing tests * test fix * test inclusion exclsuion in AAT preview for feature toggles features * Unassigned cases functional tests added * smoke test fix * smoke test command fix * yarn functional test command fix * CVE updates * functional test comand update * assigned cases tests added --------- Co-authored-by: Uday Denduluri <uday.denduluri1@hmcts.net> * test update * a11y test fix * Override the LD Key for Preview (#1143) * Override LD Key * Adding ENV * lint fix * preview changes * preview * preview LD key * LAUNCH_DARKLY_CLIENT_ID * LD client * audit changes --------- Co-authored-by: sreekanthpuligadda <52752138+sreekanthpuligadda@users.noreply.github.com> Co-authored-by: connorpgpmcelroy <74015088+connorpgpmcelroy@users.noreply.github.com> * CVE updates --------- Co-authored-by: Uday Denduluri <uday.denduluri1@hmcts.net> Co-authored-by: DavidJayakumar <David.Jayakumar@hmcts.net> Co-authored-by: David Rajkumar Jayakumar <107850923+DavidJayakumar@users.noreply.github.com> Co-authored-by: connorpgpmcelroy <connor.mcelroy@hmcts.net> Co-authored-by: udaydenduluri33 <50869558+udaydenduluri33@users.noreply.github.com> Co-authored-by: sreekanthpuligadda <52752138+sreekanthpuligadda@users.noreply.github.com> Co-authored-by: connorpgpmcelroy <74015088+connorpgpmcelroy@users.noreply.github.com> Co-authored-by: sreekanthpuligadda <sreekanth.puligadda@hmcts.net>
- Loading branch information
1 parent
28a1fa9
commit 76ed751
Showing
140 changed files
with
6,682 additions
and
972 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import { AddressModel } from '@hmcts/rpx-xui-common-lib'; | ||
|
||
export interface ContactDetails { | ||
firstName: string; | ||
lastName: string; | ||
workEmailAddress: string; | ||
} | ||
|
||
export interface Regulator { | ||
regulatorType: string; | ||
regulatorName?: string; | ||
organisationRegistrationNumber?: string; | ||
} | ||
|
||
export interface OrganisationType { | ||
key: string; | ||
description: string; | ||
} | ||
|
||
export type RegistrationData = { | ||
companyName: string; | ||
companyHouseNumber?: string; | ||
hasDxReference: boolean; | ||
dxNumber?: string; | ||
dxExchange?: string; | ||
services: string[]; | ||
otherServices?: string; | ||
hasPBA: boolean; | ||
contactDetails: ContactDetails; | ||
address: AddressModel; | ||
organisationType: OrganisationType; | ||
otherOrganisationType?: string; | ||
otherOrganisationDetail?: string; | ||
regulatorRegisteredWith: string; | ||
inInternationalMode: boolean; | ||
regulators: Regulator[]; | ||
hasIndividualRegisteredWithRegulator: boolean; | ||
individualRegulators?: Regulator[]; | ||
pbaNumbers: string[]; | ||
} | ||
|
||
export type RegistrationRequest = { | ||
name: string, | ||
status?: string, | ||
statusMessage?: string, | ||
sraId?: string, | ||
sraRegulated?: string, | ||
companyNumber?: string, | ||
companyUrl?: string, | ||
superUser: { | ||
firstName: string, | ||
lastName: string, | ||
email: string | ||
}, | ||
paymentAccount: string [], | ||
contactInformation: [ | ||
{ | ||
uprn?: string, | ||
addressLine1: string, | ||
addressLine2: string, | ||
addressLine3: string, | ||
townCity: string, | ||
county: string, | ||
country: string, | ||
postCode: string, | ||
dxAddress?: [ | ||
{ | ||
dxNumber: string, | ||
dxExchange: string | ||
} | ||
] | ||
} | ||
], | ||
orgType: string, | ||
orgAttributes?: [ | ||
{ | ||
key: string, | ||
value: string | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
export const organisationTypes = [ | ||
{ name: 'Solicitor Regulation Authority', id: 'SRA' }, | ||
{ name: 'Financial Conduct Authority', id: 'FCA' }, | ||
{ name: 'Institute of Charted Accountants for England and Wales', id: 'ICA' }, | ||
{ name: 'Charted Institute for Legal Executives', id: 'CILE' }, | ||
{ name: 'Certification For Bar Standard Boards', id: 'CFBSS' }, | ||
{ name: 'Office of Immigration Services Commissioner (OISC)', id: 'OISC' }, | ||
{ name: 'Solicitor Regulation Authority (SRA)', id: 'SRA' }, | ||
{ name: 'Financial Conduct Authority (FCA)', id: 'FCA' }, | ||
{ name: 'Institute of Charted Accountants in England and Wales', id: 'ICA' }, | ||
{ name: 'Charted Institute of Legal Executives', id: 'CILE' }, | ||
{ name: 'Certification by the Bar Standards Board', id: 'CFBSS' }, | ||
{ name: 'Office of the Immigration Services Commissioner (OISC)', id: 'OISC' }, | ||
{ name: 'Law Society of England and Wales', id: 'LSEW' }, | ||
{ name: 'Law Society of Scotland', id: 'LSS' }, | ||
{ name: 'Other', id: 'Other' }, | ||
{ name: 'Not Applicable', id: 'NA' } | ||
]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
import { NextFunction, Request, Response, Router } from 'express'; | ||
import { RegistrationData, RegistrationRequest } from '../models/registrationData'; | ||
import { generateS2sToken } from '../lib/s2sTokenGeneration'; | ||
import { getConfigValue } from '../configuration'; | ||
import { SERVICES_RD_PROFESSIONAL_API_PATH, SERVICE_S2S_PATH } from '../configuration/references'; | ||
import { http } from '../lib/http'; | ||
|
||
export function mapRequestObject(requestBody: RegistrationData): RegistrationRequest { | ||
const request: RegistrationRequest = { | ||
name: requestBody.companyName, | ||
companyNumber: requestBody.companyHouseNumber, | ||
superUser: { | ||
firstName: requestBody.contactDetails.firstName, | ||
lastName: requestBody.contactDetails.lastName, | ||
email: requestBody.contactDetails.workEmailAddress | ||
}, | ||
paymentAccount: requestBody.pbaNumbers, | ||
contactInformation: [ | ||
{ | ||
addressLine1: requestBody.address.addressLine1, | ||
addressLine2: convertEmptyStringToNull(requestBody.address.addressLine2), | ||
addressLine3: convertEmptyStringToNull(requestBody.address.addressLine3), | ||
townCity: requestBody.address.postTown, | ||
county: requestBody.address.county, | ||
country: requestBody.address.country, | ||
postCode: requestBody.address.postCode, | ||
dxAddress: getDx(requestBody) | ||
} | ||
], | ||
orgType: requestBody.organisationType.key | ||
}; | ||
return request; | ||
} | ||
|
||
export const router = Router({ mergeParams: true }); | ||
|
||
function getDx(requestBody: RegistrationData): [{ dxNumber: string; dxExchange: string; }] { | ||
const dxNumber = convertEmptyStringToNull(requestBody.dxNumber); | ||
const dxExchange = convertEmptyStringToNull(requestBody.dxExchange); | ||
if (dxNumber && dxExchange) { | ||
return [{ | ||
dxNumber, | ||
dxExchange | ||
}]; | ||
} | ||
return null; | ||
} | ||
|
||
export async function handleRegisterOrgRoute(req: Request, res: Response, next: NextFunction): Promise<any> { | ||
const registerPayload = req.body as RegistrationData; | ||
|
||
const s2sServicePath = getConfigValue(SERVICE_S2S_PATH); | ||
|
||
const s2sToken = await generateS2sToken(s2sServicePath); | ||
const rdProfessionalPath = getConfigValue(SERVICES_RD_PROFESSIONAL_API_PATH); | ||
/** | ||
* We use the S2S token to set the headers. | ||
*/ | ||
const url = `${rdProfessionalPath}/refdata/external/v2/organisations`; | ||
const options = { | ||
headers: { ServiceAuthorization: `Bearer ${s2sToken}` } | ||
}; | ||
const axiosInstance = http({} as unknown as Request); | ||
try { | ||
const registerRequest = mapRequestObject(registerPayload); | ||
const response = await axiosInstance.post(url, registerRequest, options); | ||
res.send(response.data); | ||
} catch (error) { | ||
next(error); | ||
} | ||
} | ||
|
||
router.post('/register', handleRegisterOrgRoute); | ||
|
||
export default router; | ||
|
||
function convertEmptyStringToNull(term: string): string { | ||
return term === '' ? null : term; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.