Skip to content

Commit

Permalink
Refactor registration data processing comments on AB#30189
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben committed Nov 6, 2024
1 parent dc1f2e9 commit 5806d3c
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 216 deletions.
42 changes: 21 additions & 21 deletions e2e/test-registration-data/test-registrations-westeros-20.csv
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
referenceId,preferredLanguage,maxPayments,firstName,lastName,phoneNumber,programFinancialServiceProviderConfigurationName,whatsappPhoneNumber,addressStreet,addressHouseNumber,addressHouseNumberAddition,addressPostalCode,addressCity,house
00dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,ironBank,14155238886,Straat,1,A,1234AB,Den Haag,stark
01dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,ironBank,14155238886,Straat,1,A,1234AB,Den Haag,stark
02dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,ironBank,14155238886,Straat,1,A,1234AB,Den Haag,stark
03dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,ironBank,14155238886,Straat,1,A,1234AB,Den Haag,stark
04dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,ironBank,14155238886,Straat,1,A,1234AB,Den Haag,stark
05dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,ironBank,14155238886,Straat,1,A,1234AB,Den Haag,stark
06dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,ironBank,14155238886,Straat,1,A,1234AB,Den Haag,stark
07dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,ironBank,14155238886,Straat,1,A,1234AB,Den Haag,stark
08dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,ironBank,14155238886,Straat,1,A,1234AB,Den Haag,stark
09dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,ironBank,14155238886,Straat,1,A,1234AB,Den Haag,stark
10dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,gringotts,14155238886,Straat,1,A,1234AB,Den Haag,stark
11dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,gringotts,14155238886,Straat,1,A,1234AB,Den Haag,stark
12dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,gringotts,14155238886,Straat,1,A,1234AB,Den Haag,stark
13dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,gringotts,14155238886,Straat,1,A,1234AB,Den Haag,stark
14dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238876,gringotts,14155238886,Straat,1,A,1234AB,Den Haag,stark
15dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238856,gringotts,14155238886,Straat,1,A,1234AB,Den Haag,stark
16dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,gringotts,14155238886,Straat,1,A,1234AB,Den Haag,stark
17dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,gringotts,14155238886,Straat,1,A,1234AB,Den Haag,stark
18dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,gringotts,14155238886,Straat,1,A,1234AB,Den Haag,stark
19dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,gringotts,14155238886,Straat,1,A,1234AB,Den Haag,stark
referenceId,preferredLanguage,maxPayments,firstName,lastName,phoneNumber,programFinancialServiceProviderConfigurationName,whatsappPhoneNumber,house,dragon,knowsNothing,motto,personalId,date,accountId,openAnswer,fixedChoice,healthArea
00dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,ironBank,14155238886,stark,0,1,Winter is coming,id1,30-06-1994,1,agreed,true,HealthAreaName
01dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,ironBank,14155238886,stark,0,1,Winter is coming,id1,30-06-1994,1,agreed,true,HealthAreaName
02dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,ironBank,14155238886,stark,0,1,Winter is coming,id1,30-06-1994,1,agreed,true,HealthAreaName
03dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,ironBank,14155238886,stark,0,1,Winter is coming,id1,30-06-1994,1,agreed,true,HealthAreaName
04dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,ironBank,14155238886,stark,0,1,Winter is coming,id1,30-06-1994,1,agreed,true,HealthAreaName
05dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,ironBank,14155238886,stark,0,1,Winter is coming,id1,30-06-1994,1,agreed,true,HealthAreaName
06dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,ironBank,14155238886,stark,0,1,Winter is coming,id1,30-06-1994,1,agreed,true,HealthAreaName
07dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,ironBank,14155238886,stark,0,1,Winter is coming,id1,30-06-1994,1,agreed,true,HealthAreaName
08dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,ironBank,14155238886,stark,0,1,Winter is coming,id1,30-06-1994,1,agreed,true,HealthAreaName
09dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,ironBank,14155238886,stark,0,1,Winter is coming,id1,30-06-1994,1,agreed,true,HealthAreaName
10dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,gringotts,14155238886,stark,0,1,Winter is coming,id1,30-06-1994,1,agreed,true,HealthAreaName
11dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,gringotts,14155238886,stark,0,1,Winter is coming,id1,30-06-1994,1,agreed,true,HealthAreaName
12dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,gringotts,14155238886,stark,0,1,Winter is coming,id1,30-06-1994,1,agreed,true,HealthAreaName
13dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,gringotts,14155238886,stark,0,1,Winter is coming,id1,30-06-1994,1,agreed,true,HealthAreaName
14dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238876,gringotts,14155238886,stark,0,1,Winter is coming,id1,30-06-1994,1,agreed,true,HealthAreaName
15dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238856,gringotts,14155238886,stark,0,1,Winter is coming,id1,30-06-1994,1,agreed,true,HealthAreaName
16dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,gringotts,14155238886,stark,0,1,Winter is coming,id1,30-06-1994,1,agreed,true,HealthAreaName
17dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,gringotts,14155238886,stark,0,1,Winter is coming,id1,30-06-1994,1,agreed,true,HealthAreaName
18dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,gringotts,14155238886,stark,0,1,Winter is coming,id1,30-06-1994,1,agreed,true,HealthAreaName
19dc9451-1273-484c-b2e8-ae21b51a96ab,en,,Test,succeed,14155238886,gringotts,14155238886,stark,0,1,Winter is coming,id1,30-06-1994,1,agreed,true,HealthAreaName
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,7 @@ export class ProgramPeopleAffectedComponent implements OnDestroy {
: '',
fsp: person.financialServiceProviderName,
financialServiceProvider: this.translatableStringService.get(
this.program?.financialServiceProviderConfigurations?.find(
(p) => p.name === person?.financialServiceProviderName,
)?.label,
person.programFinancialServiceProviderConfigurationLabel,
),
lastMessageStatus: person.lastMessageStatus,
hasNote: !!person.note,
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ export class ExcelService
);
}

