diff --git a/services/121-service/src/scripts/seed-configuration.const.ts b/services/121-service/src/scripts/seed-configuration.const.ts index 6b1185653d..ac5cf55e51 100644 --- a/services/121-service/src/scripts/seed-configuration.const.ts +++ b/services/121-service/src/scripts/seed-configuration.const.ts @@ -60,17 +60,13 @@ export const SEED_CONFIGURATION_SETTINGS: SeedConfigurationDto[] = [ organization: 'organization-generic.json', programs: [ { - program: 'program-demo.json', + program: 'program-cbe.json', // The test seed has multiple programs, because some tests scenarios only occur with multiple program messageTemplate: 'message-template-generic.json', }, { program: 'program-test.json', messageTemplate: 'message-template-generic.json', }, - { - program: 'program-validation.json', - messageTemplate: 'message-template-generic.json', - }, ], }, ]; diff --git a/services/121-service/src/seed-data/program/program-demo.json b/services/121-service/src/seed-data/program/program-demo.json deleted file mode 100644 index 6e6f5799f2..0000000000 --- a/services/121-service/src/seed-data/program/program-demo.json +++ /dev/null @@ -1,625 +0,0 @@ -{ - "published": true, - "validation": true, - "location": "Demoland", - "ngo": "Demo NGO", - "titlePortal": { - "ar": "مشروع المساعدات النقدية التجريبي", - "en": "Demo Cash Aid Project", - "es": "Proyecto de demostración de ayuda monetaria", - "fr": "Projet de démonstration d'aide en espèces", - "nl": "Demo Cash Hulpprogramma" - }, - "description": { - "ar": "", - "en": "", - "es": "", - "fr": "", - "nl": "" - }, - "startDate": "2022-09-29T12:00:00Z", - "endDate": "2030-11-30T12:00:00Z", - "currency": "EUR", - "distributionFrequency": "week", - "distributionDuration": 10, - "fixedTransferValue": 35, - "targetNrRegistrations": 870, - "tryWhatsAppFirst": true, - "programRegistrationAttributes": [ - { - "name": "name", - "label": { - "ar": "الاسم", - "en": "Name", - "es": "Nombre", - "fr": "Nom", - "nl": "Naam" - }, - "type": "text", - "options": null, - "export": ["all-people-affected", "included"], - "scoring": {}, - "editableInPortal": true, - "showInPeopleAffectedTable": false - }, - { - "name": "middlename", - "label": { - "ar": "الاسم الأوسط", - "en": "Middle name", - "es": "Segundo nombre", - "fr": "Deuxième prénom", - "nl": "Tweede naam" - }, - "type": "text", - "options": null, - "export": ["all-people-affected", "included"], - "scoring": {}, - "editableInPortal": true, - "showInPeopleAffectedTable": false - }, - { - "name": "firstname", - "label": { - "ar": "الاسم الأول", - "en": "First Name", - "es": "Nombre de pila", - "fr": "Prénom", - "nl": "Voornaam" - }, - "type": "text", - "options": null, - "export": ["all-people-affected", "included"], - "scoring": {}, - "editableInPortal": true, - "showInPeopleAffectedTable": false - }, - { - "name": "gender", - "label": { - "ar": "جنس", - "en": "Gender", - "es": "Género", - "fr": "Genre", - "nl": "Geslacht" - }, - "type": "dropdown", - "options": [ - { - "option": "M", - "label": { - "ar": "ذكر", - "en": "Male", - "es": "Masculino", - "fr": "Masculin", - "nl": "Man" - } - }, - { - "option": "F", - "label": { - "ar": "أنثى", - "en": "Female", - "es": "Femenino", - "fr": "Féminin", - "nl": "Vrouw" - } - }, - { - "option": "X", - "label": { - "ar": "أخرى", - "en": "Other", - "es": "Otra", - "fr": "Autre", - "nl": "Anders" - } - } - ], - "export": ["all-people-affected", "included"], - "scoring": {}, - "editableInPortal": true, - "showInPeopleAffectedTable": false - }, - { - "name": "birthdate", - "label": { - "ar": "تاريخ الميلاد", - "en": "Birth date", - "es": "Fecha de nacimiento", - "fr": "Date de naissance", - "nl": "Geboortedatum" - }, - "type": "date", - "options": null, - "export": ["all-people-affected", "included"], - "scoring": {}, - "editableInPortal": true, - "showInPeopleAffectedTable": false - }, - { - "name": "documentid", - "label": { - "ar": "معرف المستند", - "en": "Document ID", - "es": "Número de identificación", - "fr": "Numéro d'identification", - "nl": "Document ID" - }, - "type": "text", - "options": null, - "export": ["all-people-affected", "included"], - "scoring": {}, - "duplicateCheck": true, - "editableInPortal": true, - "showInPeopleAffectedTable": true - }, - { - "name": "headhousehold", - "label": { - "ar": "رب الأسرة", - "en": "Household head", - "es": "Jefe de hogar", - "fr": "Chef de ménage", - "nl": "Hoofd huishouden" - }, - "type": "dropdown", - "options": [ - { - "option": "Oui", - "label": { - "ar": "نعم", - "en": "Yes", - "es": "Sí", - "fr": "Oui", - "nl": "Ja" - } - }, - { - "option": "Non", - "label": { - "ar": "لا", - "en": "No", - "es": "No", - "fr": "Non", - "nl": "Nee" - } - } - ], - "export": ["all-people-affected", "included"], - "scoring": {}, - "editableInPortal": true, - "showInPeopleAffectedTable": false - }, - { - "name": "males", - "label": { - "ar": "", - "en": "Men", - "es": "", - "fr": "", - "nl": "" - }, - "type": "numeric", - "options": null, - "export": ["all-people-affected", "included"], - "scoring": {}, - "editableInPortal": true, - "showInPeopleAffectedTable": false - }, - { - "name": "boys", - "label": { - "ar": "", - "en": "Boys", - "es": "", - "fr": "", - "nl": "" - }, - "type": "numeric", - "options": null, - "export": ["all-people-affected", "included"], - "scoring": { - "multiplier": 1 - }, - "editableInPortal": true, - "showInPeopleAffectedTable": false - }, - { - "name": "women", - "label": { - "ar": "", - "en": "Women", - "es": "", - "fr": "", - "nl": "" - }, - "type": "numeric", - "options": null, - "export": ["all-people-affected", "included"], - "scoring": {}, - "editableInPortal": true, - "showInPeopleAffectedTable": false - }, - { - "name": "girls", - "label": { - "ar": "", - "en": "Girls", - "es": "", - "fr": "", - "nl": "" - }, - "type": "numeric", - "options": null, - "export": ["all-people-affected", "included"], - "scoring": { - "multiplier": 1 - }, - "editableInPortal": true, - "showInPeopleAffectedTable": false - }, - { - "name": "householdsituation", - "label": { - "ar": "", - "en": "Household situation", - "es": "", - "fr": "", - "nl": "" - }, - "type": "dropdown", - "options": [ - { - "option": "returnee", - "label": { - "ar": "", - "en": "Retournee", - "es": "", - "fr": "Retourné", - "nl": "" - } - }, - { - "option": "displaced", - "label": { - "ar": "", - "en": "Displaced", - "es": "", - "fr": "Déplacé", - "nl": "" - } - }, - { - "option": "autochtoneprivate", - "label": { - "ar": "", - "en": "Autochtone (private residency)", - "es": "", - "fr": "Autochtone (simple résident)", - "nl": "" - } - }, - { - "option": "autochtonehost", - "label": { - "ar": "", - "en": "Autochtone (host family)", - "es": "", - "fr": "Autochtone (famille d’accueil)", - "nl": "" - } - } - ], - "export": ["all-people-affected", "included"], - "scoring": { - "returnee": 2, - "displaced": 2, - "autochtoneprivate": 0, - "autochtonehost": 1 - }, - "editableInPortal": true, - "showInPeopleAffectedTable": false - }, - { - "name": "maritalsituation", - "label": { - "ar": "", - "en": "Marital situation", - "es": "", - "fr": "", - "nl": "" - }, - "type": "dropdown", - "options": [ - { - "option": "widowed", - "label": { - "ar": "", - "en": "Widowed", - "es": "", - "fr": "Veuf/Veuve", - "nl": "Weduwe/Weduwnaar" - } - }, - { - "option": "married", - "label": { - "ar": "", - "en": "Married", - "es": "", - "fr": "Marié(e)", - "nl": "Getrouwd" - } - }, - { - "option": "abandoned", - "label": { - "ar": "", - "en": "Abandoned", - "es": "", - "fr": "Abandonné(e)", - "nl": "Verlaten" - } - }, - { - "option": "seperated", - "label": { - "ar": "", - "en": "Seperated", - "es": "", - "fr": "Séparé(e)", - "nl": "Uit elkaar" - } - }, - { - "option": "divorced", - "label": { - "ar": "", - "en": "Divorced", - "es": "", - "fr": "Divorcé (e)", - "nl": "Gescheiden" - } - }, - { - "option": "girl", - "label": { - "ar": "", - "en": "Girl/adolescent < 18 pregnant or mother", - "es": "", - "fr": "Enfant/adolescent ménage", - "nl": "" - } - } - ], - "export": ["all-people-affected", "included"], - "scoring": { - "widowed": 1, - "married": 0, - "abandoned": 1, - "seperated": 1, - "divorced": 1, - "girl": 3 - }, - "editableInPortal": true, - "showInPeopleAffectedTable": false - }, - { - "name": "pregnant", - "label": { - "ar": "", - "en": "Pregnant women", - "es": "", - "fr": "", - "nl": "" - }, - "type": "numeric", - "options": null, - "export": ["all-people-affected", "included"], - "scoring": { - "multiplier": 1 - }, - "editableInPortal": true, - "showInPeopleAffectedTable": false - }, - { - "name": "breastfeeding", - "label": { - "ar": "", - "en": "Breastfeeding women", - "es": "", - "fr": "", - "nl": "" - }, - "type": "numeric", - "options": null, - "export": ["all-people-affected", "included"], - "scoring": { - "multiplier": 1 - }, - "editableInPortal": true, - "showInPeopleAffectedTable": false - }, - { - "name": "womendisabled", - "label": { - "ar": "", - "en": "Women disability", - "es": "", - "fr": "", - "nl": "" - }, - "type": "numeric", - "options": null, - "export": ["all-people-affected", "included"], - "scoring": { - "multiplier": 2 - }, - "editableInPortal": true, - "showInPeopleAffectedTable": false - }, - { - "name": "mendisabled", - "label": { - "ar": "", - "en": "Men disability", - "es": "", - "fr": "", - "nl": "" - }, - "type": "numeric", - "options": null, - "export": ["all-people-affected", "included"], - "scoring": { - "multiplier": 2 - }, - "editableInPortal": true, - "showInPeopleAffectedTable": false - }, - { - "name": "girlsdisabled", - "label": { - "ar": "", - "en": "Girls disability", - "es": "", - "fr": "", - "nl": "" - }, - "type": "numeric", - "options": null, - "export": ["all-people-affected", "included"], - "scoring": { - "multiplier": 2 - }, - "editableInPortal": true, - "showInPeopleAffectedTable": false - }, - { - "name": "boysdisabled", - "label": { - "ar": "", - "en": "Boys disability", - "es": "", - "fr": "", - "nl": "" - }, - "type": "numeric", - "options": null, - "export": ["all-people-affected", "included"], - "scoring": { - "multiplier": 2 - }, - "editableInPortal": true, - "showInPeopleAffectedTable": false - }, - { - "name": "childrenmalnourished", - "label": { - "ar": "", - "en": "Malnourished children", - "es": "", - "fr": "", - "nl": "" - }, - "type": "numeric", - "options": null, - "export": ["all-people-affected", "included"], - "scoring": { - "multiplier": 2 - }, - "editableInPortal": true, - "showInPeopleAffectedTable": false - }, - { - "name": "malnourishedtreatment", - "label": { - "ar": "", - "en": "Malnourished treatment", - "es": "", - "fr": "", - "nl": "" - }, - "type": "dropdown", - "options": [ - { - "option": "Oui", - "label": { - "ar": "نعم", - "en": "Yes", - "es": "Sí", - "fr": "Oui", - "nl": "Ja" - } - }, - { - "option": "Non", - "label": { - "ar": "لا", - "en": "No", - "es": "No", - "fr": "Non", - "nl": "Nee" - } - } - ], - "export": ["all-people-affected", "included"], - "scoring": {}, - "editableInPortal": true, - "showInPeopleAffectedTable": false - }, - { - "name": "whatsappPhoneNumber", - "label": { - "en": "WhatsApp Nr." - }, - "placeholder": { - "ar": "00 00 00 00 0 00+", - "en": "+00 0 00 00 00 00" - }, - "export": ["all-people-affected", "included"], - "type": "tel", - "options": null, - "duplicateCheck": true, - "showInPeopleAffectedTable": true - } - ], - "aboutProgram": { - "ar": "[حول برنامج المساعدات]", - "en": "[about aid program]", - "es": "[sobre el programa de ayuda]", - "fr": "[à propos du programme d'aide]", - "nl": "[beschrijving van het programma]" - }, - "fullnameNamingConvention": ["name", "middlename", "firstname"], - "languages": ["ar", "en", "es", "fr", "nl"], - "allowEmptyPhoneNumber": false, - "programFinancialServiceProviderConfigurations": [ - { - "financialServiceProvider": "Intersolve-voucher-whatsapp", - "properties": [ - { - "name": "username", - "value": "INTERSOLVE_USERNAME" - }, - { - "name": "password", - "value": "INTERSOLVE_PASSWORD" - } - ] - }, - { - "financialServiceProvider": "Excel", - "properties": [ - { - "name": "columnsToExport", - "value": ["name", "birthdate", "documentid", "phoneNumber"] - }, - { - "name": "columnToMatch", - "value": "phoneNumber" - } - ] - } - ] -} diff --git a/services/121-service/src/seed-data/program/program-validation.json b/services/121-service/src/seed-data/program/program-validation.json deleted file mode 100644 index d8eb001920..0000000000 --- a/services/121-service/src/seed-data/program/program-validation.json +++ /dev/null @@ -1,131 +0,0 @@ -{ - "published": true, - "validation": true, - "location": "Location A", - "ngo": "NGO A", - "titlePortal": { - "ar": "برنامج الاختبار - مع التحقق من الصحة", - "en": "Test Program - with validation", - "es": "Programa de prueba - con validación", - "fr": "Programme de test - avec validation", - "nl": "Testprogramma - met validatie" - }, - "description": { - "ar": "", - "en": "", - "es": "", - "fr": "", - "nl": "" - }, - "startDate": "2020-01-01T12:00:00Z", - "endDate": "2020-12-31T12:00:00Z", - "currency": "EUR", - "distributionFrequency": "month", - "distributionDuration": 3, - "fixedTransferValue": 10, - "targetNrRegistrations": 250, - "programRegistrationAttributes": [ - { - "name": "nameFirst", - "label": { - "ar": "الاسم الأول", - "en": "First Name", - "es": "Nombre de pila", - "fr": "Prénom", - "nl": "Voornaam" - }, - "type": "text", - "options": null, - "export": ["all-people-affected", "included"], - "scoring": {}, - "editableInPortal": false, - "showInPeopleAffectedTable": false - }, - { - "name": "nameLast", - "label": { - "ar": "اسم العائلة", - "en": "Last Name", - "es": "Apellido", - "fr": "Nom de famille", - "nl": "Achternaam" - }, - "type": "text", - "options": null, - "export": ["all-people-affected", "included"], - "scoring": {}, - "editableInPortal": false, - "showInPeopleAffectedTable": false - }, - { - "name": "phoneNumber", - "label": { - "ar": "رقم الهاتف.", - "en": "Phone Nr.", - "es": "Nr. teléfono", - "fr": "Nr. de téléphone", - "nl": "Telefoon Nr." - }, - "placeholder": { - "en": "+31 6 00 00 00 00" - }, - "type": "tel", - "options": null, - "export": ["all-people-affected", "included"], - "scoring": {}, - "showInPeopleAffectedTable": false - }, - { - "name": "whatsappPhoneNumber", - "label": { - "en": "WhatsApp Nr." - }, - "placeholder": { - "ar": "00 00 00 00 0 00+", - "en": "+00 0 00 00 00 00" - }, - "export": ["all-people-affected", "included"], - "type": "tel", - "options": null, - "duplicateCheck": true, - "showInPeopleAffectedTable": true - } - ], - "aboutProgram": { - "ar": "[حول برنامج المساعدات]", - "en": "[about aid program]", - "es": "[sobre el programa de ayuda]", - "fr": "[à propos du programme d'aide]", - "nl": "[beschrijving van het programma]" - }, - "fullnameNamingConvention": ["nameFirst", "nameLast"], - "languages": ["ar", "en", "es", "fr", "nl"], - "programFinancialServiceProviderConfigurations": [ - { - "financialServiceProvider": "Intersolve-voucher-whatsapp", - "properties": [ - { - "name": "username", - "value": "INTERSOLVE_USERNAME" - }, - { - "name": "password", - "value": "INTERSOLVE_PASSWORD" - } - ] - }, - { - "financialServiceProvider": "Intersolve-voucher-paper", - "properties": [ - { - "name": "username", - "value": "INTERSOLVE_USERNAME" - }, - { - "name": "password", - "value": "INTERSOLVE_PASSWORD" - } - ] - } - ] -} diff --git a/services/121-service/test/payment/do-payment-fsp-excel.test.ts b/services/121-service/test/payment/do-payment-fsp-excel.test.ts index bc6d6b13e6..ddc4a62ec5 100644 --- a/services/121-service/test/payment/do-payment-fsp-excel.test.ts +++ b/services/121-service/test/payment/do-payment-fsp-excel.test.ts @@ -30,8 +30,7 @@ import { } from '@121-service/test/helpers/utility.helper'; import { programIdWesteros, - programIdWithValidation, - registrationPV5, + registrationCbe, registrationWesteros1, registrationWesteros2, registrationWesteros3, @@ -56,8 +55,9 @@ describe('Do payment with Excel FSP', () => { (registration) => registration.phoneNumber, ); - const registrationsProgramWithValidation = [registrationPV5]; - const refrenceIdsWithValidation = [registrationPV5.referenceId]; + const registrationsProgramWithValidation = [registrationCbe]; + const refrenceIdsWithValidation = [registrationCbe.referenceId]; + const programIdCbe = 1; beforeEach(async () => { await resetDB(SeedScript.testMultiple); @@ -95,27 +95,21 @@ describe('Do payment with Excel FSP', () => { // Do more tests with multiple programs, to include data isolation in tests // Specifically, this enables testing if transactions and registrations have the same length (see excel.service.ts) await importRegistrations( - programIdWithValidation, + programIdCbe, registrationsProgramWithValidation, accessToken, ); await awaitChangePaStatus( - programIdWithValidation, + programIdCbe, refrenceIdsWithValidation, RegistrationStatusEnum.included, accessToken, ); - await doPayment( - programIdWithValidation, - paymentNr, - amount, - [], - accessToken, - ); + await doPayment(programIdCbe, paymentNr, amount, [], accessToken); await waitForPaymentTransactionsToComplete( - programIdWithValidation, + programIdCbe, refrenceIdsWithValidation, accessToken, 10_000, diff --git a/services/121-service/test/registrations/import-registration.test.ts b/services/121-service/test/registrations/import-registration.test.ts index 5478575c13..db82ba43c0 100644 --- a/services/121-service/test/registrations/import-registration.test.ts +++ b/services/121-service/test/registrations/import-registration.test.ts @@ -295,7 +295,7 @@ describe('Import a registration', () => { registrationWesteros1Copy.programFinancialServiceProviderConfigurationName = FinancialServiceProviders.intersolveVoucherWhatsapp; - const programIdWestoros = 1; + const programIdWestoros = 2; // Act const response = await importRegistrations( diff --git a/services/121-service/test/registrations/pagination/pagination-data.ts b/services/121-service/test/registrations/pagination/pagination-data.ts index 54f30dbebb..1059e33cda 100644 --- a/services/121-service/test/registrations/pagination/pagination-data.ts +++ b/services/121-service/test/registrations/pagination/pagination-data.ts @@ -21,7 +21,6 @@ export function createExpectedValueObject( export const programIdPV = 2; export const programIdOCW = 3; export const programIdWesteros = 2; -export const programIdWithValidation = 3; export const registrationOCW1 = { referenceId: '63e62864557597e0d',