diff --git a/src/frontend/data/schema.graphql b/src/frontend/data/schema.graphql index 0e29a3329c..54c45c7ebc 100644 --- a/src/frontend/data/schema.graphql +++ b/src/frontend/data/schema.graphql @@ -3147,7 +3147,7 @@ type Query { sampleSize(input: GetCashplanVerificationSampleSizeInput): GetCashplanVerificationSampleSizeObject allPaymentVerificationLogEntries(offset: Int, before: String, after: String, first: Int, last: Int, objectId: UUID, user: ID, businessArea: String!, search: String, module: String, userId: String, programId: String, objectType: String): PaymentVerificationLogEntryNodeConnection paymentPlan(id: ID!): PaymentPlanNode - allPaymentPlans(offset: Int, before: String, after: String, first: Int, last: Int, businessArea: String!, search: String, status: [String], totalEntitledQuantityFrom: Float, totalEntitledQuantityTo: Float, dispersionStartDate: Date, dispersionEndDate: Date, isFollowUp: Boolean, isPaymentPlan: Boolean, isTargetPopulation: Boolean, sourcePaymentPlanId: String, program: String, programCycle: String, orderBy: String): PaymentPlanNodeConnection + allPaymentPlans(offset: Int, before: String, after: String, first: Int, last: Int, businessArea: String!, search: String, status: [String], totalEntitledQuantityFrom: Float, totalEntitledQuantityTo: Float, dispersionStartDate: Date, dispersionEndDate: Date, isFollowUp: Boolean, isPaymentPlan: Boolean, isTargetPopulation: Boolean, sourcePaymentPlanId: String, program: String, programCycle: String, name: String, paymentPlanApplicable: Boolean, totalHouseholdsCountMin: Int, totalHouseholdsCountMax: Int, createdAtRange: String, orderBy: String): PaymentPlanNodeConnection paymentPlanStatusChoices: [ChoiceObject] currencyChoices: [ChoiceObject] allDeliveryMechanisms: [ChoiceObject] diff --git a/src/frontend/fixtures/targeting/fakeAllTargetPopulation.ts b/src/frontend/fixtures/targeting/fakeAllTargetPopulation.ts new file mode 100644 index 0000000000..942da955cf --- /dev/null +++ b/src/frontend/fixtures/targeting/fakeAllTargetPopulation.ts @@ -0,0 +1,262 @@ +import { AllTargetPopulationsQuery } from '../../src/__generated__/graphql'; + +export const fakeAllTargetPopulation = { + { + "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" + }, + "__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; diff --git a/src/frontend/src/__generated__/graphql.tsx b/src/frontend/src/__generated__/graphql.tsx index 4c5f93697a..cff0d39793 100644 --- a/src/frontend/src/__generated__/graphql.tsx +++ b/src/frontend/src/__generated__/graphql.tsx @@ -419,6 +419,30 @@ export type BankTransferObjectType = { type: Scalars['String']['input']; }; +export type BeneficiaryGroupNode = Node & { + __typename?: 'BeneficiaryGroupNode'; + createdAt: Scalars['DateTime']['output']; + groupLabel: Scalars['String']['output']; + groupLabelPlural: Scalars['String']['output']; + id: Scalars['ID']['output']; + masterDetail: Scalars['Boolean']['output']; + memberLabel: Scalars['String']['output']; + memberLabelPlural: Scalars['String']['output']; + name: Scalars['String']['output']; + programs: ProgramNodeConnection; + updatedAt: Scalars['DateTime']['output']; +}; + + +export type BeneficiaryGroupNodeProgramsArgs = { + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + name?: InputMaybe; + offset?: InputMaybe; +}; + export type BulkGrievanceAddNoteMutation = { __typename?: 'BulkGrievanceAddNoteMutation'; grievanceTickets?: Maybe>>; @@ -1056,6 +1080,7 @@ export type CreateProgram = { export type CreateProgramInput = { administrativeAreasOfImplementation?: InputMaybe; + beneficiaryGroup?: InputMaybe; budget?: InputMaybe; businessAreaSlug?: InputMaybe; cashPlus?: InputMaybe; @@ -4718,6 +4743,7 @@ export type ProgramNode = Node & { adminAreas: AreaNodeConnection; adminUrl?: Maybe; administrativeAreasOfImplementation: Scalars['String']['output']; + beneficiaryGroup?: Maybe; biometricDeduplicationEnabled: Scalars['Boolean']['output']; budget?: Maybe; businessArea: UserBusinessAreaNode; @@ -5160,6 +5186,7 @@ export type QueryAllAccountabilityCommunicationMessagesArgs = { export type QueryAllActiveProgramsArgs = { after?: InputMaybe; before?: InputMaybe; + beneficiaryGroupMatch?: InputMaybe; budget?: InputMaybe; businessArea: Scalars['String']['input']; compatibleDct?: InputMaybe; @@ -5462,6 +5489,7 @@ export type QueryAllPaymentPlansArgs = { after?: InputMaybe; before?: InputMaybe; businessArea: Scalars['String']['input']; + createdAtRange?: InputMaybe; dispersionEndDate?: InputMaybe; dispersionStartDate?: InputMaybe; first?: InputMaybe; @@ -5469,8 +5497,10 @@ export type QueryAllPaymentPlansArgs = { isPaymentPlan?: InputMaybe; isTargetPopulation?: InputMaybe; last?: InputMaybe; + name?: InputMaybe; offset?: InputMaybe; orderBy?: InputMaybe; + paymentPlanApplicable?: InputMaybe; program?: InputMaybe; programCycle?: InputMaybe; search?: InputMaybe; @@ -5478,6 +5508,8 @@ export type QueryAllPaymentPlansArgs = { status?: InputMaybe>>; totalEntitledQuantityFrom?: InputMaybe; totalEntitledQuantityTo?: InputMaybe; + totalHouseholdsCountMax?: InputMaybe; + totalHouseholdsCountMin?: InputMaybe; }; @@ -5558,6 +5590,7 @@ export type QueryAllPduFieldsArgs = { export type QueryAllProgramsArgs = { after?: InputMaybe; before?: InputMaybe; + beneficiaryGroupMatch?: InputMaybe; budget?: InputMaybe; businessArea: Scalars['String']['input']; compatibleDct?: InputMaybe; @@ -7545,6 +7578,7 @@ export type UpdateProgram = { export type UpdateProgramInput = { administrativeAreasOfImplementation?: InputMaybe; + beneficiaryGroup?: InputMaybe; budget?: InputMaybe; cashPlus?: InputMaybe; dataCollectingTypeCode?: InputMaybe; @@ -8087,7 +8121,7 @@ export type IndividualDetailedFragment = { __typename?: 'IndividualNode', givenN export type MergedIndividualMinimalFragment = { __typename?: 'IndividualNode', id: string, unicefId?: string | null, age?: number | null, fullName: string, birthDate: any, sex: IndividualSex, role?: string | null, relationship?: IndividualRelationship | null, deduplicationBatchStatus: IndividualDeduplicationBatchStatus, deduplicationGoldenRecordStatus: IndividualDeduplicationGoldenRecordStatus, importId?: string | null, deduplicationGoldenRecordResults?: Array<{ __typename?: 'DeduplicationResultNode', hitId?: string | null, fullName?: string | null, score?: number | null, proximityToScore?: number | null, age?: number | null, location?: string | null } | null> | null, deduplicationBatchResults?: Array<{ __typename?: 'DeduplicationResultNode', hitId?: string | null, fullName?: string | null, score?: number | null, proximityToScore?: number | null, age?: number | null, location?: string | null } | null> | null, registrationDataImport: { __typename?: 'RegistrationDataImportNode', id: string, name: string } }; -export type ProgramDetailsFragment = { __typename?: 'ProgramNode', id: string, name: string, programmeCode?: string | null, startDate: any, endDate?: any | null, status: ProgramStatus, caId?: string | null, caHashId?: string | null, description: string, budget?: any | null, frequencyOfPayments: ProgramFrequencyOfPayments, cashPlus: boolean, populationGoal: number, scope?: ProgramScope | null, sector: ProgramSector, totalNumberOfHouseholds?: number | null, totalNumberOfHouseholdsWithTpInProgram?: number | null, administrativeAreasOfImplementation: string, isSocialWorkerProgram?: boolean | null, version: any, adminUrl?: string | null, partnerAccess: ProgramPartnerAccess, targetPopulationsCount?: number | null, canFinish?: boolean | null, dataCollectingType?: { __typename?: 'DataCollectingTypeNode', id: string, code: string, label: string, active: boolean, individualFiltersAvailable: boolean, householdFiltersAvailable: boolean, description: string, type?: DataCollectingTypeType | null } | null, partners?: Array<{ __typename?: 'PartnerNode', id: string, name?: string | null, areaAccess?: string | null, areas?: Array<{ __typename?: 'AreaNode', id: string, level: number } | null> | null } | null> | null, registrationImports: { __typename?: 'RegistrationDataImportNodeConnection', totalCount?: number | null }, pduFields?: Array<{ __typename?: 'PeriodicFieldNode', id: string, label: any, pduData?: { __typename?: 'PeriodicFieldDataNode', id: string, subtype: PeriodicFieldDataSubtype, numberOfRounds: number, roundsNames: Array } | null } | null> | null }; +export type ProgramDetailsFragment = { __typename?: 'ProgramNode', id: string, name: string, programmeCode?: string | null, startDate: any, endDate?: any | null, status: ProgramStatus, caId?: string | null, caHashId?: string | null, description: string, budget?: any | null, frequencyOfPayments: ProgramFrequencyOfPayments, cashPlus: boolean, populationGoal: number, scope?: ProgramScope | null, sector: ProgramSector, totalNumberOfHouseholds?: number | null, totalNumberOfHouseholdsWithTpInProgram?: number | null, administrativeAreasOfImplementation: string, isSocialWorkerProgram?: boolean | null, version: any, adminUrl?: string | null, partnerAccess: ProgramPartnerAccess, targetPopulationsCount?: number | null, canFinish?: boolean | null, dataCollectingType?: { __typename?: 'DataCollectingTypeNode', id: string, code: string, label: string, active: boolean, individualFiltersAvailable: boolean, householdFiltersAvailable: boolean, description: string, type?: DataCollectingTypeType | null } | null, partners?: Array<{ __typename?: 'PartnerNode', id: string, name?: string | null, areaAccess?: string | null, areas?: Array<{ __typename?: 'AreaNode', id: string, level: number } | null> | null } | null> | null, registrationImports: { __typename?: 'RegistrationDataImportNodeConnection', totalCount?: number | null }, pduFields?: Array<{ __typename?: 'PeriodicFieldNode', id: string, label: any, pduData?: { __typename?: 'PeriodicFieldDataNode', id: string, subtype: PeriodicFieldDataSubtype, numberOfRounds: number, roundsNames: Array } | null } | null> | null, beneficiaryGroup?: { __typename?: 'BeneficiaryGroupNode', id: string, name: string, groupLabel: string, groupLabelPlural: string, memberLabel: string, memberLabelPlural: string, masterDetail: boolean } | null }; export type RegistrationMinimalFragment = { __typename?: 'RegistrationDataImportNode', id: string, createdAt: any, name: string, status: RegistrationDataImportStatus, erased: boolean, importDate: any, dataSource: RegistrationDataImportDataSource, numberOfHouseholds: number, numberOfIndividuals: number, refuseReason?: string | null, totalHouseholdsCountWithValidPhoneNo?: number | null, adminUrl?: string | null, biometricDeduplicated?: string | null, importedBy?: { __typename?: 'UserNode', id: string, firstName: string, lastName: string, email: string } | null, program?: { __typename?: 'ProgramNode', id: string, name: string, startDate: any, endDate?: any | null, status: ProgramStatus } | null }; @@ -8535,7 +8569,7 @@ export type UpdateProgramMutationVariables = Exact<{ }>; -export type UpdateProgramMutation = { __typename?: 'Mutations', updateProgram?: { __typename?: 'UpdateProgram', validationErrors?: any | null, program?: { __typename?: 'ProgramNode', id: string, name: string, programmeCode?: string | null, startDate: any, endDate?: any | null, status: ProgramStatus, caId?: string | null, caHashId?: string | null, description: string, budget?: any | null, frequencyOfPayments: ProgramFrequencyOfPayments, cashPlus: boolean, populationGoal: number, scope?: ProgramScope | null, sector: ProgramSector, totalNumberOfHouseholds?: number | null, totalNumberOfHouseholdsWithTpInProgram?: number | null, administrativeAreasOfImplementation: string, isSocialWorkerProgram?: boolean | null, version: any, adminUrl?: string | null, partnerAccess: ProgramPartnerAccess, targetPopulationsCount?: number | null, canFinish?: boolean | null, dataCollectingType?: { __typename?: 'DataCollectingTypeNode', id: string, code: string, label: string, active: boolean, individualFiltersAvailable: boolean, householdFiltersAvailable: boolean, description: string, type?: DataCollectingTypeType | null } | null, partners?: Array<{ __typename?: 'PartnerNode', id: string, name?: string | null, areaAccess?: string | null, areas?: Array<{ __typename?: 'AreaNode', id: string, level: number } | null> | null } | null> | null, registrationImports: { __typename?: 'RegistrationDataImportNodeConnection', totalCount?: number | null }, pduFields?: Array<{ __typename?: 'PeriodicFieldNode', id: string, label: any, pduData?: { __typename?: 'PeriodicFieldDataNode', id: string, subtype: PeriodicFieldDataSubtype, numberOfRounds: number, roundsNames: Array } | null } | null> | null } | null } | null }; +export type UpdateProgramMutation = { __typename?: 'Mutations', updateProgram?: { __typename?: 'UpdateProgram', validationErrors?: any | null, program?: { __typename?: 'ProgramNode', id: string, name: string, programmeCode?: string | null, startDate: any, endDate?: any | null, status: ProgramStatus, caId?: string | null, caHashId?: string | null, description: string, budget?: any | null, frequencyOfPayments: ProgramFrequencyOfPayments, cashPlus: boolean, populationGoal: number, scope?: ProgramScope | null, sector: ProgramSector, totalNumberOfHouseholds?: number | null, totalNumberOfHouseholdsWithTpInProgram?: number | null, administrativeAreasOfImplementation: string, isSocialWorkerProgram?: boolean | null, version: any, adminUrl?: string | null, partnerAccess: ProgramPartnerAccess, targetPopulationsCount?: number | null, canFinish?: boolean | null, dataCollectingType?: { __typename?: 'DataCollectingTypeNode', id: string, code: string, label: string, active: boolean, individualFiltersAvailable: boolean, householdFiltersAvailable: boolean, description: string, type?: DataCollectingTypeType | null } | null, partners?: Array<{ __typename?: 'PartnerNode', id: string, name?: string | null, areaAccess?: string | null, areas?: Array<{ __typename?: 'AreaNode', id: string, level: number } | null> | null } | null> | null, registrationImports: { __typename?: 'RegistrationDataImportNodeConnection', totalCount?: number | null }, pduFields?: Array<{ __typename?: 'PeriodicFieldNode', id: string, label: any, pduData?: { __typename?: 'PeriodicFieldDataNode', id: string, subtype: PeriodicFieldDataSubtype, numberOfRounds: number, roundsNames: Array } | null } | null> | null, beneficiaryGroup?: { __typename?: 'BeneficiaryGroupNode', id: string, name: string, groupLabel: string, groupLabelPlural: string, memberLabel: string, memberLabelPlural: string, masterDetail: boolean } | null } | null } | null }; export type UpdateProgramPartnersMutationVariables = Exact<{ programData?: InputMaybe; @@ -8543,7 +8577,7 @@ export type UpdateProgramPartnersMutationVariables = Exact<{ }>; -export type UpdateProgramPartnersMutation = { __typename?: 'Mutations', updateProgramPartners?: { __typename?: 'UpdateProgramPartners', program?: { __typename?: 'ProgramNode', id: string, name: string, programmeCode?: string | null, startDate: any, endDate?: any | null, status: ProgramStatus, caId?: string | null, caHashId?: string | null, description: string, budget?: any | null, frequencyOfPayments: ProgramFrequencyOfPayments, cashPlus: boolean, populationGoal: number, scope?: ProgramScope | null, sector: ProgramSector, totalNumberOfHouseholds?: number | null, totalNumberOfHouseholdsWithTpInProgram?: number | null, administrativeAreasOfImplementation: string, isSocialWorkerProgram?: boolean | null, version: any, adminUrl?: string | null, partnerAccess: ProgramPartnerAccess, targetPopulationsCount?: number | null, canFinish?: boolean | null, dataCollectingType?: { __typename?: 'DataCollectingTypeNode', id: string, code: string, label: string, active: boolean, individualFiltersAvailable: boolean, householdFiltersAvailable: boolean, description: string, type?: DataCollectingTypeType | null } | null, partners?: Array<{ __typename?: 'PartnerNode', id: string, name?: string | null, areaAccess?: string | null, areas?: Array<{ __typename?: 'AreaNode', id: string, level: number } | null> | null } | null> | null, registrationImports: { __typename?: 'RegistrationDataImportNodeConnection', totalCount?: number | null }, pduFields?: Array<{ __typename?: 'PeriodicFieldNode', id: string, label: any, pduData?: { __typename?: 'PeriodicFieldDataNode', id: string, subtype: PeriodicFieldDataSubtype, numberOfRounds: number, roundsNames: Array } | null } | null> | null } | null } | null }; +export type UpdateProgramPartnersMutation = { __typename?: 'Mutations', updateProgramPartners?: { __typename?: 'UpdateProgramPartners', program?: { __typename?: 'ProgramNode', id: string, name: string, programmeCode?: string | null, startDate: any, endDate?: any | null, status: ProgramStatus, caId?: string | null, caHashId?: string | null, description: string, budget?: any | null, frequencyOfPayments: ProgramFrequencyOfPayments, cashPlus: boolean, populationGoal: number, scope?: ProgramScope | null, sector: ProgramSector, totalNumberOfHouseholds?: number | null, totalNumberOfHouseholdsWithTpInProgram?: number | null, administrativeAreasOfImplementation: string, isSocialWorkerProgram?: boolean | null, version: any, adminUrl?: string | null, partnerAccess: ProgramPartnerAccess, targetPopulationsCount?: number | null, canFinish?: boolean | null, dataCollectingType?: { __typename?: 'DataCollectingTypeNode', id: string, code: string, label: string, active: boolean, individualFiltersAvailable: boolean, householdFiltersAvailable: boolean, description: string, type?: DataCollectingTypeType | null } | null, partners?: Array<{ __typename?: 'PartnerNode', id: string, name?: string | null, areaAccess?: string | null, areas?: Array<{ __typename?: 'AreaNode', id: string, level: number } | null> | null } | null> | null, registrationImports: { __typename?: 'RegistrationDataImportNodeConnection', totalCount?: number | null }, pduFields?: Array<{ __typename?: 'PeriodicFieldNode', id: string, label: any, pduData?: { __typename?: 'PeriodicFieldDataNode', id: string, subtype: PeriodicFieldDataSubtype, numberOfRounds: number, roundsNames: Array } | null } | null> | null, beneficiaryGroup?: { __typename?: 'BeneficiaryGroupNode', id: string, name: string, groupLabel: string, groupLabelPlural: string, memberLabel: string, memberLabelPlural: string, masterDetail: boolean } | null } | null } | null }; export type CreateRegistrationKoboImportMutationVariables = Exact<{ registrationDataImportData: RegistrationKoboImportMutationInput; @@ -8681,7 +8715,7 @@ export type AccountabilityCommunicationMessageQueryVariables = Exact<{ }>; -export type AccountabilityCommunicationMessageQuery = { __typename?: 'Query', accountabilityCommunicationMessage?: { __typename?: 'CommunicationMessageNode', id: string, unicefId?: string | null, adminUrl?: string | null, createdAt: any, title: string, body: string, createdBy?: { __typename?: 'UserNode', id: string, firstName: string, lastName: string, email: string } | null, paymentPlan?: { __typename?: 'PaymentPlanNode', id: string, name?: string | null } | null, registrationDataImport?: { __typename?: 'RegistrationDataImportNode', id: string, name: string } | null } | null }; +export type AccountabilityCommunicationMessageQuery = { __typename?: 'Query', accountabilityCommunicationMessage?: { __typename?: 'CommunicationMessageNode', id: string, unicefId?: string | null, adminUrl?: string | null, createdAt: any, title: string, body: string, createdBy?: { __typename?: 'UserNode', id: string, firstName: string, lastName: string, email: string } | null, paymentPlan?: { __typename?: 'PaymentPlanNode', id: string, unicefId?: string | null, name?: string | null } | null, registrationDataImport?: { __typename?: 'RegistrationDataImportNode', id: string, name: string } | null } | null }; export type AccountabilityCommunicationMessageSampleSizeQueryVariables = Exact<{ input: GetAccountabilityCommunicationMessageSampleSizeInput; @@ -9439,10 +9473,11 @@ export type AllProgramsForChoicesQueryVariables = Exact<{ orderBy?: InputMaybe; name?: InputMaybe; compatibleDct?: InputMaybe; + beneficiaryGroupMatch?: InputMaybe; }>; -export type AllProgramsForChoicesQuery = { __typename?: 'Query', allPrograms?: { __typename?: 'ProgramNodeConnection', totalCount?: number | null, edgeCount?: number | null, pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean, hasPreviousPage: boolean, endCursor?: string | null, startCursor?: string | null }, edges: Array<{ __typename?: 'ProgramNodeEdge', cursor: string, node?: { __typename?: 'ProgramNode', id: string, name: string, status: ProgramStatus, dataCollectingType?: { __typename?: 'DataCollectingTypeNode', id: string, code: string, type?: DataCollectingTypeType | null, label: string, active: boolean, individualFiltersAvailable: boolean, householdFiltersAvailable: boolean, description: string } | null, pduFields?: Array<{ __typename?: 'PeriodicFieldNode', id: string } | null> | null } | null } | null> } | null }; +export type AllProgramsForChoicesQuery = { __typename?: 'Query', allPrograms?: { __typename?: 'ProgramNodeConnection', totalCount?: number | null, edgeCount?: number | null, pageInfo: { __typename?: 'PageInfo', hasNextPage: boolean, hasPreviousPage: boolean, endCursor?: string | null, startCursor?: string | null }, edges: Array<{ __typename?: 'ProgramNodeEdge', cursor: string, node?: { __typename?: 'ProgramNode', id: string, name: string, status: ProgramStatus, dataCollectingType?: { __typename?: 'DataCollectingTypeNode', id: string, code: string, type?: DataCollectingTypeType | null, label: string, active: boolean, individualFiltersAvailable: boolean, householdFiltersAvailable: boolean, description: string } | null, beneficiaryGroup?: { __typename?: 'BeneficiaryGroupNode', id: string, createdAt: any, updatedAt: any, name: string, groupLabel: string, groupLabelPlural: string, memberLabel: string, memberLabelPlural: string, masterDetail: boolean } | null, pduFields?: Array<{ __typename?: 'PeriodicFieldNode', id: string } | null> | null } | null } | null> } | null }; export type AllProgramsForTableQueryVariables = Exact<{ before?: InputMaybe; @@ -9474,7 +9509,7 @@ export type ProgramQueryVariables = Exact<{ }>; -export type ProgramQuery = { __typename?: 'Query', program?: { __typename?: 'ProgramNode', id: string, name: string, programmeCode?: string | null, startDate: any, endDate?: any | null, status: ProgramStatus, caId?: string | null, caHashId?: string | null, description: string, budget?: any | null, frequencyOfPayments: ProgramFrequencyOfPayments, cashPlus: boolean, populationGoal: number, scope?: ProgramScope | null, sector: ProgramSector, totalNumberOfHouseholds?: number | null, totalNumberOfHouseholdsWithTpInProgram?: number | null, administrativeAreasOfImplementation: string, isSocialWorkerProgram?: boolean | null, version: any, adminUrl?: string | null, partnerAccess: ProgramPartnerAccess, targetPopulationsCount?: number | null, canFinish?: boolean | null, dataCollectingType?: { __typename?: 'DataCollectingTypeNode', id: string, code: string, label: string, active: boolean, individualFiltersAvailable: boolean, householdFiltersAvailable: boolean, description: string, type?: DataCollectingTypeType | null } | null, partners?: Array<{ __typename?: 'PartnerNode', id: string, name?: string | null, areaAccess?: string | null, areas?: Array<{ __typename?: 'AreaNode', id: string, level: number } | null> | null } | null> | null, registrationImports: { __typename?: 'RegistrationDataImportNodeConnection', totalCount?: number | null }, pduFields?: Array<{ __typename?: 'PeriodicFieldNode', id: string, label: any, pduData?: { __typename?: 'PeriodicFieldDataNode', id: string, subtype: PeriodicFieldDataSubtype, numberOfRounds: number, roundsNames: Array } | null } | null> | null } | null }; +export type ProgramQuery = { __typename?: 'Query', program?: { __typename?: 'ProgramNode', id: string, name: string, programmeCode?: string | null, startDate: any, endDate?: any | null, status: ProgramStatus, caId?: string | null, caHashId?: string | null, description: string, budget?: any | null, frequencyOfPayments: ProgramFrequencyOfPayments, cashPlus: boolean, populationGoal: number, scope?: ProgramScope | null, sector: ProgramSector, totalNumberOfHouseholds?: number | null, totalNumberOfHouseholdsWithTpInProgram?: number | null, administrativeAreasOfImplementation: string, isSocialWorkerProgram?: boolean | null, version: any, adminUrl?: string | null, partnerAccess: ProgramPartnerAccess, targetPopulationsCount?: number | null, canFinish?: boolean | null, dataCollectingType?: { __typename?: 'DataCollectingTypeNode', id: string, code: string, label: string, active: boolean, individualFiltersAvailable: boolean, householdFiltersAvailable: boolean, description: string, type?: DataCollectingTypeType | null } | null, partners?: Array<{ __typename?: 'PartnerNode', id: string, name?: string | null, areaAccess?: string | null, areas?: Array<{ __typename?: 'AreaNode', id: string, level: number } | null> | null } | null> | null, registrationImports: { __typename?: 'RegistrationDataImportNodeConnection', totalCount?: number | null }, pduFields?: Array<{ __typename?: 'PeriodicFieldNode', id: string, label: any, pduData?: { __typename?: 'PeriodicFieldDataNode', id: string, subtype: PeriodicFieldDataSubtype, numberOfRounds: number, roundsNames: Array } | null } | null> | null, beneficiaryGroup?: { __typename?: 'BeneficiaryGroupNode', id: string, name: string, groupLabel: string, groupLabelPlural: string, memberLabel: string, memberLabelPlural: string, masterDetail: boolean } | null } | null }; export type ProgrammeChoiceDataQueryVariables = Exact<{ [key: string]: never; }>; @@ -9674,7 +9709,7 @@ export type SurveyQueryVariables = Exact<{ }>; -export type SurveyQuery = { __typename?: 'Query', survey?: { __typename?: 'SurveyNode', id: string, unicefId?: string | null, category: SurveyCategory, title: string, adminUrl?: string | null, createdAt: any, body: string, rapidProUrl?: string | null, sampleFilePath?: string | null, hasValidSampleFile?: boolean | null, createdBy?: { __typename?: 'UserNode', id: string, firstName: string, lastName: string, username: string, email: string } | null, program?: { __typename?: 'ProgramNode', id: string, name: string } | null } | null }; +export type SurveyQuery = { __typename?: 'Query', survey?: { __typename?: 'SurveyNode', id: string, unicefId?: string | null, category: SurveyCategory, title: string, adminUrl?: string | null, createdAt: any, body: string, rapidProUrl?: string | null, sampleFilePath?: string | null, hasValidSampleFile?: boolean | null, createdBy?: { __typename?: 'UserNode', id: string, firstName: string, lastName: string, username: string, email: string } | null, program?: { __typename?: 'ProgramNode', id: string, name: string } | null, paymentPlan?: { __typename?: 'PaymentPlanNode', id: string, unicefId?: string | null, name?: string | null } | null } | null }; export type SurveysChoiceDataQueryVariables = Exact<{ [key: string]: never; }>; @@ -9700,6 +9735,39 @@ export type AllSteficonRulesQueryVariables = Exact<{ export type AllSteficonRulesQuery = { __typename?: 'Query', allSteficonRules?: { __typename?: 'SteficonRuleNodeConnection', edges: Array<{ __typename?: 'SteficonRuleNodeEdge', node?: { __typename?: 'SteficonRuleNode', id: string, name: string } | null } | null> } | null }; +export type AllTargetPopulationsQueryVariables = Exact<{ + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + orderBy?: InputMaybe; + name?: InputMaybe; + status?: InputMaybe> | InputMaybe>; + totalHouseholdsCountMin?: InputMaybe; + totalHouseholdsCountMax?: InputMaybe; + businessArea: Scalars['String']['input']; + program?: InputMaybe; + programCycle?: InputMaybe; + createdAtRange?: InputMaybe; + paymentPlanApplicable?: InputMaybe; +}>; + + +export type AllTargetPopulationsQuery = { __typename?: 'Query', allPaymentPlans?: { __typename?: 'PaymentPlanNodeConnection', edges: Array<{ __typename?: 'PaymentPlanNodeEdge', cursor: string, node?: { __typename?: 'PaymentPlanNode', id: string, unicefId?: string | null, name?: string | null, isFollowUp: boolean, status: PaymentPlanStatus, 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, followUps: { __typename?: 'PaymentPlanNodeConnection', totalCount?: number | null, edges: Array<{ __typename?: 'PaymentPlanNodeEdge', node?: { __typename?: 'PaymentPlanNode', id: string, unicefId?: string | null, dispersionStartDate?: any | null, dispersionEndDate?: any | null } | null } | null> }, createdBy: { __typename?: 'UserNode', id: string, firstName: string, lastName: string, email: string }, program?: { __typename?: 'ProgramNode', id: string, name: string } | null } | null } | null> } | null }; + +export type AllTargetPopulationForChoicesQueryVariables = Exact<{ + after?: InputMaybe; + before?: InputMaybe; + first?: InputMaybe; + last?: InputMaybe; + orderBy?: InputMaybe; + name?: InputMaybe; + businessArea: Scalars['String']['input']; +}>; + + +export type AllTargetPopulationForChoicesQuery = { __typename?: 'Query', allPaymentPlans?: { __typename?: 'PaymentPlanNodeConnection', totalCount?: number | null, edgeCount?: number | null, edges: Array<{ __typename?: 'PaymentPlanNodeEdge', cursor: string, node?: { __typename?: 'PaymentPlanNode', id: string, name?: string | null } | null } | null> } | null }; + export type TargetPopulationQueryVariables = Exact<{ id: Scalars['ID']['input']; }>; @@ -10632,6 +10700,15 @@ export const ProgramDetailsFragmentDoc = gql` } } canFinish + beneficiaryGroup { + id + name + groupLabel + groupLabelPlural + memberLabel + memberLabelPlural + masterDetail + } } `; export const RegistrationMinimalFragmentDoc = gql` @@ -13955,6 +14032,7 @@ export const AccountabilityCommunicationMessageDocument = gql` } paymentPlan { id + unicefId name } createdAt @@ -19019,7 +19097,7 @@ export type AllProgramsLazyQueryHookResult = ReturnType; export type AllProgramsQueryResult = Apollo.QueryResult; export const AllProgramsForChoicesDocument = gql` - query AllProgramsForChoices($before: String, $after: String, $first: Int, $last: Int, $status: [String], $sector: [String], $businessArea: String!, $search: String, $numberOfHouseholds: String, $budget: String, $startDate: Date, $endDate: Date, $orderBy: String, $name: String, $compatibleDct: Boolean) { + query AllProgramsForChoices($before: String, $after: String, $first: Int, $last: Int, $status: [String], $sector: [String], $businessArea: String!, $search: String, $numberOfHouseholds: String, $budget: String, $startDate: Date, $endDate: Date, $orderBy: String, $name: String, $compatibleDct: Boolean, $beneficiaryGroupMatch: Boolean) { allPrograms( before: $before after: $after @@ -19036,6 +19114,7 @@ export const AllProgramsForChoicesDocument = gql` endDate: $endDate name: $name compatibleDct: $compatibleDct + beneficiaryGroupMatch: $beneficiaryGroupMatch ) { pageInfo { hasNextPage @@ -19061,6 +19140,17 @@ export const AllProgramsForChoicesDocument = gql` householdFiltersAvailable description } + beneficiaryGroup { + id + createdAt + updatedAt + name + groupLabel + groupLabelPlural + memberLabel + memberLabelPlural + masterDetail + } pduFields { id } @@ -19097,6 +19187,7 @@ export const AllProgramsForChoicesDocument = gql` * orderBy: // value for 'orderBy' * name: // value for 'name' * compatibleDct: // value for 'compatibleDct' + * beneficiaryGroupMatch: // value for 'beneficiaryGroupMatch' * }, * }); */ @@ -20635,6 +20726,11 @@ export const SurveyDocument = gql` id name } + paymentPlan { + id + unicefId + name + } body title rapidProUrl @@ -20863,6 +20959,181 @@ export type AllSteficonRulesQueryHookResult = ReturnType; export type AllSteficonRulesSuspenseQueryHookResult = ReturnType; export type AllSteficonRulesQueryResult = Apollo.QueryResult; +export const AllTargetPopulationsDocument = gql` + query AllTargetPopulations($after: String, $before: String, $first: Int, $last: Int, $orderBy: String, $name: String, $status: [String], $totalHouseholdsCountMin: Int, $totalHouseholdsCountMax: Int, $businessArea: String!, $program: String, $programCycle: String, $createdAtRange: String, $paymentPlanApplicable: Boolean) { + allPaymentPlans( + after: $after + before: $before + first: $first + last: $last + orderBy: $orderBy + name: $name + status: $status + totalHouseholdsCountMin: $totalHouseholdsCountMin + totalHouseholdsCountMax: $totalHouseholdsCountMax + businessArea: $businessArea + program: $program + programCycle: $programCycle + createdAtRange: $createdAtRange + paymentPlanApplicable: $paymentPlanApplicable + ) { + edges { + cursor + node { + id + unicefId + name + isFollowUp + followUps { + totalCount + edges { + node { + id + unicefId + dispersionStartDate + dispersionEndDate + } + } + } + status + createdBy { + id + firstName + lastName + email + } + program { + id + name + } + currency + currencyName + startDate + endDate + dispersionStartDate + dispersionEndDate + femaleChildrenCount + femaleAdultsCount + maleChildrenCount + maleAdultsCount + totalHouseholdsCount + totalIndividualsCount + totalEntitledQuantity + totalDeliveredQuantity + totalUndeliveredQuantity + } + } + } +} + `; + +/** + * __useAllTargetPopulationsQuery__ + * + * To run a query within a React component, call `useAllTargetPopulationsQuery` and pass it any options that fit your needs. + * When your component renders, `useAllTargetPopulationsQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useAllTargetPopulationsQuery({ + * variables: { + * after: // value for 'after' + * before: // value for 'before' + * first: // value for 'first' + * last: // value for 'last' + * orderBy: // value for 'orderBy' + * name: // value for 'name' + * status: // value for 'status' + * totalHouseholdsCountMin: // value for 'totalHouseholdsCountMin' + * totalHouseholdsCountMax: // value for 'totalHouseholdsCountMax' + * businessArea: // value for 'businessArea' + * program: // value for 'program' + * programCycle: // value for 'programCycle' + * createdAtRange: // value for 'createdAtRange' + * paymentPlanApplicable: // value for 'paymentPlanApplicable' + * }, + * }); + */ +export function useAllTargetPopulationsQuery(baseOptions: Apollo.QueryHookOptions & ({ variables: AllTargetPopulationsQueryVariables; skip?: boolean; } | { skip: boolean; }) ) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(AllTargetPopulationsDocument, options); + } +export function useAllTargetPopulationsLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(AllTargetPopulationsDocument, options); + } +export function useAllTargetPopulationsSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { + const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} + return Apollo.useSuspenseQuery(AllTargetPopulationsDocument, options); + } +export type AllTargetPopulationsQueryHookResult = ReturnType; +export type AllTargetPopulationsLazyQueryHookResult = ReturnType; +export type AllTargetPopulationsSuspenseQueryHookResult = ReturnType; +export type AllTargetPopulationsQueryResult = Apollo.QueryResult; +export const AllTargetPopulationForChoicesDocument = gql` + query AllTargetPopulationForChoices($after: String, $before: String, $first: Int, $last: Int, $orderBy: String, $name: String, $businessArea: String!) { + allPaymentPlans( + after: $after + before: $before + first: $first + last: $last + orderBy: $orderBy + name: $name + businessArea: $businessArea + ) { + edges { + node { + id + name + } + cursor + } + totalCount + edgeCount + } +} + `; + +/** + * __useAllTargetPopulationForChoicesQuery__ + * + * To run a query within a React component, call `useAllTargetPopulationForChoicesQuery` and pass it any options that fit your needs. + * When your component renders, `useAllTargetPopulationForChoicesQuery` returns an object from Apollo Client that contains loading, error, and data properties + * you can use to render your UI. + * + * @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; + * + * @example + * const { data, loading, error } = useAllTargetPopulationForChoicesQuery({ + * variables: { + * after: // value for 'after' + * before: // value for 'before' + * first: // value for 'first' + * last: // value for 'last' + * orderBy: // value for 'orderBy' + * name: // value for 'name' + * businessArea: // value for 'businessArea' + * }, + * }); + */ +export function useAllTargetPopulationForChoicesQuery(baseOptions: Apollo.QueryHookOptions & ({ variables: AllTargetPopulationForChoicesQueryVariables; skip?: boolean; } | { skip: boolean; }) ) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useQuery(AllTargetPopulationForChoicesDocument, options); + } +export function useAllTargetPopulationForChoicesLazyQuery(baseOptions?: Apollo.LazyQueryHookOptions) { + const options = {...defaultOptions, ...baseOptions} + return Apollo.useLazyQuery(AllTargetPopulationForChoicesDocument, options); + } +export function useAllTargetPopulationForChoicesSuspenseQuery(baseOptions?: Apollo.SkipToken | Apollo.SuspenseQueryHookOptions) { + const options = baseOptions === Apollo.skipToken ? baseOptions : {...defaultOptions, ...baseOptions} + return Apollo.useSuspenseQuery(AllTargetPopulationForChoicesDocument, options); + } +export type AllTargetPopulationForChoicesQueryHookResult = ReturnType; +export type AllTargetPopulationForChoicesLazyQueryHookResult = ReturnType; +export type AllTargetPopulationForChoicesSuspenseQueryHookResult = ReturnType; +export type AllTargetPopulationForChoicesQueryResult = Apollo.QueryResult; export const TargetPopulationDocument = gql` query TargetPopulation($id: ID!) { paymentPlan(id: $id) { @@ -21099,7 +21370,7 @@ export type DirectiveResolverFn> = { - Node: ( ApprovalProcessNode ) | ( AreaNode ) | ( AreaTypeNode ) | ( BankAccountInfoNode ) | ( BusinessAreaNode ) | ( CommunicationMessageNode ) | ( CommunicationMessageRecipientMapNode ) | ( DataCollectingTypeNode ) | ( DeliveryMechanismDataNode ) | ( DeliveryMechanismNode ) | ( DeliveryMechanismPerPaymentPlanNode ) | ( DocumentNode ) | ( FeedbackMessageNode ) | ( FeedbackNode ) | ( FinancialServiceProviderNode ) | ( FinancialServiceProviderXlsxTemplateNode ) | ( GrievanceDocumentNode ) | ( GrievanceTicketNode ) | ( HouseholdNode ) | ( ImportDataNode ) | ( IndividualIdentityNode ) | ( IndividualNode ) | ( KoboImportDataNode ) | ( LogEntryNode ) | ( PaymentHouseholdSnapshotNode ) | ( PaymentNode ) | ( PaymentPlanNode ) | ( PaymentPlanSupportingDocumentNode ) | ( PaymentVerificationLogEntryNode ) | ( PaymentVerificationNode ) | ( PaymentVerificationPlanNode ) | ( PaymentVerificationSummaryNode ) | ( PeriodicFieldNode ) | ( ProgramCycleNode ) | ( ProgramNode ) | ( RecipientNode ) | ( RegistrationDataImportDatahubNode ) | ( RegistrationDataImportNode ) | ( ReportNode ) | ( RuleCommitNode ) | ( SanctionListIndividualAliasNameNode ) | ( SanctionListIndividualCountriesNode ) | ( SanctionListIndividualDateOfBirthNode ) | ( SanctionListIndividualDocumentNode ) | ( SanctionListIndividualNationalitiesNode ) | ( SanctionListIndividualNode ) | ( SteficonRuleNode ) | ( SurveyNode ) | ( TicketAddIndividualDetailsNode ) | ( TicketComplaintDetailsNode ) | ( TicketDeleteHouseholdDetailsNode ) | ( TicketDeleteIndividualDetailsNode ) | ( TicketHouseholdDataUpdateDetailsNode ) | ( TicketIndividualDataUpdateDetailsNode ) | ( TicketNeedsAdjudicationDetailsNode ) | ( TicketNegativeFeedbackDetailsNode ) | ( TicketNoteNode ) | ( TicketPaymentVerificationDetailsNode ) | ( TicketPositiveFeedbackDetailsNode ) | ( TicketReferralDetailsNode ) | ( TicketSensitiveDetailsNode ) | ( TicketSystemFlaggingDetailsNode ) | ( UserBusinessAreaNode ) | ( UserNode ) | ( VolumeByDeliveryMechanismNode ); + Node: ( ApprovalProcessNode ) | ( AreaNode ) | ( AreaTypeNode ) | ( BankAccountInfoNode ) | ( BeneficiaryGroupNode ) | ( BusinessAreaNode ) | ( CommunicationMessageNode ) | ( CommunicationMessageRecipientMapNode ) | ( DataCollectingTypeNode ) | ( DeliveryMechanismDataNode ) | ( DeliveryMechanismNode ) | ( DeliveryMechanismPerPaymentPlanNode ) | ( DocumentNode ) | ( FeedbackMessageNode ) | ( FeedbackNode ) | ( FinancialServiceProviderNode ) | ( FinancialServiceProviderXlsxTemplateNode ) | ( GrievanceDocumentNode ) | ( GrievanceTicketNode ) | ( HouseholdNode ) | ( ImportDataNode ) | ( IndividualIdentityNode ) | ( IndividualNode ) | ( KoboImportDataNode ) | ( LogEntryNode ) | ( PaymentHouseholdSnapshotNode ) | ( PaymentNode ) | ( PaymentPlanNode ) | ( PaymentPlanSupportingDocumentNode ) | ( PaymentVerificationLogEntryNode ) | ( PaymentVerificationNode ) | ( PaymentVerificationPlanNode ) | ( PaymentVerificationSummaryNode ) | ( PeriodicFieldNode ) | ( ProgramCycleNode ) | ( ProgramNode ) | ( RecipientNode ) | ( RegistrationDataImportDatahubNode ) | ( RegistrationDataImportNode ) | ( ReportNode ) | ( RuleCommitNode ) | ( SanctionListIndividualAliasNameNode ) | ( SanctionListIndividualCountriesNode ) | ( SanctionListIndividualDateOfBirthNode ) | ( SanctionListIndividualDocumentNode ) | ( SanctionListIndividualNationalitiesNode ) | ( SanctionListIndividualNode ) | ( SteficonRuleNode ) | ( SurveyNode ) | ( TicketAddIndividualDetailsNode ) | ( TicketComplaintDetailsNode ) | ( TicketDeleteHouseholdDetailsNode ) | ( TicketDeleteIndividualDetailsNode ) | ( TicketHouseholdDataUpdateDetailsNode ) | ( TicketIndividualDataUpdateDetailsNode ) | ( TicketNeedsAdjudicationDetailsNode ) | ( TicketNegativeFeedbackDetailsNode ) | ( TicketNoteNode ) | ( TicketPaymentVerificationDetailsNode ) | ( TicketPositiveFeedbackDetailsNode ) | ( TicketReferralDetailsNode ) | ( TicketSensitiveDetailsNode ) | ( TicketSystemFlaggingDetailsNode ) | ( UserBusinessAreaNode ) | ( UserNode ) | ( VolumeByDeliveryMechanismNode ); }; /** Mapping between all available schema types and the resolvers types */ @@ -21137,6 +21408,7 @@ export type ResolversTypes = { BankAccountInfoNodeEdge: ResolverTypeWrapper; BankAccountInfoRdiMergeStatus: BankAccountInfoRdiMergeStatus; BankTransferObjectType: BankTransferObjectType; + BeneficiaryGroupNode: ResolverTypeWrapper; BigInt: ResolverTypeWrapper; Boolean: ResolverTypeWrapper; BulkGrievanceAddNoteMutation: ResolverTypeWrapper; @@ -21634,6 +21906,7 @@ export type ResolversParentTypes = { BankAccountInfoNodeConnection: BankAccountInfoNodeConnection; BankAccountInfoNodeEdge: BankAccountInfoNodeEdge; BankTransferObjectType: BankTransferObjectType; + BeneficiaryGroupNode: BeneficiaryGroupNode; BigInt: Scalars['BigInt']['output']; Boolean: Scalars['Boolean']['output']; BulkGrievanceAddNoteMutation: BulkGrievanceAddNoteMutation; @@ -22223,6 +22496,20 @@ export type BankAccountInfoNodeEdgeResolvers; }; +export type BeneficiaryGroupNodeResolvers = { + createdAt?: Resolver; + groupLabel?: Resolver; + groupLabelPlural?: Resolver; + id?: Resolver; + masterDetail?: Resolver; + memberLabel?: Resolver; + memberLabelPlural?: Resolver; + name?: Resolver; + programs?: Resolver>; + updatedAt?: Resolver; + __isTypeOf?: IsTypeOfResolverFn; +}; + export interface BigIntScalarConfig extends GraphQLScalarTypeConfig { name: 'BigInt'; } @@ -23822,7 +24109,7 @@ export type NeedsAdjudicationApproveMutationResolvers = { - __resolveType: TypeResolveFn<'ApprovalProcessNode' | 'AreaNode' | 'AreaTypeNode' | 'BankAccountInfoNode' | 'BusinessAreaNode' | 'CommunicationMessageNode' | 'CommunicationMessageRecipientMapNode' | 'DataCollectingTypeNode' | 'DeliveryMechanismDataNode' | 'DeliveryMechanismNode' | 'DeliveryMechanismPerPaymentPlanNode' | 'DocumentNode' | 'FeedbackMessageNode' | 'FeedbackNode' | 'FinancialServiceProviderNode' | 'FinancialServiceProviderXlsxTemplateNode' | 'GrievanceDocumentNode' | 'GrievanceTicketNode' | 'HouseholdNode' | 'ImportDataNode' | 'IndividualIdentityNode' | 'IndividualNode' | 'KoboImportDataNode' | 'LogEntryNode' | 'PaymentHouseholdSnapshotNode' | 'PaymentNode' | 'PaymentPlanNode' | 'PaymentPlanSupportingDocumentNode' | 'PaymentVerificationLogEntryNode' | 'PaymentVerificationNode' | 'PaymentVerificationPlanNode' | 'PaymentVerificationSummaryNode' | 'PeriodicFieldNode' | 'ProgramCycleNode' | 'ProgramNode' | 'RecipientNode' | 'RegistrationDataImportDatahubNode' | 'RegistrationDataImportNode' | 'ReportNode' | 'RuleCommitNode' | 'SanctionListIndividualAliasNameNode' | 'SanctionListIndividualCountriesNode' | 'SanctionListIndividualDateOfBirthNode' | 'SanctionListIndividualDocumentNode' | 'SanctionListIndividualNationalitiesNode' | 'SanctionListIndividualNode' | 'SteficonRuleNode' | 'SurveyNode' | 'TicketAddIndividualDetailsNode' | 'TicketComplaintDetailsNode' | 'TicketDeleteHouseholdDetailsNode' | 'TicketDeleteIndividualDetailsNode' | 'TicketHouseholdDataUpdateDetailsNode' | 'TicketIndividualDataUpdateDetailsNode' | 'TicketNeedsAdjudicationDetailsNode' | 'TicketNegativeFeedbackDetailsNode' | 'TicketNoteNode' | 'TicketPaymentVerificationDetailsNode' | 'TicketPositiveFeedbackDetailsNode' | 'TicketReferralDetailsNode' | 'TicketSensitiveDetailsNode' | 'TicketSystemFlaggingDetailsNode' | 'UserBusinessAreaNode' | 'UserNode' | 'VolumeByDeliveryMechanismNode', ParentType, ContextType>; + __resolveType: TypeResolveFn<'ApprovalProcessNode' | 'AreaNode' | 'AreaTypeNode' | 'BankAccountInfoNode' | 'BeneficiaryGroupNode' | 'BusinessAreaNode' | 'CommunicationMessageNode' | 'CommunicationMessageRecipientMapNode' | 'DataCollectingTypeNode' | 'DeliveryMechanismDataNode' | 'DeliveryMechanismNode' | 'DeliveryMechanismPerPaymentPlanNode' | 'DocumentNode' | 'FeedbackMessageNode' | 'FeedbackNode' | 'FinancialServiceProviderNode' | 'FinancialServiceProviderXlsxTemplateNode' | 'GrievanceDocumentNode' | 'GrievanceTicketNode' | 'HouseholdNode' | 'ImportDataNode' | 'IndividualIdentityNode' | 'IndividualNode' | 'KoboImportDataNode' | 'LogEntryNode' | 'PaymentHouseholdSnapshotNode' | 'PaymentNode' | 'PaymentPlanNode' | 'PaymentPlanSupportingDocumentNode' | 'PaymentVerificationLogEntryNode' | 'PaymentVerificationNode' | 'PaymentVerificationPlanNode' | 'PaymentVerificationSummaryNode' | 'PeriodicFieldNode' | 'ProgramCycleNode' | 'ProgramNode' | 'RecipientNode' | 'RegistrationDataImportDatahubNode' | 'RegistrationDataImportNode' | 'ReportNode' | 'RuleCommitNode' | 'SanctionListIndividualAliasNameNode' | 'SanctionListIndividualCountriesNode' | 'SanctionListIndividualDateOfBirthNode' | 'SanctionListIndividualDocumentNode' | 'SanctionListIndividualNationalitiesNode' | 'SanctionListIndividualNode' | 'SteficonRuleNode' | 'SurveyNode' | 'TicketAddIndividualDetailsNode' | 'TicketComplaintDetailsNode' | 'TicketDeleteHouseholdDetailsNode' | 'TicketDeleteIndividualDetailsNode' | 'TicketHouseholdDataUpdateDetailsNode' | 'TicketIndividualDataUpdateDetailsNode' | 'TicketNeedsAdjudicationDetailsNode' | 'TicketNegativeFeedbackDetailsNode' | 'TicketNoteNode' | 'TicketPaymentVerificationDetailsNode' | 'TicketPositiveFeedbackDetailsNode' | 'TicketReferralDetailsNode' | 'TicketSensitiveDetailsNode' | 'TicketSystemFlaggingDetailsNode' | 'UserBusinessAreaNode' | 'UserNode' | 'VolumeByDeliveryMechanismNode', ParentType, ContextType>; id?: Resolver; }; @@ -24361,6 +24648,7 @@ export type ProgramNodeResolvers>; adminUrl?: Resolver, ParentType, ContextType>; administrativeAreasOfImplementation?: Resolver; + beneficiaryGroup?: Resolver, ParentType, ContextType>; biometricDeduplicationEnabled?: Resolver; budget?: Resolver, ParentType, ContextType>; businessArea?: Resolver; @@ -25852,6 +26140,7 @@ export type Resolvers = { BankAccountInfoNode?: BankAccountInfoNodeResolvers; BankAccountInfoNodeConnection?: BankAccountInfoNodeConnectionResolvers; BankAccountInfoNodeEdge?: BankAccountInfoNodeEdgeResolvers; + BeneficiaryGroupNode?: BeneficiaryGroupNodeResolvers; BigInt?: GraphQLScalarType; BulkGrievanceAddNoteMutation?: BulkGrievanceAddNoteMutationResolvers; BulkUpdateGrievanceTicketsAssigneesMutation?: BulkUpdateGrievanceTicketsAssigneesMutationResolvers; diff --git a/src/frontend/src/apollo/queries/communication/AccountabilityCommunicationMessage.ts b/src/frontend/src/apollo/queries/communication/AccountabilityCommunicationMessage.ts index e070076dae..6cdb1693b6 100644 --- a/src/frontend/src/apollo/queries/communication/AccountabilityCommunicationMessage.ts +++ b/src/frontend/src/apollo/queries/communication/AccountabilityCommunicationMessage.ts @@ -14,6 +14,7 @@ export const AccountabilityCommunicationMessage = gql` } paymentPlan { id + unicefId name } createdAt diff --git a/src/frontend/src/apollo/queries/surveys/Survey.ts b/src/frontend/src/apollo/queries/surveys/Survey.ts index 04cc22e2f3..c71ca4485d 100644 --- a/src/frontend/src/apollo/queries/surveys/Survey.ts +++ b/src/frontend/src/apollo/queries/surveys/Survey.ts @@ -20,6 +20,11 @@ export const Survey = gql` id name } + paymentPlan { + id + unicefId + name + } body title rapidProUrl diff --git a/src/frontend/src/apollo/queries/targeting/AllTargetPopulations.ts b/src/frontend/src/apollo/queries/targeting/AllTargetPopulations.ts new file mode 100644 index 0000000000..8a9d95abb7 --- /dev/null +++ b/src/frontend/src/apollo/queries/targeting/AllTargetPopulations.ts @@ -0,0 +1,84 @@ +import { gql } from '@apollo/client'; + +export const AllTargetPopulations = gql` + query AllTargetPopulations( + $after: String + $before: String + $first: Int + $last: Int + $orderBy: String + $name: String + $status: [String] + $totalHouseholdsCountMin: Int + $totalHouseholdsCountMax: Int + $businessArea: String! + $program: String + $programCycle: String + $createdAtRange: String + $paymentPlanApplicable: Boolean + ) { + allPaymentPlans( + after: $after + before: $before + first: $first + last: $last + orderBy: $orderBy + name: $name + status: $status + totalHouseholdsCountMin: $totalHouseholdsCountMin + totalHouseholdsCountMax: $totalHouseholdsCountMax + businessArea: $businessArea + program: $program + programCycle: $programCycle + createdAtRange: $createdAtRange + paymentPlanApplicable: $paymentPlanApplicable + ) { + edges { + cursor + node { + id + unicefId + name + isFollowUp + followUps { + totalCount + edges { + node { + id + unicefId + dispersionStartDate + dispersionEndDate + } + } + } + status + createdBy { + id + firstName + lastName + email + } + program { + id + name + } + currency + currencyName + startDate + endDate + dispersionStartDate + dispersionEndDate + femaleChildrenCount + femaleAdultsCount + maleChildrenCount + maleAdultsCount + totalHouseholdsCount + totalIndividualsCount + totalEntitledQuantity + totalDeliveredQuantity + totalUndeliveredQuantity + } + } + } + } +`; diff --git a/src/frontend/src/apollo/queries/targeting/AllTargetPopulationsForChoices.ts b/src/frontend/src/apollo/queries/targeting/AllTargetPopulationsForChoices.ts new file mode 100644 index 0000000000..61ee622b54 --- /dev/null +++ b/src/frontend/src/apollo/queries/targeting/AllTargetPopulationsForChoices.ts @@ -0,0 +1,33 @@ +import { gql } from '@apollo/client'; + +export const AllTargetPopulationForChoices = gql` + query AllTargetPopulationForChoices( + $after: String + $before: String + $first: Int + $last: Int + $orderBy: String + $name: String + $businessArea: String! + ) { + allPaymentPlans( + after: $after + before: $before + first: $first + last: $last + orderBy: $orderBy + name: $name + businessArea: $businessArea + ) { + edges { + node { + id + name + } + cursor + } + totalCount + edgeCount + } + } +`; diff --git a/src/frontend/src/components/accountability/Communication/CommunicationDetails.tsx b/src/frontend/src/components/accountability/Communication/CommunicationDetails.tsx index 3d0f3ce9db..2034ee6c4d 100644 --- a/src/frontend/src/components/accountability/Communication/CommunicationDetails.tsx +++ b/src/frontend/src/components/accountability/Communication/CommunicationDetails.tsx @@ -38,16 +38,20 @@ export function CommunicationDetails({ {message.createdAt} - {message.paymentPlan && ( + {message.paymentPlan ? ( - {message.paymentPlan.unicefId} + {message?.paymentPlan.name} + ) : ( + + - + )} {message.registrationDataImport && ( diff --git a/src/frontend/src/components/accountability/Surveys/SurveyDetails.tsx b/src/frontend/src/components/accountability/Surveys/SurveyDetails.tsx index 8bd2bdcac0..f4f2ee719d 100644 --- a/src/frontend/src/components/accountability/Surveys/SurveyDetails.tsx +++ b/src/frontend/src/components/accountability/Surveys/SurveyDetails.tsx @@ -22,8 +22,7 @@ export function SurveyDetails({ }: SurveyDetailsProps): ReactElement { const { t } = useTranslation(); const { baseUrl } = useBaseUrl(); - const { category, title, createdBy, createdAt, paymentPlan, program, body } = - survey; + const { category, title, createdBy, createdAt, program, body } = survey; const categoryDict = choicesToDict(choicesData.surveyCategoryChoices); return ( @@ -55,11 +54,15 @@ export function SurveyDetails({ - - {survey.paymentPlan.unicefId} - + {survey?.paymentPlan ? ( + + {survey?.paymentPlan.name} + + ) : ( + '-' + )} diff --git a/src/frontend/src/components/paymentmodule/CreatePaymentPlan/PaymentPlanTargeting/PaymentPlanTargeting.tsx b/src/frontend/src/components/paymentmodule/CreatePaymentPlan/PaymentPlanTargeting/PaymentPlanTargeting.tsx index 1af2a81a16..ff55e11696 100644 --- a/src/frontend/src/components/paymentmodule/CreatePaymentPlan/PaymentPlanTargeting/PaymentPlanTargeting.tsx +++ b/src/frontend/src/components/paymentmodule/CreatePaymentPlan/PaymentPlanTargeting/PaymentPlanTargeting.tsx @@ -9,6 +9,7 @@ import { OverviewContainer } from '@core/OverviewContainer'; import { Title } from '@core/Title'; import { PaperContainer } from '../../../targeting/PaperContainer'; import { ReactElement } from 'react'; +import { AllTargetPopulationsQuery } from '@generated/graphql'; const StyledBox = styled(Box)` width: 100%; diff --git a/src/frontend/src/components/payments/VerificationPaymentDetails.tsx b/src/frontend/src/components/payments/VerificationPaymentDetails.tsx index 579ca05c40..b731d78a63 100644 --- a/src/frontend/src/components/payments/VerificationPaymentDetails.tsx +++ b/src/frontend/src/components/payments/VerificationPaymentDetails.tsx @@ -49,8 +49,8 @@ export function VerificationPaymentDetails({