From bdf72899e7329310a3e58d33a86e54674d41b093 Mon Sep 17 00:00:00 2001 From: Maciej Szewczyk Date: Wed, 11 Dec 2024 21:29:00 +0100 Subject: [PATCH] more --- .../targeting/fakeAllTargetPopulation.ts | 511 +++++++++--------- .../fakeApolloAllTargetPopulation.ts | 137 +++++ src/frontend/src/__generated__/graphql.tsx | 3 +- .../queries/paymentmodule/PaymentPlan.ts | 1 + .../FollowUpPaymentPlanDetails.tsx | 5 +- .../PaymentPlanDetails/PaymentPlanDetails.tsx | 5 +- .../PaymentPlanParameters.tsx | 22 +- .../PaymentDetails/PaymentDetails.tsx | 4 +- .../PaymentPlanDetails/PaymentPlanDetails.tsx | 9 +- .../Surveys/SurveysTable/SurveysTable.tsx | 2 +- .../TargetPopulationForPeopleTable.test.tsx | 3 +- 11 files changed, 421 insertions(+), 281 deletions(-) create mode 100644 src/frontend/fixtures/targeting/fakeApolloAllTargetPopulation.ts diff --git a/src/frontend/fixtures/targeting/fakeAllTargetPopulation.ts b/src/frontend/fixtures/targeting/fakeAllTargetPopulation.ts index 942da955cf..adf16c9cd4 100644 --- a/src/frontend/fixtures/targeting/fakeAllTargetPopulation.ts +++ b/src/frontend/fixtures/targeting/fakeAllTargetPopulation.ts @@ -1,262 +1,257 @@ import { AllTargetPopulationsQuery } from '../../src/__generated__/graphql'; export const fakeAllTargetPopulation = { - { - "allPaymentPlans": { - "pageInfo": { - "hasNextPage": true, - "hasPreviousPage": false, - "startCursor": "YXJyYXljb25uZWN0aW9uOjA=", - "endCursor": "YXJyYXljb25uZWN0aW9uOjQ=", - "__typename": "PageInfo" + allPaymentPlans: { + pageInfo: { + hasNextPage: true, + hasPreviousPage: false, + startCursor: 'YXJyYXljb25uZWN0aW9uOjA=', + endCursor: 'YXJyYXljb25uZWN0aW9uOjQ=', + __typename: 'PageInfo', + }, + totalCount: 25, + edges: [ + { + cursor: 'YXJyYXljb25uZWN0aW9uOjA=', + node: { + id: 'UGF5bWVudFBsYW5Ob2RlOmRjYTdlMTQzLTU4Y2UtNDQ0Mi1hMDY2LTY3ZTc2ZDA4YzljYg==', + unicefId: 'PP-0060-24-00000073', + name: 'tes tp', + isFollowUp: false, + followUps: { + totalCount: 0, + edges: [], + __typename: 'PaymentPlanNodeConnection', + }, + status: 'LOCKED', + createdBy: { + id: 'VXNlck5vZGU6NDE5NmMyYzUtYzJkZC00OGQyLTg4N2YtM2E5ZDM5ZTc4OTE2', + firstName: 'Paulina', + lastName: 'Kujawa', + email: 'paulina.kujawa@kellton.com', + __typename: 'UserNode', + }, + program: { + id: 'UHJvZ3JhbU5vZGU6MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtZmFjZWIwMGMwMDAw', + name: 'Test Program', + __typename: 'ProgramNode', + }, + targetPopulation: { + id: 'VGFyZ2V0UG9wdWxhdGlvbk5vZGU6MDdkOGMwOGUtNzYxOS00NmUzLWJmM2UtMWIwYTk2ZjI5ZGRk', + name: 'tes tp', + __typename: 'TargetPopulationNode', + }, + currency: 'ALL', + currencyName: 'Albanian lek', + startDate: '2024-08-09', + endDate: '2024-08-31', + dispersionStartDate: '2024-08-09', + dispersionEndDate: '2024-08-23', + femaleChildrenCount: 5, + femaleAdultsCount: 6, + maleChildrenCount: 7, + maleAdultsCount: 0, + totalHouseholdsCount: 4, + totalIndividualsCount: 18, + totalEntitledQuantity: 0, + totalDeliveredQuantity: 0, + totalUndeliveredQuantity: 0, + __typename: 'PaymentPlanNode', }, - "totalCount": 25, - "edges": [ - { - "cursor": "YXJyYXljb25uZWN0aW9uOjA=", - "node": { - "id": "UGF5bWVudFBsYW5Ob2RlOmRjYTdlMTQzLTU4Y2UtNDQ0Mi1hMDY2LTY3ZTc2ZDA4YzljYg==", - "unicefId": "PP-0060-24-00000073", - "name": "tes tp", - "isFollowUp": false, - "followUps": { - "totalCount": 0, - "edges": [], - "__typename": "PaymentPlanNodeConnection" - }, - "status": "LOCKED", - "createdBy": { - "id": "VXNlck5vZGU6NDE5NmMyYzUtYzJkZC00OGQyLTg4N2YtM2E5ZDM5ZTc4OTE2", - "firstName": "Paulina", - "lastName": "Kujawa", - "email": "paulina.kujawa@kellton.com", - "__typename": "UserNode" - }, - "program": { - "id": "UHJvZ3JhbU5vZGU6MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtZmFjZWIwMGMwMDAw", - "name": "Test Program", - "__typename": "ProgramNode" - }, - "targetPopulation": { - "id": "VGFyZ2V0UG9wdWxhdGlvbk5vZGU6MDdkOGMwOGUtNzYxOS00NmUzLWJmM2UtMWIwYTk2ZjI5ZGRk", - "name": "tes tp", - "__typename": "TargetPopulationNode" - }, - "currency": "ALL", - "currencyName": "Albanian lek", - "startDate": "2024-08-09", - "endDate": "2024-08-31", - "dispersionStartDate": "2024-08-09", - "dispersionEndDate": "2024-08-23", - "femaleChildrenCount": 5, - "femaleAdultsCount": 6, - "maleChildrenCount": 7, - "maleAdultsCount": 0, - "totalHouseholdsCount": 4, - "totalIndividualsCount": 18, - "totalEntitledQuantity": 0, - "totalDeliveredQuantity": 0, - "totalUndeliveredQuantity": 0, - "__typename": "PaymentPlanNode" - }, - "__typename": "PaymentPlanNodeEdge" - }, - { - "cursor": "YXJyYXljb25uZWN0aW9uOjE=", - "node": { - "id": "UGF5bWVudFBsYW5Ob2RlOjM2YTBkYWMwLWVlNjAtNDYyMC04MDk0LWI3Y2FjYjdjZjZlYQ==", - "unicefId": "PP-0060-24-00000072", - "name": "fdssdsdfsfdssdsdfsfdssdsdfs", - "isFollowUp": false, - "followUps": { - "totalCount": 0, - "edges": [], - "__typename": "PaymentPlanNodeConnection" - }, - "status": "OPEN", - "createdBy": { - "id": "VXNlck5vZGU6NjZiN2MxMjMtMmRiOS00M2RjLWJlYTQtOTY5OTc5YjE3MjI5", - "firstName": "Jan", - "lastName": "Romaniak", - "email": "jan.romaniak@kellton.com", - "__typename": "UserNode" - }, - "program": { - "id": "UHJvZ3JhbU5vZGU6MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtZmFjZWIwMGMwMDAw", - "name": "Test Program", - "__typename": "ProgramNode" - }, - "targetPopulation": { - "id": "VGFyZ2V0UG9wdWxhdGlvbk5vZGU6ZDE0ODJlMGMtNzJkMC00NDU3LWFkOWItMThmNzc1Zjg3MjVj", - "name": "fdssdsdfsfdssdsdfsfdssdsdfs", - "__typename": "TargetPopulationNode" - }, - "currency": "AOA", - "currencyName": "Angolan kwanza", - "startDate": "2024-07-24", - "endDate": "2024-07-27", - "dispersionStartDate": "2024-07-24", - "dispersionEndDate": "2024-07-30", - "femaleChildrenCount": 0, - "femaleAdultsCount": 0, - "maleChildrenCount": 0, - "maleAdultsCount": 0, - "totalHouseholdsCount": 0, - "totalIndividualsCount": 0, - "totalEntitledQuantity": 0, - "totalDeliveredQuantity": 0, - "totalUndeliveredQuantity": 0, - "__typename": "PaymentPlanNode" - }, - "__typename": "PaymentPlanNodeEdge" - }, - { - "cursor": "YXJyYXljb25uZWN0aW9uOjI=", - "node": { - "id": "UGF5bWVudFBsYW5Ob2RlOmZmNTY4NWY0LTI1ZDEtNGI1YS1iMWU0LTFkNjRiN2ZkYThiMw==", - "unicefId": "PP-0060-24-00000063", - "name": "Test TP 1", - "isFollowUp": false, - "followUps": { - "totalCount": 0, - "edges": [], - "__typename": "PaymentPlanNodeConnection" - }, - "status": "ACCEPTED", - "createdBy": { - "id": "VXNlck5vZGU6NjZiN2MxMjMtMmRiOS00M2RjLWJlYTQtOTY5OTc5YjE3MjI5", - "firstName": "Jan", - "lastName": "Romaniak", - "email": "jan.romaniak@kellton.com", - "__typename": "UserNode" - }, - "program": { - "id": "UHJvZ3JhbU5vZGU6MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtZmFjZWIwMGMwMDAw", - "name": "Test Program", - "__typename": "ProgramNode" - }, - "targetPopulation": { - "id": "VGFyZ2V0UG9wdWxhdGlvbk5vZGU6MzM3NDg0ZTAtYmVkMC00N2U0LWI2YzEtZWUyMmViNzFmZTY3", - "name": "Test TP 1", - "__typename": "TargetPopulationNode" - }, - "currency": "ALL", - "currencyName": "Albanian lek", - "startDate": "2024-06-25", - "endDate": "2024-06-29", - "dispersionStartDate": "2024-06-25", - "dispersionEndDate": "2024-06-29", - "femaleChildrenCount": 45, - "femaleAdultsCount": 47, - "maleChildrenCount": 65, - "maleAdultsCount": 50, - "totalHouseholdsCount": 50, - "totalIndividualsCount": 207, - "totalEntitledQuantity": 10600, - "totalDeliveredQuantity": 0, - "totalUndeliveredQuantity": 10600, - "__typename": "PaymentPlanNode" - }, - "__typename": "PaymentPlanNodeEdge" - }, - { - "cursor": "YXJyYXljb25uZWN0aW9uOjM=", - "node": { - "id": "UGF5bWVudFBsYW5Ob2RlOjJjNDUwYzU1LWM4YWEtNDk5Ni1hMWU4LWU3OGYzMzgxYWVlNA==", - "unicefId": "PP-0060-24-00000057", - "name": "nazywam", - "isFollowUp": false, - "followUps": { - "totalCount": 0, - "edges": [], - "__typename": "PaymentPlanNodeConnection" - }, - "status": "ACCEPTED", - "createdBy": { - "id": "VXNlck5vZGU6NmZiYTBhNDctN2U2Mi00ZjMyLWI0Y2EtNGNiNjkxZTk4ZmI0", - "firstName": "Szymon", - "lastName": "Wyderka", - "email": "szymon.wyderka@kellton.com", - "__typename": "UserNode" - }, - "program": { - "id": "UHJvZ3JhbU5vZGU6MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtZmFjZWIwMGMwMDAw", - "name": "Test Program", - "__typename": "ProgramNode" - }, - "targetPopulation": { - "id": "VGFyZ2V0UG9wdWxhdGlvbk5vZGU6OTIyYzZiMmYtYWYxOS00NzM0LTg5M2QtZTg1YWM0NWQ4YjU1", - "name": "nazywam", - "__typename": "TargetPopulationNode" - }, - "currency": "ARS", - "currencyName": "Argentine peso", - "startDate": "2024-06-12", - "endDate": "2024-06-14", - "dispersionStartDate": "2024-06-11", - "dispersionEndDate": "2024-06-21", - "femaleChildrenCount": 20, - "femaleAdultsCount": 5, - "maleChildrenCount": 13, - "maleAdultsCount": 4, - "totalHouseholdsCount": 10, - "totalIndividualsCount": 42, - "totalEntitledQuantity": 2120, - "totalDeliveredQuantity": 0, - "totalUndeliveredQuantity": 2120, - "__typename": "PaymentPlanNode" - }, - "__typename": "PaymentPlanNodeEdge" - }, - { - "cursor": "YXJyYXljb25uZWN0aW9uOjQ=", - "node": { - "id": "UGF5bWVudFBsYW5Ob2RlOjZiY2Y1NDFkLTliZGYtNGQ5Ny05NmYxLWU1M2MyZjYyZjkxMw==", - "unicefId": "PP-0060-24-00000056", - "name": null, - "isFollowUp": true, - "followUps": { - "totalCount": 0, - "edges": [], - "__typename": "PaymentPlanNodeConnection" - }, - "status": "OPEN", - "createdBy": { - "id": "VXNlck5vZGU6NmZiYTBhNDctN2U2Mi00ZjMyLWI0Y2EtNGNiNjkxZTk4ZmI0", - "firstName": "Szymon", - "lastName": "Wyderka", - "email": "szymon.wyderka@kellton.com", - "__typename": "UserNode" - }, - "program": { - "id": "UHJvZ3JhbU5vZGU6MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtZmFjZWIwMGMwMDAw", - "name": "Test Program", - "__typename": "ProgramNode" - }, - "targetPopulation": { - "id": "VGFyZ2V0UG9wdWxhdGlvbk5vZGU6ZmZlNjMyODQtYzFmOC00ZGI5LWE0MzktMzlkODI1ZTk3MjBi", - "name": "xxxxxxxx", - "__typename": "TargetPopulationNode" - }, - "currency": "AWG", - "currencyName": "Aruban florin", - "startDate": "2024-04-01", - "endDate": "2024-04-02", - "dispersionStartDate": "2024-06-02", - "dispersionEndDate": "2024-06-29", - "femaleChildrenCount": 0, - "femaleAdultsCount": 5, - "maleChildrenCount": 0, - "maleAdultsCount": 3, - "totalHouseholdsCount": 1, - "totalIndividualsCount": 8, - "totalEntitledQuantity": 212, - "totalDeliveredQuantity": 0, - "totalUndeliveredQuantity": 212, - "__typename": "PaymentPlanNode" - }, - "__typename": "PaymentPlanNodeEdge" - } - ], - "__typename": "PaymentPlanNodeConnection" -}} as AllTargetPopulationsQuery; + __typename: 'PaymentPlanNodeEdge', + }, + { + cursor: 'YXJyYXljb25uZWN0aW9uOjE=', + node: { + id: 'UGF5bWVudFBsYW5Ob2RlOjM2YTBkYWMwLWVlNjAtNDYyMC04MDk0LWI3Y2FjYjdjZjZlYQ==', + unicefId: 'PP-0060-24-00000072', + name: 'fdssdsdfsfdssdsdfsfdssdsdfs', + isFollowUp: false, + followUps: { + totalCount: 0, + edges: [], + __typename: 'PaymentPlanNodeConnection', + }, + status: 'OPEN', + createdBy: { + id: 'VXNlck5vZGU6NjZiN2MxMjMtMmRiOS00M2RjLWJlYTQtOTY5OTc5YjE3MjI5', + firstName: 'Jan', + lastName: 'Romaniak', + email: 'jan.romaniak@kellton.com', + __typename: 'UserNode', + }, + program: { + id: 'UHJvZ3JhbU5vZGU6MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtZmFjZWIwMGMwMDAw', + name: 'Test Program', + __typename: 'ProgramNode', + }, + targetPopulation: { + id: 'VGFyZ2V0UG9wdWxhdGlvbk5vZGU6ZDE0ODJlMGMtNzJkMC00NDU3LWFkOWItMThmNzc1Zjg3MjVj', + name: 'fdssdsdfsfdssdsdfsfdssdsdfs', + __typename: 'TargetPopulationNode', + }, + currency: 'AOA', + currencyName: 'Angolan kwanza', + startDate: '2024-07-24', + endDate: '2024-07-27', + dispersionStartDate: '2024-07-24', + dispersionEndDate: '2024-07-30', + femaleChildrenCount: 0, + femaleAdultsCount: 0, + maleChildrenCount: 0, + maleAdultsCount: 0, + totalHouseholdsCount: 0, + totalIndividualsCount: 0, + totalEntitledQuantity: 0, + totalDeliveredQuantity: 0, + totalUndeliveredQuantity: 0, + __typename: 'PaymentPlanNode', + }, + __typename: 'PaymentPlanNodeEdge', + }, + { + cursor: 'YXJyYXljb25uZWN0aW9uOjI=', + node: { + id: 'UGF5bWVudFBsYW5Ob2RlOmZmNTY4NWY0LTI1ZDEtNGI1YS1iMWU0LTFkNjRiN2ZkYThiMw==', + unicefId: 'PP-0060-24-00000063', + name: 'Test TP 1', + isFollowUp: false, + followUps: { + totalCount: 0, + edges: [], + __typename: 'PaymentPlanNodeConnection', + }, + status: 'ACCEPTED', + createdBy: { + id: 'VXNlck5vZGU6NjZiN2MxMjMtMmRiOS00M2RjLWJlYTQtOTY5OTc5YjE3MjI5', + firstName: 'Jan', + lastName: 'Romaniak', + email: 'jan.romaniak@kellton.com', + __typename: 'UserNode', + }, + program: { + id: 'UHJvZ3JhbU5vZGU6MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtZmFjZWIwMGMwMDAw', + name: 'Test Program', + __typename: 'ProgramNode', + }, + targetPopulation: { + id: 'VGFyZ2V0UG9wdWxhdGlvbk5vZGU6MzM3NDg0ZTAtYmVkMC00N2U0LWI2YzEtZWUyMmViNzFmZTY3', + name: 'Test TP 1', + __typename: 'TargetPopulationNode', + }, + currency: 'ALL', + currencyName: 'Albanian lek', + startDate: '2024-06-25', + endDate: '2024-06-29', + dispersionStartDate: '2024-06-25', + dispersionEndDate: '2024-06-29', + femaleChildrenCount: 45, + femaleAdultsCount: 47, + maleChildrenCount: 65, + maleAdultsCount: 50, + totalHouseholdsCount: 50, + totalIndividualsCount: 207, + totalEntitledQuantity: 10600, + totalDeliveredQuantity: 0, + totalUndeliveredQuantity: 10600, + __typename: 'PaymentPlanNode', + }, + __typename: 'PaymentPlanNodeEdge', + }, + { + cursor: 'YXJyYXljb25uZWN0aW9uOjM=', + node: { + id: 'UGF5bWVudFBsYW5Ob2RlOjJjNDUwYzU1LWM4YWEtNDk5Ni1hMWU4LWU3OGYzMzgxYWVlNA==', + unicefId: 'PP-0060-24-00000057', + name: 'nazywam', + isFollowUp: false, + followUps: { + totalCount: 0, + edges: [], + __typename: 'PaymentPlanNodeConnection', + }, + status: 'ACCEPTED', + createdBy: { + id: 'VXNlck5vZGU6NmZiYTBhNDctN2U2Mi00ZjMyLWI0Y2EtNGNiNjkxZTk4ZmI0', + firstName: 'Szymon', + lastName: 'Wyderka', + email: 'szymon.wyderka@kellton.com', + __typename: 'UserNode', + }, + program: { + id: 'UHJvZ3JhbU5vZGU6MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtZmFjZWIwMGMwMDAw', + name: 'Test Program', + __typename: 'ProgramNode', + }, + targetPopulation: { + id: 'VGFyZ2V0UG9wdWxhdGlvbk5vZGU6OTIyYzZiMmYtYWYxOS00NzM0LTg5M2QtZTg1YWM0NWQ4YjU1', + name: 'nazywam', + __typename: 'TargetPopulationNode', + }, + currency: 'ARS', + currencyName: 'Argentine peso', + startDate: '2024-06-12', + endDate: '2024-06-14', + dispersionStartDate: '2024-06-11', + dispersionEndDate: '2024-06-21', + femaleChildrenCount: 20, + femaleAdultsCount: 5, + maleChildrenCount: 13, + maleAdultsCount: 4, + totalHouseholdsCount: 10, + totalIndividualsCount: 42, + totalEntitledQuantity: 2120, + totalDeliveredQuantity: 0, + totalUndeliveredQuantity: 2120, + __typename: 'PaymentPlanNode', + }, + __typename: 'PaymentPlanNodeEdge', + }, + { + cursor: 'YXJyYXljb25uZWN0aW9uOjQ=', + node: { + id: 'UGF5bWVudFBsYW5Ob2RlOjZiY2Y1NDFkLTliZGYtNGQ5Ny05NmYxLWU1M2MyZjYyZjkxMw==', + unicefId: 'PP-0060-24-00000056', + name: null, + isFollowUp: true, + followUps: { + totalCount: 0, + edges: [], + __typename: 'PaymentPlanNodeConnection', + }, + status: 'OPEN', + createdBy: { + id: 'VXNlck5vZGU6NmZiYTBhNDctN2U2Mi00ZjMyLWI0Y2EtNGNiNjkxZTk4ZmI0', + firstName: 'Szymon', + lastName: 'Wyderka', + email: 'szymon.wyderka@kellton.com', + __typename: 'UserNode', + }, + program: { + id: 'UHJvZ3JhbU5vZGU6MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtZmFjZWIwMGMwMDAw', + name: 'Test Program', + __typename: 'ProgramNode', + }, + currency: 'AWG', + currencyName: 'Aruban florin', + startDate: '2024-04-01', + endDate: '2024-04-02', + dispersionStartDate: '2024-06-02', + dispersionEndDate: '2024-06-29', + femaleChildrenCount: 0, + femaleAdultsCount: 5, + maleChildrenCount: 0, + maleAdultsCount: 3, + totalHouseholdsCount: 1, + totalIndividualsCount: 8, + totalEntitledQuantity: 212, + totalDeliveredQuantity: 0, + totalUndeliveredQuantity: 212, + __typename: 'PaymentPlanNode', + }, + __typename: 'PaymentPlanNodeEdge', + }, + ], + __typename: 'PaymentPlanNodeConnection', + }, +} as AllTargetPopulationsQuery; diff --git a/src/frontend/fixtures/targeting/fakeApolloAllTargetPopulation.ts b/src/frontend/fixtures/targeting/fakeApolloAllTargetPopulation.ts new file mode 100644 index 0000000000..245dace21b --- /dev/null +++ b/src/frontend/fixtures/targeting/fakeApolloAllTargetPopulation.ts @@ -0,0 +1,137 @@ +import { AllTargetPopulationsDocument } from '../../src/__generated__/graphql'; + +export const fakeApolloAllTargetPopulation = [ + { + request: { + query: AllTargetPopulationsDocument, + variables: { + name: '', + totalHouseholdsCountMin: null, + totalHouseholdsCountMax: null, + status: '', + businessArea: 'afghanistan', + program: [ + 'UHJvZ3JhbU5vZGU6YzRkNTY1N2QtMWEyOS00NmUxLTgxOTAtZGY3Zjg1YTBkMmVm', + ], + createdAtRange: '{"min":null,"max":null}', + first: 10, + orderBy: '-created_at', + }, + }, + result: { + data: { + allTargetPopulation: { + edges: [ + { + node: { + id: 'VGFyZ2V0UG9wdWxhdGlvbk5vZGU6MjQyZmQ4NDQtOTYzOC00MTdhLTkzZWMtYjQzMjY0Y2Y4YmRj', + name: 'Our ball many investment look like.', + status: 'READY_FOR_CASH_ASSIST', + createdAt: '2023-09-29T10:52:33.042363+00:00', + updatedAt: '2023-09-29T10:52:33.068191+00:00', + totalHouseholdsCount: 0, + totalHouseholdsCountWithValidPhoneNo: 0, + totalIndividualsCount: null, + __typename: 'TargetPopulationNode', + program: { + id: 'UHJvZ3JhbU5vZGU6MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtZmFjZWIwMGMwMDAw', + name: 'Test Program', + __typename: 'ProgramNode', + }, + createdBy: { + id: 'VXNlck5vZGU6M2ZlNWE2OGMtYTI3Mi00Y2UzLWE3YzgtODhkNWIyOTY1YjMy', + firstName: 'Mary', + lastName: 'Reyes', + __typename: 'UserNode', + }, + }, + cursor: 'YXJyYXljb25uZWN0aW9uOjA=', + __typename: 'TargetPopulationNodeEdge', + }, + { + node: { + id: 'VGFyZ2V0UG9wdWxhdGlvbk5vZGU6YjI0ZDA5ZTUtN2E1Yy00MjgyLWI4ZmItYWY4MDkwMGY5YzRm', + name: 'Less road structure audience those modern.', + status: 'READY_FOR_CASH_ASSIST', + createdAt: '2023-09-29T10:52:30.379605+00:00', + updatedAt: '2023-09-29T10:52:30.412142+00:00', + totalHouseholdsCount: 0, + totalHouseholdsCountWithValidPhoneNo: 0, + totalIndividualsCount: null, + __typename: 'TargetPopulationNode', + program: { + id: 'UHJvZ3JhbU5vZGU6MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtZmFjZWIwMGMwMDAw', + name: 'Test Program', + __typename: 'ProgramNode', + }, + createdBy: { + id: 'VXNlck5vZGU6ZDA0MjdlNjktN2U1Mi00NmYzLTljNjItMGU1YzJlZWRjNGYz', + firstName: 'Elizabeth', + lastName: 'Coleman', + __typename: 'UserNode', + }, + }, + cursor: 'YXJyYXljb25uZWN0aW9uOjE=', + __typename: 'TargetPopulationNodeEdge', + }, + { + node: { + id: 'VGFyZ2V0UG9wdWxhdGlvbk5vZGU6YzBiMzE0NjItNmIzMC00OGNiLTljMmMtZDgzM2JkZTJmNGYx', + name: 'Score visit write ask whole myself.', + status: 'READY_FOR_CASH_ASSIST', + createdAt: '2023-09-29T10:52:30.190168+00:00', + updatedAt: '2023-09-29T10:52:30.220259+00:00', + totalHouseholdsCount: 0, + totalHouseholdsCountWithValidPhoneNo: 0, + totalIndividualsCount: null, + __typename: 'TargetPopulationNode', + program: { + id: 'UHJvZ3JhbU5vZGU6MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtZmFjZWIwMGMwMDAw', + name: 'Test Program', + __typename: 'ProgramNode', + }, + createdBy: { + id: 'VXNlck5vZGU6ODE3OWIyMDAtZjBhZC00OWYyLWJjZDItNTYwZjUxZDZlOGNj', + firstName: 'Jennifer', + lastName: 'Bailey', + __typename: 'UserNode', + }, + }, + cursor: 'YXJyYXljb25uZWN0aW9uOjI=', + __typename: 'TargetPopulationNodeEdge', + }, + { + node: { + id: 'VGFyZ2V0UG9wdWxhdGlvbk5vZGU6MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtZmFjZWIwMGMwMTIz', + name: 'Test Target Population', + status: 'ASSIGNED', + createdAt: '2023-09-29T10:52:29.726956+00:00', + updatedAt: '2023-09-29T10:52:29.779197+00:00', + totalHouseholdsCount: 2, + totalHouseholdsCountWithValidPhoneNo: 0, + totalIndividualsCount: 8, + __typename: 'TargetPopulationNode', + program: { + id: 'UHJvZ3JhbU5vZGU6MDAwMDAwMDAtMDAwMC0wMDAwLTAwMDAtZmFjZWIwMGMwMDAw', + name: 'Test Program', + __typename: 'ProgramNode', + }, + createdBy: { + id: 'VXNlck5vZGU6NDE5NmMyYzUtYzJkZC00OGQyLTg4N2YtM2E5ZDM5ZTc4OTE2', + firstName: 'Root', + lastName: 'Rootkowski', + __typename: 'UserNode', + }, + }, + cursor: 'YXJyYXljb25uZWN0aW9uOjM=', + __typename: 'TargetPopulationNodeEdge', + }, + ], + totalCount: 4, + edgeCount: 4, + __typename: 'TargetPopulationNodeConnection', + }, + }, + }, + }, +]; diff --git a/src/frontend/src/__generated__/graphql.tsx b/src/frontend/src/__generated__/graphql.tsx index cff0d39793..1f540b97f0 100644 --- a/src/frontend/src/__generated__/graphql.tsx +++ b/src/frontend/src/__generated__/graphql.tsx @@ -9130,7 +9130,7 @@ export type PaymentPlanQueryVariables = Exact<{ }>; -export type PaymentPlanQuery = { __typename?: 'Query', paymentPlan?: { __typename?: 'PaymentPlanNode', id: string, version: any, unicefId?: string | null, status: PaymentPlanStatus, canCreateFollowUp?: boolean | null, backgroundActionStatus?: PaymentPlanBackgroundActionStatus | null, canCreatePaymentVerificationPlan?: boolean | null, availablePaymentRecordsCount?: number | null, bankReconciliationSuccess?: number | null, bankReconciliationError?: number | null, exchangeRate?: number | null, adminUrl?: string | null, currency?: string | null, currencyName?: string | null, startDate?: any | null, endDate?: any | null, dispersionStartDate?: any | null, dispersionEndDate?: any | null, femaleChildrenCount: number, femaleAdultsCount: number, maleChildrenCount: number, maleAdultsCount: number, totalHouseholdsCount: number, totalIndividualsCount: number, totalEntitledQuantity?: number | null, totalDeliveredQuantity?: number | null, totalUndeliveredQuantity?: number | null, totalWithdrawnHouseholdsCount?: number | null, hasPaymentListExportFile?: boolean | null, hasFspDeliveryMechanismXlsxTemplate?: boolean | null, importedFileDate?: any | null, importedFileName?: string | null, totalEntitledQuantityUsd?: number | null, paymentsConflictsCount?: number | null, canSendToPaymentGateway?: boolean | null, canSplit?: boolean | null, exclusionReason: string, excludeHouseholdError: string, isFollowUp: boolean, unsuccessfulPaymentsCount?: number | null, createdBy: { __typename?: 'UserNode', id: string, firstName: string, lastName: string, email: string }, program?: { __typename?: 'ProgramNode', id: string, name: string, caId?: string | null } | null, approvalProcess: { __typename?: 'ApprovalProcessNodeConnection', totalCount?: number | null, edgeCount?: number | null, edges: Array<{ __typename?: 'ApprovalProcessNodeEdge', node?: { __typename?: 'ApprovalProcessNode', id: string, sentForApprovalDate?: any | null, sentForAuthorizationDate?: any | null, sentForFinanceReleaseDate?: any | null, approvalNumberRequired: number, authorizationNumberRequired: number, financeReleaseNumberRequired: number, rejectedOn?: string | null, sentForApprovalBy?: { __typename?: 'UserNode', id: string, firstName: string, lastName: string, email: string } | null, sentForAuthorizationBy?: { __typename?: 'UserNode', id: string, firstName: string, lastName: string, email: string } | null, sentForFinanceReleaseBy?: { __typename?: 'UserNode', id: string, firstName: string, lastName: string, email: string } | null, actions?: { __typename?: 'FilteredActionsListNode', approval?: Array<{ __typename?: 'ApprovalNode', createdAt: any, comment?: string | null, info?: string | null, createdBy?: { __typename?: 'UserNode', id: string, firstName: string, lastName: string, email: string } | null } | null> | null, authorization?: Array<{ __typename?: 'ApprovalNode', createdAt: any, comment?: string | null, info?: string | null, createdBy?: { __typename?: 'UserNode', id: string, firstName: string, lastName: string, email: string } | null } | null> | null, financeRelease?: Array<{ __typename?: 'ApprovalNode', createdAt: any, comment?: string | null, info?: string | null, createdBy?: { __typename?: 'UserNode', id: string, firstName: string, lastName: string, email: string } | null } | null> | null, reject?: Array<{ __typename?: 'ApprovalNode', createdAt: any, comment?: string | null, info?: string | null, createdBy?: { __typename?: 'UserNode', id: string, firstName: string, lastName: string, email: string } | null } | null> | null } | null } | null } | null> }, steficonRule?: { __typename?: 'RuleCommitNode', id: string, rule?: { __typename?: 'SteficonRuleNode', id: string, name: string } | null } | null, deliveryMechanisms?: Array<{ __typename?: 'DeliveryMechanismPerPaymentPlanNode', id: string, name?: string | null, code?: string | null, order?: number | null, sentToPaymentGateway: boolean, chosenConfiguration?: string | null, fsp?: { __typename?: 'FinancialServiceProviderNode', id: string, name: string, communicationChannel: FinancialServiceProviderCommunicationChannel, isPaymentGateway?: boolean | null } | null } | null> | null, splitChoices?: Array<{ __typename?: 'ChoiceObject', name?: string | null, value?: string | null } | null> | null, volumeByDeliveryMechanism?: Array<{ __typename?: 'VolumeByDeliveryMechanismNode', volume?: number | null, volumeUsd?: number | null, deliveryMechanism?: { __typename?: 'DeliveryMechanismPerPaymentPlanNode', id: string, name?: string | null, order?: number | null, fsp?: { __typename?: 'FinancialServiceProviderNode', id: string, name: string } | null } | null } | null> | null, verificationPlans?: { __typename?: 'PaymentVerificationPlanNodeConnection', totalCount?: number | null, edges: Array<{ __typename?: 'PaymentVerificationPlanNodeEdge', node?: { __typename?: 'PaymentVerificationPlanNode', id: string, unicefId?: string | null, adminUrl?: string | null, status: PaymentVerificationPlanStatus, sampleSize?: number | null, receivedCount?: number | null, notReceivedCount?: number | null, respondedCount?: number | null, verificationChannel: PaymentVerificationPlanVerificationChannel, sampling: PaymentVerificationPlanSampling, receivedWithProblemsCount?: number | null, rapidProFlowId: string, confidenceInterval?: number | null, marginOfError?: number | null, activationDate?: any | null, completionDate?: any | null, excludedAdminAreasFilter?: Array | null, sexFilter?: string | null, xlsxFileExporting: boolean, hasXlsxFile?: boolean | null, xlsxFileWasDownloaded?: boolean | null, xlsxFileImported: boolean, ageFilter?: { __typename?: 'AgeFilterObject', min?: number | null, max?: number | null } | null } | null } | null> } | null, paymentVerificationSummary?: { __typename?: 'PaymentVerificationSummaryNode', id: string, createdAt: any, updatedAt: any, status: PaymentVerificationSummaryStatus, activationDate?: any | null, completionDate?: any | null } | null, paymentItems: { __typename?: 'PaymentNodeConnection', totalCount?: number | null, edgeCount?: number | null, edges: Array<{ __typename?: 'PaymentNodeEdge', node?: { __typename?: 'PaymentNode', id: string, status: PaymentStatus } | null } | null> }, reconciliationSummary?: { __typename?: 'ReconciliationSummaryNode', deliveredFully?: number | null, deliveredPartially?: number | null, notDelivered?: number | null, unsuccessful?: number | null, pending?: number | null, numberOfPayments?: number | null, reconciled?: number | null } | null, excludedHouseholds?: Array<{ __typename?: 'HouseholdNode', id: string, unicefId?: string | null } | null> | null, excludedIndividuals?: Array<{ __typename?: 'IndividualNode', id: string, unicefId?: string | null } | null> | null, followUps: { __typename?: 'PaymentPlanNodeConnection', totalCount?: number | null, edges: Array<{ __typename?: 'PaymentPlanNodeEdge', node?: { __typename?: 'PaymentPlanNode', id: string, unicefId?: string | null, createdAt: any, paymentItems: { __typename?: 'PaymentNodeConnection', totalCount?: number | null } } | null } | null> }, sourcePaymentPlan?: { __typename?: 'PaymentPlanNode', id: string, unicefId?: string | null } | null, supportingDocuments?: Array<{ __typename?: 'PaymentPlanSupportingDocumentNode', id: string, title: string, file: string } | null> | null } | null }; +export type PaymentPlanQuery = { __typename?: 'Query', paymentPlan?: { __typename?: 'PaymentPlanNode', id: string, name?: string | null, version: any, unicefId?: string | null, status: PaymentPlanStatus, canCreateFollowUp?: boolean | null, backgroundActionStatus?: PaymentPlanBackgroundActionStatus | null, canCreatePaymentVerificationPlan?: boolean | null, availablePaymentRecordsCount?: number | null, bankReconciliationSuccess?: number | null, bankReconciliationError?: number | null, exchangeRate?: number | null, adminUrl?: string | null, currency?: string | null, currencyName?: string | null, startDate?: any | null, endDate?: any | null, dispersionStartDate?: any | null, dispersionEndDate?: any | null, femaleChildrenCount: number, femaleAdultsCount: number, maleChildrenCount: number, maleAdultsCount: number, totalHouseholdsCount: number, totalIndividualsCount: number, totalEntitledQuantity?: number | null, totalDeliveredQuantity?: number | null, totalUndeliveredQuantity?: number | null, totalWithdrawnHouseholdsCount?: number | null, hasPaymentListExportFile?: boolean | null, hasFspDeliveryMechanismXlsxTemplate?: boolean | null, importedFileDate?: any | null, importedFileName?: string | null, totalEntitledQuantityUsd?: number | null, paymentsConflictsCount?: number | null, canSendToPaymentGateway?: boolean | null, canSplit?: boolean | null, exclusionReason: string, excludeHouseholdError: string, isFollowUp: boolean, unsuccessfulPaymentsCount?: number | null, createdBy: { __typename?: 'UserNode', id: string, firstName: string, lastName: string, email: string }, program?: { __typename?: 'ProgramNode', id: string, name: string, caId?: string | null } | null, approvalProcess: { __typename?: 'ApprovalProcessNodeConnection', totalCount?: number | null, edgeCount?: number | null, edges: Array<{ __typename?: 'ApprovalProcessNodeEdge', node?: { __typename?: 'ApprovalProcessNode', id: string, sentForApprovalDate?: any | null, sentForAuthorizationDate?: any | null, sentForFinanceReleaseDate?: any | null, approvalNumberRequired: number, authorizationNumberRequired: number, financeReleaseNumberRequired: number, rejectedOn?: string | null, sentForApprovalBy?: { __typename?: 'UserNode', id: string, firstName: string, lastName: string, email: string } | null, sentForAuthorizationBy?: { __typename?: 'UserNode', id: string, firstName: string, lastName: string, email: string } | null, sentForFinanceReleaseBy?: { __typename?: 'UserNode', id: string, firstName: string, lastName: string, email: string } | null, actions?: { __typename?: 'FilteredActionsListNode', approval?: Array<{ __typename?: 'ApprovalNode', createdAt: any, comment?: string | null, info?: string | null, createdBy?: { __typename?: 'UserNode', id: string, firstName: string, lastName: string, email: string } | null } | null> | null, authorization?: Array<{ __typename?: 'ApprovalNode', createdAt: any, comment?: string | null, info?: string | null, createdBy?: { __typename?: 'UserNode', id: string, firstName: string, lastName: string, email: string } | null } | null> | null, financeRelease?: Array<{ __typename?: 'ApprovalNode', createdAt: any, comment?: string | null, info?: string | null, createdBy?: { __typename?: 'UserNode', id: string, firstName: string, lastName: string, email: string } | null } | null> | null, reject?: Array<{ __typename?: 'ApprovalNode', createdAt: any, comment?: string | null, info?: string | null, createdBy?: { __typename?: 'UserNode', id: string, firstName: string, lastName: string, email: string } | null } | null> | null } | null } | null } | null> }, steficonRule?: { __typename?: 'RuleCommitNode', id: string, rule?: { __typename?: 'SteficonRuleNode', id: string, name: string } | null } | null, deliveryMechanisms?: Array<{ __typename?: 'DeliveryMechanismPerPaymentPlanNode', id: string, name?: string | null, code?: string | null, order?: number | null, sentToPaymentGateway: boolean, chosenConfiguration?: string | null, fsp?: { __typename?: 'FinancialServiceProviderNode', id: string, name: string, communicationChannel: FinancialServiceProviderCommunicationChannel, isPaymentGateway?: boolean | null } | null } | null> | null, splitChoices?: Array<{ __typename?: 'ChoiceObject', name?: string | null, value?: string | null } | null> | null, volumeByDeliveryMechanism?: Array<{ __typename?: 'VolumeByDeliveryMechanismNode', volume?: number | null, volumeUsd?: number | null, deliveryMechanism?: { __typename?: 'DeliveryMechanismPerPaymentPlanNode', id: string, name?: string | null, order?: number | null, fsp?: { __typename?: 'FinancialServiceProviderNode', id: string, name: string } | null } | null } | null> | null, verificationPlans?: { __typename?: 'PaymentVerificationPlanNodeConnection', totalCount?: number | null, edges: Array<{ __typename?: 'PaymentVerificationPlanNodeEdge', node?: { __typename?: 'PaymentVerificationPlanNode', id: string, unicefId?: string | null, adminUrl?: string | null, status: PaymentVerificationPlanStatus, sampleSize?: number | null, receivedCount?: number | null, notReceivedCount?: number | null, respondedCount?: number | null, verificationChannel: PaymentVerificationPlanVerificationChannel, sampling: PaymentVerificationPlanSampling, receivedWithProblemsCount?: number | null, rapidProFlowId: string, confidenceInterval?: number | null, marginOfError?: number | null, activationDate?: any | null, completionDate?: any | null, excludedAdminAreasFilter?: Array | null, sexFilter?: string | null, xlsxFileExporting: boolean, hasXlsxFile?: boolean | null, xlsxFileWasDownloaded?: boolean | null, xlsxFileImported: boolean, ageFilter?: { __typename?: 'AgeFilterObject', min?: number | null, max?: number | null } | null } | null } | null> } | null, paymentVerificationSummary?: { __typename?: 'PaymentVerificationSummaryNode', id: string, createdAt: any, updatedAt: any, status: PaymentVerificationSummaryStatus, activationDate?: any | null, completionDate?: any | null } | null, paymentItems: { __typename?: 'PaymentNodeConnection', totalCount?: number | null, edgeCount?: number | null, edges: Array<{ __typename?: 'PaymentNodeEdge', node?: { __typename?: 'PaymentNode', id: string, status: PaymentStatus } | null } | null> }, reconciliationSummary?: { __typename?: 'ReconciliationSummaryNode', deliveredFully?: number | null, deliveredPartially?: number | null, notDelivered?: number | null, unsuccessful?: number | null, pending?: number | null, numberOfPayments?: number | null, reconciled?: number | null } | null, excludedHouseholds?: Array<{ __typename?: 'HouseholdNode', id: string, unicefId?: string | null } | null> | null, excludedIndividuals?: Array<{ __typename?: 'IndividualNode', id: string, unicefId?: string | null } | null> | null, followUps: { __typename?: 'PaymentPlanNodeConnection', totalCount?: number | null, edges: Array<{ __typename?: 'PaymentPlanNodeEdge', node?: { __typename?: 'PaymentPlanNode', id: string, unicefId?: string | null, createdAt: any, paymentItems: { __typename?: 'PaymentNodeConnection', totalCount?: number | null } } | null } | null> }, sourcePaymentPlan?: { __typename?: 'PaymentPlanNode', id: string, unicefId?: string | null } | null, supportingDocuments?: Array<{ __typename?: 'PaymentPlanSupportingDocumentNode', id: string, title: string, file: string } | null> | null } | null }; export type AllCashPlansAndPaymentPlansQueryVariables = Exact<{ businessArea: Scalars['String']['input']; @@ -16913,6 +16913,7 @@ export const PaymentPlanDocument = gql` query PaymentPlan($id: ID!) { paymentPlan(id: $id) { id + name version unicefId status diff --git a/src/frontend/src/apollo/queries/paymentmodule/PaymentPlan.ts b/src/frontend/src/apollo/queries/paymentmodule/PaymentPlan.ts index c7cd623217..cfd58b0b0d 100644 --- a/src/frontend/src/apollo/queries/paymentmodule/PaymentPlan.ts +++ b/src/frontend/src/apollo/queries/paymentmodule/PaymentPlan.ts @@ -4,6 +4,7 @@ export const PAYMENT_PLAN_QUERY = gql` query PaymentPlan($id: ID!) { paymentPlan(id: $id) { id + name version unicefId status diff --git a/src/frontend/src/components/paymentmodule/FollowUpPaymentPlanDetails/FollowUpPaymentPlanDetails/FollowUpPaymentPlanDetails.tsx b/src/frontend/src/components/paymentmodule/FollowUpPaymentPlanDetails/FollowUpPaymentPlanDetails/FollowUpPaymentPlanDetails.tsx index 530d90a144..75ba3263d7 100644 --- a/src/frontend/src/components/paymentmodule/FollowUpPaymentPlanDetails/FollowUpPaymentPlanDetails/FollowUpPaymentPlanDetails.tsx +++ b/src/frontend/src/components/paymentmodule/FollowUpPaymentPlanDetails/FollowUpPaymentPlanDetails/FollowUpPaymentPlanDetails.tsx @@ -33,7 +33,6 @@ export function FollowUpPaymentPlanDetails({ id: sourcePaymentPlanId, unicefId: sourcePaymentPlanUnicefId, }, - targetPopulation, exchangeRate, } = paymentPlan; @@ -69,9 +68,9 @@ export function FollowUpPaymentPlanDetails({ - {targetPopulation.name} + {paymentPlan.name} diff --git a/src/frontend/src/components/paymentmodule/PaymentPlanDetails/PaymentPlanDetails/PaymentPlanDetails.tsx b/src/frontend/src/components/paymentmodule/PaymentPlanDetails/PaymentPlanDetails/PaymentPlanDetails.tsx index b3355fd0fe..6902942533 100644 --- a/src/frontend/src/components/paymentmodule/PaymentPlanDetails/PaymentPlanDetails/PaymentPlanDetails.tsx +++ b/src/frontend/src/components/paymentmodule/PaymentPlanDetails/PaymentPlanDetails/PaymentPlanDetails.tsx @@ -26,7 +26,6 @@ export const PaymentPlanDetails = ({ const { createdBy, program, - targetPopulation, currency, startDate, endDate, @@ -60,9 +59,9 @@ export const PaymentPlanDetails = ({ - {targetPopulation.name} + {paymentPlan.name} diff --git a/src/frontend/src/components/paymentmodulepeople/CreatePaymentPlan/PaymentPlanParameters/PaymentPlanParameters.tsx b/src/frontend/src/components/paymentmodulepeople/CreatePaymentPlan/PaymentPlanParameters/PaymentPlanParameters.tsx index 242f9e416c..b46189e53a 100644 --- a/src/frontend/src/components/paymentmodulepeople/CreatePaymentPlan/PaymentPlanParameters/PaymentPlanParameters.tsx +++ b/src/frontend/src/components/paymentmodulepeople/CreatePaymentPlan/PaymentPlanParameters/PaymentPlanParameters.tsx @@ -6,7 +6,7 @@ import { FormikCurrencyAutocomplete } from '@shared/Formik/FormikCurrencyAutocom import { FormikDateField } from '@shared/Formik/FormikDateField'; import { tomorrow } from '@utils/utils'; import { Field } from 'formik'; -import { ReactElement } from 'react'; +import { ReactElement, useEffect } from 'react'; import { useTranslation } from 'react-i18next'; import { PaperContainer } from '../../../targeting/PaperContainer'; import { CalendarTodayRounded } from '@mui/icons-material'; @@ -21,6 +21,18 @@ export const PaymentPlanParameters = ({ paymentPlan, }: PaymentPlanParametersProps): ReactElement => { const { t } = useTranslation(); + const [loadTargetPopulation, { data, loading }] = + useTargetPopulationLazyQuery(); + + useEffect(() => { + if (values.targetingId) { + loadTargetPopulation({ + variables: { + id: values.targetingId, + }, + }); + } + }, [values.targetingId, loadTargetPopulation]); return ( @@ -35,10 +47,8 @@ export const PaymentPlanParameters = ({ label={t('Start Date')} component={FormikDateField} required - minDate={data?.targetPopulation?.program?.startDate} - maxDate={ - values.endDate || data?.targetPopulation?.program?.endDate - } + minDate={data?.paymentPlan?.program?.startDate} + maxDate={values.endDate || data?.paymentPlan?.program?.endDate} disabled={!data || loading || Boolean(paymentPlan?.isFollowUp)} fullWidth decoratorEnd={} @@ -55,7 +65,7 @@ export const PaymentPlanParameters = ({ component={FormikDateField} required minDate={values.startDate} - maxDate={data?.targetPopulation?.program?.endDate} + maxDate={data?.paymentPlan?.program?.endDate} disabled={!values.startDate || Boolean(paymentPlan?.isFollowUp)} initialFocusedDate={values.startDate} fullWidth diff --git a/src/frontend/src/components/paymentmodulepeople/PaymentDetails/PaymentDetails.tsx b/src/frontend/src/components/paymentmodulepeople/PaymentDetails/PaymentDetails.tsx index 5ac343ee26..b6ccf28e01 100644 --- a/src/frontend/src/components/paymentmodulepeople/PaymentDetails/PaymentDetails.tsx +++ b/src/frontend/src/components/paymentmodulepeople/PaymentDetails/PaymentDetails.tsx @@ -103,9 +103,9 @@ export function PaymentDetails({ - {payment.targetPopulation?.name} + {payment.parent?.name} diff --git a/src/frontend/src/components/paymentmodulepeople/PaymentPlanDetails/PaymentPlanDetails/PaymentPlanDetails.tsx b/src/frontend/src/components/paymentmodulepeople/PaymentPlanDetails/PaymentPlanDetails/PaymentPlanDetails.tsx index fd978287ae..a33281f8f9 100644 --- a/src/frontend/src/components/paymentmodulepeople/PaymentPlanDetails/PaymentPlanDetails/PaymentPlanDetails.tsx +++ b/src/frontend/src/components/paymentmodulepeople/PaymentPlanDetails/PaymentPlanDetails/PaymentPlanDetails.tsx @@ -24,9 +24,10 @@ export const PaymentPlanDetails = ({ }: PaymentPlanDetailsProps): ReactElement => { const { t } = useTranslation(); const { + id, + name, createdBy, program, - targetPopulation, currency, startDate, endDate, @@ -59,10 +60,8 @@ export const PaymentPlanDetails = ({ - - {targetPopulation.name} + + {name} diff --git a/src/frontend/src/containers/tables/Surveys/SurveysTable/SurveysTable.tsx b/src/frontend/src/containers/tables/Surveys/SurveysTable/SurveysTable.tsx index 5db97eeccc..1dac56b52e 100644 --- a/src/frontend/src/containers/tables/Surveys/SurveysTable/SurveysTable.tsx +++ b/src/frontend/src/containers/tables/Surveys/SurveysTable/SurveysTable.tsx @@ -29,7 +29,7 @@ export function SurveysTable({ const initialVariables: AllSurveysQueryVariables = { search: filter.search, - targetPopulation: filter.targetPopulation || '', + paymentPlan: filter.targetPopulation || '', createdBy: filter.createdBy || '', program: programId, createdAtRange: JSON.stringify({ diff --git a/src/frontend/src/containers/tables/targeting/TargetPopulationForPeopleTable/TargetPopulationForPeopleTable.test.tsx b/src/frontend/src/containers/tables/targeting/TargetPopulationForPeopleTable/TargetPopulationForPeopleTable.test.tsx index 02ecc37411..acd41a8d8c 100644 --- a/src/frontend/src/containers/tables/targeting/TargetPopulationForPeopleTable/TargetPopulationForPeopleTable.test.tsx +++ b/src/frontend/src/containers/tables/targeting/TargetPopulationForPeopleTable/TargetPopulationForPeopleTable.test.tsx @@ -1,8 +1,7 @@ import { MockedProvider } from '@apollo/react-testing'; import { act } from 'react'; - -import wait from 'waait'; import { fakeApolloAllTargetPopulation } from '../../../../../fixtures/targeting/fakeApolloAllTargetPopulation'; +import wait from 'waait'; import { ApolloLoadingLink, render } from '../../../../testUtils/testUtils'; import { TargetPopulationForPeopleTable } from '.';