diff --git a/.github/workflows/deploy-prod.yml b/.github/workflows/deploy-prod.yml index 30f89c55d..45b819afb 100644 --- a/.github/workflows/deploy-prod.yml +++ b/.github/workflows/deploy-prod.yml @@ -28,7 +28,7 @@ jobs: - uses: trstringer/manual-approval@v1 with: secret: ${{ github.TOKEN }} - approvers: euanmillar,rikukissa + approvers: euanmillar,rikukissa,alsmk minimum-approvals: 1 issue-title: 'Deploy (${{ github.event.inputs.environment }}): core: ${{ github.event.inputs.core-image-tag }} country config: ${{ github.event.inputs.countryconfig-image-tag }}' issue-body: 'Please approve or deny the deployment of core: ${{ github.event.inputs.core-image-tag }} country config: ${{ github.event.inputs.countryconfig-image-tag }} to ${{ github.event.inputs.environment }}' diff --git a/CHANGELOG.md b/CHANGELOG.md index f2206826c..098549d6f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,8 @@ - "Publish release" pipeline now correctly uses the "Branch to build from" value as the branch to be tagged. Previously it tried tagging "master". "Release tag" is also now used as the release version as is instead of it being read from `package.json`. - Backup process now doesn't require internet connection to download docker images thus working more reliably when internet connections are unreliable. Previously non-active images were cleaned nightly, now we only do it as part of deployment. [#7896](https://github.com/opencrvs/opencrvs-core/issues/7896) - We make sure that the automatic cleanup job only runs before deployment (instead of cron schedule cleanup). +- Previously it was possible MongoDB replica set and users were left randomly uninitialised after a deployment. MongoDB initialisation container now retries on failure. +- On some machines 'file' utility was not preinstalled causing provision to fail. We now install the utility if it doesn't exist. ### Breaking changes @@ -49,8 +51,11 @@ INSERT CSV ROWS IN ENGLISH ONLY ### Bug fixes - Fix a typo in the birth certificate svg code that was causing the birth certificate to fail to render in the `print certified copy` flow. [7886](https://github.com/opencrvs/opencrvs-core/issues/7886) +- We make sure that the automatic cleanup job only runs before deployment (instead of cron schedule cleanup). +- Previously it was possible MongoDB replica set and users were left randomly uninitialised after a deployment. MongoDB initialisation container now retries on failure. +- On some machines 'file' utility was not preinstalled causing provision to fail. We now install the utility if it doesn't exist. -## 1.6.0 Release candidate +## 1.6.0 ### Breaking changes @@ -97,6 +102,7 @@ INSERT CSV ROWS IN ENGLISH ONLY 5. 'PHONE_NUMBER', 6. 'EMAIL' - Updated `allowedFileFormats` in signature fields to use MIME types (`image/png`, `image/jpg`, `image/jpeg`, `image/svg`) instead of simple file extensions. If you are already using the `allowedFileFormats` field in your implementation, please ensure to update the format accordingly. +- The details exists conditionals for the various sections i.e. father, mother, spouse has to use the `values.detailsExist` property instead of accessing it from `draftData.[sectionName].detailsExists`. This is due to the fact that the draftData is not populated until any changes have been made to any of the fields in the current section. ### New features @@ -131,6 +137,7 @@ INSERT CSV ROWS IN ENGLISH ONLY - Github pipeline dedicated for reading secrets and variables from other environments now checks if GH_TOKEN is still valid before attempting other operations - Remove unnecessary UI dividers that add in various sections of the declaration forms(e.g the Death, Birth and Marriage forms) [#244](https://github.com/opencrvs/opencrvs-countryconfig/pull/244) - Update template transformer for fields `informantType` and `otherInformantType` that fixes the bug of unavailability of these template fields [#5952](https://github.com/opencrvs/opencrvs-countryconfig/pull/5952) +- Fixed missing InitialValue property to set initial values based on an expression ## 1.5.2 (https://github.com/opencrvs/opencrvs-countryconfig/compare/v1.5.1...v1.5.2) diff --git a/e2e/helpers.ts b/e2e/helpers.ts index 01e835b9a..8f37aa543 100644 --- a/e2e/helpers.ts +++ b/e2e/helpers.ts @@ -8,6 +8,7 @@ import { } from './constants' import { format, parseISO } from 'date-fns' import { isArray, random } from 'lodash' +import fetch from 'node-fetch' export async function login(page: Page, username: string, password: string) { const token = await getToken(username, password) diff --git a/e2e/testcases/applications/17-validate-user-can-correct-a-record-from-audit-record-page.spec.ts b/e2e/testcases/applications/17-validate-user-can-correct-a-record-from-audit-record-page.spec.ts index 020040d3c..7d4eecc20 100644 --- a/e2e/testcases/applications/17-validate-user-can-correct-a-record-from-audit-record-page.spec.ts +++ b/e2e/testcases/applications/17-validate-user-can-correct-a-record-from-audit-record-page.spec.ts @@ -6,7 +6,7 @@ import { getToken, login } from '../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { createDeclaration } from '../birth/helpers' import TEST_DATA_1 from '../birth/data/1-both-mother-and-father.json' import { CREDENTIALS } from '../../constants' @@ -25,8 +25,8 @@ test.describe const token = await getToken('k.mweene', 'test') const res = await createDeclaration(token, { child: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName(), + firstNames: faker.person.firstName(), + familyName: faker.person.firstName(), gender: TEST_DATA_1['Child details'].Sex.toLowerCase() as 'male' }, informant: { @@ -40,12 +40,12 @@ test.describe ].toUpperCase() as 'PHYSICIAN' }, mother: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName() + firstNames: faker.person.firstName(), + familyName: faker.person.firstName() }, father: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName() + firstNames: faker.person.firstName(), + familyName: faker.person.firstName() } }) expect(res).toStrictEqual({ diff --git a/e2e/testcases/birth/1-birth-event-declaration.spec.ts b/e2e/testcases/birth/1-birth-event-declaration.spec.ts index 99107e4e0..78426dfaf 100644 --- a/e2e/testcases/birth/1-birth-event-declaration.spec.ts +++ b/e2e/testcases/birth/1-birth-event-declaration.spec.ts @@ -3,7 +3,7 @@ import { createPIN, getToken, login } from '../../helpers' import { createDeclaration } from './helpers' import TEST_DATA_1 from './data/1-both-mother-and-father.json' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { CREDENTIALS } from '../../constants' test.describe('1. Birth event declaration', () => { @@ -569,8 +569,8 @@ test.describe('1. Birth event declaration', () => { const token = await getToken('k.mweene', 'test') const res = await createDeclaration(token, { child: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName(), + firstNames: faker.person.firstName(), + familyName: faker.person.firstName(), gender: TEST_DATA_1['Child details'].Sex.toLowerCase() as 'male' }, informant: { @@ -584,12 +584,12 @@ test.describe('1. Birth event declaration', () => { ].toUpperCase() as 'PHYSICIAN' }, mother: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName() + firstNames: faker.person.firstName(), + familyName: faker.person.firstName() }, father: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName() + firstNames: faker.person.firstName(), + familyName: faker.person.firstName() } }) expect(res).toStrictEqual({ diff --git a/e2e/testcases/birth/8-validate-declaration-review-page.spec.ts b/e2e/testcases/birth/8-validate-declaration-review-page.spec.ts index e1035c0eb..26294d50f 100644 --- a/e2e/testcases/birth/8-validate-declaration-review-page.spec.ts +++ b/e2e/testcases/birth/8-validate-declaration-review-page.spec.ts @@ -12,7 +12,7 @@ import { getAction, assignRecord } from '../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { CREDENTIALS } from '../../constants' test.describe.serial('8. Validate declaration review page', () => { @@ -20,8 +20,8 @@ test.describe.serial('8. Validate declaration review page', () => { const declaration = { child: { name: { - firstNames: faker.name.firstName('male'), - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male'), + familyName: faker.person.lastName('male') }, gender: 'Male', birthDate: getRandomDate(0, 200) @@ -35,13 +35,13 @@ test.describe.serial('8. Validate declaration review page', () => { informantEmail: faker.internet.email(), mother: { name: { - firstNames: faker.name.firstName('female'), - familyName: faker.name.lastName('female') + firstNames: faker.person.firstName('female'), + familyName: faker.person.lastName('female') }, birthDate: getRandomDate(20, 200), nationality: 'Farajaland', identifier: { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'National ID' }, address: { @@ -52,13 +52,13 @@ test.describe.serial('8. Validate declaration review page', () => { }, father: { name: { - firstNames: faker.name.firstName('male'), - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male'), + familyName: faker.person.lastName('male') }, birthDate: getRandomDate(22, 200), nationality: 'Farajaland', identifier: { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'National ID' }, address: 'Same as mother' @@ -422,8 +422,8 @@ test.describe.serial('8. Validate declaration review page', () => { await page.locator('#child-content #Full').getByText('Change').click() declaration.child.name = { - firstNames: faker.name.firstName('male'), - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male'), + familyName: faker.person.lastName('male') } await page .locator('#firstNamesEng') @@ -612,8 +612,8 @@ test.describe.serial('8. Validate declaration review page', () => { test("8.1.2.10 Change mother's name", async () => { await page.locator('#mother-content #Full').getByText('Change').click() - declaration.mother.name.firstNames = faker.name.firstName('female') - declaration.mother.name.familyName = faker.name.lastName('female') + declaration.mother.name.firstNames = faker.person.firstName('female') + declaration.mother.name.familyName = faker.person.lastName('female') await page .locator('#firstNamesEng') .fill(declaration.mother.name.firstNames) @@ -695,7 +695,7 @@ test.describe.serial('8. Validate declaration review page', () => { test("8.1.2.14 Change mother's ID", async () => { await page.locator('#mother-content #ID').getByText('Change').click() - declaration.mother.identifier.id = faker.random.numeric(10) + declaration.mother.identifier.id = faker.string.numeric(10) await page .locator('#motherPassport') .fill(declaration.mother.identifier.id) @@ -738,8 +738,8 @@ test.describe.serial('8. Validate declaration review page', () => { test("8.1.2.16 Change father's name", async () => { await page.locator('#father-content #Full').getByText('Change').click() - declaration.father.name.firstNames = faker.name.firstName('male') - declaration.father.name.familyName = faker.name.lastName('male') + declaration.father.name.firstNames = faker.person.firstName('male') + declaration.father.name.familyName = faker.person.lastName('male') await page .locator('#firstNamesEng') .fill(declaration.father.name.firstNames) @@ -821,7 +821,7 @@ test.describe.serial('8. Validate declaration review page', () => { test("8.1.2.20 Change father's ID", async () => { await page.locator('#father-content #ID').getByText('Change').click() - declaration.father.identifier.id = faker.random.numeric(10) + declaration.father.identifier.id = faker.string.numeric(10) await page .locator('#fatherPassport') .fill(declaration.father.identifier.id) @@ -1349,7 +1349,7 @@ test.describe.serial('8. Validate declaration review page', () => { ]) }) - const newFamilyNameForChild = faker.name.lastName('male') + const newFamilyNameForChild = faker.person.lastName('male') test("8.3.2.1 Update child's family name", async () => { await page diff --git a/e2e/testcases/birth/declarations/birth-declaration-1.spec.ts b/e2e/testcases/birth/declarations/birth-declaration-1.spec.ts index 2ca50b831..6a076a514 100644 --- a/e2e/testcases/birth/declarations/birth-declaration-1.spec.ts +++ b/e2e/testcases/birth/declarations/birth-declaration-1.spec.ts @@ -12,7 +12,7 @@ import { goToSection, login } from '../../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { CREDENTIALS } from '../../../constants' test.describe.serial('1. Birth declaration case - 1', () => { @@ -41,7 +41,7 @@ test.describe.serial('1. Birth declaration case - 1', () => { birthDate: getRandomDate(20, 200), nationality: 'Farajaland', identifier: { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'National ID' }, address: { @@ -49,11 +49,11 @@ test.describe.serial('1. Birth declaration case - 1', () => { province: 'Sulaka', district: 'Irundu', urbanOrRural: 'Urban', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() }, maritalStatus: 'Single', levelOfEducation: 'No schooling' @@ -66,7 +66,7 @@ test.describe.serial('1. Birth declaration case - 1', () => { birthDate: getRandomDate(22, 200), nationality: 'Gabon', identifier: { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'National ID' }, maritalStatus: 'Single', diff --git a/e2e/testcases/birth/declarations/birth-declaration-10.spec.ts b/e2e/testcases/birth/declarations/birth-declaration-10.spec.ts index b04099944..ef7a4f7df 100644 --- a/e2e/testcases/birth/declarations/birth-declaration-10.spec.ts +++ b/e2e/testcases/birth/declarations/birth-declaration-10.spec.ts @@ -9,7 +9,7 @@ import { goToSection, login } from '../../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { CREDENTIALS } from '../../../constants' test.describe.serial('10. Birth declaration case - 10', () => { @@ -18,7 +18,7 @@ test.describe.serial('10. Birth declaration case - 10', () => { const declaration = { child: { name: { - firstNames: faker.name.lastName() + firstNames: faker.person.lastName() } }, informantType: 'Father', diff --git a/e2e/testcases/birth/declarations/birth-declaration-2.spec.ts b/e2e/testcases/birth/declarations/birth-declaration-2.spec.ts index 2834454fd..32fbaeb6f 100644 --- a/e2e/testcases/birth/declarations/birth-declaration-2.spec.ts +++ b/e2e/testcases/birth/declarations/birth-declaration-2.spec.ts @@ -13,7 +13,7 @@ import { joinValuesWith, login } from '../../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { CREDENTIALS } from '../../../constants' test.describe.serial('2. Birth declaration case - 2', () => { @@ -21,8 +21,8 @@ test.describe.serial('2. Birth declaration case - 2', () => { const declaration = { child: { name: { - firstNames: faker.name.firstName('female'), - familyName: faker.name.lastName('female') + firstNames: faker.person.firstName('female'), + familyName: faker.person.lastName('female') }, gender: 'Female', birthDate: getRandomDate(0, 200) @@ -35,23 +35,23 @@ test.describe.serial('2. Birth declaration case - 2', () => { province: 'Pualula', district: 'Funabuli', urbanOrRural: 'Urban', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() }, informantType: 'Father', informantEmail: faker.internet.email(), mother: { name: { - firstNames: faker.name.firstName('female'), - familyName: faker.name.lastName('female') + firstNames: faker.person.firstName('female'), + familyName: faker.person.lastName('female') }, age: 21, nationality: 'Fiji', identifier: { - id: faker.random.numeric(12), + id: faker.string.numeric(12), type: 'Passport' }, address: { @@ -59,20 +59,20 @@ test.describe.serial('2. Birth declaration case - 2', () => { province: 'Sulaka', district: 'Irundu', urbanOrRural: 'Rural', - village: faker.address.county() + village: faker.location.county() }, maritalStatus: 'Married', levelOfEducation: 'Primary' }, father: { name: { - firstNames: faker.name.firstName('male'), - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male'), + familyName: faker.person.lastName('male') }, age: 25, nationality: 'Farajaland', identifier: { - id: faker.random.numeric(8), + id: faker.string.numeric(8), type: 'Passport' }, maritalStatus: 'Married', @@ -83,11 +83,11 @@ test.describe.serial('2. Birth declaration case - 2', () => { province: 'Sulaka', district: 'Zobwe', urbanOrRural: 'Urban', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() } } } diff --git a/e2e/testcases/birth/declarations/birth-declaration-3.spec.ts b/e2e/testcases/birth/declarations/birth-declaration-3.spec.ts index eebf06888..f99b5ea8a 100644 --- a/e2e/testcases/birth/declarations/birth-declaration-3.spec.ts +++ b/e2e/testcases/birth/declarations/birth-declaration-3.spec.ts @@ -14,7 +14,7 @@ import { uploadImage, uploadImageToSection } from '../../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { CREDENTIALS } from '../../../constants' test.describe.serial('3. Birth declaration case - 3', () => { @@ -22,8 +22,8 @@ test.describe.serial('3. Birth declaration case - 3', () => { const declaration = { child: { name: { - firstNames: faker.name.firstName() + '_Peter', - familyName: faker.name.lastName() + firstNames: faker.person.firstName() + '_Peter', + familyName: faker.person.lastName() }, gender: 'Unknown', birthDate: getRandomDate(0, 200) @@ -36,19 +36,19 @@ test.describe.serial('3. Birth declaration case - 3', () => { province: 'Pualula', district: 'Funabuli', urbanOrRural: 'Rural', - village: faker.address.county() + village: faker.location.county() }, informantType: 'Grandfather', informantEmail: faker.internet.email(), informant: { name: { - firstNames: faker.name.firstName('male'), - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male'), + familyName: faker.person.lastName('male') }, birthDate: getRandomDate(40, 200), nationality: 'Farajaland', identifier: { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'National ID' }, address: { @@ -56,46 +56,46 @@ test.describe.serial('3. Birth declaration case - 3', () => { province: 'Chuminga', district: 'Ama', urbanOrRural: 'Urban', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() } }, mother: { name: { - firstNames: faker.name.firstName('female'), - familyName: faker.name.lastName('female') + firstNames: faker.person.firstName('female'), + familyName: faker.person.lastName('female') }, birthDate: getRandomDate(20, 200), nationality: 'Farajaland', identifier: { - id: faker.random.numeric(9), + id: faker.string.numeric(9), type: 'Birth Registration Number' }, address: { country: 'Djibouti', - state: faker.address.state(), - district: faker.address.county(), - town: faker.address.city(), - addressLine1: faker.address.county(), - addressLine2: faker.address.streetName(), - addressLine3: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + state: faker.location.state(), + district: faker.location.county(), + town: faker.location.city(), + addressLine1: faker.location.county(), + addressLine2: faker.location.street(), + addressLine3: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() }, maritalStatus: 'Widowed', levelOfEducation: 'Secondary' }, father: { name: { - firstNames: faker.name.firstName('male'), - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male'), + familyName: faker.person.lastName('male') }, birthDate: getRandomDate(22, 200), nationality: 'Gabon', identifier: { - id: faker.random.numeric(11), + id: faker.string.numeric(11), type: 'Birth Registration Number' }, maritalStatus: 'Widowed', @@ -106,7 +106,7 @@ test.describe.serial('3. Birth declaration case - 3', () => { province: 'Chuminga', district: 'Nsali', urbanOrRural: 'Rural', - village: faker.address.county() + village: faker.location.county() } } } diff --git a/e2e/testcases/birth/declarations/birth-declaration-4.spec.ts b/e2e/testcases/birth/declarations/birth-declaration-4.spec.ts index 7e7cedf46..f216d855e 100644 --- a/e2e/testcases/birth/declarations/birth-declaration-4.spec.ts +++ b/e2e/testcases/birth/declarations/birth-declaration-4.spec.ts @@ -13,7 +13,7 @@ import { joinValuesWith, login } from '../../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { CREDENTIALS } from '../../../constants' test.describe.serial('4. Birth declaration case - 4', () => { @@ -21,8 +21,8 @@ test.describe.serial('4. Birth declaration case - 4', () => { const declaration = { child: { name: { - firstNames: faker.name.firstName() + '-Peter', - familyName: faker.name.lastName() + firstNames: faker.person.firstName() + '-Peter', + familyName: faker.person.lastName() }, gender: 'Unknown', birthDate: getRandomDate(0, 200) @@ -35,23 +35,23 @@ test.describe.serial('4. Birth declaration case - 4', () => { province: 'Pualula', district: 'Funabuli', urbanOrRural: 'Urban', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() }, informantType: 'Grandmother', informantEmail: faker.internet.email(), informant: { name: { - firstNames: faker.name.firstName('female'), - familyName: faker.name.lastName('female') + firstNames: faker.person.firstName('female'), + familyName: faker.person.lastName('female') }, age: 60, nationality: 'Guernsey', identifier: { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'Passport' }, address: { @@ -59,13 +59,13 @@ test.describe.serial('4. Birth declaration case - 4', () => { province: 'Chuminga', district: 'Ama', urbanOrRural: 'Rural', - village: faker.address.county() + village: faker.location.county() } }, mother: { name: { - firstNames: faker.name.firstName('female'), - familyName: faker.name.lastName('female') + firstNames: faker.person.firstName('female'), + familyName: faker.person.lastName('female') }, age: 25, nationality: 'Farajaland', @@ -74,21 +74,21 @@ test.describe.serial('4. Birth declaration case - 4', () => { }, address: { country: 'Guam', - state: faker.address.state(), - district: faker.address.county(), - town: faker.address.city(), - addressLine1: faker.address.county(), - addressLine2: faker.address.streetName(), - addressLine3: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + state: faker.location.state(), + district: faker.location.county(), + town: faker.location.city(), + addressLine1: faker.location.county(), + addressLine2: faker.location.street(), + addressLine3: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() }, maritalStatus: 'Divorced', levelOfEducation: 'Tertiary' }, father: { name: { - firstNames: faker.name.firstName('male'), - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male'), + familyName: faker.person.lastName('male') }, birthDate: getRandomDate(22, 200), nationality: 'Farajaland', @@ -100,13 +100,13 @@ test.describe.serial('4. Birth declaration case - 4', () => { address: { sameAsMother: false, country: 'Grenada', - state: faker.address.state(), - district: faker.address.county(), - town: faker.address.city(), - addressLine1: faker.address.county(), - addressLine2: faker.address.streetName(), - addressLine3: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + state: faker.location.state(), + district: faker.location.county(), + town: faker.location.city(), + addressLine1: faker.location.county(), + addressLine2: faker.location.street(), + addressLine3: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() } } } diff --git a/e2e/testcases/birth/declarations/birth-declaration-5.spec.ts b/e2e/testcases/birth/declarations/birth-declaration-5.spec.ts index 65bf0a713..1e37bffed 100644 --- a/e2e/testcases/birth/declarations/birth-declaration-5.spec.ts +++ b/e2e/testcases/birth/declarations/birth-declaration-5.spec.ts @@ -11,7 +11,7 @@ import { joinValuesWith, login } from '../../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { CREDENTIALS } from '../../../constants' test.describe.serial('5. Birth declaration case - 5', () => { @@ -19,8 +19,8 @@ test.describe.serial('5. Birth declaration case - 5', () => { const declaration = { child: { name: { - firstNames: faker.name.firstName() + ' the 3rd', - familyName: faker.name.lastName() + firstNames: faker.person.firstName() + ' the 3rd', + familyName: faker.person.lastName() }, gender: 'Unknown', birthDate: getRandomDate(0, 200) @@ -33,36 +33,36 @@ test.describe.serial('5. Birth declaration case - 5', () => { province: 'Pualula', district: 'Funabuli', urbanOrRural: 'Rural', - village: faker.address.county() + village: faker.location.county() }, informantType: 'Brother', informantEmail: faker.internet.email(), informant: { name: { - firstNames: faker.name.firstName('male'), - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male'), + familyName: faker.person.lastName('male') }, age: 16, nationality: 'Guernsey', identifier: { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'Birth Registration Number' }, address: { country: 'Haiti', - state: faker.address.state(), - district: faker.address.county(), - town: faker.address.city(), - addressLine1: faker.address.county(), - addressLine2: faker.address.streetName(), - addressLine3: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + state: faker.location.state(), + district: faker.location.county(), + town: faker.location.city(), + addressLine1: faker.location.county(), + addressLine2: faker.location.street(), + addressLine3: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() } }, mother: { name: { - firstNames: faker.name.firstName('female'), - familyName: faker.name.lastName('female') + firstNames: faker.person.firstName('female'), + familyName: faker.person.lastName('female') }, age: 25, nationality: 'Farajaland', @@ -71,13 +71,13 @@ test.describe.serial('5. Birth declaration case - 5', () => { }, address: { country: 'Guam', - state: faker.address.state(), - district: faker.address.county(), - town: faker.address.city(), - addressLine1: faker.address.county(), - addressLine2: faker.address.streetName(), - addressLine3: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + state: faker.location.state(), + district: faker.location.county(), + town: faker.location.city(), + addressLine1: faker.location.county(), + addressLine2: faker.location.street(), + addressLine3: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() }, maritalStatus: 'Separated', levelOfEducation: 'Tertiary' diff --git a/e2e/testcases/birth/declarations/birth-declaration-6.spec.ts b/e2e/testcases/birth/declarations/birth-declaration-6.spec.ts index e834b27f7..112ade170 100644 --- a/e2e/testcases/birth/declarations/birth-declaration-6.spec.ts +++ b/e2e/testcases/birth/declarations/birth-declaration-6.spec.ts @@ -11,7 +11,7 @@ import { joinValuesWith, login } from '../../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { CREDENTIALS } from '../../../constants' test.describe.serial('6. Birth declaration case - 6', () => { @@ -19,8 +19,8 @@ test.describe.serial('6. Birth declaration case - 6', () => { const declaration = { child: { name: { - firstNames: faker.name.firstName() + " O'Neil", - familyName: faker.name.lastName() + firstNames: faker.person.firstName() + " O'Neil", + familyName: faker.person.lastName() }, gender: 'Unknown', birthDate: getRandomDate(0, 200) @@ -30,20 +30,20 @@ test.describe.serial('6. Birth declaration case - 6', () => { placeOfBirth: 'Other', birthLocation: { country: 'Greenland', - state: faker.address.state(), - district: faker.address.county(), - town: faker.address.city(), - addressLine1: faker.address.county(), - addressLine2: faker.address.streetName(), - addressLine3: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + state: faker.location.state(), + district: faker.location.county(), + town: faker.location.city(), + addressLine1: faker.location.county(), + addressLine2: faker.location.street(), + addressLine3: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() }, informantType: 'Sister', informantEmail: faker.internet.email(), informant: { name: { - firstNames: faker.name.firstName('female'), - familyName: faker.name.lastName('female') + firstNames: faker.person.firstName('female'), + familyName: faker.person.lastName('female') }, age: 17, nationality: 'Guernsey', @@ -52,19 +52,19 @@ test.describe.serial('6. Birth declaration case - 6', () => { }, address: { country: 'Haiti', - state: faker.address.state(), - district: faker.address.county(), - town: faker.address.city(), - addressLine1: faker.address.county(), - addressLine2: faker.address.streetName(), - addressLine3: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + state: faker.location.state(), + district: faker.location.county(), + town: faker.location.city(), + addressLine1: faker.location.county(), + addressLine2: faker.location.street(), + addressLine3: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() } }, father: { name: { - firstNames: faker.name.firstName('male'), - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male'), + familyName: faker.person.lastName('male') }, age: 25, nationality: 'Farajaland', @@ -73,13 +73,13 @@ test.describe.serial('6. Birth declaration case - 6', () => { }, address: { country: 'Guam', - state: faker.address.state(), - district: faker.address.county(), - town: faker.address.city(), - addressLine1: faker.address.county(), - addressLine2: faker.address.streetName(), - addressLine3: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + state: faker.location.state(), + district: faker.location.county(), + town: faker.location.city(), + addressLine1: faker.location.county(), + addressLine2: faker.location.street(), + addressLine3: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() }, maritalStatus: 'Separated', levelOfEducation: 'Tertiary' diff --git a/e2e/testcases/birth/declarations/birth-declaration-7.spec.ts b/e2e/testcases/birth/declarations/birth-declaration-7.spec.ts index e05dd0537..8d8156521 100644 --- a/e2e/testcases/birth/declarations/birth-declaration-7.spec.ts +++ b/e2e/testcases/birth/declarations/birth-declaration-7.spec.ts @@ -11,7 +11,7 @@ import { uploadImage, uploadImageToSection } from '../../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { CREDENTIALS } from '../../../constants' test.describe.serial('7. Birth declaration case - 7', () => { @@ -20,8 +20,8 @@ test.describe.serial('7. Birth declaration case - 7', () => { const declaration = { child: { name: { - firstNames: faker.name.firstName(), - familyName: faker.name.lastName() + firstNames: faker.person.firstName(), + familyName: faker.person.lastName() } }, attendantAtBirth: 'None', diff --git a/e2e/testcases/birth/declarations/birth-declaration-9.spec.ts b/e2e/testcases/birth/declarations/birth-declaration-9.spec.ts index 9148afeb3..ecd28a25b 100644 --- a/e2e/testcases/birth/declarations/birth-declaration-9.spec.ts +++ b/e2e/testcases/birth/declarations/birth-declaration-9.spec.ts @@ -9,7 +9,7 @@ import { goToSection, login } from '../../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { CREDENTIALS } from '../../../constants' test.describe.serial('9. Birth declaration case - 9', () => { @@ -18,7 +18,7 @@ test.describe.serial('9. Birth declaration case - 9', () => { const declaration = { child: { name: { - familyName: faker.name.lastName() + familyName: faker.person.lastName() } }, informantType: 'Mother', diff --git a/e2e/testcases/birth/helpers.ts b/e2e/testcases/birth/helpers.ts index bd4dd6d76..a2f83fe8c 100644 --- a/e2e/testcases/birth/helpers.ts +++ b/e2e/testcases/birth/helpers.ts @@ -1,6 +1,6 @@ import { GATEWAY_HOST } from '../../constants' import { BirthRegistrationInput } from '../../gateway' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { readFileSync } from 'fs' import uuid from 'uuid' @@ -13,6 +13,7 @@ import { } from './queries' import { random } from 'lodash' import { generateRandomSuffix } from '../../helpers' +import fetch from 'node-fetch' export type BirthDetails = { informant: { @@ -92,7 +93,7 @@ export async function createDeclaration(token: string, details: BirthDetails) { join(__dirname, './data/assets/528KB-random.png') ).toString('base64'), informantType: details.informant.type, - contactPhoneNumber: '0' + faker.random.numeric(9), + contactPhoneNumber: '0' + faker.string.numeric(9), contactEmail: faker.internet.email(), draftId: uuid.v4() }, @@ -120,9 +121,9 @@ export async function createDeclaration(token: string, details: BirthDetails) { type: 'PRIVATE_HOME', address: { line: [ - faker.address.buildingNumber(), - faker.address.streetName(), - faker.address.cityName(), + faker.location.buildingNumber(), + faker.location.street(), + faker.location.city(), '', '', 'URBAN', @@ -141,8 +142,8 @@ export async function createDeclaration(token: string, details: BirthDetails) { locations, details.child.birthLocation?.district || 'Ibombo' ), - city: faker.address.cityName(), - postalCode: faker.address.zipCode() + city: faker.location.city(), + postalCode: faker.location.zipCode() } } : { @@ -166,7 +167,7 @@ export async function createDeclaration(token: string, details: BirthDetails) { nationality: ['FAR'], identifier: [ { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'NATIONAL_ID' } ], @@ -174,9 +175,9 @@ export async function createDeclaration(token: string, details: BirthDetails) { { type: 'PRIMARY_ADDRESS', line: [ - faker.address.buildingNumber(), - faker.address.streetName(), - faker.address.cityName(), + faker.location.buildingNumber(), + faker.location.street(), + faker.location.city(), '', '', 'URBAN', @@ -220,8 +221,8 @@ export async function createDeclaration(token: string, details: BirthDetails) { name: [ { use: 'en', - firstNames: faker.name.findName(), - familyName: faker.name.lastName() + firstNames: faker.person.firstName(), + familyName: faker.person.lastName() } ], birthDate: @@ -233,7 +234,7 @@ export async function createDeclaration(token: string, details: BirthDetails) { nationality: ['FAR'], identifier: [ { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'NATIONAL_ID' } ], @@ -272,8 +273,8 @@ export async function createDeclaration(token: string, details: BirthDetails) { name: [ { use: 'en', - firstNames: faker.name.findName(), - familyName: faker.name.lastName() + firstNames: faker.person.firstName(), + familyName: faker.person.lastName() } ], birthDate: format( @@ -283,7 +284,7 @@ export async function createDeclaration(token: string, details: BirthDetails) { nationality: ['FAR'], identifier: [ { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'NATIONAL_ID' } ], diff --git a/e2e/testcases/correction-birth/correct-birth-record-1.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-1.spec.ts index dc5658aaa..86f5cdca8 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-1.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-1.spec.ts @@ -15,7 +15,7 @@ import { uploadImage, uploadImageToSection } from '../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { ConvertEnumsToStrings, createDeclaration, @@ -30,8 +30,8 @@ test.describe('1. Correct record - 1', () => { let trackingId = '' const updatedChildDetails = { - firstNames: faker.name.firstName('female'), - familyName: faker.name.firstName('female'), + firstNames: faker.person.firstName('female'), + familyName: faker.person.firstName('female'), gender: 'Female', birthDate: format( subDays(new Date(), Math.ceil(10 * Math.random())), @@ -47,8 +47,8 @@ test.describe('1. Correct record - 1', () => { let token = await getToken('k.mweene', 'test') const declarationInput = { child: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName(), + firstNames: faker.person.firstName(), + familyName: faker.person.firstName(), gender: 'male' }, informant: { @@ -58,12 +58,12 @@ test.describe('1. Correct record - 1', () => { type: 'PHYSICIAN' }, mother: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName() + firstNames: faker.person.firstName(), + familyName: faker.person.firstName() }, father: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName() + firstNames: faker.person.firstName(), + familyName: faker.person.firstName() } } as ConvertEnumsToStrings diff --git a/e2e/testcases/correction-birth/correct-birth-record-2.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-2.spec.ts index 9d717f130..b6bef5121 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-2.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-2.spec.ts @@ -13,7 +13,7 @@ import { joinValuesWith, login } from '../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { ConvertEnumsToStrings, createDeclaration, @@ -31,24 +31,24 @@ test.describe.serial('Correct record - 2', () => { const updatedInformantDetails = { relationship: 'Sister', - firstNames: faker.name.firstName('female'), - familyName: faker.name.firstName('female'), + firstNames: faker.person.firstName('female'), + familyName: faker.person.firstName('female'), birthDate: format( subYears(new Date(), 25 + Math.ceil(10 * Math.random())), 'yyyy-MM-dd' ), email: faker.internet.email(), nationality: 'Nauru', - id: faker.random.numeric(10), + id: faker.string.numeric(10), idType: 'Passport', address: { province: 'Sulaka', district: 'Irundu', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - zipCode: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + zipCode: faker.location.zipCode() } } const updatedChildDetails = { @@ -56,11 +56,11 @@ test.describe.serial('Correct record - 2', () => { birthLocation: { province: 'Pualula', district: 'Ienge', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - zipCode: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + zipCode: faker.location.zipCode() } } @@ -76,8 +76,8 @@ test.describe.serial('Correct record - 2', () => { let token = await getToken('k.mweene', 'test') const declarationInput = { child: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName(), + firstNames: faker.person.firstName(), + familyName: faker.person.firstName(), gender: 'male' }, informant: { @@ -87,12 +87,12 @@ test.describe.serial('Correct record - 2', () => { type: 'PHYSICIAN' }, mother: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName() + firstNames: faker.person.firstName(), + familyName: faker.person.firstName() }, father: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName() + firstNames: faker.person.firstName(), + familyName: faker.person.firstName() } } as ConvertEnumsToStrings diff --git a/e2e/testcases/correction-birth/correct-birth-record-3.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-3.spec.ts index e91bbbb93..5bb865e77 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-3.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-3.spec.ts @@ -12,7 +12,7 @@ import { joinValuesWith, login } from '../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { ConvertEnumsToStrings, createDeclaration, @@ -29,21 +29,21 @@ test.describe.serial(' Correct record - 3', () => { let page: Page const updatedMotherDetails = { - firstNames: faker.name.firstName('female'), - familyName: faker.name.firstName('female'), + firstNames: faker.person.firstName('female'), + familyName: faker.person.firstName('female'), age: random(20, 45), email: faker.internet.email(), nationality: 'Nauru', - id: faker.random.numeric(10), + id: faker.string.numeric(10), idType: 'Passport', address: { province: 'Sulaka', district: 'Irundu', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - zipCode: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + zipCode: faker.location.zipCode() }, maritalStatus: 'Married', educationLevel: 'Primary' @@ -53,11 +53,11 @@ test.describe.serial(' Correct record - 3', () => { birthLocation: { province: 'Pualula', district: 'Ienge', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - zipCode: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + zipCode: faker.location.zipCode() } } @@ -73,8 +73,8 @@ test.describe.serial(' Correct record - 3', () => { let token = await getToken('k.mweene', 'test') const declarationInput = { child: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName(), + firstNames: faker.person.firstName(), + familyName: faker.person.firstName(), gender: 'male' }, informant: { @@ -84,12 +84,12 @@ test.describe.serial(' Correct record - 3', () => { type: 'PHYSICIAN' }, mother: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName() + firstNames: faker.person.firstName(), + familyName: faker.person.firstName() }, father: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName() + firstNames: faker.person.firstName(), + familyName: faker.person.firstName() } } as ConvertEnumsToStrings diff --git a/e2e/testcases/correction-birth/correct-birth-record-4.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-4.spec.ts index 86e339be2..2473e4412 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-4.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-4.spec.ts @@ -14,7 +14,7 @@ import { uploadImage, uploadImageToSection } from '../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { ConvertEnumsToStrings, createDeclaration, @@ -31,24 +31,24 @@ test.describe.serial(' Correct record - 4', () => { let page: Page const updatedFatherDetails = { - firstNames: faker.name.firstName('male'), - familyName: faker.name.firstName('male'), + firstNames: faker.person.firstName('male'), + familyName: faker.person.firstName('male'), birthDate: format( subYears(new Date(), 25 + Math.ceil(10 * Math.random())), 'yyyy-MM-dd' ), email: faker.internet.email(), nationality: 'Nauru', - id: faker.random.numeric(10), + id: faker.string.numeric(10), idType: 'Passport', address: { province: 'Sulaka', district: 'Irundu', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - zipCode: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + zipCode: faker.location.zipCode() }, maritalStatus: 'Married', educationLevel: 'Primary' @@ -71,8 +71,8 @@ test.describe.serial(' Correct record - 4', () => { let token = await getToken('j.musonda', 'test') const declarationInput = { child: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName(), + firstNames: faker.person.firstName(), + familyName: faker.person.firstName(), gender: 'male', placeOfBirth: 'Residential address', birthLocation: { @@ -87,12 +87,12 @@ test.describe.serial(' Correct record - 4', () => { type: 'PHYSICIAN' }, mother: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName() + firstNames: faker.person.firstName(), + familyName: faker.person.firstName() }, father: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName() + firstNames: faker.person.firstName(), + familyName: faker.person.firstName() } } as ConvertEnumsToStrings diff --git a/e2e/testcases/correction-birth/correct-birth-record-5.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-5.spec.ts index 65a7cd968..0a138ade7 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-5.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-5.spec.ts @@ -11,7 +11,7 @@ import { goBackToReview, login } from '../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { BirthDetails, ConvertEnumsToStrings, @@ -30,8 +30,8 @@ test.describe.serial(' Correct record - 5', () => { let page: Page const updatedChildDetails = { - firstNames: faker.name.firstName('female'), - familyName: faker.name.firstName('female'), + firstNames: faker.person.firstName('female'), + familyName: faker.person.firstName('female'), gender: 'Female', birthDate: format( subDays(new Date(), Math.ceil(10 * Math.random())), @@ -41,11 +41,11 @@ test.describe.serial(' Correct record - 5', () => { birthLocation: { state: 'Sulaka', district: 'Irundu', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - zipCode: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + zipCode: faker.location.zipCode() }, attendantAtBirth: 'Nurse', typeOfBirth: 'Twin', @@ -65,8 +65,8 @@ test.describe.serial(' Correct record - 5', () => { let token = await getToken('k.mweene', 'test') declarationInput = { child: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName(), + firstNames: faker.person.firstName(), + familyName: faker.person.firstName(), gender: 'male', placeOfBirth: 'Residential address', birthLocation: { @@ -81,12 +81,12 @@ test.describe.serial(' Correct record - 5', () => { type: 'PHYSICIAN' }, mother: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName() + firstNames: faker.person.firstName(), + familyName: faker.person.firstName() }, father: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName() + firstNames: faker.person.firstName(), + familyName: faker.person.firstName() } } as ConvertEnumsToStrings diff --git a/e2e/testcases/correction-birth/correct-birth-record-6.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-6.spec.ts index 01d1c2b9b..8efaba603 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-6.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-6.spec.ts @@ -11,7 +11,7 @@ import { goBackToReview, login } from '../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { ConvertEnumsToStrings, createDeclaration, @@ -28,24 +28,24 @@ test.describe.serial(' Correct record - 6', () => { let page: Page const updatedInformantDetails = { relationship: 'Sister', - firstNames: faker.name.firstName('female'), - familyName: faker.name.firstName('female'), + firstNames: faker.person.firstName('female'), + familyName: faker.person.firstName('female'), birthDate: format( subYears(new Date(), 25 + Math.ceil(10 * Math.random())), 'yyyy-MM-dd' ), email: faker.internet.email(), nationality: 'Nauru', - id: faker.random.numeric(10), + id: faker.string.numeric(10), idType: 'Passport', address: { province: 'Sulaka', district: 'Irundu', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - zipCode: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + zipCode: faker.location.zipCode() } } @@ -61,8 +61,8 @@ test.describe.serial(' Correct record - 6', () => { let token = await getToken('k.mweene', 'test') const declarationInput = { child: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName(), + firstNames: faker.person.firstName(), + familyName: faker.person.firstName(), gender: 'male' }, informant: { @@ -72,12 +72,12 @@ test.describe.serial(' Correct record - 6', () => { type: 'PHYSICIAN' }, mother: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName() + firstNames: faker.person.firstName(), + familyName: faker.person.firstName() }, father: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName() + firstNames: faker.person.firstName(), + familyName: faker.person.firstName() } } as ConvertEnumsToStrings diff --git a/e2e/testcases/correction-birth/correct-birth-record-7.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-7.spec.ts index 3cbb2f0c5..fc5b1d52f 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-7.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-7.spec.ts @@ -13,7 +13,7 @@ import { uploadImage, uploadImageToSection } from '../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { ConvertEnumsToStrings, createDeclaration, @@ -30,21 +30,21 @@ test.describe.serial(' Correct record - 7', () => { let page: Page const updatedMotherDetails = { - firstNames: faker.name.firstName('male'), - familyName: faker.name.firstName('male'), + firstNames: faker.person.firstName('male'), + familyName: faker.person.firstName('male'), age: random(20, 45), email: faker.internet.email(), nationality: 'Nauru', - id: faker.random.numeric(10), + id: faker.string.numeric(10), idType: 'Passport', address: { province: 'Sulaka', district: 'Irundu', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - zipCode: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + zipCode: faker.location.zipCode() }, maritalStatus: 'Married', educationLevel: 'Primary' @@ -62,8 +62,8 @@ test.describe.serial(' Correct record - 7', () => { let token = await getToken('j.musonda', 'test') const declarationInput = { child: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName(), + firstNames: faker.person.firstName(), + familyName: faker.person.firstName(), gender: 'male' }, informant: { @@ -73,12 +73,12 @@ test.describe.serial(' Correct record - 7', () => { type: 'PHYSICIAN' }, mother: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName() + firstNames: faker.person.firstName(), + familyName: faker.person.firstName() }, father: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName() + firstNames: faker.person.firstName(), + familyName: faker.person.firstName() } } as ConvertEnumsToStrings diff --git a/e2e/testcases/correction-birth/correct-birth-record-8.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-8.spec.ts index 24eb14351..bc6718b4d 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-8.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-8.spec.ts @@ -11,7 +11,7 @@ import { goBackToReview, login } from '../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { ConvertEnumsToStrings, createDeclaration, @@ -28,24 +28,24 @@ test.describe.serial(' Correct record - 8', () => { let page: Page const updatedFatherDetails = { - firstNames: faker.name.firstName('male'), - familyName: faker.name.firstName('male'), + firstNames: faker.person.firstName('male'), + familyName: faker.person.firstName('male'), birthDate: format( subYears(new Date(), 25 + Math.ceil(10 * Math.random())), 'yyyy-MM-dd' ), email: faker.internet.email(), nationality: 'Nauru', - id: faker.random.numeric(10), + id: faker.string.numeric(10), idType: 'Passport', address: { province: 'Sulaka', district: 'Irundu', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - zipCode: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + zipCode: faker.location.zipCode() }, maritalStatus: 'Married', educationLevel: 'Primary' @@ -63,8 +63,8 @@ test.describe.serial(' Correct record - 8', () => { let token = await getToken('j.musonda', 'test') const declarationInput = { child: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName(), + firstNames: faker.person.firstName(), + familyName: faker.person.firstName(), gender: 'male' }, informant: { @@ -74,12 +74,12 @@ test.describe.serial(' Correct record - 8', () => { type: 'PHYSICIAN' }, mother: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName() + firstNames: faker.person.firstName(), + familyName: faker.person.firstName() }, father: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName() + firstNames: faker.person.firstName(), + familyName: faker.person.firstName() } } as ConvertEnumsToStrings diff --git a/e2e/testcases/correction-birth/correct-birth-record-9.spec.ts b/e2e/testcases/correction-birth/correct-birth-record-9.spec.ts index c73b0d924..2e5d5ae7a 100644 --- a/e2e/testcases/correction-birth/correct-birth-record-9.spec.ts +++ b/e2e/testcases/correction-birth/correct-birth-record-9.spec.ts @@ -11,7 +11,7 @@ import { goBackToReview, login } from '../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { ConvertEnumsToStrings, createDeclaration, @@ -28,24 +28,24 @@ test.describe.serial(' Correct record - 9', () => { let page: Page const updatedInformantDetails = { relationship: 'Sister', - firstNames: faker.name.firstName('female'), - familyName: faker.name.firstName('female'), + firstNames: faker.person.firstName('female'), + familyName: faker.person.firstName('female'), birthDate: format( subYears(new Date(), 25 + Math.ceil(10 * Math.random())), 'yyyy-MM-dd' ), email: faker.internet.email(), nationality: 'Nauru', - id: faker.random.numeric(10), + id: faker.string.numeric(10), idType: 'Passport', address: { province: 'Sulaka', district: 'Irundu', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - zipCode: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + zipCode: faker.location.zipCode() } } @@ -61,8 +61,8 @@ test.describe.serial(' Correct record - 9', () => { let token = await getToken('j.musonda', 'test') const declarationInput = { child: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName(), + firstNames: faker.person.firstName(), + familyName: faker.person.firstName(), gender: 'male' }, informant: { @@ -72,12 +72,12 @@ test.describe.serial(' Correct record - 9', () => { type: 'PHYSICIAN' }, mother: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName() + firstNames: faker.person.firstName(), + familyName: faker.person.firstName() }, father: { - firstNames: faker.name.firstName(), - familyName: faker.name.firstName() + firstNames: faker.person.firstName(), + familyName: faker.person.firstName() } } as ConvertEnumsToStrings diff --git a/e2e/testcases/correction-death/correct-death-record-10.spec.ts b/e2e/testcases/correction-death/correct-death-record-10.spec.ts index 0f2ac71a5..c19be363a 100644 --- a/e2e/testcases/correction-death/correct-death-record-10.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-10.spec.ts @@ -15,7 +15,7 @@ import { uploadImage, uploadImageToSection } from '../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { format, parseISO } from 'date-fns' import { createDeathDeclaration, fetchDeclaration } from '../death/helpers' import { DeathDeclaration } from '../death/types' @@ -27,21 +27,21 @@ test.describe('10. Correct record - 10', () => { let trackingId = '' const updatedDeceasedDetails = { - firstNames: faker.name.firstName('female'), - familyName: faker.name.firstName('female'), + firstNames: faker.person.firstName('female'), + familyName: faker.person.firstName('female'), gender: 'Female', age: random(20, 45), nationality: 'Canada', - id: faker.random.numeric(10), + id: faker.string.numeric(10), idType: 'Passport', address: { province: 'Pualula', district: 'Pili', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - zipCode: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + zipCode: faker.location.zipCode() }, maritalStatus: 'Married', NOdependants: '3' diff --git a/e2e/testcases/correction-death/correct-death-record-12.spec.ts b/e2e/testcases/correction-death/correct-death-record-12.spec.ts index 2c2ca8048..6615b3ebd 100644 --- a/e2e/testcases/correction-death/correct-death-record-12.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-12.spec.ts @@ -11,7 +11,7 @@ import { goBackToReview, login } from '../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { format, parseISO, subDays } from 'date-fns' import { DeathDeclaration } from '../death/types' import { @@ -31,26 +31,26 @@ test.describe.serial(' Correct record - 12', () => { const updatedInformantDetails = { type: 'Son', - firstNames: faker.name.firstName('female'), - familyName: faker.name.firstName('female'), + firstNames: faker.person.firstName('female'), + familyName: faker.person.firstName('female'), birthDate: format( subDays(new Date(), Math.ceil(50 * Math.random() + 365 * 25)), 'yyyy-MM-dd' ), email: faker.internet.email(), nationality: 'Nauru', - id: faker.random.numeric(10), + id: faker.string.numeric(10), idType: 'Passport', address: { sameAsDeceased: false, country: 'Farajaland', province: 'Sulaka', district: 'Irundu', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - zipCode: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + zipCode: faker.location.zipCode() } } @@ -59,11 +59,11 @@ test.describe.serial(' Correct record - 12', () => { deathLocation: { province: 'Chuminga', district: 'Soka', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - zipCode: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + zipCode: faker.location.zipCode() } } diff --git a/e2e/testcases/correction-death/correct-death-record-13.spec.ts b/e2e/testcases/correction-death/correct-death-record-13.spec.ts index 7cd487ef5..478a46bfe 100644 --- a/e2e/testcases/correction-death/correct-death-record-13.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-13.spec.ts @@ -13,7 +13,7 @@ import { uploadImage, uploadImageToSection } from '../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { format, subDays } from 'date-fns' import { DeathDeclaration } from '../death/types' import { @@ -33,25 +33,25 @@ test.describe.serial(' Correct record - 13', () => { let declarationInput: DeathDeclarationInput const updatedSpouseDetails = { - firstNames: faker.name.firstName('female'), - familyName: faker.name.firstName('female'), + firstNames: faker.person.firstName('female'), + familyName: faker.person.firstName('female'), birthDate: format( subDays(new Date(), Math.ceil(50 * Math.random() + 365 * 25)), 'yyyy-MM-dd' ), email: faker.internet.email(), nationality: 'Nauru', - id: faker.random.numeric(10), + id: faker.string.numeric(10), idType: 'Passport', address: { sameAsDeceased: false, province: 'Pualula', district: 'Ienge', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - zipCode: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + zipCode: faker.location.zipCode() } } diff --git a/e2e/testcases/correction-death/correct-death-record-14.spec.ts b/e2e/testcases/correction-death/correct-death-record-14.spec.ts index 365bfd748..0c1fab52d 100644 --- a/e2e/testcases/correction-death/correct-death-record-14.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-14.spec.ts @@ -12,7 +12,7 @@ import { joinValuesWith, login } from '../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { DeathDeclaration } from '../death/types' import { createDeathDeclaration, fetchDeclaration } from '../death/helpers' import { CREDENTIALS } from '../../constants' @@ -24,21 +24,21 @@ test.describe.serial(' Correct record - 14', () => { let page: Page const updatedDeceasedDetails = { - firstNames: faker.name.firstName('female'), - familyName: faker.name.firstName('female'), + firstNames: faker.person.firstName('female'), + familyName: faker.person.firstName('female'), gender: 'Female', age: random(20, 45), nationality: 'Canada', - id: faker.random.numeric(10), + id: faker.string.numeric(10), idType: 'Passport', address: { province: 'Pualula', district: 'Pili', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - zipCode: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + zipCode: faker.location.zipCode() }, maritalStatus: 'Married', NOdependants: '3', diff --git a/e2e/testcases/correction-death/correct-death-record-16.spec.ts b/e2e/testcases/correction-death/correct-death-record-16.spec.ts index 88f067d93..bcfe6657c 100644 --- a/e2e/testcases/correction-death/correct-death-record-16.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-16.spec.ts @@ -13,7 +13,7 @@ import { uploadImage, uploadImageToSection } from '../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { format, subDays } from 'date-fns' import { DeathDeclaration } from '../death/types' import { createDeathDeclaration, fetchDeclaration } from '../death/helpers' @@ -26,26 +26,26 @@ test.describe.serial(' Correct record - 16', () => { let page: Page const updatedInformantDetails = { type: 'Son', - firstNames: faker.name.firstName('female'), - familyName: faker.name.firstName('female'), + firstNames: faker.person.firstName('female'), + familyName: faker.person.firstName('female'), birthDate: format( subDays(new Date(), Math.ceil(50 * Math.random() + 365 * 25)), 'yyyy-MM-dd' ), email: faker.internet.email(), nationality: 'Nauru', - id: faker.random.numeric(10), + id: faker.string.numeric(10), idType: 'Passport', address: { sameAsDeceased: false, country: 'Farajaland', province: 'Sulaka', district: 'Irundu', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - zipCode: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + zipCode: faker.location.zipCode() } } diff --git a/e2e/testcases/correction-death/correct-death-record-17.spec.ts b/e2e/testcases/correction-death/correct-death-record-17.spec.ts index b918e4e3a..f52ae1300 100644 --- a/e2e/testcases/correction-death/correct-death-record-17.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-17.spec.ts @@ -11,7 +11,7 @@ import { goBackToReview, login } from '../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { format, subDays } from 'date-fns' import { DeathDeclaration } from '../death/types' import { createDeathDeclaration, fetchDeclaration } from '../death/helpers' @@ -24,25 +24,25 @@ test.describe.serial(' Correct record - 17', () => { let page: Page const updatedSpouseDetails = { - firstNames: faker.name.firstName('female'), - familyName: faker.name.firstName('female'), + firstNames: faker.person.firstName('female'), + familyName: faker.person.firstName('female'), birthDate: format( subDays(new Date(), Math.ceil(50 * Math.random() + 365 * 25)), 'yyyy-MM-dd' ), email: faker.internet.email(), nationality: 'Nauru', - id: faker.random.numeric(10), + id: faker.string.numeric(10), idType: 'Passport', address: { sameAsDeceased: false, province: 'Pualula', district: 'Ienge', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - zipCode: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + zipCode: faker.location.zipCode() } } diff --git a/e2e/testcases/correction-death/correct-death-record-18.spec.ts b/e2e/testcases/correction-death/correct-death-record-18.spec.ts index e2323638c..aa0747a73 100644 --- a/e2e/testcases/correction-death/correct-death-record-18.spec.ts +++ b/e2e/testcases/correction-death/correct-death-record-18.spec.ts @@ -11,7 +11,7 @@ import { joinValuesWith, login } from '../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { DeathDeclaration } from '../death/types' import { createDeathDeclaration, fetchDeclaration } from '../death/helpers' import { CREDENTIALS } from '../../constants' @@ -23,21 +23,21 @@ test.describe.serial(' Correct record - 18', () => { let page: Page const updatedDeceasedDetails = { - firstNames: faker.name.firstName('female'), - familyName: faker.name.firstName('female'), + firstNames: faker.person.firstName('female'), + familyName: faker.person.firstName('female'), gender: 'Female', age: random(20, 45), nationality: 'Canada', - id: faker.random.numeric(10), + id: faker.string.numeric(10), idType: 'Passport', address: { province: 'Pualula', district: 'Pili', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - zipCode: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + zipCode: faker.location.zipCode() }, maritalStatus: 'Married', NOdependants: '3' diff --git a/e2e/testcases/death/8-validate-declaration-review-page.spec.ts b/e2e/testcases/death/8-validate-declaration-review-page.spec.ts index 49f4f66c6..0d1899859 100644 --- a/e2e/testcases/death/8-validate-declaration-review-page.spec.ts +++ b/e2e/testcases/death/8-validate-declaration-review-page.spec.ts @@ -13,7 +13,7 @@ import { getAction, assignRecord } from '../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { CREDENTIALS } from '../../constants' test.describe.serial('8. Validate declaration review page', () => { @@ -21,14 +21,14 @@ test.describe.serial('8. Validate declaration review page', () => { const declaration = { deceased: { name: { - firstNames: faker.name.firstName('male'), - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male'), + familyName: faker.person.lastName('male') }, gender: 'Male', birthDate: getRandomDate(75, 200), nationality: 'Farajaland', identifier: { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'National ID' }, address: { @@ -49,13 +49,13 @@ test.describe.serial('8. Validate declaration review page', () => { informantEmail: faker.internet.email(), spouse: { name: { - firstNames: faker.name.firstName('female'), - familyName: faker.name.lastName('female') + firstNames: faker.person.firstName('female'), + familyName: faker.person.lastName('female') }, birthDate: getRandomDate(50, 200), nationality: 'Farajaland', identifier: { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'National ID' }, address: { @@ -364,8 +364,8 @@ test.describe.serial('8. Validate declaration review page', () => { .getByText('Change') .click() declaration.deceased.name = { - firstNames: faker.name.firstName('male'), - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male'), + familyName: faker.person.lastName('male') } await page .locator('#firstNamesEng') @@ -448,7 +448,7 @@ test.describe.serial('8. Validate declaration review page', () => { }) test("8.1.2.5 Change deceased's ID", async () => { await page.locator('#deceased-content #ID').getByText('Change').click() - declaration.deceased.identifier.id = faker.random.numeric(10) + declaration.deceased.identifier.id = faker.string.numeric(10) await page .locator('#deceasedPassport') .fill(declaration.deceased.identifier.id) @@ -530,8 +530,8 @@ test.describe.serial('8. Validate declaration review page', () => { test("8.1.2.9 Change spouse's name", async () => { await page.locator('#spouse-content #Full').getByText('Change').click() - declaration.spouse.name.firstNames = faker.name.firstName('female') - declaration.spouse.name.familyName = faker.name.lastName('female') + declaration.spouse.name.firstNames = faker.person.firstName('female') + declaration.spouse.name.familyName = faker.person.lastName('female') await page .locator('#firstNamesEng') .fill(declaration.spouse.name.firstNames) @@ -602,7 +602,7 @@ test.describe.serial('8. Validate declaration review page', () => { }) test("8.1.2.13 Change spouse's ID", async () => { await page.locator('#spouse-content #ID').getByText('Change').click() - declaration.spouse.identifier.id = faker.random.numeric(10) + declaration.spouse.identifier.id = faker.string.numeric(10) await page .locator('#spousePassport') .fill(declaration.spouse.identifier.id) @@ -897,8 +897,8 @@ test.describe.serial('8. Validate declaration review page', () => { await page.getByRole('button', { name: 'Continue' }).click() declaration.deceased.name = { - firstNames: faker.name.firstName('male'), - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male'), + familyName: faker.person.lastName('male') } await page .locator('#firstNamesEng') @@ -986,7 +986,7 @@ test.describe.serial('8. Validate declaration review page', () => { test("8.2.2.5 Change deceased's ID", async () => { await page.locator('#deceased-content #ID').getByText('Change').click() await page.getByRole('button', { name: 'Continue' }).click() - declaration.deceased.identifier.id = faker.random.numeric(10) + declaration.deceased.identifier.id = faker.string.numeric(10) await page .locator('#deceasedBirthRegistrationNumber') .fill(declaration.deceased.identifier.id) @@ -1075,8 +1075,8 @@ test.describe.serial('8. Validate declaration review page', () => { test("8.2.2.9 Change spouse's name", async () => { await page.locator('#spouse-content #Full').getByText('Change').click() await page.getByRole('button', { name: 'Continue' }).click() - declaration.spouse.name.firstNames = faker.name.firstName('female') - declaration.spouse.name.familyName = faker.name.lastName('female') + declaration.spouse.name.firstNames = faker.person.firstName('female') + declaration.spouse.name.familyName = faker.person.lastName('female') await page .locator('#firstNamesEng') .fill(declaration.spouse.name.firstNames) @@ -1151,7 +1151,7 @@ test.describe.serial('8. Validate declaration review page', () => { test("8.2.2.13 Change spouse's ID", async () => { await page.locator('#spouse-content #ID').getByText('Change').click() await page.getByRole('button', { name: 'Continue' }).click() - declaration.spouse.identifier.id = faker.random.numeric(10) + declaration.spouse.identifier.id = faker.string.numeric(10) await page .locator('#spouseBirthRegistrationNumber') .fill(declaration.spouse.identifier.id) diff --git a/e2e/testcases/death/declaration/death-declaration-1.spec.ts b/e2e/testcases/death/declaration/death-declaration-1.spec.ts index 579ba5738..d60e9af5e 100644 --- a/e2e/testcases/death/declaration/death-declaration-1.spec.ts +++ b/e2e/testcases/death/declaration/death-declaration-1.spec.ts @@ -12,7 +12,7 @@ import { goToSection, login } from '../../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { CREDENTIALS } from '../../../constants' test.describe.serial('1. Death declaration case - 1', () => { @@ -20,14 +20,14 @@ test.describe.serial('1. Death declaration case - 1', () => { const declaration = { deceased: { name: { - firstNames: faker.name.firstName('male'), - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male'), + familyName: faker.person.lastName('male') }, gender: 'Male', birthDate: getRandomDate(75, 200), nationality: 'Farajaland', identifier: { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'National ID' }, maritalStatus: 'Single', @@ -37,11 +37,11 @@ test.describe.serial('1. Death declaration case - 1', () => { province: 'Sulaka', district: 'Zobwe', urbanOrRural: 'Urban', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() } }, event: { @@ -57,13 +57,13 @@ test.describe.serial('1. Death declaration case - 1', () => { informantEmail: faker.internet.email(), spouse: { name: { - firstNames: faker.name.firstName('female'), - familyName: faker.name.lastName('female') + firstNames: faker.person.firstName('female'), + familyName: faker.person.lastName('female') }, birthDate: getRandomDate(50, 200), nationality: 'Farajaland', identifier: { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'National ID' }, address: { diff --git a/e2e/testcases/death/declaration/death-declaration-11.spec.ts b/e2e/testcases/death/declaration/death-declaration-11.spec.ts index 0b069303c..0a58b121e 100644 --- a/e2e/testcases/death/declaration/death-declaration-11.spec.ts +++ b/e2e/testcases/death/declaration/death-declaration-11.spec.ts @@ -14,7 +14,7 @@ import { joinValuesWith, login } from '../../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { CREDENTIALS } from '../../../constants' test.describe.serial('11. Death declaration case - 11', () => { @@ -22,26 +22,26 @@ test.describe.serial('11. Death declaration case - 11', () => { const declaration = { deceased: { name: { - firstNames: faker.name.firstName('male'), - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male'), + familyName: faker.person.lastName('male') }, gender: 'Unknown', age: 45, nationality: 'Farajaland', identifier: { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'Birth Registration Number' }, maritalStatus: 'Widowed', address: { country: 'Guam', - state: faker.address.state(), - district: faker.address.county(), - town: faker.address.city(), - addressLine1: faker.address.county(), - addressLine2: faker.address.streetName(), - addressLine3: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + state: faker.location.state(), + district: faker.location.county(), + town: faker.location.city(), + addressLine1: faker.location.county(), + addressLine2: faker.location.street(), + addressLine3: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() } }, event: { @@ -58,14 +58,14 @@ test.describe.serial('11. Death declaration case - 11', () => { informantEmail: faker.internet.email(), informant: { name: { - firstNames: faker.name.firstName('female'), - familyName: faker.name.lastName('female') + firstNames: faker.person.firstName('female'), + familyName: faker.person.lastName('female') }, age: 17, birthDate: getRandomDate(5, 200), nationality: 'Malawi', identifier: { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'Passport' }, address: { @@ -74,22 +74,22 @@ test.describe.serial('11. Death declaration case - 11', () => { province: 'Chuminga', district: 'Nsali', urbanOrRural: 'Urban', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() } }, spouse: { name: { - firstNames: faker.name.firstName('female'), - familyName: faker.name.lastName('female') + firstNames: faker.person.firstName('female'), + familyName: faker.person.lastName('female') }, age: 42, nationality: 'Farajaland', identifier: { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'Birth Registration Number' }, address: { @@ -98,7 +98,7 @@ test.describe.serial('11. Death declaration case - 11', () => { province: 'Chuminga', district: 'Nsali', urbanOrRural: 'Rural', - village: faker.address.county() + village: faker.location.county() } } } @@ -619,8 +619,8 @@ test.describe.serial('11. Death declaration case - 11', () => { .getByText('Change') .click() declaration.informant.name = { - firstNames: faker.name.firstName('female'), - familyName: faker.name.lastName('female') + firstNames: faker.person.firstName('female'), + familyName: faker.person.lastName('female') } expect(page.url().includes('informant')).toBeTruthy() await page @@ -689,7 +689,7 @@ test.describe.serial('11. Death declaration case - 11', () => { test("11.1.7.4 Change informant's ID", async () => { await page.locator('#informant-content #ID').getByText('Change').click() expect(page.url().includes('informant')).toBeTruthy() - declaration.informant.identifier.id = faker.random.numeric(10) + declaration.informant.identifier.id = faker.string.numeric(10) await page .locator('#informantBirthRegistrationNumber') .fill(declaration.informant.identifier.id) @@ -713,11 +713,11 @@ test.describe.serial('11. Death declaration case - 11', () => { province: 'Sulaka', district: 'Afue', urbanOrRural: 'Urban', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() } await page.locator('#statePrimaryInformant').click() await page diff --git a/e2e/testcases/death/declaration/death-declaration-2.spec.ts b/e2e/testcases/death/declaration/death-declaration-2.spec.ts index 5e080faf9..e952d8a36 100644 --- a/e2e/testcases/death/declaration/death-declaration-2.spec.ts +++ b/e2e/testcases/death/declaration/death-declaration-2.spec.ts @@ -14,7 +14,7 @@ import { login, uploadImageToSection } from '../../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { CREDENTIALS } from '../../../constants' test.describe.serial('2. Death declaration case - 2', () => { @@ -22,14 +22,14 @@ test.describe.serial('2. Death declaration case - 2', () => { const declaration = { deceased: { name: { - firstNames: faker.name.firstName('female'), - familyName: faker.name.lastName('female') + firstNames: faker.person.firstName('female'), + familyName: faker.person.lastName('female') }, gender: 'Female', age: 65, nationality: 'Guernsey', identifier: { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'Passport' }, maritalStatus: 'Married', @@ -38,7 +38,7 @@ test.describe.serial('2. Death declaration case - 2', () => { province: 'Sulaka', district: 'Zobwe', urbanOrRural: 'Rural', - village: faker.address.county() + village: faker.location.county() } }, event: { @@ -55,13 +55,13 @@ test.describe.serial('2. Death declaration case - 2', () => { informantEmail: faker.internet.email(), informant: { name: { - firstNames: faker.name.firstName('male'), - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male'), + familyName: faker.person.lastName('male') }, birthDate: getRandomDate(50, 200), nationality: 'Farajaland', identifier: { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'National ID' }, address: { @@ -70,13 +70,13 @@ test.describe.serial('2. Death declaration case - 2', () => { }, spouse: { name: { - firstNames: faker.name.firstName('male'), - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male'), + familyName: faker.person.lastName('male') }, age: 68, nationality: 'Canada', identifier: { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'Passport' }, address: { @@ -85,11 +85,11 @@ test.describe.serial('2. Death declaration case - 2', () => { province: 'Chuminga', district: 'Nsali', urbanOrRural: 'Urban', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() } } } diff --git a/e2e/testcases/death/declaration/death-declaration-3.spec.ts b/e2e/testcases/death/declaration/death-declaration-3.spec.ts index 888e60ff5..6ab35d4d6 100644 --- a/e2e/testcases/death/declaration/death-declaration-3.spec.ts +++ b/e2e/testcases/death/declaration/death-declaration-3.spec.ts @@ -13,7 +13,7 @@ import { joinValuesWith, login } from '../../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { CREDENTIALS } from '../../../constants' test.describe.serial('3. Death declaration case - 3', () => { @@ -21,26 +21,26 @@ test.describe.serial('3. Death declaration case - 3', () => { const declaration = { deceased: { name: { - firstNames: faker.name.firstName('male') + ' the 2nd', - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male') + ' the 2nd', + familyName: faker.person.lastName('male') }, gender: 'Unknown', age: 45, nationality: 'Farajaland', identifier: { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'Birth Registration Number' }, maritalStatus: 'Widowed', address: { country: 'Guam', - state: faker.address.state(), - district: faker.address.county(), - town: faker.address.city(), - addressLine1: faker.address.county(), - addressLine2: faker.address.streetName(), - addressLine3: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + state: faker.location.state(), + district: faker.location.county(), + town: faker.location.city(), + addressLine1: faker.location.county(), + addressLine2: faker.location.street(), + addressLine3: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() } }, event: { @@ -57,13 +57,13 @@ test.describe.serial('3. Death declaration case - 3', () => { informantEmail: faker.internet.email(), informant: { name: { - firstNames: faker.name.firstName('male'), - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male'), + familyName: faker.person.lastName('male') }, age: 17, nationality: 'Malawi', identifier: { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'Passport' }, address: { @@ -72,22 +72,22 @@ test.describe.serial('3. Death declaration case - 3', () => { province: 'Chuminga', district: 'Nsali', urbanOrRural: 'Urban', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() } }, spouse: { name: { - firstNames: faker.name.firstName('female'), - familyName: faker.name.lastName('female') + firstNames: faker.person.firstName('female'), + familyName: faker.person.lastName('female') }, age: 42, nationality: 'Farajaland', identifier: { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'Birth Registration Number' }, address: { @@ -96,7 +96,7 @@ test.describe.serial('3. Death declaration case - 3', () => { province: 'Chuminga', district: 'Nsali', urbanOrRural: 'Rural', - village: faker.address.county() + village: faker.location.county() } } } diff --git a/e2e/testcases/death/declaration/death-declaration-4.spec.ts b/e2e/testcases/death/declaration/death-declaration-4.spec.ts index 8bfa9338f..210f5910c 100644 --- a/e2e/testcases/death/declaration/death-declaration-4.spec.ts +++ b/e2e/testcases/death/declaration/death-declaration-4.spec.ts @@ -14,7 +14,7 @@ import { login, uploadImageToSection } from '../../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { CREDENTIALS } from '../../../constants' test.describe.serial('4. Death declaration case - 4', () => { @@ -22,8 +22,8 @@ test.describe.serial('4. Death declaration case - 4', () => { const declaration = { deceased: { name: { - firstNames: faker.name.firstName('female') + '_Nolas', - familyName: faker.name.lastName('female') + firstNames: faker.person.firstName('female') + '_Nolas', + familyName: faker.person.lastName('female') }, gender: 'Female', age: 45, @@ -34,13 +34,13 @@ test.describe.serial('4. Death declaration case - 4', () => { maritalStatus: 'Divorced', address: { country: 'Guam', - state: faker.address.state(), - district: faker.address.county(), - town: faker.address.city(), - addressLine1: faker.address.county(), - addressLine2: faker.address.streetName(), - addressLine3: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + state: faker.location.state(), + district: faker.location.county(), + town: faker.location.city(), + addressLine1: faker.location.county(), + addressLine2: faker.location.street(), + addressLine3: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() } }, event: { @@ -57,13 +57,13 @@ test.describe.serial('4. Death declaration case - 4', () => { informantEmail: faker.internet.email(), informant: { name: { - firstNames: faker.name.firstName('male'), - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male'), + familyName: faker.person.lastName('male') }, age: 17, nationality: 'Malawi', identifier: { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'Birth Registration Number' }, address: { @@ -72,13 +72,13 @@ test.describe.serial('4. Death declaration case - 4', () => { province: 'Chuminga', district: 'Nsali', urbanOrRural: 'Rural', - village: faker.address.county() + village: faker.location.county() } }, spouse: { name: { - firstNames: faker.name.firstName('female'), - familyName: faker.name.lastName('female') + firstNames: faker.person.firstName('female'), + familyName: faker.person.lastName('female') }, age: 42, nationality: 'Farajaland', @@ -88,13 +88,13 @@ test.describe.serial('4. Death declaration case - 4', () => { address: { sameAsDeceased: false, country: 'Guam', - state: faker.address.state(), - district: faker.address.county(), - town: faker.address.city(), - addressLine1: faker.address.county(), - addressLine2: faker.address.streetName(), - addressLine3: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + state: faker.location.state(), + district: faker.location.county(), + town: faker.location.city(), + addressLine1: faker.location.county(), + addressLine2: faker.location.street(), + addressLine3: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() } } } diff --git a/e2e/testcases/death/declaration/death-declaration-5.spec.ts b/e2e/testcases/death/declaration/death-declaration-5.spec.ts index 43bbf9bca..37a5a621d 100644 --- a/e2e/testcases/death/declaration/death-declaration-5.spec.ts +++ b/e2e/testcases/death/declaration/death-declaration-5.spec.ts @@ -13,7 +13,7 @@ import { joinValuesWith, login } from '../../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { CREDENTIALS } from '../../../constants' test.describe.serial('5. Death declaration case - 5', () => { @@ -21,8 +21,8 @@ test.describe.serial('5. Death declaration case - 5', () => { const declaration = { deceased: { name: { - firstNames: faker.name.firstName('female') + '-Peter', - familyName: faker.name.lastName('female') + firstNames: faker.person.firstName('female') + '-Peter', + familyName: faker.person.lastName('female') }, gender: 'Female', age: 45, @@ -33,13 +33,13 @@ test.describe.serial('5. Death declaration case - 5', () => { maritalStatus: 'Separated', address: { country: 'Guam', - state: faker.address.state(), - district: faker.address.county(), - town: faker.address.city(), - addressLine1: faker.address.county(), - addressLine2: faker.address.streetName(), - addressLine3: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + state: faker.location.state(), + district: faker.location.county(), + town: faker.location.city(), + addressLine1: faker.location.county(), + addressLine2: faker.location.street(), + addressLine3: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() } }, event: { @@ -54,19 +54,19 @@ test.describe.serial('5. Death declaration case - 5', () => { province: 'Chuminga', district: 'Nsali', urbanOrRural: 'Urban', - town: faker.address.city(), - residentialArea: faker.address.county(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() } }, informantType: 'Daughter in law', informantEmail: faker.internet.email(), informant: { name: { - firstNames: faker.name.firstName('male'), - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male'), + familyName: faker.person.lastName('male') }, age: 17, nationality: 'Malawi', @@ -76,13 +76,13 @@ test.describe.serial('5. Death declaration case - 5', () => { address: { sameAsDeceased: false, country: 'Comoros', - state: faker.address.state(), - district: faker.address.county(), - town: faker.address.city(), - addressLine1: faker.address.county(), - addressLine2: faker.address.streetName(), - addressLine3: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + state: faker.location.state(), + district: faker.location.county(), + town: faker.location.city(), + addressLine1: faker.location.county(), + addressLine2: faker.location.street(), + addressLine3: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() } }, spouse: { diff --git a/e2e/testcases/death/declaration/death-declaration-6.spec.ts b/e2e/testcases/death/declaration/death-declaration-6.spec.ts index 6257fb992..2d5a90646 100644 --- a/e2e/testcases/death/declaration/death-declaration-6.spec.ts +++ b/e2e/testcases/death/declaration/death-declaration-6.spec.ts @@ -14,7 +14,7 @@ import { joinValuesWith, login } from '../../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { CREDENTIALS } from '../../../constants' test.describe.serial('6. Death declaration case - 6', () => { @@ -22,8 +22,8 @@ test.describe.serial('6. Death declaration case - 6', () => { const declaration = { deceased: { name: { - firstNames: faker.name.firstName('female') + " O'Nila", - familyName: faker.name.lastName('female') + firstNames: faker.person.firstName('female') + " O'Nila", + familyName: faker.person.lastName('female') }, gender: 'Female', age: 45, @@ -34,13 +34,13 @@ test.describe.serial('6. Death declaration case - 6', () => { maritalStatus: 'Not stated', address: { country: 'Guam', - state: faker.address.state(), - district: faker.address.county(), - town: faker.address.city(), - addressLine1: faker.address.county(), - addressLine2: faker.address.streetName(), - addressLine3: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + state: faker.location.state(), + district: faker.location.county(), + town: faker.location.city(), + addressLine1: faker.location.county(), + addressLine2: faker.location.street(), + addressLine3: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() } }, event: { @@ -55,15 +55,15 @@ test.describe.serial('6. Death declaration case - 6', () => { province: 'Chuminga', district: 'Nsali', urbanOrRural: 'Rural', - village: faker.address.county() + village: faker.location.county() } }, informantType: 'Mother', informantEmail: faker.internet.email(), informant: { name: { - firstNames: faker.name.firstName('male'), - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male'), + familyName: faker.person.lastName('male') }, age: 17, nationality: 'Malawi', @@ -73,13 +73,13 @@ test.describe.serial('6. Death declaration case - 6', () => { address: { sameAsDeceased: false, country: 'Comoros', - state: faker.address.state(), - district: faker.address.county(), - town: faker.address.city(), - addressLine1: faker.address.county(), - addressLine2: faker.address.streetName(), - addressLine3: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + state: faker.location.state(), + district: faker.location.county(), + town: faker.location.city(), + addressLine1: faker.location.county(), + addressLine2: faker.location.street(), + addressLine3: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() } }, spouse: { diff --git a/e2e/testcases/death/declaration/death-declaration-7.spec.ts b/e2e/testcases/death/declaration/death-declaration-7.spec.ts index f4433803a..f1eb7d7a8 100644 --- a/e2e/testcases/death/declaration/death-declaration-7.spec.ts +++ b/e2e/testcases/death/declaration/death-declaration-7.spec.ts @@ -13,7 +13,7 @@ import { joinValuesWith, login } from '../../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { CREDENTIALS } from '../../../constants' test.describe.serial('7. Death declaration case - 7', () => { @@ -21,8 +21,8 @@ test.describe.serial('7. Death declaration case - 7', () => { const declaration = { deceased: { name: { - firstNames: faker.name.firstName('female'), - familyName: faker.name.lastName('female') + firstNames: faker.person.firstName('female'), + familyName: faker.person.lastName('female') }, gender: 'Female', age: 45, @@ -33,13 +33,13 @@ test.describe.serial('7. Death declaration case - 7', () => { maritalStatus: 'Not stated', address: { country: 'Guam', - state: faker.address.state(), - district: faker.address.county(), - town: faker.address.city(), - addressLine1: faker.address.county(), - addressLine2: faker.address.streetName(), - addressLine3: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + state: faker.location.state(), + district: faker.location.county(), + town: faker.location.city(), + addressLine1: faker.location.county(), + addressLine2: faker.location.street(), + addressLine3: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() } }, event: { @@ -51,21 +51,21 @@ test.describe.serial('7. Death declaration case - 7', () => { place: 'Other', deathLocation: { country: 'Germany', - state: faker.address.state(), - district: faker.address.county(), - town: faker.address.city(), - addressLine1: faker.address.county(), - addressLine2: faker.address.streetName(), - addressLine3: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + state: faker.location.state(), + district: faker.location.county(), + town: faker.location.city(), + addressLine1: faker.location.county(), + addressLine2: faker.location.street(), + addressLine3: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() } }, informantType: 'Father', informantEmail: faker.internet.email(), informant: { name: { - firstNames: faker.name.firstName('male'), - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male'), + familyName: faker.person.lastName('male') }, age: 17, nationality: 'Malawi', @@ -75,13 +75,13 @@ test.describe.serial('7. Death declaration case - 7', () => { address: { sameAsDeceased: false, country: 'Comoros', - state: faker.address.state(), - district: faker.address.county(), - town: faker.address.city(), - addressLine1: faker.address.county(), - addressLine2: faker.address.streetName(), - addressLine3: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + state: faker.location.state(), + district: faker.location.county(), + town: faker.location.city(), + addressLine1: faker.location.county(), + addressLine2: faker.location.street(), + addressLine3: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() } }, spouse: { diff --git a/e2e/testcases/death/declaration/death-declaration-8.spec.ts b/e2e/testcases/death/declaration/death-declaration-8.spec.ts index 3e7bf135d..62457236c 100644 --- a/e2e/testcases/death/declaration/death-declaration-8.spec.ts +++ b/e2e/testcases/death/declaration/death-declaration-8.spec.ts @@ -10,7 +10,7 @@ import { goToSection, login } from '../../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { CREDENTIALS } from '../../../constants' test.describe.serial('8. Death declaration case - 8', () => { @@ -19,8 +19,8 @@ test.describe.serial('8. Death declaration case - 8', () => { const declaration = { deceased: { name: { - firstNames: faker.name.firstName('male'), - familyName: faker.name.lastName('male') + firstNames: faker.person.firstName('male'), + familyName: faker.person.lastName('male') }, address: { country: 'Farajaland', diff --git a/e2e/testcases/death/declaration/death-declaration-9.spec.ts b/e2e/testcases/death/declaration/death-declaration-9.spec.ts index de71a3e76..e41bbe485 100644 --- a/e2e/testcases/death/declaration/death-declaration-9.spec.ts +++ b/e2e/testcases/death/declaration/death-declaration-9.spec.ts @@ -10,7 +10,7 @@ import { goToSection, login } from '../../../helpers' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { CREDENTIALS } from '../../../constants' test.describe.serial('9. Death declaration case - 9', () => { @@ -19,7 +19,7 @@ test.describe.serial('9. Death declaration case - 9', () => { const declaration = { deceased: { name: { - firstNames: faker.name.firstName('male') + firstNames: faker.person.firstName('male') }, address: { country: 'Farajaland', diff --git a/e2e/testcases/death/helpers.ts b/e2e/testcases/death/helpers.ts index 13e532551..806b6855e 100644 --- a/e2e/testcases/death/helpers.ts +++ b/e2e/testcases/death/helpers.ts @@ -1,6 +1,6 @@ import { GATEWAY_HOST } from '../../constants' import { DeathRegistrationInput } from '../../gateway' -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { readFileSync } from 'fs' import uuid from 'uuid' @@ -15,6 +15,7 @@ import { GET_DEATH_REGISTRATION_FOR_REVIEW } from './queries' import { random } from 'lodash' +import fetch from 'node-fetch' export type DeathDeclarationInput = { deceased?: { @@ -35,26 +36,26 @@ export type DeathDeclarationInput = { const declaration = { deceased: { name: { - firstNames: faker.name.firstName('male') + generateRandomSuffix(), - familyName: faker.name.lastName('male') + generateRandomSuffix() + firstNames: faker.person.firstName('male') + generateRandomSuffix(), + familyName: faker.person.lastName('male') + generateRandomSuffix() }, gender: 'male', age: random(50, 100), nationality: 'FAR', identifier: { type: 'NATIONAL_ID', - id: faker.random.numeric(10) + id: faker.string.numeric(10) }, address: { country: 'FAR', province: 'Sulaka', district: 'Zobwe', urbanOrRural: 'Urban', - town: faker.address.city(), - residentialArea: faker.address.county() + generateRandomSuffix(), - street: faker.address.streetName(), - number: faker.address.buildingNumber(), - postcodeOrZip: faker.address.zipCode() + town: faker.location.city(), + residentialArea: faker.location.county() + generateRandomSuffix(), + street: faker.location.street(), + number: faker.location.buildingNumber(), + postcodeOrZip: faker.location.zipCode() } }, event: { @@ -70,13 +71,13 @@ const declaration = { informantEmail: faker.internet.email(), spouse: { name: { - firstNames: faker.name.firstName('female'), - familyName: faker.name.lastName('female') + firstNames: faker.person.firstName('female'), + familyName: faker.person.lastName('female') }, birthDate: getRandomDate(50, 200, 200), nationality: 'Farajaland', identifier: { - id: faker.random.numeric(10), + id: faker.string.numeric(10), type: 'NATIONAL_ID' }, address: { diff --git a/infrastructure/deployment/deploy.sh b/infrastructure/deployment/deploy.sh index 2cb5b764a..601ce1760 100755 --- a/infrastructure/deployment/deploy.sh +++ b/infrastructure/deployment/deploy.sh @@ -271,7 +271,7 @@ split_and_join() { cleanup_docker_images() { echo "Cleaning up the docker images" - /usr/bin/docker system prune -af | sudo tee -a /var/log/docker-prune.log > /dev/null + configured_ssh "/usr/bin/docker system prune -af | sudo tee -a /var/log/docker-prune.log > /dev/null" } docker_stack_deploy() { @@ -304,8 +304,23 @@ docker_stack_deploy() { docker stack deploy --prune -c '$(split_and_join " " " -c " "$(to_remote_paths $COMPOSE_FILES_USED)")' --with-registry-auth opencrvs' } +get_opencrvs_version() { + PREVIOUS_VERSION=$(configured_ssh "docker service ls | grep opencrvs_base | cut -d ':' -f 2") + echo "Previous opencrvs version: $PREVIOUS_VERSION" + echo "Current opencrvs version: $VERSION" +} + +reset_metabase() { + echo "Reseting metabase" + configured_ssh "docker exec \$(docker ps | grep opencrvs_dashboards | awk '{print \$1}' | head -n 1) /bin/sh -c \"rm /data/metabase/metabase.mv.db\" && \ + docker service scale opencrvs_dashboards=0 && \ + docker service scale opencrvs_dashboards=1" +} + validate_options +get_opencrvs_version + # Create new passwords for all MongoDB users created in # infrastructure/mongodb/docker-entrypoint-initdb.d/create-mongo-users.sh # @@ -320,6 +335,7 @@ export PERFORMANCE_MONGODB_PASSWORD=`generate_password` export OPENHIM_MONGODB_PASSWORD=`generate_password` export WEBHOOKS_MONGODB_PASSWORD=`generate_password` export NOTIFICATION_MONGODB_PASSWORD=`generate_password` +export EVENTS_MONGODB_PASSWORD=`generate_password` # # Elasticsearch credentials @@ -420,6 +436,15 @@ EMAIL_PAYLOAD='{ "to": "{{ALERT_EMAIL}}" }' +VERSION=$(echo "$VERSION" | xargs) +PREVIOUS_VERSION=$(echo "$PREVIOUS_VERSION" | xargs) + +if [[ "$VERSION" == "$PREVIOUS_VERSION" ]]; then + echo "No reset needed for Metabase." +else + reset_metabase +fi + configured_ssh "docker run --rm --network=opencrvs_overlay_net appropriate/curl \ -X POST 'http://countryconfig:3040/email' \ -H 'Content-Type: application/json' \ diff --git a/infrastructure/docker-compose.deploy.yml b/infrastructure/docker-compose.deploy.yml index 92ed86932..7613e01a8 100644 --- a/infrastructure/docker-compose.deploy.yml +++ b/infrastructure/docker-compose.deploy.yml @@ -226,8 +226,11 @@ services: labels: - traefik.enable=false replicas: 1 + # If this doesn't get run successfully, both the replica set in mongo and + # the user schema remains uninitialized. restart_policy: - condition: none + condition: on-failure + delay: 10s environment: - REPLICAS=1 - MONGODB_ADMIN_USER=${MONGODB_ADMIN_USER} @@ -240,6 +243,7 @@ services: - OPENHIM_MONGODB_PASSWORD=${OPENHIM_MONGODB_PASSWORD} - WEBHOOKS_MONGODB_PASSWORD=${WEBHOOKS_MONGODB_PASSWORD} - NOTIFICATION_MONGODB_PASSWORD=${NOTIFICATION_MONGODB_PASSWORD} + - EVENTS_MONGODB_PASSWORD=${EVENTS_MONGODB_PASSWORD} networks: - overlay_net logging: @@ -671,6 +675,23 @@ services: options: gelf-address: 'udp://127.0.0.1:12201' tag: 'user-mgnt' + events: + secrets: + - jwt-public-key.{{ts}} + environment: + - NODE_ENV=production + - MONGO_URL=mongodb://events:${EVENTS_MONGODB_PASSWORD}@mongo1/events?replicaSet=rs0 + deploy: + labels: + - 'traefik.enable=false' + replicas: 1 + networks: + - overlay_net + logging: + driver: gelf + options: + gelf-address: 'udp://127.0.0.1:12201' + tag: 'events' notification: secrets: - jwt-public-key.{{ts}} diff --git a/infrastructure/logrotate.conf b/infrastructure/logrotate.conf index 168eb1977..8b965ffe7 100644 --- a/infrastructure/logrotate.conf +++ b/infrastructure/logrotate.conf @@ -65,6 +65,20 @@ include /etc/logrotate.d rotate 1 } +/var/log/opencrvs-backup.log { + missingok + monthly + create 0660 root application + rotate 1 +} + +/var/log/opencrvs-backup.error.log { + missingok + monthly + create 0660 root application + rotate 1 +} + /var/log/papertrail.log { missingok monthly diff --git a/infrastructure/mongodb/on-deploy.sh b/infrastructure/mongodb/on-deploy.sh index fc10bc854..49b4ec36a 100755 --- a/infrastructure/mongodb/on-deploy.sh +++ b/infrastructure/mongodb/on-deploy.sh @@ -252,4 +252,26 @@ else roles: [{ role: 'readWrite', db: 'notification' }] }) EOF +fi + +EVENTS_USER=$(echo $(checkIfUserExists "events")) +if [[ $EVENTS_USER != "FOUND" ]]; then + echo "events user not found --> creating" + mongo $(mongo_credentials) --host $HOST < updating credentials" + mongo $(mongo_credentials) --host $HOST <> /var/log/opencrvs-backup.log 2>&1' + job: 'bash {{ crontab_user_home }}/backup.sh --passphrase={{ backup_encryption_passphrase }} --ssh_user={{ backup_server_user }} --ssh_host={{ backup_hostname }} --ssh_port={{ backup_port }} --remote_dir={{ backup_server_remote_target_directory }} --replicas=1 >> /var/log/opencrvs-backup.log 2>> /var/log/opencrvs-backup.error.log' state: "{{ 'present' if (backup_hostname is defined and backup_encryption_passphrase and (enable_backups | default(false))) else 'absent' }}" ## diff --git a/infrastructure/server-setup/tasks/swap.yml b/infrastructure/server-setup/tasks/swap.yml index 9c732e3e7..08f6407b2 100644 --- a/infrastructure/server-setup/tasks/swap.yml +++ b/infrastructure/server-setup/tasks/swap.yml @@ -14,6 +14,13 @@ tags: - swap.file.permissions +- name: Ensure 'file' utility is installed + ansible.builtin.package: + name: file + state: present + tags: + - swap.file.mkswap + - name: 'Check swap file type' command: file {{ swap_file_path }} register: swapfile diff --git a/package.json b/package.json index 2ae58cc21..2b8b0d1e2 100644 --- a/package.json +++ b/package.json @@ -46,13 +46,13 @@ "@playwright/test": "^1.48.0", "@types/google-libphonenumber": "^7.4.23", "@types/handlebars": "^4.1.0", + "@types/hapi__h2o2": "8.3.3", "@types/hapi__inert": "5.2.1", "@types/inquirer": "^9.0.7", "@types/libsodium-wrappers": "^0.7.10", "@types/minimist": "^1.2.5", "@types/prompts": "^2.4.9", "@types/react-intl": "^3.0.0", - "@types/hapi__h2o2": "8.3.3", "@typescript-eslint/eslint-plugin": "^5.60.1", "@typescript-eslint/parser": "^5.60.1", "eslint": "^8.43.0", @@ -72,11 +72,12 @@ "vitest": "^2.1.2" }, "dependencies": { - "@faker-js/faker": "^6.0.0-alpha.5", + "@faker-js/faker": "^9.3.0", "@hapi/boom": "^9.1.1", "@hapi/h2o2": "^9.1.0", "@hapi/hapi": "^20.0.1", "@hapi/inert": "^6.0.3", + "@opencrvs/toolkit": "0.0.6-events", "@types/chalk": "^2.2.0", "@types/code": "^4.0.3", "@types/csv2json": "^1.4.0", @@ -90,6 +91,7 @@ "@types/node": "^18.19.1", "@types/node-fetch": "^2.6.2", "@types/nodemailer": "^6.4.14", + "@types/uuid": "^10.0.0", "app-module-path": "^2.2.0", "chalk": "^2.4.1", "country-data": "^0.0.31", diff --git a/src/api/custom-event/handler.ts b/src/api/custom-event/handler.ts new file mode 100644 index 000000000..ebc656b26 --- /dev/null +++ b/src/api/custom-event/handler.ts @@ -0,0 +1,19 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * OpenCRVS is also distributed under the terms of the Civil Registration + * & Healthcare Disclaimer located at http://opencrvs.org/license. + * + * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. + */ +import * as Hapi from '@hapi/hapi' +import { tennisClubMembershipEvent } from '@countryconfig/form/tennis-club-membership' + +export const customEventHandler = ( + request: Hapi.Request, + h: Hapi.ResponseToolkit +) => { + return h.response([tennisClubMembershipEvent]).code(200) +} diff --git a/src/api/event-registration/handler.ts b/src/api/event-registration/handler.ts index 4d0d7f0fd..63c5d86e9 100644 --- a/src/api/event-registration/handler.ts +++ b/src/api/event-registration/handler.ts @@ -16,6 +16,7 @@ import { confirmRegistration // rejectRegistration } from '@countryconfig/utils/gateway-api' +import { tennisClubMembershipEvent } from '@countryconfig/form/tennis-club-membership' export async function eventRegistrationHandler( request: Hapi.Request, @@ -67,3 +68,10 @@ export async function eventRegistrationHandler( return h.response().code(202) } + +export const tennisClubMembershipEventHandler = ( + request: Hapi.Request, + h: Hapi.ResponseToolkit +) => { + return h.response(tennisClubMembershipEvent).code(200) +} diff --git a/src/data-generator/address.ts b/src/data-generator/address.ts index 0ee4e915d..981d916f9 100644 --- a/src/data-generator/address.ts +++ b/src/data-generator/address.ts @@ -1,4 +1,4 @@ -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { Location } from './location' export function createAddressInput(location: Location, type: string) { @@ -6,12 +6,12 @@ export function createAddressInput(location: Location, type: string) { country: 'FAR', state: location.partOf.split('/')[1], district: location.id, - city: faker.address.city(), - postalCode: faker.address.zipCode(), + city: faker.location.city(), + postalCode: faker.location.zipCode(), type, line: [ - faker.address.streetAddress(), - faker.address.zipCode(), + faker.location.streetAddress(), + faker.location.zipCode(), 'URBAN', '', '', diff --git a/src/data-generator/declare.ts b/src/data-generator/declare.ts index 2565d342e..92670b8bf 100644 --- a/src/data-generator/declare.ts +++ b/src/data-generator/declare.ts @@ -76,9 +76,9 @@ export async function sendBirthNotification( district: Location, office: Facility ): Promise { - const lastName = faker.name.lastName() - const firstName = faker.name.firstName() - const motherFirstName = faker.name.firstName('female') + const lastName = faker.person.lastName() + const firstName = faker.person.firstName() + const motherFirstName = faker.person.firstName('female') const requestStart = Date.now() const notification = birthNotification({ @@ -89,36 +89,35 @@ export async function sendBirthNotification( gender: sex }, father: { - firstName: faker.name.firstName('male'), + firstName: faker.person.firstName('male'), lastName, - nid: faker.datatype - .number({ min: 1000000000, max: 9999999999 }) - .toString(), + nid: faker.number.bigInt({ min: 1000000000, max: 9999999999 }).toString(), dateOfBirth: sub(birthDate, { years: 20 }).toISOString().split('T')[0] }, mother: { firstName: motherFirstName, lastName, dateOfBirth: sub(birthDate, { years: 20 }).toISOString().split('T')[0], - nid: faker.datatype - .number({ min: 1000000000, max: 9999999999 }) - .toString() + nid: faker.number.bigInt({ min: 1000000000, max: 9999999999 }).toString() }, createdAt: createdAt.toISOString(), address: [ { type: 'PRIMARY_ADDRESS', line: ['12', 'Usual Street', 'Usual Residental Area', '', '', 'URBAN'], - city: faker.address.city(), + city: faker.location.city(), district: district.id, state: district.partOf.split('/')[1], - postalCode: faker.address.zipCode(), + postalCode: faker.location.zipCode(), country: 'FAR' } ], phoneNumber: - '+2607' + faker.datatype.number({ min: 10000000, max: 99999999 }), - email: faker.internet.email(motherFirstName, lastName), + '+2607' + faker.number.bigInt({ min: 10000000, max: 99999999 }), + email: faker.internet.email({ + firstName: motherFirstName, + lastName: lastName + }), dateOfBirth: birthDate.toISOString().split('T')[0], placeOfBirth: `Location/${facility.id}`, officeLocation: office.partOf, @@ -169,9 +168,9 @@ export function createBirthDeclarationData( base64Attachment: string ): BirthRegistrationInput { const timeFilling = Math.round(100000 + Math.random() * 100000) // 100 - 200 seconds - const familyName = faker.name.lastName() - const firstNames = faker.name.firstName() - const motherFirstName = faker.name.firstName('female') + const familyName = faker.person.lastName() + const firstNames = faker.person.firstName() + const motherFirstName = faker.person.firstName('female') const isLateRegistration = differenceInDays(new Date(), birthDate) > 365 const mother: PersonInput = { @@ -181,8 +180,8 @@ export function createBirthDeclarationData( dateOfMarriage: sub(birthDate, { years: 2 }).toISOString().split('T')[0], identifier: [ { - id: faker.datatype - .number({ min: 1000000000, max: 9999999999 }) + id: faker.number + .bigInt({ min: 1000000000, max: 9999999999 }) .toString(), type: identity.nationalId } @@ -208,8 +207,11 @@ export function createBirthDeclarationData( informantType: informant.mother, otherInformantType: '', contactPhoneNumber: - '+2607' + faker.datatype.number({ min: 10000000, max: 99999999 }), - contactEmail: faker.internet.email(motherFirstName, familyName), + '+2607' + faker.number.bigInt({ min: 10000000, max: 99999999 }), + email: faker.internet.email({ + firstName: motherFirstName, + lastName: familyName + }), status: [ { timestamp: sub(declarationTime, { @@ -218,7 +220,7 @@ export function createBirthDeclarationData( timeLoggedMS: timeFilling * 1000 } ], - draftId: faker.datatype.uuid(), + draftId: faker.string.uuid(), attachments: faker.helpers .arrayElements(BIRTH_ATTACHMENTS, NUMBER_OF_ATTACHMENTS_PER_RECORD) .map((attachment) => ({ @@ -268,11 +270,11 @@ export function createBirthDeclarationData( country: 'FAR', state: location.partOf.replace('Location/', ''), district: location.id, - city: faker.address.city(), - postalCode: faker.address.zipCode(), + city: faker.location.city(), + postalCode: faker.location.zipCode(), line: [ - faker.address.streetAddress(), - faker.address.zipCode(), + faker.location.streetAddress(), + faker.location.zipCode(), 'URBAN' ] }, @@ -357,9 +359,9 @@ export async function createDeathDeclaration( facility: Facility, base64Attachment: string ) { - const familyName = faker.name.lastName() - const firstNames = faker.name.firstName() - const spouseFirstName = faker.name.firstName() + const familyName = faker.person.lastName() + const firstNames = faker.person.firstName() + const spouseFirstName = faker.person.firstName() const requestStart = Date.now() @@ -374,8 +376,11 @@ export async function createDeathDeclaration( registration: { informantType: 'SPOUSE', contactPhoneNumber: - '+2607' + faker.datatype.number({ min: 10000000, max: 99999999 }), - contactEmail: faker.internet.email(spouseFirstName, familyName), + '+2607' + faker.number.bigInt({ min: 10000000, max: 99999999 }), + contactEmail: faker.internet.email({ + firstName: spouseFirstName, + lastName: familyName + }), attachments: faker.helpers .arrayElements(DEATH_ATTACHMENTS, NUMBER_OF_ATTACHMENTS_PER_RECORD) .map((attachment) => ({ @@ -383,7 +388,7 @@ export async function createDeathDeclaration( contentType: 'image/png', data: 'data:image/png;base64,' + base64Attachment })), - draftId: faker.datatype.uuid(), + draftId: faker.string.uuid(), status: [ { timestamp: sub(declarationTime, { @@ -398,14 +403,14 @@ export async function createDeathDeclaration( deceased: { identifier: [ { - id: faker.datatype - .number({ min: 1000000000, max: 9999999999 }) + id: faker.number + .bigInt({ min: 1000000000, max: 9999999999 }) .toString(), type: identity.nationalId }, { - id: faker.datatype - .number({ min: 100000000, max: 999999999 }) + id: faker.number + .bigInt({ min: 100000000, max: 999999999 }) .toString(), type: identity.socialSecurityNumber } @@ -454,8 +459,8 @@ export async function createDeathDeclaration( nationality: ['FAR'], identifier: [ { - id: faker.datatype - .number({ min: 1000000000, max: 9999999999 }) + id: faker.number + .bigInt({ min: 1000000000, max: 9999999999 }) .toString(), type: identity.nationalId } diff --git a/src/data-generator/users.ts b/src/data-generator/users.ts index 393fa8693..84304794b 100644 --- a/src/data-generator/users.ts +++ b/src/data-generator/users.ts @@ -1,4 +1,4 @@ -import faker from '@faker-js/faker' +import { faker } from '@faker-js/faker' import { log } from './util' import { Facility, getFacilities, Location } from './location' import fetch from 'node-fetch' @@ -81,8 +81,8 @@ export async function createUser( phoneNumberRegex: string, overrides: Record ) { - const firstName = faker.name.firstName() - const familyName = faker.name.lastName() + const firstName = faker.person.firstName() + const familyName = faker.person.lastName() log('Creating user', firstName, familyName, overrides) const phoneNumberExpander = expand(phoneNumberRegex) @@ -100,15 +100,15 @@ export async function createUser( identifier: [ { system: 'NATIONAL_ID', - value: faker.datatype - .number({ min: 100000000, max: 999999999 }) + value: faker.number + .bigInt({ min: 100000000, max: 999999999 }) .toString() } ], username: firstName.toLocaleLowerCase() + '.' + familyName.toLocaleLowerCase(), mobile: convertToMSISDN(generatedPhoneNumber, countryAlpha3), - email: faker.internet.email(undefined, undefined, 'example.com'), + email: faker.internet.email({ provider: 'example.com' }), primaryOffice: primaryOfficeId, ...overrides } diff --git a/src/form/addresses/index.ts b/src/form/addresses/index.ts index c6a217db7..3322f70ea 100644 --- a/src/form/addresses/index.ts +++ b/src/form/addresses/index.ts @@ -10,9 +10,6 @@ */ import { - FATHER_DETAILS_DONT_EXIST, - MOTHER_DETAILS_DONT_EXIST, - SPOUSE_DETAILS_DONT_EXIST, detailsDontExist, expressionToConditional, hideIfInformantBrideOrGroom, @@ -101,11 +98,11 @@ export const defaultAddressConfiguration: IAddressConfiguration[] = [ { config: AddressSubsections.PRIMARY_ADDRESS_SUBSECTION, label: formMessageDescriptors.primaryAddress, - conditionalCase: MOTHER_DETAILS_DONT_EXIST + conditionalCase: detailsDontExist }, { config: AddressCases.PRIMARY_ADDRESS, - conditionalCase: MOTHER_DETAILS_DONT_EXIST + conditionalCase: detailsDontExist } /*, { config: AddressSubsections.SECONDARY_ADDRESS_SUBSECTION, @@ -128,10 +125,10 @@ export const defaultAddressConfiguration: IAddressConfiguration[] = [ label: formMessageDescriptors.primaryAddress, conditionalCase: [ expressionToConditional( - `${FATHER_DETAILS_DONT_EXIST} || ${hideIfMotherAddressNotAvailable[0].expression}` + `${detailsDontExist} || ${hideIfMotherAddressNotAvailable[0].expression}` ), expressionToConditional( - `${FATHER_DETAILS_DONT_EXIST} || ${hideIfMotherAddressNotAvailable[0].expression} || ${primaryAddressSameAsOtherPrimaryAddress}`, + `${detailsDontExist} || ${hideIfMotherAddressNotAvailable[0].expression} || ${primaryAddressSameAsOtherPrimaryAddress}`, 'hideInPreview' ) ] @@ -153,7 +150,7 @@ export const defaultAddressConfiguration: IAddressConfiguration[] = [ }, { config: AddressCases.PRIMARY_ADDRESS, - conditionalCase: `((${FATHER_DETAILS_DONT_EXIST} || ${primaryAddressSameAsOtherPrimaryAddress}) && !(${mothersDetailsDontExistOnOtherPage}) || ((${detailsDontExist}) && (${mothersDetailsDontExistOnOtherPage})))` + conditionalCase: `((${detailsDontExist} || ${primaryAddressSameAsOtherPrimaryAddress}) && !(${mothersDetailsDontExistOnOtherPage}) || ((${detailsDontExist}) && (${mothersDetailsDontExistOnOtherPage})))` } /*, { config: AddressSubsections.SECONDARY_ADDRESS_SUBSECTION, @@ -282,10 +279,10 @@ export const defaultAddressConfiguration: IAddressConfiguration[] = [ label: formMessageDescriptors.primaryAddress, conditionalCase: [ expressionToConditional( - `${SPOUSE_DETAILS_DONT_EXIST} || ${hideIfDeceasedAddressNotAvailable[0].expression}` + `${detailsDontExist} || ${hideIfDeceasedAddressNotAvailable[0].expression}` ), expressionToConditional( - `${SPOUSE_DETAILS_DONT_EXIST} || ${hideIfDeceasedAddressNotAvailable[0].expression} || ${primaryAddressSameAsOtherPrimaryAddress}`, + `${detailsDontExist} || ${hideIfDeceasedAddressNotAvailable[0].expression} || ${primaryAddressSameAsOtherPrimaryAddress}`, 'hideInPreview' ) ] @@ -307,7 +304,7 @@ export const defaultAddressConfiguration: IAddressConfiguration[] = [ }, { config: AddressCases.PRIMARY_ADDRESS, - conditionalCase: `((${SPOUSE_DETAILS_DONT_EXIST} || ${primaryAddressSameAsOtherPrimaryAddress}) || (${detailsDontExist}))` + conditionalCase: `(${detailsDontExist} || ${primaryAddressSameAsOtherPrimaryAddress})` } ] }, diff --git a/src/form/common/default-validation-conditionals.ts b/src/form/common/default-validation-conditionals.ts index d287a37b9..881ee8e4a 100644 --- a/src/form/common/default-validation-conditionals.ts +++ b/src/form/common/default-validation-conditionals.ts @@ -9,7 +9,6 @@ * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. */ import { Conditional } from '../types/types' -import { IntegratingSystemType } from '../types/types' import { Validator } from '../types/validators' /** @@ -456,18 +455,11 @@ export const spouseFamilyNameConditionals = [ } ] -export const FATHER_DETAILS_DONT_EXIST = - '(draftData?.father && !draftData?.father.detailsExist) || !values.detailsExist' -export const MOTHER_DETAILS_DONT_EXIST = - '(draftData?.mother && !draftData?.mother.detailsExist) || !values.detailsExist' -export const SPOUSE_DETAILS_DONT_EXIST = - '(draftData?.spouse && !draftData?.spouse.detailsExist) || !values.detailsExist' - // if mothers details do not exist on other page export const mothersDetailsDontExistOnOtherPage = 'draftData && draftData.mother && !draftData.mother.detailsExist' -// if fathers details do not exist +// if details don't exist for the current section export const detailsDontExist = '!values.detailsExist' // primary address same as other primary diff --git a/src/form/tennis-club-membership.ts b/src/form/tennis-club-membership.ts new file mode 100644 index 000000000..efb0ec55d --- /dev/null +++ b/src/form/tennis-club-membership.ts @@ -0,0 +1,312 @@ +/* + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at https://mozilla.org/MPL/2.0/. + * + * OpenCRVS is also distributed under the terms of the Civil Registration + * & Healthcare Disclaimer located at http://opencrvs.org/license. + * + * Copyright (C) The OpenCRVS Authors located at https://github.com/opencrvs/opencrvs-core/blob/master/AUTHORS. + */ + +import { defineConfig, defineForm } from '@opencrvs/toolkit/events' +import { + defineConditional, + or, + eventHasAction, + userHasScope, + and, + not, + field +} from '@opencrvs/toolkit/conditionals' + +const TENNIS_CLUB_FORM = defineForm({ + label: { + id: 'event.tennis-club-membership.action.declare.form.label', + defaultMessage: 'Tennis club membership application', + description: 'This is what this form is referred as in the system' + }, + review: { + title: { + id: 'event.tennis-club-membership.action.declare.form.review.title', + defaultMessage: 'Member declaration for {firstname} {surname}', + description: 'Title of the form to show in review page' + } + }, + active: true, + version: { + id: '1.0.0', + label: { + id: 'event.tennis-club-membership.action.declare.form.version.1', + defaultMessage: 'Version 1', + description: 'This is the first version of the form' + } + }, + pages: [ + { + id: 'applicant', + title: { + id: 'event.tennis-club-membership.action.declare.form.section.who.title', + defaultMessage: 'Who is applying for the membership?', + description: 'This is the title of the section' + }, + fields: [ + { + id: 'applicant.firstname', + type: 'TEXT', + required: true, + label: { + defaultMessage: "Applicant's first name", + description: 'This is the label for the field', + id: 'event.tennis-club-membership.action.declare.form.section.who.field.firstname.label' + } + }, + { + id: 'applicant.surname', + type: 'TEXT', + required: true, + label: { + defaultMessage: "Applicant's surname", + description: 'This is the label for the field', + id: 'event.tennis-club-membership.action.declare.form.section.who.field.surname.label' + } + }, + { + id: 'applicant.dob', + type: 'DATE', + required: true, + validation: [ + { + message: { + defaultMessage: 'Please enter a valid date', + description: 'This is the error message for invalid date', + id: 'event.tennis-club-membership.action.declare.form.section.who.field.dob.error' + }, + validator: field('applicant.dob').isBeforeNow() + } + ], + label: { + defaultMessage: "Applicant's date of birth", + description: 'This is the label for the field', + id: 'event.tennis-club-membership.action.declare.form.section.who.field.dob.label' + } + } + // { + // id: 'applicant.image', + // type: 'FILE', + // required: false, + // label: { + // defaultMessage: "Applicant's profile picture", + // description: 'This is the label for the field', + // id: 'event.tennis-club-membership.action.declare.form.section.who.field.image.label' + // } + // } + ] + }, + { + id: 'recommender', + title: { + id: 'event.tennis-club-membership.action.declare.form.section.recommender.title', + defaultMessage: 'Who is recommending the applicant?', + description: 'This is the title of the section' + }, + fields: [ + { + id: 'recommender.firstname', + type: 'TEXT', + required: true, + label: { + defaultMessage: "Recommender's first name", + description: 'This is the label for the field', + id: 'event.tennis-club-membership.action.declare.form.section.recommender.field.firstname.label' + } + }, + { + id: 'recommender.surname', + type: 'TEXT', + required: true, + label: { + defaultMessage: "Recommender's surname", + description: 'This is the label for the field', + id: 'event.tennis-club-membership.action.declare.form.section.recommender.field.surname.label' + } + }, + { + id: 'recommender.id', + type: 'TEXT', + required: true, + label: { + defaultMessage: "Recommender's membership ID", + description: 'This is the label for the field', + id: 'event.tennis-club-membership.action.declare.form.section.recommender.field.id.label' + } + } + ] + } + ] +}) + +export const tennisClubMembershipEvent = defineConfig({ + id: 'TENNIS_CLUB_MEMBERSHIP', + label: { + defaultMessage: 'Tennis club membership application', + description: 'This is what this event is referred as in the system', + id: 'event.tennis-club-membership.label' + }, + summary: { + title: { + defaultMessage: '{applicant.firstname} {applicant.surname}', + description: 'This is the title of the summary', + id: 'event.tennis-club-membership.summary.title' + }, + fields: [ + { + id: 'applicant.firstname' + }, + { + id: 'applicant.surname' + }, + { + id: 'recommender.firstname' + }, + { + id: 'recommender.surname' + }, + { + id: 'recommender.id' + } + ] + }, + workqueues: [ + { + id: 'all', + title: { + defaultMessage: 'All events', + description: 'Label for in progress workqueue', + id: 'event.tennis-club-membership.workqueue.all.label' + }, + fields: [ + { + id: 'applicant.firstname' + }, + { + id: 'applicant.surname' + } + ], + filters: [] + }, + { + id: 'ready-for-review', + title: { + defaultMessage: 'Ready for review', + description: 'Label for in review workqueue', + id: 'event.tennis-club-membership.workqueue.in-review.label' + }, + fields: [ + { + id: 'applicant.firstname' + }, + { + id: 'event.type' + }, + { + id: 'event.createdAt' + }, + { + id: 'event.modifiedAt' + } + ], + filters: [ + { + status: ['DECLARED'] + } + ] + }, + { + id: 'registered', + title: { + defaultMessage: 'Ready to print', + description: 'Label for registered workqueue', + id: 'event.tennis-club-membership.workqueue.registered.label' + }, + fields: [ + { + id: 'applicant.firstname' + }, + { + id: 'event.type' + }, + { + id: 'event.createdAt' + }, + { + id: 'event.modifiedAt' + } + ], + filters: [ + { + status: ['REGISTERED'] + } + ] + } + ], + actions: [ + { + type: 'DECLARE', + label: { + defaultMessage: 'Declare', + description: + 'This is shown as the action name anywhere the user can trigger the action from', + id: 'event.tennis-club-membership.action.declare.label' + }, + forms: [TENNIS_CLUB_FORM], + allowedWhen: defineConditional(not(eventHasAction('DECLARE'))) + }, + { + type: 'VALIDATE', + label: { + defaultMessage: 'Validate', + description: + 'This is shown as the action name anywhere the user can trigger the action from', + id: 'event.tennis-club-membership.action.validate.label' + }, + allowedWhen: defineConditional(eventHasAction('DECLARE')), + forms: [TENNIS_CLUB_FORM] + }, + { + type: 'REGISTER', + label: { + defaultMessage: 'Register', + description: + 'This is shown as the action name anywhere the user can trigger the action from', + id: 'event.tennis-club-membership.action.register.label' + }, + allowedWhen: defineConditional( + and( + or( + eventHasAction('VALIDATE'), + and(eventHasAction('DECLARE'), userHasScope('register')) + ), + not(eventHasAction('REGISTER')) + ) + ), + forms: [TENNIS_CLUB_FORM] + }, + { + type: 'CUSTOM', + label: { + defaultMessage: 'My custom action', + description: + 'This is shown as the action name anywhere the user can trigger the action from', + id: 'event.tennis-club-membership.action.sdf.label' + }, + allowedWhen: defineConditional( + or( + eventHasAction('VALIDATE'), + and(eventHasAction('DECLARE'), userHasScope('register')) + ) + ), + forms: [] + } + ] +}) diff --git a/src/form/types/types.ts b/src/form/types/types.ts index 7b3fa8ce1..302174f64 100644 --- a/src/form/types/types.ts +++ b/src/form/types/types.ts @@ -563,7 +563,7 @@ export interface IFormFieldBase { disabled?: boolean enabled?: string custom?: boolean - initialValue?: IFormFieldValue + initialValue?: InitialValue initialValueKey?: string extraValue?: IFormFieldValue conditionals?: Conditional[] @@ -839,6 +839,13 @@ export interface IDateRangePickerValue { isDateRangeActive: boolean | undefined } +export type DependencyInfo = { + expression: string + dependsOn: string[] +} + +export type InitialValue = IFormFieldValue | DependencyInfo + export type IFormFieldValue = | string | string[] diff --git a/src/index.ts b/src/index.ts index a2f42cbca..211104554 100644 --- a/src/index.ts +++ b/src/index.ts @@ -72,6 +72,7 @@ import { dashboardQueriesHandler } from './api/dashboards/handler' import { fontsHandler } from './api/fonts/handler' import { certificateConfigurationHandler } from './api/certificate-configuration/handler' import { recordNotificationHandler } from './api/record-notification/handler' +import { customEventHandler } from '@countryconfig/api/custom-event/handler' export interface ITokenPayload { sub: string @@ -623,6 +624,16 @@ export async function createServer() { } }) + server.route({ + method: 'GET', + path: '/events', + handler: customEventHandler, + options: { + tags: ['api', 'custom-event'], + description: 'Serves custom events' + } + }) + server.ext({ type: 'onRequest', method(request: Hapi.Request & { sentryScope?: any }, h) { diff --git a/src/translations/client.csv b/src/translations/client.csv index 2ee2f11b7..81ac8cacd 100644 --- a/src/translations/client.csv +++ b/src/translations/client.csv @@ -168,6 +168,10 @@ certificate.receipt.service.targetDay,,{event} registration after 45 days of eve certificate.receipt.service.targetDay.amount,,৳ 25.00,৳ 25.00 certificate.receipt.subheader,Subheader for receipt on payment on certificate,{event} Registration after {DOBDiff} of {DOE},{event} Déclaration après {DOBDiff} de {DOE} changeEmail.validation.msg,Phone number validation message,Must be a valid email address,Doit être une adresse e-mail valide +changeModal.cancel,The label for cancel button of change modal,Cancel,Annuler +changeModal.continue,The label for continue button of change modal,Continue,Continuer +changeModal.description,The description for change modal,A record will be created of any changes you make,Un enregistrement sera créé pour chaque modification que vous apporterez. +changeModal.title,The title for change modal,Edit declaration?,Modifier la déclaration? changePhone.validation.msg,Phone number validation message,Must be a valid 10 digit number that starts with 0,Doit être un numéro valide à {num} chiffres qui commence par {start}. config.advanced.search,This is used for the advanced search,Advanced Search,Recherche avancée config.advanced.search.instruction,This is used for the advanced search,Select the options to build an advanced search. A minimum of two search parameters is required.,Sélectionnez les options pour construire une recherche avancée. Un minimum de deux paramètres de recherche est requis. @@ -785,6 +789,21 @@ error.title,Error title,Oops!,Oups ! error.title.unauthorized,Error title unauthorized,Unauthorized!,Non autorisé ! error.userListError,Error message when user list loads fails,Failed to load users,Impossible de charger les utilisateurs error.weAreTryingToFixThisError,Error description,This page could not be found,"Ce n'est pas vous, c'est nous. C'est notre faute." +event.tennis-club-membership.action.declare.form.label,This is what this form is referred as in the system,Tennis club membership application,Demande d'adhésion au club de tennis +event.tennis-club-membership.action.declare.form.section.recommender.field.firstname.label,This is the label for the field,Recommender's first name,Prénom du recommandeur +event.tennis-club-membership.action.declare.form.section.recommender.field.id.label,This is the label for the field,Recommender's membership ID,ID d'adhésion du recommandeur +event.tennis-club-membership.action.declare.form.section.recommender.field.surname.label,This is the label for the field,Recommender's surname,Nom de famille du recommandeur +event.tennis-club-membership.action.declare.form.section.recommender.title,This is the title of the section,Who is recommending the applicant?,Qui recommande le demandeur? +event.tennis-club-membership.action.declare.form.section.who.field.dob.label,This is the label for the field,Applicant's date of birth,Date de naissance du demandeur +event.tennis-club-membership.action.declare.form.section.who.field.firstname.label,This is the label for the field,Applicant's first name,Prénom du demandeur +event.tennis-club-membership.action.declare.form.section.who.field.surname.label,This is the label for the field,Applicant's surname,Nom de famille du demandeur +event.tennis-club-membership.action.declare.form.section.who.title,This is the title of the section,Who is applying for the membership?,Qui postule pour l'adhésion? +event.tennis-club-membership.action.declare.form.version.1,This is the first version of the form,Version 1,Version 1 +event.tennis-club-membership.action.declare.label,This is shown as the action name anywhere the user can trigger the action from,Send an application,Envoyer une demande +event.tennis-club-membership.label,This is what this event is referred as in the system,Tennis club membership application,Demande d'adhésion au club de tennis +exitModal.cancel,The label for cancel button in exit modal,Cancel,Annuler +exitModal.exitWithoutSaving,The title for exit without saving modal,Exit without saving changes?,Quitter sans enregistrer les modifications? +exitModal.exitWithoutSavingDescription,The description for exit without saving modal,You have unsaved changes on your declaration form. Are you sure you want to exit without saving?,Vous avez des modifications non enregistrées sur votre formulaire de déclaration. Êtes-vous sûr de vouloir quitter sans enregistrer? fieldAgentHome.allUpdatesText,,Great job! You have updated all declarations,Bon travail ! Vous avez mis à jour toutes les déclarations fieldAgentHome.inProgressCount,,In progress ({total}),En cours ({total}) fieldAgentHome.queryError,The text when error ocurred loading rejected declarations,An error occurred while loading declarations,Une erreur s'est produite lors du chargement des déclarations @@ -1256,10 +1275,10 @@ form.section.information.death.bullet2,,As the legal Informant it is important t form.section.information.death.bullet3,,Once the declaration is processed you will receive an email to tell you when to visit the office to collect the certificate - Take your ID with you.,"Une fois la déclaration traitée, vous recevrez un courriel vous indiquant quand vous rendre au bureau pour retirer le certificat - Munissez-vous d'une pièce d'identité." form.section.information.death.bullet4,,Make sure you collect the certificate. A death certificate is critical to support with inheritance claims and to resolve the affairs of the deceased e.g. closing bank accounts and setting loans.,"Veillez à récupérer le certificat. Le certificat de décès est essentiel pour les demandes d'héritage et pour régler les affaires de la personne décédée, par exemple la fermeture des comptes bancaires et la mise en place des prêts." form.section.information.name,,Information,Informations -form.section.label.timePeriodLast30Days,Label for option of time period select: last 30 days,last 30 days,les 30 derniers jours -form.section.label.timePeriodLast7Days,Label for option of time period select: last 7 days,last 7 days,les 7 derniers jours -form.section.label.timePeriodLast90Days,Label for option of time period select: last 90 days,last 90 days,les 90 derniers jours -form.section.label.timePeriodLastYear,Label for option of time period select: last year,last year,l'année dernière +form.section.label.timePeriodLast30Days,Label for option of time period select: last 30 days,Last 30 days,les 30 derniers jours +form.section.label.timePeriodLast7Days,Label for option of time period select: last 7 days,Last 7 days,les 7 derniers jours +form.section.label.timePeriodLast90Days,Label for option of time period select: last 90 days,Last 90 days,les 90 derniers jours +form.section.label.timePeriodLastYear,Label for option of time period select: last year,Last year,l'année dernière form.section.marriageEvent.date,,Date of marriage,Date du mariage form.section.marriageEvent.name,,Marriage event details,Détails de l'événement de mariage form.section.marriageEvent.title,,Marriage details,Détails du mariage @@ -1347,7 +1366,6 @@ integrations.name,Label for name input,Name,Nom integrations.nationalIDName,Label for name input for National ID,Name,Nom integrations.nationalidAlertDescription,,"A National ID client (eg. MOSIP) can react to birth or death webhooks to create or invalidate NID numbers, and respond to OpenCRVS to provide a temporary ID to children, and link vital events to each other. For more information, visit:","Un client d'identification nationale (par exemple MOSIP) peut réagir aux webhooks de naissance ou de décès pour créer ou invalider des numéros d'identification nationale, et répondre à OpenCRVS pour fournir une identification temporaire aux enfants, et relier les événements d'état civil entre eux. Pour plus d'informations, visitez le site :" integrations.newIntegrationDescription,Description to help user fill name and type of a new integration client,Add a unique name and select the type of client you would like to create,Ajoutez un nom unique et sélectionnez le type de client que vous souhaitez créer -integrations.onlyOneNationalId,,Only one National ID integration is allowed.,Une seule intégration d'identité nationale est autorisée integrations.otherAlertDescription,,...Please visit,...Veuillez visiter integrations.pageIntroduction,Label for the text integration page intorduction,"For each new client that needs to integrate with OpenCRVS you can create unique client IDs. A number of integration use cases are currently supported, based on both API and webhook technologies.","Pour chaque nouveau client qui doit s'intégrer à OpenCRVS, vous pouvez créer des identifiants client uniques. Un certain nombre de cas d'utilisation de l'intégration sont actuellement pris en charge, sur la base des technologies API et webhook" integrations.pageTitle,Title for integrations page,Integrations,Intégrations @@ -1358,7 +1376,6 @@ integrations.shaSecret,Label for SHA secret,SHA secret,SHA Secret integrations.supportingDescription,,Supporting description to help user make a decision and navigate the content,Description complémentaire pour aider l'utilisateur à prendre une décision et à naviguer dans le contenu. integrations.type.eventNotification,Label for event notification,Event notification,Notification d'événement integrations.type.healthSystem,Label for health system type,Health integration,Intégration de la santé -integrations.type.nationalID,Label for national ID system client,National ID,Carte d'identité nationale integrations.type.recordSearch,Label for record search,Record search,Recherche d'enregistrements integrations.type.webhook,Label for web hook,Webhook,Webhook integrations.uniqueKeyDescription,Label for the unique key description,These unique keys will be required by the client integrating...,Ces clés uniques seront requises par l'interface du système @@ -1761,6 +1778,16 @@ register.selectVitalEvent.registerNewEventHeading,The section heading on the pag register.selectVitalEvent.registerNewEventTitle,The title that appears on the select vital event page,New declaration,Nouvelle déclaration register.selectinformant.legalGuardian,,Legal guardian,Tuteur légal register.workQueue.declarations.banner,,Declarations to register in your area,Déclarations à enregistrer dans votre région +registerModal.cancel,The label for cancel button of register modal,Cancel,Annuler +registerModal.description,The description for register modal,The declarant will be notified of this correction and a record of this decision will be recorded,Le déclarant sera informé de cette correction et un enregistrement de cette décision sera créé. +registerModal.register,The label for register button of register modal,Register,Enregistrer +registerModal.title,The title for register modal,Register the member?,Enregistrer le membre? +rejectModal.archive,The label for archive button of reject modal,Archive,Archiver +rejectModal.cancel,The label for cancel button of reject modal,Cancel,Annuler +rejectModal.description,The description for reject modal,Please describe the updates required to this record for follow up action.,Veuillez décrire les mises à jour nécessaires à ce dossier pour un suivi. +rejectModal.markAsDuplicate,The label for mark as duplicate checkbox of reject modal,Mark as a duplicate,Marquer comme doublon +rejectModal.sendForUpdate,The label for send For Update button of reject modal,Send For Update,Envoyer pour mise à jour +rejectModal.title,The title for reject modal,Reason for rejection?,Raison du rejet? reloadmodal.body,Body of reload modal,There’s a new version of {app_name} available. Please update to continue.,Une nouvelle version de {app_name} est disponible. Veuillez effectuer la mise à jour pour continuer. reloadmodal.button.update,Label of update button,Update,Mise à jour reloadmodal.title,Title when update is available,Update available,Mise à jour disponible @@ -1817,6 +1844,10 @@ review.signature.delete,Label for button that deletes signature,Delete,Supprimer review.signature.description,Label awknowledging the correctness of the declaration,"I, the undersigned, hereby declare that the particulars in this form are true and correct to the best of my knowledge.","Je soussigné(e) déclare par la présente que les informations contenues dans ce formulaire sont, à ma connaissance, vraies et correctes." review.signature.input.description,Description awknowledging the correctness of the declaration,"By signing this document with an electronic signature, I agree that such signature will be valid as handwritten signatures to the extent allowed by the laws of Farajaland.","En signant ce document avec une signature électronique, j'accepte que cette signature soit valable comme les signatures manuscrites dans la mesure où les lois du Farajaland le permettent." review.signature.open,Label for button that opens the signature input,Sign,Signer +reviewAction.description,The description for review action,"By clicking register, you confirm that the information entered is correct and the member can be registered.","En cliquant sur enregistrer, vous confirmez que les informations saisies sont correctes et que le membre peut être enregistré." +reviewAction.register,The label for register button of review action,Register,Enregistrer +reviewAction.reject,The label for reject button of review action,Reject,Rejeter +reviewAction.title,The title for review action,Register member,Enregistrer un membre search.bookmark.error.notification,Error Notification messages for bookmark advanced search result,"Sorry, something went wrong. Please try again","Désolé, quelque chose s'est mal passé. Veuillez réessayer" search.bookmark.loading.notification,Loading Notification messages for bookmark advanced search result,Bookmarking your advanced search results...,Mettre en signet les résultats de votre recherche avancée... search.bookmark.remove.loading.notification,Loading Notification messages for remove advanced search bookmark,Removing your advanced search bookmark...,Suppression de votre signet de recherche avancée... diff --git a/src/translations/login.csv b/src/translations/login.csv index adccc04d6..93ab9a672 100644 --- a/src/translations/login.csv +++ b/src/translations/login.csv @@ -50,6 +50,9 @@ password.minLength,Password validation,{min} characters minimum,{min} caractère password.mismatch,Password validation,Passwords do not match,Les mots de passe ne correspondent pas password.number,Password validation,At least one number,Au moins un chiffre password.validation.msg,Password validation message,Password must have:,"Le mot de passe doit avoir ," +reloadmodal.body,Body of reload modal,There’s a new version of {app_name} available. Please update to continue.,Une nouvelle version de {app_name} est disponible. Veuillez effectuer la mise à jour pour continuer. +reloadmodal.button.update,Label of update button,Update,Mise à jour +reloadmodal.title,Title when update is available,Update available,Mise à jour disponible resend.sms,Text for button that resend SMS or email verification code,"Resend {notificationMethod, select, sms {SMS} email {Email} other {}}","Renvoyer un {notificationMethod, select, sms {SMS} email {Email} other {}}" resetCredentials.emailAddressConfirmation.form.body.header,Form body header used in the body of email address confirmation step,Enter your email address,Entrez votre adresse email resetCredentials.forgottenItem.form.body.header,Body header for forgotten item form,Select an option,Qu'avez-vous oublié ? diff --git a/tsconfig.json b/tsconfig.json index 4932f7cb8..beba0ad94 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,13 +5,12 @@ "@countryconfig/*": ["./*"] }, "target": "es6", - "module": "commonjs", + "module": "Node16", "outDir": "build/dist", "sourceMap": true, - "resolveJsonModule": true, - "moduleResolution": "node", + "moduleResolution": "node16", "rootDir": ".", - "lib": ["esnext.asynciterable", "es6", "es2017", "es2019", "es2022"], + "lib": ["esnext.asynciterable", "es6", "es2017", "es2019", "es2022", "dom"], "forceConsistentCasingInFileNames": true, "esModuleInterop": true, "noImplicitReturns": true, @@ -19,9 +18,15 @@ "noImplicitAny": true, "skipLibCheck": true, "strictNullChecks": true, - "types": ["jest", "fhir", "geojson"] + "types": ["jest", "fhir", "geojson"], + "resolveJsonModule": true }, - "include": ["src/**/*.ts", "infrastructure/environments/**/*.ts", "typings"], + "include": [ + "src/**/*.ts", + "infrastructure/environments/**/*.ts", + "typings", + "e2e/**/*.ts" + ], "exclude": [ "node_modules", "build", diff --git a/yarn.lock b/yarn.lock index 68e3e545e..74baa78ea 100644 --- a/yarn.lock +++ b/yarn.lock @@ -732,10 +732,10 @@ resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.57.0.tgz#a5417ae8427873f1dd08b70b3574b453e67b5f7f" integrity sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g== -"@faker-js/faker@^6.0.0-alpha.5": - version "6.3.1" - resolved "https://registry.yarnpkg.com/@faker-js/faker/-/faker-6.3.1.tgz#1ae963dd40405450a2945408cba553e1afa3e0fb" - integrity sha512-8YXBE2ZcU/pImVOHX7MWrSR/X5up7t6rPWZlk34RwZEcdr3ua6X+32pSd6XuOQRN+vbuvYNfA6iey8NbrjuMFQ== +"@faker-js/faker@^9.3.0": + version "9.3.0" + resolved "https://registry.yarnpkg.com/@faker-js/faker/-/faker-9.3.0.tgz#ef398dab34c67faaa0e348318c905eae3564fa58" + integrity sha512-r0tJ3ZOkMd9xsu3VRfqlFR6cz0V/jFYRswAIpC+m/DIfAUXq7g8N7wTAlhSANySXYGKzGryfDXwtwsY8TxEIDw== "@formatjs/ecma402-abstract@2.2.3": version "2.2.3" @@ -1712,6 +1712,13 @@ dependencies: "@octokit/openapi-types" "^18.0.0" +"@opencrvs/toolkit@0.0.6-events": + version "0.0.6-events" + resolved "https://registry.yarnpkg.com/@opencrvs/toolkit/-/toolkit-0.0.6-events.tgz#48327b3e322bc82ae60ec13fc855e2e23300b298" + integrity sha512-wh4qaPJktG4Dnh+zFFbDv5b/oZ+bTSzQYRfOzLGS1KNqG7h2j6iZfvmSBtyL0rb/SrpIHcI+9eoqLfwg8cjfyQ== + dependencies: + ajv "^8.17.1" + "@parcel/watcher-android-arm64@2.5.0": version "2.5.0" resolved "https://registry.yarnpkg.com/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.0.tgz#e32d3dda6647791ee930556aee206fcd5ea0fb7a" @@ -2319,6 +2326,11 @@ dependencies: "@types/node" "*" +"@types/uuid@^10.0.0": + version "10.0.0" + resolved "https://registry.yarnpkg.com/@types/uuid/-/uuid-10.0.0.tgz#e9c07fe50da0f53dc24970cca94d619ff03f6f6d" + integrity sha512-7gqG38EyHgyP1S+7+xomFtL+ZNHcKv6DwNaCZmJmo1vgMugyF3TCnXVg4t1uk89mLNwnLtnY3TpOpCOyp1/xHQ== + "@types/wrap-ansi@^3.0.0": version "3.0.0" resolved "https://registry.yarnpkg.com/@types/wrap-ansi/-/wrap-ansi-3.0.0.tgz#18b97a972f94f60a679fd5c796d96421b9abb9fd" @@ -2582,6 +2594,16 @@ ajv@^6.12.4: json-schema-traverse "^0.4.1" uri-js "^4.2.2" +ajv@^8.17.1: + version "8.17.1" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.17.1.tgz#37d9a5c776af6bc92d7f4f9510eba4c0a60d11a6" + integrity sha512-B/gBuNg5SiMTrPkC+A2+cW0RszwxYmn6VYxB/inlBStS5nx6xHIt/ehKRhIMhqusl7a8LjQoZnjCs5vhwxOQ1g== + dependencies: + fast-deep-equal "^3.1.3" + fast-uri "^3.0.1" + json-schema-traverse "^1.0.0" + require-from-string "^2.0.2" + ansi-escapes@^3.0.0: version "3.2.0" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" @@ -4088,6 +4110,11 @@ fast-safe-stringify@^2.1.1: resolved "https://registry.yarnpkg.com/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz#c406a83b6e70d9e35ce3b30a81141df30aeba884" integrity sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA== +fast-uri@^3.0.1: + version "3.0.3" + resolved "https://registry.yarnpkg.com/fast-uri/-/fast-uri-3.0.3.tgz#892a1c91802d5d7860de728f18608a0573142241" + integrity sha512-aLrHthzCjH5He4Z2H9YZ+v6Ujb9ocRuW6ZzkJQOrTxleEijANq4v1TsaPaVG1PZcuurEzrLcWRyYBYXD5cEiaw== + fast-url-parser@^1.1.3: version "1.1.3" resolved "https://registry.yarnpkg.com/fast-url-parser/-/fast-url-parser-1.1.3.tgz#f4af3ea9f34d8a271cf58ad2b3759f431f0b318d" @@ -5180,6 +5207,11 @@ json-schema-traverse@^0.4.1: resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== +json-schema-traverse@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2" + integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug== + json-stable-stringify-without-jsonify@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" @@ -6648,6 +6680,11 @@ require-directory@^2.1.1: resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q== +require-from-string@^2.0.2: + version "2.0.2" + resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909" + integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw== + require-main-filename@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b"