public joinRegistrationsAndImportRecords(
private joinRegistrationsAndImportRecords(
registrations: Awaited<
ReturnType<ExcelService['getRegistrationsForReconciliation']>
>,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Do payment with Excel FSP Export FSP instructions Should return all program-question/program-custom attributes on Get FSP instruction with Excel-FSP when "columnsToExport" is not set 1`] = `
exports[`Do payment with Excel FSP Export FSP instructions Should return all program-registration-attributes on Get FSP instruction with Excel-FSP when "columnsToExport" is not set 1`] = `
[
{
"data": [
Expand Down Expand Up @@ -112,6 +112,12 @@ exports[`Do payment with Excel FSP Export FSP instructions Should return specifi
]
`;

exports[`Do payment with Excel FSP Import FSP reconciliation data Should give an error when status column is missing 1`] = `
{
"errors": "The 'status' column is either missing or contains unexpected values. It should only contain 'success' or 'error'.",
}
`;

exports[`Do payment with Excel FSP Import FSP reconciliation data should give me a CSV template when I request it 1`] = `
[
{
Expand Down
23 changes: 22 additions & 1 deletion services/121-service/test/payment/do-payment-fsp-excel.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ describe('Do payment with Excel FSP', () => {
});

// ##TODO: wait with fixing this test until endpoint is available to update/delete columnsToExport
it('Should return all program-question/program-custom attributes on Get FSP instruction with Excel-FSP when "columnsToExport" is not set', async () => {
it('Should return all program-registration-attributes on Get FSP instruction with Excel-FSP when "columnsToExport" is not set', async () => {
// Arrange
const programAttributeColumns =
programTest.programRegistrationAttributes.map((pa) => pa.name);
Expand Down Expand Up @@ -260,5 +260,26 @@ describe('Do payment with Excel FSP', () => {
expect(response.statusCode).toBe(HttpStatus.OK);
expect(response.body.sort()).toMatchSnapshot();
});

it('Should give an error when status column is missing', async () => {
// Arrange
const matchColumn = 'phoneNumber';
// construct reconciliation-file here
const reconciliationData = [
{
[matchColumn]: registrationWesteros1.phoneNumber,
},
];

// Act
const importResult = await importFspReconciliationData(
programIdWesteros,
paymentNr,
accessToken,
reconciliationData,
);
expect(importResult.statusCode).toBe(HttpStatus.NOT_FOUND);
expect(importResult.body).toMatchSnapshot();
});
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ async function setupNlrcEnvironment() {
return accessToken;
}

describe('Update chosen FSP of PA', () => {
describe('Update program financial servce provider configuration of PA', () => {
let accessToken: string;

beforeEach(async () => {
accessToken = await setupNlrcEnvironment();
});

it('should succeed when updating chosen FSP when all required properties of new FSP are already present', async () => {
it('should succeed when updating program financial servce provider configuration when all required properties of new FSP are already present', async () => {
// Arrange
await setupNlrcEnvironment();

Expand Down Expand Up @@ -73,7 +73,7 @@ describe('Update chosen FSP of PA', () => {
);
});

it('should fail when updating chosen FSP when a required property of new FSP is not yet present', async () => {
it('should fail when updating program financial servce provider configuration when a required property of new FSP is not yet present', async () => {
// Arrange
await setupNlrcEnvironment();

Expand All @@ -100,7 +100,7 @@ describe('Update chosen FSP of PA', () => {
expect(response.body).toMatchSnapshot();
});

it('should succeed when updating chosen FSP when missing required properties of new FSP are passed along with the request', async () => {
it('should succeed when updating program financial servce provider configuration when missing required properties of new FSP are passed along with the request', async () => {
// Arrange
await setupNlrcEnvironment();

Expand Down

0 comments on commit 5806d3c

Please sign in to comment.