diff --git a/src/frontend/data/schema.graphql b/src/frontend/data/schema.graphql index 03ec69bba9..9cf6a765c4 100644 --- a/src/frontend/data/schema.graphql +++ b/src/frontend/data/schema.graphql @@ -288,6 +288,19 @@ input BankTransferObjectType { accountHolderName: String! } +type BeneficiaryGroupNode implements Node { + id: ID! + createdAt: DateTime! + updatedAt: DateTime! + name: String! + groupLabel: String! + groupLabelPlural: String! + memberLabel: String! + memberLabelPlural: String! + masterDetail: Boolean! + programs(offset: Int, before: String, after: String, first: Int, last: Int, name: String): ProgramNodeConnection! +} + scalar BigInt type BulkGrievanceAddNoteMutation { @@ -699,6 +712,7 @@ input CreateProgramInput { administrativeAreasOfImplementation: String businessAreaSlug: String dataCollectingTypeCode: String + beneficiaryGroup: String partners: [ProgramPartnerThroughInput] partnerAccess: String programmeCode: String @@ -2513,8 +2527,8 @@ type PaymentNode implements Node { fspAuthCode: String isCashAssist: Boolean! followUps(offset: Int, before: String, after: String, first: Int, last: Int): PaymentNodeConnection! - paymentVerification: PaymentVerificationNode householdSnapshot: PaymentHouseholdSnapshotNode + paymentVerification: PaymentVerificationNode ticketComplaintDetails: TicketComplaintDetailsNode ticketSensitiveDetails: TicketSensitiveDetailsNode adminUrl: String @@ -2607,13 +2621,13 @@ type PaymentPlanNode implements Node { excludeHouseholdError: String! name: String isCashAssist: Boolean! + approvalProcess(offset: Int, before: String, after: String, first: Int, last: Int): ApprovalProcessNodeConnection! followUps(offset: Int, before: String, after: String, first: Int, last: Int): PaymentPlanNodeConnection! deliveryMechanisms: [DeliveryMechanismPerPaymentPlanNode] paymentItems(offset: Int, before: String, after: String, first: Int, last: Int): PaymentNodeConnection! + documents(offset: Int, before: String, after: String, first: Int, last: Int): PaymentPlanSupportingDocumentNodeConnection! paymentVerificationPlans(offset: Int, before: String, after: String, first: Int, last: Int): PaymentVerificationPlanNodeConnection! paymentVerificationSummary: PaymentVerificationSummaryNode - approvalProcess(offset: Int, before: String, after: String, first: Int, last: Int): ApprovalProcessNodeConnection! - documents(offset: Int, before: String, after: String, first: Int, last: Int): PaymentPlanSupportingDocumentNodeConnection! adminUrl: String currencyName: String hasPaymentListExportFile: Boolean @@ -2988,6 +3002,7 @@ type ProgramNode implements Node { partners: [PartnerNode] biometricDeduplicationEnabled: Boolean! deduplicationSetId: UUID + beneficiaryGroup: BeneficiaryGroupNode pduFields: [PeriodicFieldNode] households(offset: Int, before: String, after: String, first: Int, last: Int): HouseholdNodeConnection! householdSet(offset: Int, before: String, after: String, first: Int, last: Int): HouseholdNodeConnection! @@ -3157,7 +3172,7 @@ type Query { dataCollectionTypeChoices: [DataCollectingTypeChoiceObject] pduSubtypeChoices: [PDUSubtypeChoiceObject] program(id: ID!): ProgramNode - allPrograms(offset: Int, before: String, after: String, first: Int, last: Int, businessArea: String!, search: String, status: [String], sector: [String], numberOfHouseholds: String, budget: String, startDate: Date, endDate: Date, name: String, numberOfHouseholdsWithTpInProgram: String, dataCollectingType: String, compatibleDct: Boolean, orderBy: String): ProgramNodeConnection + allPrograms(offset: Int, before: String, after: String, first: Int, last: Int, businessArea: String!, search: String, status: [String], sector: [String], numberOfHouseholds: String, budget: String, startDate: Date, endDate: Date, name: String, beneficiaryGroupMatch: Boolean, numberOfHouseholdsWithTpInProgram: String, dataCollectingType: String, compatibleDct: Boolean, orderBy: String): ProgramNodeConnection chartProgrammesBySector(businessAreaSlug: String!, year: Int!, program: String, administrativeArea: String): ChartDetailedDatasetsNode chartTotalTransferredByMonth(businessAreaSlug: String!, year: Int!, program: String, administrativeArea: String): ChartDetailedDatasetsNode programStatusChoices: [ChoiceObject] @@ -3167,7 +3182,7 @@ type Query { programScopeChoices: [ChoiceObject] cashPlanStatusChoices: [ChoiceObject] dataCollectingTypeChoices: [ChoiceObject] - allActivePrograms(offset: Int, before: String, after: String, first: Int, last: Int, businessArea: String!, search: String, status: [String], sector: [String], numberOfHouseholds: String, budget: String, startDate: Date, endDate: Date, name: String, numberOfHouseholdsWithTpInProgram: String, dataCollectingType: String, compatibleDct: Boolean, orderBy: String): ProgramNodeConnection + allActivePrograms(offset: Int, before: String, after: String, first: Int, last: Int, businessArea: String!, search: String, status: [String], sector: [String], numberOfHouseholds: String, budget: String, startDate: Date, endDate: Date, name: String, beneficiaryGroupMatch: Boolean, numberOfHouseholdsWithTpInProgram: String, dataCollectingType: String, compatibleDct: Boolean, orderBy: String): ProgramNodeConnection programCycle(id: ID!): ProgramCycleNode canRunDeduplication: Boolean isDeduplicationDisabled: Boolean @@ -4550,6 +4565,7 @@ input UpdateProgramInput { populationGoal: Int administrativeAreasOfImplementation: String dataCollectingTypeCode: String + beneficiaryGroup: String programmeCode: String pduFields: [PDUFieldInput] } @@ -4681,13 +4697,13 @@ type UserNode implements Node { doapHash: String! userRoles: [UserRoleNode!]! documentSet(offset: Int, before: String, after: String, first: Int, last: Int): DocumentNodeConnection! + approvalSet: [ApprovalNode!]! registrationDataImports(offset: Int, before: String, after: String, first: Int, last: Int): RegistrationDataImportNodeConnection! createdPaymentPlans(offset: Int, before: String, after: String, first: Int, last: Int): PaymentPlanNodeConnection! createdFinancialServiceProviderXlsxTemplates(offset: Int, before: String, after: String, first: Int, last: Int): FinancialServiceProviderXlsxTemplateNodeConnection! createdFinancialServiceProviders(offset: Int, before: String, after: String, first: Int, last: Int): FinancialServiceProviderNodeConnection! createdDeliveryMechanisms(offset: Int, before: String, after: String, first: Int, last: Int): DeliveryMechanismPerPaymentPlanNodeConnection! sentDeliveryMechanisms(offset: Int, before: String, after: String, first: Int, last: Int): DeliveryMechanismPerPaymentPlanNodeConnection! - approvalSet: [ApprovalNode!]! createdTickets(offset: Int, before: String, after: String, first: Int, last: Int): GrievanceTicketNodeConnection! assignedTickets(offset: Int, before: String, after: String, first: Int, last: Int): GrievanceTicketNodeConnection! ticketNotes(offset: Int, before: String, after: String, first: Int, last: Int): TicketNoteNodeConnection! diff --git a/src/frontend/generated/core/ApiError.ts b/src/frontend/generated/core/ApiError.ts new file mode 100644 index 0000000000..ec7b16af6f --- /dev/null +++ b/src/frontend/generated/core/ApiError.ts @@ -0,0 +1,25 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; + +export class ApiError extends Error { + public readonly url: string; + public readonly status: number; + public readonly statusText: string; + public readonly body: any; + public readonly request: ApiRequestOptions; + + constructor(request: ApiRequestOptions, response: ApiResult, message: string) { + super(message); + + this.name = 'ApiError'; + this.url = response.url; + this.status = response.status; + this.statusText = response.statusText; + this.body = response.body; + this.request = request; + } +} diff --git a/src/frontend/generated/core/ApiRequestOptions.ts b/src/frontend/generated/core/ApiRequestOptions.ts new file mode 100644 index 0000000000..93143c3ce1 --- /dev/null +++ b/src/frontend/generated/core/ApiRequestOptions.ts @@ -0,0 +1,17 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type ApiRequestOptions = { + readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH'; + readonly url: string; + readonly path?: Record; + readonly cookies?: Record; + readonly headers?: Record; + readonly query?: Record; + readonly formData?: Record; + readonly body?: any; + readonly mediaType?: string; + readonly responseHeader?: string; + readonly errors?: Record; +}; diff --git a/src/frontend/generated/core/ApiResult.ts b/src/frontend/generated/core/ApiResult.ts new file mode 100644 index 0000000000..ee1126e2cc --- /dev/null +++ b/src/frontend/generated/core/ApiResult.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type ApiResult = { + readonly url: string; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly body: any; +}; diff --git a/src/frontend/generated/core/CancelablePromise.ts b/src/frontend/generated/core/CancelablePromise.ts new file mode 100644 index 0000000000..d70de92946 --- /dev/null +++ b/src/frontend/generated/core/CancelablePromise.ts @@ -0,0 +1,131 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export class CancelError extends Error { + + constructor(message: string) { + super(message); + this.name = 'CancelError'; + } + + public get isCancelled(): boolean { + return true; + } +} + +export interface OnCancel { + readonly isResolved: boolean; + readonly isRejected: boolean; + readonly isCancelled: boolean; + + (cancelHandler: () => void): void; +} + +export class CancelablePromise implements Promise { + #isResolved: boolean; + #isRejected: boolean; + #isCancelled: boolean; + readonly #cancelHandlers: (() => void)[]; + readonly #promise: Promise; + #resolve?: (value: T | PromiseLike) => void; + #reject?: (reason?: any) => void; + + constructor( + executor: ( + resolve: (value: T | PromiseLike) => void, + reject: (reason?: any) => void, + onCancel: OnCancel + ) => void + ) { + this.#isResolved = false; + this.#isRejected = false; + this.#isCancelled = false; + this.#cancelHandlers = []; + this.#promise = new Promise((resolve, reject) => { + this.#resolve = resolve; + this.#reject = reject; + + const onResolve = (value: T | PromiseLike): void => { + if (this.#isResolved || this.#isRejected || this.#isCancelled) { + return; + } + this.#isResolved = true; + if (this.#resolve) this.#resolve(value); + }; + + const onReject = (reason?: any): void => { + if (this.#isResolved || this.#isRejected || this.#isCancelled) { + return; + } + this.#isRejected = true; + if (this.#reject) this.#reject(reason); + }; + + const onCancel = (cancelHandler: () => void): void => { + if (this.#isResolved || this.#isRejected || this.#isCancelled) { + return; + } + this.#cancelHandlers.push(cancelHandler); + }; + + Object.defineProperty(onCancel, 'isResolved', { + get: (): boolean => this.#isResolved, + }); + + Object.defineProperty(onCancel, 'isRejected', { + get: (): boolean => this.#isRejected, + }); + + Object.defineProperty(onCancel, 'isCancelled', { + get: (): boolean => this.#isCancelled, + }); + + return executor(onResolve, onReject, onCancel as OnCancel); + }); + } + + get [Symbol.toStringTag]() { + return "Cancellable Promise"; + } + + public then( + onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, + onRejected?: ((reason: any) => TResult2 | PromiseLike) | null + ): Promise { + return this.#promise.then(onFulfilled, onRejected); + } + + public catch( + onRejected?: ((reason: any) => TResult | PromiseLike) | null + ): Promise { + return this.#promise.catch(onRejected); + } + + public finally(onFinally?: (() => void) | null): Promise { + return this.#promise.finally(onFinally); + } + + public cancel(): void { + if (this.#isResolved || this.#isRejected || this.#isCancelled) { + return; + } + this.#isCancelled = true; + if (this.#cancelHandlers.length) { + try { + for (const cancelHandler of this.#cancelHandlers) { + cancelHandler(); + } + } catch (error) { + console.warn('Cancellation threw an error', error); + return; + } + } + this.#cancelHandlers.length = 0; + if (this.#reject) this.#reject(new CancelError('Request aborted')); + } + + public get isCancelled(): boolean { + return this.#isCancelled; + } +} diff --git a/src/frontend/generated/core/OpenAPI.ts b/src/frontend/generated/core/OpenAPI.ts new file mode 100644 index 0000000000..a0a9ed4a99 --- /dev/null +++ b/src/frontend/generated/core/OpenAPI.ts @@ -0,0 +1,32 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { ApiRequestOptions } from './ApiRequestOptions'; + +type Resolver = (options: ApiRequestOptions) => Promise; +type Headers = Record; + +export type OpenAPIConfig = { + BASE: string; + VERSION: string; + WITH_CREDENTIALS: boolean; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + HEADERS?: Headers | Resolver | undefined; + ENCODE_PATH?: ((path: string) => string) | undefined; +}; + +export const OpenAPI: OpenAPIConfig = { + BASE: '', + VERSION: '1.0.0', + WITH_CREDENTIALS: false, + CREDENTIALS: 'include', + TOKEN: undefined, + USERNAME: undefined, + PASSWORD: undefined, + HEADERS: undefined, + ENCODE_PATH: undefined, +}; diff --git a/src/frontend/generated/core/request.ts b/src/frontend/generated/core/request.ts new file mode 100644 index 0000000000..f83d711995 --- /dev/null +++ b/src/frontend/generated/core/request.ts @@ -0,0 +1,322 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import { ApiError } from './ApiError'; +import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { ApiResult } from './ApiResult'; +import { CancelablePromise } from './CancelablePromise'; +import type { OnCancel } from './CancelablePromise'; +import type { OpenAPIConfig } from './OpenAPI'; + +export const isDefined = (value: T | null | undefined): value is Exclude => { + return value !== undefined && value !== null; +}; + +export const isString = (value: any): value is string => { + return typeof value === 'string'; +}; + +export const isStringWithValue = (value: any): value is string => { + return isString(value) && value !== ''; +}; + +export const isBlob = (value: any): value is Blob => { + return ( + typeof value === 'object' && + typeof value.type === 'string' && + typeof value.stream === 'function' && + typeof value.arrayBuffer === 'function' && + typeof value.constructor === 'function' && + typeof value.constructor.name === 'string' && + /^(Blob|File)$/.test(value.constructor.name) && + /^(Blob|File)$/.test(value[Symbol.toStringTag]) + ); +}; + +export const isFormData = (value: any): value is FormData => { + return value instanceof FormData; +}; + +export const base64 = (str: string): string => { + try { + return btoa(str); + } catch (err) { + // @ts-ignore + return Buffer.from(str).toString('base64'); + } +}; + +export const getQueryString = (params: Record): string => { + const qs: string[] = []; + + const append = (key: string, value: any) => { + qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); + }; + + const process = (key: string, value: any) => { + if (isDefined(value)) { + if (Array.isArray(value)) { + value.forEach(v => { + process(key, v); + }); + } else if (typeof value === 'object') { + Object.entries(value).forEach(([k, v]) => { + process(`${key}[${k}]`, v); + }); + } else { + append(key, value); + } + } + }; + + Object.entries(params).forEach(([key, value]) => { + process(key, value); + }); + + if (qs.length > 0) { + return `?${qs.join('&')}`; + } + + return ''; +}; + +const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { + const encoder = config.ENCODE_PATH || encodeURI; + + const path = options.url + .replace('{api-version}', config.VERSION) + .replace(/{(.*?)}/g, (substring: string, group: string) => { + if (options.path?.hasOwnProperty(group)) { + return encoder(String(options.path[group])); + } + return substring; + }); + + const url = `${config.BASE}${path}`; + if (options.query) { + return `${url}${getQueryString(options.query)}`; + } + return url; +}; + +export const getFormData = (options: ApiRequestOptions): FormData | undefined => { + if (options.formData) { + const formData = new FormData(); + + const process = (key: string, value: any) => { + if (isString(value) || isBlob(value)) { + formData.append(key, value); + } else { + formData.append(key, JSON.stringify(value)); + } + }; + + Object.entries(options.formData) + .filter(([_, value]) => isDefined(value)) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach(v => process(key, v)); + } else { + process(key, value); + } + }); + + return formData; + } + return undefined; +}; + +type Resolver = (options: ApiRequestOptions) => Promise; + +export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { + if (typeof resolver === 'function') { + return (resolver as Resolver)(options); + } + return resolver; +}; + +export const getHeaders = async (config: OpenAPIConfig, options: ApiRequestOptions): Promise => { + const [token, username, password, additionalHeaders] = await Promise.all([ + resolve(options, config.TOKEN), + resolve(options, config.USERNAME), + resolve(options, config.PASSWORD), + resolve(options, config.HEADERS), + ]); + + const headers = Object.entries({ + Accept: 'application/json', + ...additionalHeaders, + ...options.headers, + }) + .filter(([_, value]) => isDefined(value)) + .reduce((headers, [key, value]) => ({ + ...headers, + [key]: String(value), + }), {} as Record); + + if (isStringWithValue(token)) { + headers['Authorization'] = `Bearer ${token}`; + } + + if (isStringWithValue(username) && isStringWithValue(password)) { + const credentials = base64(`${username}:${password}`); + headers['Authorization'] = `Basic ${credentials}`; + } + + if (options.body !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } else if (isBlob(options.body)) { + headers['Content-Type'] = options.body.type || 'application/octet-stream'; + } else if (isString(options.body)) { + headers['Content-Type'] = 'text/plain'; + } else if (!isFormData(options.body)) { + headers['Content-Type'] = 'application/json'; + } + } + + return new Headers(headers); +}; + +export const getRequestBody = (options: ApiRequestOptions): any => { + if (options.body !== undefined) { + if (options.mediaType?.includes('/json')) { + return JSON.stringify(options.body) + } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { + return options.body; + } else { + return JSON.stringify(options.body); + } + } + return undefined; +}; + +export const sendRequest = async ( + config: OpenAPIConfig, + options: ApiRequestOptions, + url: string, + body: any, + formData: FormData | undefined, + headers: Headers, + onCancel: OnCancel +): Promise => { + const controller = new AbortController(); + + const request: RequestInit = { + headers, + body: body ?? formData, + method: options.method, + signal: controller.signal, + }; + + if (config.WITH_CREDENTIALS) { + request.credentials = config.CREDENTIALS; + } + + onCancel(() => controller.abort()); + + return await fetch(url, request); +}; + +export const getResponseHeader = (response: Response, responseHeader?: string): string | undefined => { + if (responseHeader) { + const content = response.headers.get(responseHeader); + if (isString(content)) { + return content; + } + } + return undefined; +}; + +export const getResponseBody = async (response: Response): Promise => { + if (response.status !== 204) { + try { + const contentType = response.headers.get('Content-Type'); + if (contentType) { + const jsonTypes = ['application/json', 'application/problem+json'] + const isJSON = jsonTypes.some(type => contentType.toLowerCase().startsWith(type)); + if (isJSON) { + return await response.json(); + } else { + return await response.text(); + } + } + } catch (error) { + console.error(error); + } + } + return undefined; +}; + +export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { + const errors: Record = { + 400: 'Bad Request', + 401: 'Unauthorized', + 403: 'Forbidden', + 404: 'Not Found', + 500: 'Internal Server Error', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + ...options.errors, + } + + const error = errors[result.status]; + if (error) { + throw new ApiError(options, result, error); + } + + if (!result.ok) { + const errorStatus = result.status ?? 'unknown'; + const errorStatusText = result.statusText ?? 'unknown'; + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2); + } catch (e) { + return undefined; + } + })(); + + throw new ApiError(options, result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + ); + } +}; + +/** + * Request method + * @param config The OpenAPI configuration object + * @param options The request options from the service + * @returns CancelablePromise + * @throws ApiError + */ +export const request = (config: OpenAPIConfig, options: ApiRequestOptions): CancelablePromise => { + return new CancelablePromise(async (resolve, reject, onCancel) => { + try { + const url = getUrl(config, options); + const formData = getFormData(options); + const body = getRequestBody(options); + const headers = await getHeaders(config, options); + + if (!onCancel.isCancelled) { + const response = await sendRequest(config, options, url, body, formData, headers, onCancel); + const responseBody = await getResponseBody(response); + const responseHeader = getResponseHeader(response, options.responseHeader); + + const result: ApiResult = { + url, + ok: response.ok, + status: response.status, + statusText: response.statusText, + body: responseHeader ?? responseBody, + }; + + catchErrorCodes(options, result); + + resolve(result.body); + } + } catch (error) { + reject(error); + } + }); +}; diff --git a/src/frontend/generated/index.ts b/src/frontend/generated/index.ts new file mode 100644 index 0000000000..359c31e8d8 --- /dev/null +++ b/src/frontend/generated/index.ts @@ -0,0 +1,99 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export { ApiError } from './core/ApiError'; +export { CancelablePromise, CancelError } from './core/CancelablePromise'; +export { OpenAPI } from './core/OpenAPI'; +export type { OpenAPIConfig } from './core/OpenAPI'; + +export { ActionEnum } from './models/ActionEnum'; +export { Admin1Enum } from './models/Admin1Enum'; +export { Admin2Enum } from './models/Admin2Enum'; +export { Admin3Enum } from './models/Admin3Enum'; +export type { Admin4Enum } from './models/Admin4Enum'; +export type { Area } from './models/Area'; +export type { AreaList } from './models/AreaList'; +export type { AreaType } from './models/AreaType'; +export type { BeneficiaryGroup } from './models/BeneficiaryGroup'; +export { BlankEnum } from './models/BlankEnum'; +export type { BusinessArea } from './models/BusinessArea'; +export { CollectIndividualDataEnum } from './models/CollectIndividualDataEnum'; +export { CollectTypeEnum } from './models/CollectTypeEnum'; +export { CommsDisabilityEnum } from './models/CommsDisabilityEnum'; +export { ConsentSharingEnum } from './models/ConsentSharingEnum'; +export type { Country } from './models/Country'; +export { CountryEnum } from './models/CountryEnum'; +export { CountryOriginEnum } from './models/CountryOriginEnum'; +export { CurrencyEnum } from './models/CurrencyEnum'; +export { DeduplicationGoldenRecordStatusEnum } from './models/DeduplicationGoldenRecordStatusEnum'; +export type { Delegate } from './models/Delegate'; +export type { DelegatePeople } from './models/DelegatePeople'; +export { DisabilityEnum } from './models/DisabilityEnum'; +export type { Document } from './models/Document'; +export { DocumentStatusEnum } from './models/DocumentStatusEnum'; +export { DocumentTypeEnum } from './models/DocumentTypeEnum'; +export type { FollowUpPaymentPlan } from './models/FollowUpPaymentPlan'; +export { FrequencyOfPaymentsEnum } from './models/FrequencyOfPaymentsEnum'; +export { HearingDisabilityEnum } from './models/HearingDisabilityEnum'; +export type { Household } from './models/Household'; +export type { Individual } from './models/Individual'; +export { MemoryDisabilityEnum } from './models/MemoryDisabilityEnum'; +export type { NullEnum } from './models/NullEnum'; +export { OrgEnumeratorEnum } from './models/OrgEnumeratorEnum'; +export type { PaginatedAreaList } from './models/PaginatedAreaList'; +export type { PaginatedAreaListList } from './models/PaginatedAreaListList'; +export type { PaginatedAreaTypeList } from './models/PaginatedAreaTypeList'; +export type { PaginatedBeneficiaryGroupList } from './models/PaginatedBeneficiaryGroupList'; +export type { PaginatedBusinessAreaList } from './models/PaginatedBusinessAreaList'; +export type { PaginatedCountryList } from './models/PaginatedCountryList'; +export type { PaginatedPaymentPlanList } from './models/PaginatedPaymentPlanList'; +export type { PaginatedPeriodicDataUpdateTemplateListList } from './models/PaginatedPeriodicDataUpdateTemplateListList'; +export type { PaginatedPeriodicDataUpdateUploadListList } from './models/PaginatedPeriodicDataUpdateUploadListList'; +export type { PaginatedPeriodicFieldList } from './models/PaginatedPeriodicFieldList'; +export type { PaginatedProgramCycleListList } from './models/PaginatedProgramCycleListList'; +export type { PaginatedProgramGlobalList } from './models/PaginatedProgramGlobalList'; +export type { PaginatedRegistrationDataImportListList } from './models/PaginatedRegistrationDataImportListList'; +export type { PaginatedTargetPopulationListList } from './models/PaginatedTargetPopulationListList'; +export type { PatchedProgramCycleUpdate } from './models/PatchedProgramCycleUpdate'; +export type { PatchedRDI } from './models/PatchedRDI'; +export type { PaymentPlan } from './models/PaymentPlan'; +export type { PaymentPlanBulkAction } from './models/PaymentPlanBulkAction'; +export type { PaymentPlanSupportingDocument } from './models/PaymentPlanSupportingDocument'; +export type { PeriodicDataUpdateTemplateCreate } from './models/PeriodicDataUpdateTemplateCreate'; +export type { PeriodicDataUpdateTemplateDetail } from './models/PeriodicDataUpdateTemplateDetail'; +export type { PeriodicDataUpdateTemplateList } from './models/PeriodicDataUpdateTemplateList'; +export type { PeriodicDataUpdateUpload } from './models/PeriodicDataUpdateUpload'; +export type { PeriodicDataUpdateUploadDetail } from './models/PeriodicDataUpdateUploadDetail'; +export type { PeriodicDataUpdateUploadList } from './models/PeriodicDataUpdateUploadList'; +export type { PeriodicField } from './models/PeriodicField'; +export type { PeriodicFieldData } from './models/PeriodicFieldData'; +export { PhysicalDisabilityEnum } from './models/PhysicalDisabilityEnum'; +export { PreferredLanguageEnum } from './models/PreferredLanguageEnum'; +export type { Program } from './models/Program'; +export type { ProgramCycleCreate } from './models/ProgramCycleCreate'; +export type { ProgramCycleList } from './models/ProgramCycleList'; +export type { ProgramCycleUpdate } from './models/ProgramCycleUpdate'; +export type { ProgramGlobal } from './models/ProgramGlobal'; +export { ProgramGlobalStatusEnum } from './models/ProgramGlobalStatusEnum'; +export type { PushPeople } from './models/PushPeople'; +export { PushPeopleTypeEnum } from './models/PushPeopleTypeEnum'; +export type { RDI } from './models/RDI'; +export { RdiMergeStatusEnum } from './models/RdiMergeStatusEnum'; +export type { RDINested } from './models/RDINested'; +export type { RegistrationDataImportList } from './models/RegistrationDataImportList'; +export { RegistrationMethodEnum } from './models/RegistrationMethodEnum'; +export { RelationshipEnum } from './models/RelationshipEnum'; +export { ResidenceStatusEnum } from './models/ResidenceStatusEnum'; +export { ScopeEnum } from './models/ScopeEnum'; +export { SectorEnum } from './models/SectorEnum'; +export { SeeingDisabilityEnum } from './models/SeeingDisabilityEnum'; +export { SelfcareDisabilityEnum } from './models/SelfcareDisabilityEnum'; +export { SexEnum } from './models/SexEnum'; +export { SubtypeEnum } from './models/SubtypeEnum'; +export type { TargetPopulationList } from './models/TargetPopulationList'; +export { WorkStatusEnum } from './models/WorkStatusEnum'; + +export { FieldsAttributesService } from './services/FieldsAttributesService'; +export { HhStatusService } from './services/HhStatusService'; +export { RestService } from './services/RestService'; diff --git a/src/frontend/generated/models/ActionEnum.ts b/src/frontend/generated/models/ActionEnum.ts new file mode 100644 index 0000000000..1ac5a16bb9 --- /dev/null +++ b/src/frontend/generated/models/ActionEnum.ts @@ -0,0 +1,30 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `LOCK` - Lock + * * `LOCK_FSP` - Lock FSP + * * `UNLOCK` - Unlock + * * `UNLOCK_FSP` - Unlock FSP + * * `SEND_FOR_APPROVAL` - Send For Approval + * * `APPROVE` - Approve + * * `AUTHORIZE` - Authorize + * * `REVIEW` - Review + * * `REJECT` - Reject + * * `FINISH` - Finish + * * `SEND_TO_PAYMENT_GATEWAY` - Send to Payment Gateway + */ +export enum ActionEnum { + LOCK = 'LOCK', + LOCK_FSP = 'LOCK_FSP', + UNLOCK = 'UNLOCK', + UNLOCK_FSP = 'UNLOCK_FSP', + SEND_FOR_APPROVAL = 'SEND_FOR_APPROVAL', + APPROVE = 'APPROVE', + AUTHORIZE = 'AUTHORIZE', + REVIEW = 'REVIEW', + REJECT = 'REJECT', + FINISH = 'FINISH', + SEND_TO_PAYMENT_GATEWAY = 'SEND_TO_PAYMENT_GATEWAY', +} diff --git a/src/frontend/generated/models/Admin1Enum.ts b/src/frontend/generated/models/Admin1Enum.ts new file mode 100644 index 0000000000..64f5a6e773 --- /dev/null +++ b/src/frontend/generated/models/Admin1Enum.ts @@ -0,0 +1,146 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `AF09` - Baghlan + * * `AF29` - Badghis + * * `AF18` - Balkh + * * `AF28` - Faryab + * * `AF21` - Ghor + * * `AF10` - Bamyan + * * `AF22` - Daykundi + * * `AF31` - Farah + * * `AF27` - Jawzjan + * * `AF01` - Kabul + * * `AF33` - Kandahar + * * `AF32` - Hilmand + * * `AF11` - Ghazni + * * `AF02` - Kapisa + * * `AF26` - Khost + * * `AF30` - Hirat + * * `AF15` - Badakhshan + * * `AF25` - Paktika + * * `AF06` - Nangarhar + * * `AF14` - Nuristan + * * `AF34` - Nimroz + * * `AF12` - Paktya + * * `AF13` - Kunar + * * `AF23` - Uruzgan + * * `AF20` - Sar-e-Pul + * * `AF16` - Takhar + * * `AG06` - Saint Philip - AG05 + * * `AF04` - Wardak + * * `AG08` - Redonda - AG08 + * * `AF24` - Zabul + * * `AF05` - Logar + * * `AG05` - Saint Peter - AG05 + * * `AF03` - Parwan + * * `AG03` - Saint Mary - AG03 + * * `AG04` - Saint Paul - AG04 + * * `AG01` - Saint George - AG01 + * * `AF19` - Samangan + * * `AG07` - Barbuda - AG07 + * * `AF17` - Kunduz + * * `AG02` - Saint John - AG02 + * * `AF08` - Panjsher + * * `AF07` - Laghman + * * `UA07` - Volynska + * * `UA68` - Khmelnytska + * * `UA21` - Zakarpatska + * * `UA46` - Lvivska + * * `UA12` - Dnipropetrovska + * * `UA80` - Kyivska + * * `UA53` - Poltavska + * * `UA73` - Chernivetska + * * `UA01` - Avtonomna Respublika Krym + * * `UA18` - Zhytomyrska + * * `UA48` - Mykolaivska + * * `UA71` - Cherkaska + * * `UA65` - Khersonska + * * `UA85` - Sevastopilska + * * `UA63` - Kharkivska + * * `UA32` - Kyivska + * * `UA05` - Vinnytska + * * `UA51` - Odeska + * * `UA23` - Zaporizka + * * `UA14` - Donetska + * * `UA56` - Rivnenska + * * `UA44` - Luhanska + * * `UA59` - Sumska + * * `UA61` - Ternopilska + * * `UA74` - Chernihivska + * * `UA35` - Kirovohradska + * * `UA26` - Ivano-Frankivska + */ +export enum Admin1Enum { + AF09 = 'AF09', + AF29 = 'AF29', + AF18 = 'AF18', + AF28 = 'AF28', + AF21 = 'AF21', + AF10 = 'AF10', + AF22 = 'AF22', + AF31 = 'AF31', + AF27 = 'AF27', + AF01 = 'AF01', + AF33 = 'AF33', + AF32 = 'AF32', + AF11 = 'AF11', + AF02 = 'AF02', + AF26 = 'AF26', + AF30 = 'AF30', + AF15 = 'AF15', + AF25 = 'AF25', + AF06 = 'AF06', + AF14 = 'AF14', + AF34 = 'AF34', + AF12 = 'AF12', + AF13 = 'AF13', + AF23 = 'AF23', + AF20 = 'AF20', + AF16 = 'AF16', + AG06 = 'AG06', + AF04 = 'AF04', + AG08 = 'AG08', + AF24 = 'AF24', + AF05 = 'AF05', + AG05 = 'AG05', + AF03 = 'AF03', + AG03 = 'AG03', + AG04 = 'AG04', + AG01 = 'AG01', + AF19 = 'AF19', + AG07 = 'AG07', + AF17 = 'AF17', + AG02 = 'AG02', + AF08 = 'AF08', + AF07 = 'AF07', + UA07 = 'UA07', + UA68 = 'UA68', + UA21 = 'UA21', + UA46 = 'UA46', + UA12 = 'UA12', + UA80 = 'UA80', + UA53 = 'UA53', + UA73 = 'UA73', + UA01 = 'UA01', + UA18 = 'UA18', + UA48 = 'UA48', + UA71 = 'UA71', + UA65 = 'UA65', + UA85 = 'UA85', + UA63 = 'UA63', + UA32 = 'UA32', + UA05 = 'UA05', + UA51 = 'UA51', + UA23 = 'UA23', + UA14 = 'UA14', + UA56 = 'UA56', + UA44 = 'UA44', + UA59 = 'UA59', + UA61 = 'UA61', + UA74 = 'UA74', + UA35 = 'UA35', + UA26 = 'UA26', +} diff --git a/src/frontend/generated/models/Admin2Enum.ts b/src/frontend/generated/models/Admin2Enum.ts new file mode 100644 index 0000000000..3633db419c --- /dev/null +++ b/src/frontend/generated/models/Admin2Enum.ts @@ -0,0 +1,1260 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `AF0904` - Doshi + * * `AF0903` - Dahana-e-Ghori + * * `AF0906` - Tala Wa barfak + * * `AF0912` - Dehsalah + * * `AF0908` - Andarab + * * `AF0902` - Baghlan-e-Jadid + * * `AF0910` - Burka + * * `AF0915` - Fereng Wa Gharu + * * `AF0914` - Guzargah-e-Nur + * * `AF0907` - Khenjan + * * `AF0913` - Khost Wa Fereng + * * `AF0909` - Khwajahejran + * * `AF0905` - Nahrin + * * `AF0911` - Pul-e-Hesar + * * `AF0901` - Pul-e-Khumri + * * `AF2905` - Jawand + * * `AF2904` - Qadis + * * `AF2903` - Abkamari + * * `AF2906` - Balamurghab + * * `AF2907` - Ghormach + * * `AF2901` - Qala-e-Naw + * * `AF2902` - Muqur + * * `AF1811` - Sharak-e-Hayratan + * * `AF1805` - Balkh + * * `AF1807` - Charkent + * * `AF1813` - Chemtal + * * `AF1815` - Keshendeh + * * `AF1809` - Khulm + * * `AF1814` - Sholgareh + * * `AF1803` - Shortepa + * * `AF1801` - Mazar-e-Sharif + * * `AF1812` - Charbulak + * * `AF1816` - Zari + * * `AF1806` - Dehdadi + * * `AF1810` - Kaldar + * * `AF1808` - Marmul + * * `AF1802` - Nahr-e-Shahi + * * `AF1804` - Dawlatabad + * * `AF2814` - Qorghan + * * `AF2812` - Qaramqol + * * `AF2809` - Bilcheragh + * * `AF2803` - Pashtunkot + * * `AF2808` - Garziwan + * * `AF2806` - Qaysar + * * `AF2804` - Shirintagab + * * `AF2802` - Khwajasabzposh + * * `AF2801` - Maymana + * * `AF2811` - Andkhoy + * * `AF2805` - Almar + * * `AF2813` - Khan-e-Char Bagh + * * `AF2807` - Kohestan + * * `AF2810` - Dawlatabad + * * `AF2101` - Chaghcharan + * * `AF2102` - Charsadra + * * `AF2104` - Dawlatyar + * * `AF2103` - DoLayna + * * `AF2108` - Lal Wa Sarjangal + * * `AF2107` - Pasaband + * * `AF2110` - Saghar + * * `AF2105` - Shahrak + * * `AF2106` - Taywarah + * * `AF2109` - Tolak + * * `AF1001` - Bamyan + * * `AF1006` - Kahmard + * * `AF1002` - Sayghan + * * `AF1005` - Shibar + * * `AF1007` - Waras + * * `AF1004` - Panjab + * * `AF1003` - Yakawlang + * * `AF2202` - Ashtarlay + * * `AF2205` - Gizab / Patoo + * * `AF2203` - Khadir + * * `AF2208` - Kajran + * * `AF2204` - Kiti + * * `AF2209` - Miramor + * * `AF2207` - Sang-e-Takht + * * `AF2201` - Nili + * * `AF2206` - Shahrestan + * * `AF3109` - Gulestan + * * `AF3104` - Khak-e-Safed + * * `AF3108` - Lash-e-Juwayn + * * `AF3110` - Purchaman + * * `AF3105` - Pushtrod + * * `AF3107` - Shibkoh + * * `AF3102` - Bakwa + * * `AF3101` - Farah + * * `AF3106` - Qala-e-Kah + * * `AF3111` - Anardara + * * `AF3103` - Balabuluk + * * `AF2704` - Qushtepa + * * `AF2708` - Mardyan + * * `AF2710` - Khamyab + * * `AF2707` - Aqcha + * * `AF2711` - Darzab + * * `AF2706` - Khanaqa + * * `AF2703` - Khwajadukoh + * * `AF2709` - Qarqin + * * `AF2701` - Shiberghan + * * `AF2702` - Mingajik + * * `AF2705` - Fayzabad + * * `AF0109` - Kalakan + * * `AF0115` - Farza + * * `AF0114` - Estalef + * * `AF0101` - Kabul + * * `AF0112` - Khak-e-Jabbar + * * `AF0113` - Surobi + * * `AF0105` - Chaharasyab + * * `AF0102` - Dehsabz + * * `AF0107` - Bagrami + * * `AF0111` - Guldara + * * `AF0110` - Mirbachakot + * * `AF0106` - Musayi + * * `AF0104` - Paghman + * * `AF0103` - Shakardara + * * `AF0108` - Qarabagh + * * `AF3310` - Shorabak + * * `AF3307` - Khakrez + * * `AF3316` - Maruf + * * `AF3308` - Maywand + * * `AF3314` - Nesh + * * `AF3304` - Panjwayi + * * `AF3301` - Kandahar / Dand + * * `AF3311` - Spinboldak + * * `AF3303` - Zheray + * * `AF3312` - Arghestan + * * `AF3305` - Daman + * * `AF3315` - Ghorak + * * `AF3313` - Miyanshin + * * `AF3306` - Shahwalikot + * * `AF3309` - Reg + * * `AF3302` - Arghandab + * * `AF3211` - Baghran + * * `AF3210` - Kajaki + * * `AF3213` - Deh-e-Shu + * * `AF3209` - Garmser + * * `AF3201` - Lashkargah + * * `AF3206` - Musaqalah + * * `AF3203` - Nad-e-Ali / Marja + * * `AF3202` - Nahr-e-Saraj + * * `AF3207` - Nawzad + * * `AF3205` - Sangin + * * `AF3204` - Nawa-e-Barakzaiy + * * `AF3208` - Washer + * * `AF3212` - Reg + * * `AF1119` - Nawa + * * `AF1112` - Nawur + * * `AF1117` - Malestan + * * `AF1115` - Abband + * * `AF1116` - Ajrestan + * * `AF1105` - Andar + * * `AF1106` - Dehyak + * * `AF1111` - Giro + * * `AF1108` - Rashidan + * * `AF1104` - Waghaz + * * `AF1103` - Walimuhammad-e-Shahid + * * `AF1107` - Zanakhan + * * `AF1118` - Gelan + * * `AF1113` - Jaghuri + * * `AF1102` - Khwajaumari + * * `AF1101` - Ghazni + * * `AF1114` - Muqur + * * `AF1109` - Jaghatu + * * `AF1110` - Qarabagh + * * `AF0204` - Hisa-e-Duwum-e-Kohestan + * * `AF0202` - Nejrab + * * `AF0206` - Alasay + * * `AF0207` - Hisa-e-Awal-e-Kohestan + * * `AF0203` - Kohband + * * `AF0201` - Mahmud-e-Raqi + * * `AF0205` - Tagab + * * `AF2609` - Qalandar + * * `AF2611` - Spera + * * `AF2605` - Mandozayi + * * `AF2612` - Bak + * * `AF2607` - Gurbuz + * * `AF2613` - Jajimaydan + * * `AF2601` - Khost (Matun) + * * `AF2603` - Musakhel + * * `AF2604` - Nadirshahkot + * * `AF2602` - Sabari + * * `AF2610` - Shamal + * * `AF2606` - Tani + * * `AF2608` - Terezayi + * * `AF3011` - Farsi + * * `AF3009` - Ghoryan + * * `AF3008` - Gulran + * * `AF3002` - Injil + * * `AF3003` - Kushk + * * `AF3015` - Shindand + * * `AF3010` - Adraskan + * * `AF3016` - Chisht-e-Sharif + * * `AF3005` - Guzara + * * `AF3007` - Karukh + * * `AF3014` - Kohsan + * * `AF3013` - Kushk-e-Kohna + * * `AF3012` - Obe + * * `AF3006` - Pashtunzarghun + * * `AF3004` - Zindajan + * * `AF3001` - Hirat + * * `AF1521` - Jorm + * * `AF1518` - Keshem + * * `AF1517` - Khwahan + * * `AF1516` - Kofab + * * `AF1511` - Khash + * * `AF1526` - Koran Wa Monjan + * * `AF1506` - Raghestan + * * `AF1515` - Darwaz-e-Balla + * * `AF1504` - Arghanjkhwa + * * `AF1508` - Shahr-e-Buzorg + * * `AF1503` - Argo + * * `AF1510` - Darayem + * * `AF1525` - Shaki + * * `AF1502` - Yaftal-e-Sufla + * * `AF1507` - Yawan + * * `AF1523` - Eshkashem + * * `AF1514` - Shighnan + * * `AF1513` - Shuhada + * * `AF1524` - Darwaz + * * `AF1509` - Teshkan + * * `AF1528` - Wakhan + * * `AF1522` - Warduj + * * `AF1520` - Yamgan + * * `AF1527` - Zebak + * * `AF1505` - Kohestan + * * `AF1519` - Tagab + * * `AF1512` - Baharak + * * `AF1501` - Fayzabad + * * `AF2503` - Yosufkhel + * * `AF2515` - Bermel + * * `AF2518` - Dila + * * `AF2508` - Gomal + * * `AF2516` - Gyan + * * `AF2502` - Matakhan + * * `AF2511` - Naka + * * `AF2507` - Omna + * * `AF2509` - Sarobi + * * `AF2504` - Sarrawzah + * * `AF2519` - Turwo + * * `AF2510` - Urgun + * * `AF2513` - Wazakhah + * * `AF2514` - Wormamay + * * `AF2506` - Yahyakhel + * * `AF2517` - Ziruk + * * `AF2501` - Sharan + * * `AF2505` - Zarghunshahr + * * `AF2512` - Janikhel + * * `AF0604` - Khogyani + * * `AF0616` - Goshta + * * `AF0610` - Hesarak + * * `AF0614` - Kot + * * `AF0601` - Jalalabad + * * `AF0617` - Achin + * * `AF0615` - Batikot + * * `AF0602` - Behsud + * * `AF0609` - Dara-e-Nur + * * `AF0613` - Dehbala + * * `AF0622` - Durbaba + * * `AF0607` - Kama + * * `AF0608` - Kuzkunar + * * `AF0620` - Lalpur + * * `AF0619` - Muhmand Dara + * * `AF0621` - Nazyan + * * `AF0612` - Pachieragam + * * `AF0606` - Rodat + * * `AF0611` - Sherzad + * * `AF0618` - Shinwar + * * `AF0603` - Surkhrod + * * `AF0605` - Chaparhar + * * `AF1408` - Barg-e-Matal + * * `AF1403` - Duab + * * `AF1407` - Kamdesh + * * `AF1402` - Mandol + * * `AF1404` - Nurgeram + * * `AF1401` - Poruns + * * `AF1405` - Wama + * * `AF1406` - Waygal + * * `AF3403` - Charburjak + * * `AF3402` - Kang + * * `AF3405` - Khashrod / Dularam + * * `AF3404` - Chakhansur + * * `AF3401` - Zaranj + * * `AF1203` - Ahmadaba + * * `AF1208` - Alikhel (Jaji) + * * `AF1210` - Chamkani + * * `AF1211` - Dand Wa Patan + * * `AF1201` - Gardez + * * `AF1205` - Shawak + * * `AF1207` - Lija Ahmad Khel / Laja Mangel + * * `AF1202` - Sayedkaram / Mirzaka + * * `AF1206` - Zadran + * * `AF1204` - Zurmat + * * `AF1209` - Janikhel + * * `AF1306` - Shigal Wa Sheltan + * * `AF1304` - Sarkani + * * `AF1315` - Nari + * * `AF1303` - Narang + * * `AF1301` - Asadabad + * * `AF1311` - Barkunar + * * `AF1313` - Chapadara + * * `AF1307` - Dara-e-Pech + * * `AF1305` - Marawara + * * `AF1314` - Nurgal + * * `AF1302` - Watapur + * * `AF1310` - Dangam + * * `AF1308` - Chawkay + * * `AF1312` - Ghaziabad + * * `AF1309` - Khaskunar + * * `AF2302` - Chora / Chinarto + * * `AF2304` - Dehrawud + * * `AF2305` - Khasuruzgan + * * `AF2303` - Shahid-e-Hassas + * * `AF2301` - Tirinkot + * * `AF2006` - Balkhab + * * `AF2003` - Kohestanat + * * `AF2005` - Gosfandi + * * `AF2007` - Sancharak + * * `AF2001` - Sar-e-Pul + * * `AF2002` - Sayad + * * `AF2004` - Sozmaqala + * * `AF1604` - Bangi + * * `AF1610` - Chahab + * * `AF1605` - Chal + * * `AF1617` - Darqad + * * `AF1613` - Dasht-e-Qala + * * `AF1615` - Eshkmesh + * * `AF1607` - Farkhar + * * `AF1602` - Hazarsumuch + * * `AF1608` - Kalafgan + * * `AF1612` - Khwajabahawuddin + * * `AF1606` - Namakab + * * `AF1609` - Rostaq + * * `AF1601` - Taloqan + * * `AF1616` - Warsaj + * * `AF1614` - Khwajaghar + * * `AF1611` - Yang-e-Qala + * * `AF1603` - Baharak + * * `AG0601` - Collins - AG0601 + * * `AG0602` - Ffryes - AG0602 + * * `AG0603` - Freetown - AG0603 + * * `AG0604` - Glanvilles - AG0604 + * * `AG0605` - Lavingtons - AG0605 + * * `AG0606` - Lyons - AG0606 + * * `AG0607` - Montpelier - AG0607 + * * `AG0608` - Newfield - AG0608 + * * `AG0612` - Saint Philips - AG0612 + * * `AG0609` - Seatons - AG0609 + * * `AG0610` - Sign - AG0610 + * * `AG0611` - Simpson - AG0611 + * * `AG0613` - Willikies - AG0613 + * * `AG0614` - Willoughby - AG0614 + * * `AF0403` - Nerkh + * * `AF0404` - Hesa-e-Awal-e-Behsud + * * `AF0406` - Chak + * * `AF0402` - Jalrez + * * `AF0408` - Markaz-e-Behsud + * * `AF0401` - Maydanshahr + * * `AF0407` - Saydabad + * * `AF0405` - Daymirdad + * * `AF0409` - Jaghatu + * * `AG0801` - Redonda - AG0801 + * * `AF2409` - Atghar + * * `AF2408` - Daychopan + * * `AF2407` - Kakar + * * `AF2403` - Mizan + * * `AF2411` - Nawbahar + * * `AF2401` - Qalat + * * `AF2406` - Shahjoy + * * `AF2405` - Shinkay + * * `AF2410` - Shomulzay + * * `AF2404` - Tarnak Wa Jaldak + * * `AF2402` - Arghandab + * * `AF0503` - Mohammadagha + * * `AF0501` - Pul-e-Alam + * * `AF0507` - Azra + * * `AF0504` - Barakibarak + * * `AF0506` - Kharwar + * * `AF0502` - Khoshi + * * `AF0505` - Charkh + * * `AG0501` - Big Duers - AG0501 + * * `AG0502` - Cocoa Hall - AG0502 + * * `AG0503` - Freemans - AG0503 + * * `AG0504` - Gilberts - AG0504 + * * `AG0505` - Mercers Creek - AG0505 + * * `AG0506` - Parham - AG0506 + * * `AG0507` - Parrys - AG0507 + * * `AG0508` - Vernons - AG0508 + * * `AF0309` - Shekhali + * * `AF0304` - Bagram + * * `AF0301` - Charikar + * * `AF0307` - Ghorband + * * `AF0302` - Jabalussaraj + * * `AF0308` - Koh-e-Safi + * * `AF0306` - Salang + * * `AF0305` - Saydkhel + * * `AF0303` - Shinwari + * * `AF0310` - Surkh-e-Parsa + * * `AG0301` - Bishops - AG0301 + * * `AG0302` - Blubber Valley - AG0302 + * * `AG0303` - Bolans - AG0303 + * * `AG0304` - Cades Bay - AG0304 + * * `AG0305` - Cedar Hall - AG0305 + * * `AG0306` - Claremont - AG0306 + * * `AG0307` - Crabs Hill - AG0307 + * * `AG0308` - Ebenezer - AG0308 + * * `AG0309` - Glebe - AG0309 + * * `AG0310` - Jennings - AG0310 + * * `AG0311` - John Hughes - AG0311 + * * `AG0312` - Johnsons Point - AG0312 + * * `AG0313` - New Division - AG0313 + * * `AG0314` - Old Road - AG0314 + * * `AG0315` - Orange Valley Mill - AG0315 + * * `AG0316` - Sawcolts - AG0316 + * * `AG0317` - Seaforths - AG0317 + * * `AG0318` - Urlings - AG0318 + * * `AG0319` - Yorks - AG0319 + * * `AG0401` - Bethesda - AG0401 + * * `AG0402` - Burkes - AG0402 + * * `AG0403` - Christian Hill - AG0403 + * * `AG0404` - Delaps - AG0404 + * * `AG0405` - English Harbour - AG0405 + * * `AG0406` - Falmouth - AG0406 + * * `AG0407` - Liberta - AG0407 + * * `AG0408` - Mathews - AG0408 + * * `AG0409` - Pattersons - AG0409 + * * `AG0410` - Swetes - AG0410 + * * `AG0101` - Barnes Hill - AG0101 + * * `AG0102` - Carlisle - AG0102 + * * `AG0103` - Coolidge - AG0103 + * * `AG0104` - Crosbies - AG0104 + * * `AG0105` - Fitches Creek - AG0105 + * * `AG0106` - Gunthorpes - AG0106 + * * `AG0107` - Hodges Bay - AG0107 + * * `AG0108` - Marble Hill - AG0108 + * * `AG0109` - New Winthorpes - AG0109 + * * `AG0110` - Osbourn - AG0110 + * * `AG0111` - Paradise View - AG0111 + * * `AG0112` - Paynters - AG0112 + * * `AG0113` - Piggotts - AG0113 + * * `AG0114` - Sea View Farm - AG0114 + * * `AF1901` - Aybak + * * `AF1904` - Dara-e-Suf-e-Payin + * * `AF1905` - Dara-e Suf-e-Bala + * * `AF1903` - Feroznakhchir + * * `AF1902` - Hazrat-e-Sultan + * * `AF1906` - Khuram Wa Sarbagh + * * `AF1907` - Ruy-e-Duab + * * `AG0701` - Codrington - AG0701 + * * `AF1701` - Kunduz + * * `AF1702` - Emamsaheb + * * `AF1704` - Chardarah + * * `AF1706` - Khanabad + * * `AF1705` - Aliabad + * * `AF1707` - Dasht-e-Archi + * * `AF1703` - Qala-e-Zal + * * `AG0201` - Aberdeen - AG0201 + * * `AG0202` - Bendals - AG0202 + * * `AG0203` - Branns Hamlet - AG0203 + * * `AG0204` - Buckleys - AG0204 + * * `AG0205` - Cedar Grove - AG0205 + * * `AG0206` - Cooks Hill - AG0206 + * * `AG0207` - Cooks New Extension - AG0207 + * * `AG0208` - Emanuel - AG0208 + * * `AG0209` - Five Islands - AG0209 + * * `AG0210` - Gamble's Terrace - AG0210 + * * `AG0211` - Golden Grove - AG0211 + * * `AG0212` - Gray Hill - AG0212 + * * `AG0213` - Grays Farm - AG0213 + * * `AG0214` - Green Bay - AG0214 + * * `AG0215` - Nut Grove - AG0215 + * * `AG0216` - Renfrew - AG0216 + * * `AG0217` - Saint John's - AG0217 + * * `AG0218` - Tomlinson - AG0218 + * * `AG0219` - Upper Gamble's - AG0219 + * * `AG0220` - Villa - AG0220 + * * `AG0221` - Weatherhills - AG0221 + * * `AF0801` - Bazarak + * * `AF0804` - Dara / Ab Shar + * * `AF0805` - Khenj (Hes-e-Awal) + * * `AF0806` - Onaba (Anawa) + * * `AF0807` - Paryan + * * `AF0803` - Rukha + * * `AF0802` - Shutul + * * `AF0704` - Alingar + * * `AF0702` - Alishang + * * `AF0705` - Dawlatshah + * * `AF0701` - Mehtarlam / Bad Pash + * * `AF0703` - Qarghayi + * * `UA0708` - Lutskyi + * * `UA0702` - Volodymyr-Volynskyi + * * `UA0706` - Kovelskyi + * * `UA0704` - Kamin-Kashyrskyi + * * `UA6804` - Khmelnytskyi + * * `UA6806` - Shepetivskyi + * * `UA6802` - Kamianets-Podilskyi + * * `UA2102` - Berehivskyi + * * `UA2108` - Tiachivskyi + * * `UA2112` - Khustskyi + * * `UA2110` - Uzhhorodskyi + * * `UA2106` - Rakhivskyi + * * `UA2104` - Mukachivskyi + * * `UA4604` - Zolochivskyi + * * `UA4606` - Lvivskyi + * * `UA4614` - Yavorivskyi + * * `UA4612` - Chervonohradskyi + * * `UA4610` - Stryiskyi + * * `UA4602` - Drohobytskyi + * * `UA4608` - Sambirskyi + * * `UA1206` - Kryvorizkyi + * * `UA1202` - Dniprovskyi + * * `UA1204` - Kamianskyi + * * `UA1212` - Pavlohradskyi + * * `UA1210` - Novomoskovskyi + * * `UA1208` - Nikopolskyi + * * `UA1214` - Synelnykivskyi + * * `UA8000` - Kyivska + * * `UA5304` - Lubenskyi + * * `UA5302` - Kremenchutskyi + * * `UA5308` - Poltavskyi + * * `UA5306` - Myrhorodskyi + * * `UA7306` - Cnernivetskyi + * * `UA7304` - Dnistrovskyi + * * `UA7302` - Vyzhnytskyi + * * `UA0112` - Kurmanskyi + * * `UA0108` - Yevpatoriiskyi + * * `UA0104` - Bilohirskyi + * * `UA0106` - Dzhankoiskyi + * * `UA0102` - Bakhchysaraiskyi + * * `UA0116` - Simferopolskyi + * * `UA0114` - Perekopskyi + * * `UA0118` - Feodosiiskyi + * * `UA0110` - Kerchynskyi + * * `UA0120` - Yaltynskyi + * * `UA1804` - Zhytomyrskyi + * * `UA1808` - Novohrad-Volynskyi + * * `UA1802` - Berdychivskyi + * * `UA1806` - Korostenskyi + * * `UA4804` - Voznesenskyi + * * `UA4808` - Pervomaiskyi + * * `UA4802` - Bashtanskyi + * * `UA4806` - Mykolaivskyi + * * `UA7102` - Zvenyhorodskyi + * * `UA7108` - Cherkaskyi + * * `UA7104` - Zolotoniskyi + * * `UA7106` - Umanskyi + * * `UA6504` - Henicheskyi + * * `UA6508` - Skadovskyi + * * `UA6502` - Beryslavskyi + * * `UA6510` - Khersonskyi + * * `UA6506` - Kakhovskyi + * * `UA8500` - Sevastopilska + * * `UA6306` - Krasnohradskyi + * * `UA6314` - Chuhuivskyi + * * `UA6310` - Lozivskyi + * * `UA6302` - Bohodukhivskyi + * * `UA6304` - Iziumskyi + * * `UA6308` - Kupianskyi + * * `UA6312` - Kharkivskyi + * * `UA3208` - Buchanskyi + * * `UA3202` - Bilotserkivskyi + * * `UA3210` - Vyshhorodskyi + * * `UA3200` - Chornobylska zona vidchuzhennia + * * `UA3214` - Fastivskyi + * * `UA3212` - Obukhivskyi + * * `UA3204` - Boryspilskyi + * * `UA3206` - Brovarskyi + * * `UA0510` - Tulchynskyi + * * `UA0504` - Haisynskyi + * * `UA0506` - Zhmerynskyi + * * `UA0508` - Mohyliv-Podilskyi + * * `UA0502` - Vinnytskyi + * * `UA0512` - Khmilnytskyi + * * `UA5106` - Bolhradskyi + * * `UA5108` - Izmailskyi + * * `UA5110` - Odeskyi + * * `UA5114` - Rozdilnianskyi + * * `UA5102` - Berezivskyi + * * `UA5112` - Podilskyi + * * `UA5104` - Bilhorod-Dnistrovskyi + * * `UA2302` - Berdianskyi + * * `UA2308` - Melitopolskyi + * * `UA2306` - Zaporizkyi + * * `UA2304` - Vasylivskyi + * * `UA2310` - Polohivskyi + * * `UA1410` - Kalmiuskyi + * * `UA1412` - Kramatorskyi + * * `UA1408` - Donetskyi + * * `UA1404` - Volnovaskyi + * * `UA1414` - Mariupolskyi + * * `UA1402` - Bakhmutskyi + * * `UA1406` - Horlivskyi + * * `UA1416` - Pokrovskyi + * * `UA5604` - Dubenskyi + * * `UA5606` - Rivnenskyi + * * `UA5608` - Sarnenskyi + * * `UA5602` - Varaskyi + * * `UA4402` - Alchevskyi + * * `UA4410` - Svativskyi + * * `UA4412` - Sievierodonetskyi + * * `UA4408` - Rovenkivskyi + * * `UA4404` - Dovzhanskyi + * * `UA4414` - Starobilskyi + * * `UA4406` - Luhanskyi + * * `UA4416` - Shchastynskyi + * * `UA5902` - Konotopskyi + * * `UA5904` - Okhtyrskyi + * * `UA5910` - Shostkynskyi + * * `UA5908` - Sumskyi + * * `UA5906` - Romenskyi + * * `UA6102` - Kremenetskyi + * * `UA6104` - Ternopilskyi + * * `UA6106` - Chortkivskyi + * * `UA7402` - Koriukivskyi + * * `UA7410` - Chernihivskyi + * * `UA7408` - Prylutskyi + * * `UA7406` - Novhorod-Siverskyi + * * `UA7404` - Nizhynskyi + * * `UA3502` - Holovanivskyi + * * `UA3506` - Novoukrainskyi + * * `UA3508` - Oleksandriiskyi + * * `UA3504` - Kropyvnytskyi + * * `UA2610` - Kosivskyi + * * `UA2608` - Kolomyiskyi + * * `UA2612` - Nadvirnianskyi + * * `UA2604` - Ivano-Frankivskyi + * * `UA2602` - Verkhovynskyi + * * `UA2606` - Kaluskyi + */ +export enum Admin2Enum { + AF0904 = 'AF0904', + AF0903 = 'AF0903', + AF0906 = 'AF0906', + AF0912 = 'AF0912', + AF0908 = 'AF0908', + AF0902 = 'AF0902', + AF0910 = 'AF0910', + AF0915 = 'AF0915', + AF0914 = 'AF0914', + AF0907 = 'AF0907', + AF0913 = 'AF0913', + AF0909 = 'AF0909', + AF0905 = 'AF0905', + AF0911 = 'AF0911', + AF0901 = 'AF0901', + AF2905 = 'AF2905', + AF2904 = 'AF2904', + AF2903 = 'AF2903', + AF2906 = 'AF2906', + AF2907 = 'AF2907', + AF2901 = 'AF2901', + AF2902 = 'AF2902', + AF1811 = 'AF1811', + AF1805 = 'AF1805', + AF1807 = 'AF1807', + AF1813 = 'AF1813', + AF1815 = 'AF1815', + AF1809 = 'AF1809', + AF1814 = 'AF1814', + AF1803 = 'AF1803', + AF1801 = 'AF1801', + AF1812 = 'AF1812', + AF1816 = 'AF1816', + AF1806 = 'AF1806', + AF1810 = 'AF1810', + AF1808 = 'AF1808', + AF1802 = 'AF1802', + AF1804 = 'AF1804', + AF2814 = 'AF2814', + AF2812 = 'AF2812', + AF2809 = 'AF2809', + AF2803 = 'AF2803', + AF2808 = 'AF2808', + AF2806 = 'AF2806', + AF2804 = 'AF2804', + AF2802 = 'AF2802', + AF2801 = 'AF2801', + AF2811 = 'AF2811', + AF2805 = 'AF2805', + AF2813 = 'AF2813', + AF2807 = 'AF2807', + AF2810 = 'AF2810', + AF2101 = 'AF2101', + AF2102 = 'AF2102', + AF2104 = 'AF2104', + AF2103 = 'AF2103', + AF2108 = 'AF2108', + AF2107 = 'AF2107', + AF2110 = 'AF2110', + AF2105 = 'AF2105', + AF2106 = 'AF2106', + AF2109 = 'AF2109', + AF1001 = 'AF1001', + AF1006 = 'AF1006', + AF1002 = 'AF1002', + AF1005 = 'AF1005', + AF1007 = 'AF1007', + AF1004 = 'AF1004', + AF1003 = 'AF1003', + AF2202 = 'AF2202', + AF2205 = 'AF2205', + AF2203 = 'AF2203', + AF2208 = 'AF2208', + AF2204 = 'AF2204', + AF2209 = 'AF2209', + AF2207 = 'AF2207', + AF2201 = 'AF2201', + AF2206 = 'AF2206', + AF3109 = 'AF3109', + AF3104 = 'AF3104', + AF3108 = 'AF3108', + AF3110 = 'AF3110', + AF3105 = 'AF3105', + AF3107 = 'AF3107', + AF3102 = 'AF3102', + AF3101 = 'AF3101', + AF3106 = 'AF3106', + AF3111 = 'AF3111', + AF3103 = 'AF3103', + AF2704 = 'AF2704', + AF2708 = 'AF2708', + AF2710 = 'AF2710', + AF2707 = 'AF2707', + AF2711 = 'AF2711', + AF2706 = 'AF2706', + AF2703 = 'AF2703', + AF2709 = 'AF2709', + AF2701 = 'AF2701', + AF2702 = 'AF2702', + AF2705 = 'AF2705', + AF0109 = 'AF0109', + AF0115 = 'AF0115', + AF0114 = 'AF0114', + AF0101 = 'AF0101', + AF0112 = 'AF0112', + AF0113 = 'AF0113', + AF0105 = 'AF0105', + AF0102 = 'AF0102', + AF0107 = 'AF0107', + AF0111 = 'AF0111', + AF0110 = 'AF0110', + AF0106 = 'AF0106', + AF0104 = 'AF0104', + AF0103 = 'AF0103', + AF0108 = 'AF0108', + AF3310 = 'AF3310', + AF3307 = 'AF3307', + AF3316 = 'AF3316', + AF3308 = 'AF3308', + AF3314 = 'AF3314', + AF3304 = 'AF3304', + AF3301 = 'AF3301', + AF3311 = 'AF3311', + AF3303 = 'AF3303', + AF3312 = 'AF3312', + AF3305 = 'AF3305', + AF3315 = 'AF3315', + AF3313 = 'AF3313', + AF3306 = 'AF3306', + AF3309 = 'AF3309', + AF3302 = 'AF3302', + AF3211 = 'AF3211', + AF3210 = 'AF3210', + AF3213 = 'AF3213', + AF3209 = 'AF3209', + AF3201 = 'AF3201', + AF3206 = 'AF3206', + AF3203 = 'AF3203', + AF3202 = 'AF3202', + AF3207 = 'AF3207', + AF3205 = 'AF3205', + AF3204 = 'AF3204', + AF3208 = 'AF3208', + AF3212 = 'AF3212', + AF1119 = 'AF1119', + AF1112 = 'AF1112', + AF1117 = 'AF1117', + AF1115 = 'AF1115', + AF1116 = 'AF1116', + AF1105 = 'AF1105', + AF1106 = 'AF1106', + AF1111 = 'AF1111', + AF1108 = 'AF1108', + AF1104 = 'AF1104', + AF1103 = 'AF1103', + AF1107 = 'AF1107', + AF1118 = 'AF1118', + AF1113 = 'AF1113', + AF1102 = 'AF1102', + AF1101 = 'AF1101', + AF1114 = 'AF1114', + AF1109 = 'AF1109', + AF1110 = 'AF1110', + AF0204 = 'AF0204', + AF0202 = 'AF0202', + AF0206 = 'AF0206', + AF0207 = 'AF0207', + AF0203 = 'AF0203', + AF0201 = 'AF0201', + AF0205 = 'AF0205', + AF2609 = 'AF2609', + AF2611 = 'AF2611', + AF2605 = 'AF2605', + AF2612 = 'AF2612', + AF2607 = 'AF2607', + AF2613 = 'AF2613', + AF2601 = 'AF2601', + AF2603 = 'AF2603', + AF2604 = 'AF2604', + AF2602 = 'AF2602', + AF2610 = 'AF2610', + AF2606 = 'AF2606', + AF2608 = 'AF2608', + AF3011 = 'AF3011', + AF3009 = 'AF3009', + AF3008 = 'AF3008', + AF3002 = 'AF3002', + AF3003 = 'AF3003', + AF3015 = 'AF3015', + AF3010 = 'AF3010', + AF3016 = 'AF3016', + AF3005 = 'AF3005', + AF3007 = 'AF3007', + AF3014 = 'AF3014', + AF3013 = 'AF3013', + AF3012 = 'AF3012', + AF3006 = 'AF3006', + AF3004 = 'AF3004', + AF3001 = 'AF3001', + AF1521 = 'AF1521', + AF1518 = 'AF1518', + AF1517 = 'AF1517', + AF1516 = 'AF1516', + AF1511 = 'AF1511', + AF1526 = 'AF1526', + AF1506 = 'AF1506', + AF1515 = 'AF1515', + AF1504 = 'AF1504', + AF1508 = 'AF1508', + AF1503 = 'AF1503', + AF1510 = 'AF1510', + AF1525 = 'AF1525', + AF1502 = 'AF1502', + AF1507 = 'AF1507', + AF1523 = 'AF1523', + AF1514 = 'AF1514', + AF1513 = 'AF1513', + AF1524 = 'AF1524', + AF1509 = 'AF1509', + AF1528 = 'AF1528', + AF1522 = 'AF1522', + AF1520 = 'AF1520', + AF1527 = 'AF1527', + AF1505 = 'AF1505', + AF1519 = 'AF1519', + AF1512 = 'AF1512', + AF1501 = 'AF1501', + AF2503 = 'AF2503', + AF2515 = 'AF2515', + AF2518 = 'AF2518', + AF2508 = 'AF2508', + AF2516 = 'AF2516', + AF2502 = 'AF2502', + AF2511 = 'AF2511', + AF2507 = 'AF2507', + AF2509 = 'AF2509', + AF2504 = 'AF2504', + AF2519 = 'AF2519', + AF2510 = 'AF2510', + AF2513 = 'AF2513', + AF2514 = 'AF2514', + AF2506 = 'AF2506', + AF2517 = 'AF2517', + AF2501 = 'AF2501', + AF2505 = 'AF2505', + AF2512 = 'AF2512', + AF0604 = 'AF0604', + AF0616 = 'AF0616', + AF0610 = 'AF0610', + AF0614 = 'AF0614', + AF0601 = 'AF0601', + AF0617 = 'AF0617', + AF0615 = 'AF0615', + AF0602 = 'AF0602', + AF0609 = 'AF0609', + AF0613 = 'AF0613', + AF0622 = 'AF0622', + AF0607 = 'AF0607', + AF0608 = 'AF0608', + AF0620 = 'AF0620', + AF0619 = 'AF0619', + AF0621 = 'AF0621', + AF0612 = 'AF0612', + AF0606 = 'AF0606', + AF0611 = 'AF0611', + AF0618 = 'AF0618', + AF0603 = 'AF0603', + AF0605 = 'AF0605', + AF1408 = 'AF1408', + AF1403 = 'AF1403', + AF1407 = 'AF1407', + AF1402 = 'AF1402', + AF1404 = 'AF1404', + AF1401 = 'AF1401', + AF1405 = 'AF1405', + AF1406 = 'AF1406', + AF3403 = 'AF3403', + AF3402 = 'AF3402', + AF3405 = 'AF3405', + AF3404 = 'AF3404', + AF3401 = 'AF3401', + AF1203 = 'AF1203', + AF1208 = 'AF1208', + AF1210 = 'AF1210', + AF1211 = 'AF1211', + AF1201 = 'AF1201', + AF1205 = 'AF1205', + AF1207 = 'AF1207', + AF1202 = 'AF1202', + AF1206 = 'AF1206', + AF1204 = 'AF1204', + AF1209 = 'AF1209', + AF1306 = 'AF1306', + AF1304 = 'AF1304', + AF1315 = 'AF1315', + AF1303 = 'AF1303', + AF1301 = 'AF1301', + AF1311 = 'AF1311', + AF1313 = 'AF1313', + AF1307 = 'AF1307', + AF1305 = 'AF1305', + AF1314 = 'AF1314', + AF1302 = 'AF1302', + AF1310 = 'AF1310', + AF1308 = 'AF1308', + AF1312 = 'AF1312', + AF1309 = 'AF1309', + AF2302 = 'AF2302', + AF2304 = 'AF2304', + AF2305 = 'AF2305', + AF2303 = 'AF2303', + AF2301 = 'AF2301', + AF2006 = 'AF2006', + AF2003 = 'AF2003', + AF2005 = 'AF2005', + AF2007 = 'AF2007', + AF2001 = 'AF2001', + AF2002 = 'AF2002', + AF2004 = 'AF2004', + AF1604 = 'AF1604', + AF1610 = 'AF1610', + AF1605 = 'AF1605', + AF1617 = 'AF1617', + AF1613 = 'AF1613', + AF1615 = 'AF1615', + AF1607 = 'AF1607', + AF1602 = 'AF1602', + AF1608 = 'AF1608', + AF1612 = 'AF1612', + AF1606 = 'AF1606', + AF1609 = 'AF1609', + AF1601 = 'AF1601', + AF1616 = 'AF1616', + AF1614 = 'AF1614', + AF1611 = 'AF1611', + AF1603 = 'AF1603', + AG0601 = 'AG0601', + AG0602 = 'AG0602', + AG0603 = 'AG0603', + AG0604 = 'AG0604', + AG0605 = 'AG0605', + AG0606 = 'AG0606', + AG0607 = 'AG0607', + AG0608 = 'AG0608', + AG0612 = 'AG0612', + AG0609 = 'AG0609', + AG0610 = 'AG0610', + AG0611 = 'AG0611', + AG0613 = 'AG0613', + AG0614 = 'AG0614', + AF0403 = 'AF0403', + AF0404 = 'AF0404', + AF0406 = 'AF0406', + AF0402 = 'AF0402', + AF0408 = 'AF0408', + AF0401 = 'AF0401', + AF0407 = 'AF0407', + AF0405 = 'AF0405', + AF0409 = 'AF0409', + AG0801 = 'AG0801', + AF2409 = 'AF2409', + AF2408 = 'AF2408', + AF2407 = 'AF2407', + AF2403 = 'AF2403', + AF2411 = 'AF2411', + AF2401 = 'AF2401', + AF2406 = 'AF2406', + AF2405 = 'AF2405', + AF2410 = 'AF2410', + AF2404 = 'AF2404', + AF2402 = 'AF2402', + AF0503 = 'AF0503', + AF0501 = 'AF0501', + AF0507 = 'AF0507', + AF0504 = 'AF0504', + AF0506 = 'AF0506', + AF0502 = 'AF0502', + AF0505 = 'AF0505', + AG0501 = 'AG0501', + AG0502 = 'AG0502', + AG0503 = 'AG0503', + AG0504 = 'AG0504', + AG0505 = 'AG0505', + AG0506 = 'AG0506', + AG0507 = 'AG0507', + AG0508 = 'AG0508', + AF0309 = 'AF0309', + AF0304 = 'AF0304', + AF0301 = 'AF0301', + AF0307 = 'AF0307', + AF0302 = 'AF0302', + AF0308 = 'AF0308', + AF0306 = 'AF0306', + AF0305 = 'AF0305', + AF0303 = 'AF0303', + AF0310 = 'AF0310', + AG0301 = 'AG0301', + AG0302 = 'AG0302', + AG0303 = 'AG0303', + AG0304 = 'AG0304', + AG0305 = 'AG0305', + AG0306 = 'AG0306', + AG0307 = 'AG0307', + AG0308 = 'AG0308', + AG0309 = 'AG0309', + AG0310 = 'AG0310', + AG0311 = 'AG0311', + AG0312 = 'AG0312', + AG0313 = 'AG0313', + AG0314 = 'AG0314', + AG0315 = 'AG0315', + AG0316 = 'AG0316', + AG0317 = 'AG0317', + AG0318 = 'AG0318', + AG0319 = 'AG0319', + AG0401 = 'AG0401', + AG0402 = 'AG0402', + AG0403 = 'AG0403', + AG0404 = 'AG0404', + AG0405 = 'AG0405', + AG0406 = 'AG0406', + AG0407 = 'AG0407', + AG0408 = 'AG0408', + AG0409 = 'AG0409', + AG0410 = 'AG0410', + AG0101 = 'AG0101', + AG0102 = 'AG0102', + AG0103 = 'AG0103', + AG0104 = 'AG0104', + AG0105 = 'AG0105', + AG0106 = 'AG0106', + AG0107 = 'AG0107', + AG0108 = 'AG0108', + AG0109 = 'AG0109', + AG0110 = 'AG0110', + AG0111 = 'AG0111', + AG0112 = 'AG0112', + AG0113 = 'AG0113', + AG0114 = 'AG0114', + AF1901 = 'AF1901', + AF1904 = 'AF1904', + AF1905 = 'AF1905', + AF1903 = 'AF1903', + AF1902 = 'AF1902', + AF1906 = 'AF1906', + AF1907 = 'AF1907', + AG0701 = 'AG0701', + AF1701 = 'AF1701', + AF1702 = 'AF1702', + AF1704 = 'AF1704', + AF1706 = 'AF1706', + AF1705 = 'AF1705', + AF1707 = 'AF1707', + AF1703 = 'AF1703', + AG0201 = 'AG0201', + AG0202 = 'AG0202', + AG0203 = 'AG0203', + AG0204 = 'AG0204', + AG0205 = 'AG0205', + AG0206 = 'AG0206', + AG0207 = 'AG0207', + AG0208 = 'AG0208', + AG0209 = 'AG0209', + AG0210 = 'AG0210', + AG0211 = 'AG0211', + AG0212 = 'AG0212', + AG0213 = 'AG0213', + AG0214 = 'AG0214', + AG0215 = 'AG0215', + AG0216 = 'AG0216', + AG0217 = 'AG0217', + AG0218 = 'AG0218', + AG0219 = 'AG0219', + AG0220 = 'AG0220', + AG0221 = 'AG0221', + AF0801 = 'AF0801', + AF0804 = 'AF0804', + AF0805 = 'AF0805', + AF0806 = 'AF0806', + AF0807 = 'AF0807', + AF0803 = 'AF0803', + AF0802 = 'AF0802', + AF0704 = 'AF0704', + AF0702 = 'AF0702', + AF0705 = 'AF0705', + AF0701 = 'AF0701', + AF0703 = 'AF0703', + UA0708 = 'UA0708', + UA0702 = 'UA0702', + UA0706 = 'UA0706', + UA0704 = 'UA0704', + UA6804 = 'UA6804', + UA6806 = 'UA6806', + UA6802 = 'UA6802', + UA2102 = 'UA2102', + UA2108 = 'UA2108', + UA2112 = 'UA2112', + UA2110 = 'UA2110', + UA2106 = 'UA2106', + UA2104 = 'UA2104', + UA4604 = 'UA4604', + UA4606 = 'UA4606', + UA4614 = 'UA4614', + UA4612 = 'UA4612', + UA4610 = 'UA4610', + UA4602 = 'UA4602', + UA4608 = 'UA4608', + UA1206 = 'UA1206', + UA1202 = 'UA1202', + UA1204 = 'UA1204', + UA1212 = 'UA1212', + UA1210 = 'UA1210', + UA1208 = 'UA1208', + UA1214 = 'UA1214', + UA8000 = 'UA8000', + UA5304 = 'UA5304', + UA5302 = 'UA5302', + UA5308 = 'UA5308', + UA5306 = 'UA5306', + UA7306 = 'UA7306', + UA7304 = 'UA7304', + UA7302 = 'UA7302', + UA0112 = 'UA0112', + UA0108 = 'UA0108', + UA0104 = 'UA0104', + UA0106 = 'UA0106', + UA0102 = 'UA0102', + UA0116 = 'UA0116', + UA0114 = 'UA0114', + UA0118 = 'UA0118', + UA0110 = 'UA0110', + UA0120 = 'UA0120', + UA1804 = 'UA1804', + UA1808 = 'UA1808', + UA1802 = 'UA1802', + UA1806 = 'UA1806', + UA4804 = 'UA4804', + UA4808 = 'UA4808', + UA4802 = 'UA4802', + UA4806 = 'UA4806', + UA7102 = 'UA7102', + UA7108 = 'UA7108', + UA7104 = 'UA7104', + UA7106 = 'UA7106', + UA6504 = 'UA6504', + UA6508 = 'UA6508', + UA6502 = 'UA6502', + UA6510 = 'UA6510', + UA6506 = 'UA6506', + UA8500 = 'UA8500', + UA6306 = 'UA6306', + UA6314 = 'UA6314', + UA6310 = 'UA6310', + UA6302 = 'UA6302', + UA6304 = 'UA6304', + UA6308 = 'UA6308', + UA6312 = 'UA6312', + UA3208 = 'UA3208', + UA3202 = 'UA3202', + UA3210 = 'UA3210', + UA3200 = 'UA3200', + UA3214 = 'UA3214', + UA3212 = 'UA3212', + UA3204 = 'UA3204', + UA3206 = 'UA3206', + UA0510 = 'UA0510', + UA0504 = 'UA0504', + UA0506 = 'UA0506', + UA0508 = 'UA0508', + UA0502 = 'UA0502', + UA0512 = 'UA0512', + UA5106 = 'UA5106', + UA5108 = 'UA5108', + UA5110 = 'UA5110', + UA5114 = 'UA5114', + UA5102 = 'UA5102', + UA5112 = 'UA5112', + UA5104 = 'UA5104', + UA2302 = 'UA2302', + UA2308 = 'UA2308', + UA2306 = 'UA2306', + UA2304 = 'UA2304', + UA2310 = 'UA2310', + UA1410 = 'UA1410', + UA1412 = 'UA1412', + UA1408 = 'UA1408', + UA1404 = 'UA1404', + UA1414 = 'UA1414', + UA1402 = 'UA1402', + UA1406 = 'UA1406', + UA1416 = 'UA1416', + UA5604 = 'UA5604', + UA5606 = 'UA5606', + UA5608 = 'UA5608', + UA5602 = 'UA5602', + UA4402 = 'UA4402', + UA4410 = 'UA4410', + UA4412 = 'UA4412', + UA4408 = 'UA4408', + UA4404 = 'UA4404', + UA4414 = 'UA4414', + UA4406 = 'UA4406', + UA4416 = 'UA4416', + UA5902 = 'UA5902', + UA5904 = 'UA5904', + UA5910 = 'UA5910', + UA5908 = 'UA5908', + UA5906 = 'UA5906', + UA6102 = 'UA6102', + UA6104 = 'UA6104', + UA6106 = 'UA6106', + UA7402 = 'UA7402', + UA7410 = 'UA7410', + UA7408 = 'UA7408', + UA7406 = 'UA7406', + UA7404 = 'UA7404', + UA3502 = 'UA3502', + UA3506 = 'UA3506', + UA3508 = 'UA3508', + UA3504 = 'UA3504', + UA2610 = 'UA2610', + UA2608 = 'UA2608', + UA2612 = 'UA2612', + UA2604 = 'UA2604', + UA2602 = 'UA2602', + UA2606 = 'UA2606', +} diff --git a/src/frontend/generated/models/Admin3Enum.ts b/src/frontend/generated/models/Admin3Enum.ts new file mode 100644 index 0000000000..5964fe239f --- /dev/null +++ b/src/frontend/generated/models/Admin3Enum.ts @@ -0,0 +1,486 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `UA0112065` - Stakhanovska + * * `UA0112001` - Abrykosivska + * * `UA0112067` - Stepnivska + * * `UA0112015` - Kalininska + * * `UA0112069` - Susaninska + * * `UA0112003` - Amurska + * * `UA0112071` - Chernovska + * * `UA0112005` - Voikovska + * * `UA0112073` - Yantarnenska + * * `UA0112017` - Kalininska + * * `UA0112007` - Voskhodnenska + * * `UA0112025` - Kotelnykivska + * * `UA0112009` - Hvardiiska + * * `UA0112011` - Hryshynska + * * `UA0112013` - Zernivska + * * `UA0112021` - Kolodiazianska + * * `UA0112019` - Klepyninska + * * `UA0112023` - Kormivska + * * `UA0112027` - Krasnohvardiiska + * * `UA0112029` - Krasnoznamianska + * * `UA0112031` - Krestianivska + * * `UA0112033` - Leninska + * * `UA0112035` - Marianivska + * * `UA0112037` - Naidonivska + * * `UA0112039` - Novopokrovska + * * `UA0112041` - Oktiabrska + * * `UA0112043` - Oktiabrska + * * `UA0112045` - Oleksandrivska + * * `UA0112047` - Oleksiivska + * * `UA0112049` - Ostrovska + * * `UA0112051` - Piatykhatska + * * `UA0112053` - Pervomaiska + * * `UA0112055` - Petrivska + * * `UA0112057` - Poltavska + * * `UA0112059` - Pravdivska + * * `UA0112061` - Rivnivska + * * `UA0112063` - Sarybashivska + * * `UA0108079` - Shtormivska + * * `UA0108053` - Novofedorivska + * * `UA0108021` - Ivanivska + * * `UA0108003` - Veselivska + * * `UA0108001` - Veresaievska + * * `UA0108019` - Zernivska + * * `UA0108009` - Heroiska + * * `UA0108005` - Vynohradivska + * * `UA0108007` - Vorobiovska + * * `UA0108017` - Zaozernenska + * * `UA0108013` - Dobrushynska + * * `UA0108015` - Yevpatoriiska + * * `UA0108051` - Novosilska + * * `UA0108033` - Krymska + * * `UA0108025` - Koltsovska + * * `UA0108023` - Kirovska + * * `UA0108031` - Krasnoiarska + * * `UA0108027` - Krainenska + * * `UA0108029` - Krasnopolianska + * * `UA0108049` - Novoozernivska + * * `UA0108039` - Myrnivska + * * `UA0108035` - Lisnivska + * * `UA0108037` - Medvedivska + * * `UA0108047` - Novoivanivska + * * `UA0108041` - Mytiaivska + * * `UA0108045` - Molochnenska + * * `UA0108069` - Stovpivska + * * `UA0108059` - Orikhivska + * * `UA0108055` - Okunivska + * * `UA0108057` - Olenivska + * * `UA0108067` - Syzivska + * * `UA0108061` - Okhotnykivska + * * `UA0108065` - Sakska + * * `UA0108075` - Frunzenska + * * `UA0108071` - Suvorovska + * * `UA0108073` - Uiutnenska + * * `UA0108077` - Chornomorska + * * `UA0108063` - Romashkinska + * * `UA0108043` - Mizhvodnenska + * * `UA0108011` - Dalekivska + * * `UA0104043` - Mytrofanivska + * * `UA0104001` - Aromatnivska + * * `UA0104003` - Bahativska + * * `UA0104007` - Vasylivska + * * `UA0104005` - Bilohirska + * * `UA0104011` - Drofynska + * * `UA0104013` - Zheliabovska + * * `UA0104009` - Vyshenska + * * `UA0104015` - Zhemchuzhynska + * * `UA0104017` - Zelenohirska + * * `UA0104019` - Zemlianychnenska + * * `UA0104021` - Zybynska + * * `UA0104035` - Krynychnenska + * * `UA0104029` - Izobilnenska + * * `UA0104031` - Kistochkivska + * * `UA0104033` - Krymskorozivska + * * `UA0104027` - Ivanivska + * * `UA0104037` - Kurska + * * `UA0104025` - Zuiska + * * `UA0104023` - Zorkinska + * * `UA0104041` - Melnychna + * * `UA0104063` - Rusakivska + * * `UA0104061` - Pshenychnenska + * * `UA0104045` - Mykhailivska + * * `UA0104059` - Okhotska + * * `UA0104051` - Nyzhnohirska + * * `UA0104049` - Muromska + * * `UA0104057` - Omelianivska + * * `UA0104055` - Novozhylivska + * * `UA0104069` - Tsvitochnenska + * * `UA0104067` - Uvarivska + * * `UA0104065` - Sadova + * * `UA0104071` - Chkalovska + * * `UA0104075` - Yakymivska + * * `UA0104039` - Lystvynska + * * `UA0104073` - Chornopilska + * * `UA0104053` - Novohryhorivska + * * `UA0104047` - Michurinska + * * `UA0106049` - Tsilynna + * * `UA0106047` - Tabachnenska + * * `UA0106045` - Stalnenska + * * `UA0106011` - Zarichnenska + * * `UA0106009` - Zavito-Leninska + * * `UA0106001` - Azovska + * * `UA0106007` - Yermakivska + * * `UA0106005` - Dzhankoiska + * * `UA0106043` - Svitlivska + * * `UA0106029` - Myrnivska + * * `UA0106019` - Lobanivska + * * `UA0106015` - Kindrativska + * * `UA0106017` - Krymkivska + * * `UA0106027` - Medvedivska + * * `UA0106021` - Luhanska + * * `UA0106025` - Maslivska + * * `UA0106041` - Roshchynska + * * `UA0106035` - Pobiednenska + * * `UA0106033` - Pakharivska + * * `UA0106039` - Rozkishnenska + * * `UA0106037` - Prostornenska + * * `UA0106013` - Izumrudnivska + * * `UA0106053` - Yarkivska + * * `UA0106051` - Chaikynska + * * `UA0106057` - Yasnopolianska + * * `UA0106055` - Yarkopolenska + * * `UA0106031` - Novokrymska + * * `UA0106023` - Maiska + * * `UA0106003` - Vilnenska + * * `UA0102003` - Aromatnenska + * * `UA0102000` - Sevastopilska + * * `UA0102009` - Verkhorichenska + * * `UA0102005` - Bakhchysaraiska + * * `UA0102011` - Vilinska + * * `UA0102017` - Zaliznychnenska + * * `UA0102013` - Holubynska + * * `UA0102015` - Dolynnenska + * * `UA0102019` - Zelenivska + * * `UA0102033` - Pishchanivska + * * `UA0102025` - Kashtanivska + * * `UA0102029` - Kuibyshevska + * * `UA0102027` - Krasnomatska + * * `UA0102039` - Skalystivska + * * `UA0102035` - Plodivska + * * `UA0102037` - Poshtivska + * * `UA0102041` - Tabachnenska + * * `UA0102045` - Tinystivska + * * `UA0102047` - Uhlivska + * * `UA0116041` - Urozhainivska + * * `UA0116001` - Hvardiiska + * * `UA0116003` - Hresivska + * * `UA0116005` - Dobrivska + * * `UA0116007` - Donska + * * `UA0116009` - Zhuravlivska + * * `UA0116011` - Kolchuhynska + * * `UA0116013` - Mazanska + * * `UA0116015` - Mykolaivska + * * `UA0116017` - Myrnivska + * * `UA0116019` - Molodizhnenska + * * `UA0116021` - Novoandriivska + * * `UA0116023` - Novoselivska + * * `UA0116025` - Pervomaiska + * * `UA0116027` - Perovska + * * `UA0116029` - Pozharska + * * `UA0116031` - Rodnykivska + * * `UA0116033` - Simferopolska + * * `UA0116035` - Skvortsivska + * * `UA0116037` - Trudivska + * * `UA0116039` - Ukromnivska + * * `UA0114017` - Ishunska + * * `UA0114015` - Illinska + * * `UA0114037` - Rozdolnenska + * * `UA0114001` - Armianska + * * `UA0114021` - Krasnoarmiiska + * * `UA0114033` - Orlivska + * * `UA0114003` - Berezivska + * * `UA0114005` - Botanichna + * * `UA0114007` - Bratska + * * `UA0114011` - Voinska + * * `UA0114031` - Novoselivska + * * `UA0114013` - Zymynska + * * `UA0114029` - Novopavlivska + * * `UA0114035` - Pochetnenska + * * `UA0114019` - Kovylnivska + * * `UA0114023` - Krasnoperekopska + * * `UA0114025` - Kukushkinska + * * `UA0114027` - Mahazynska + * * `UA0114039` - Ruchivska + * * `UA0114041` - Serebrianska + * * `UA0114043` - Slavnivska + * * `UA0114045` - Slovianska + * * `UA0114047` - Sovkhoznenska + * * `UA0114049` - Suvorovska + * * `UA0114051` - Filativska + * * `UA0114053` - Chernyshivska + * * `UA0114009` - Vyshnivska + * * `UA0110027` - Leninska + * * `UA0110003` - Batalnenska + * * `UA0110011` - Hlazivska + * * `UA0110029` - Leninska + * * `UA0110039` - Novomykolaivska + * * `UA0110031` - Luhivska + * * `UA0110013` - Hornostaivska + * * `UA0110033` - Marivska + * * `UA0110035` - Marfivska + * * `UA0110015` - Zavitnenska + * * `UA0110037` - Mysivska + * * `UA0110017` - Illichivska + * * `UA0110041` - Oktiabrska + * * `UA0110005` - Bielinska + * * `UA0110019` - Kalynivska + * * `UA0110043` - Ostaninska + * * `UA0110007` - Vynohradnenska + * * `UA0110045` - Pryozernivska + * * `UA0110047` - Semysotska + * * `UA0110021` - Kerchenska + * * `UA0110049` - Uvarivska + * * `UA0110051` - Cheliadinivska + * * `UA0110001` - Baherivska + * * `UA0110023` - Kirovska + * * `UA0110053` - Chystopilska + * * `UA0110009` - Voikovska + * * `UA0110025` - Krasnohirska + * * `UA0110055` - Shcholkinska + */ +export enum Admin3Enum { + UA0112065 = 'UA0112065', + UA0112001 = 'UA0112001', + UA0112067 = 'UA0112067', + UA0112015 = 'UA0112015', + UA0112069 = 'UA0112069', + UA0112003 = 'UA0112003', + UA0112071 = 'UA0112071', + UA0112005 = 'UA0112005', + UA0112073 = 'UA0112073', + UA0112017 = 'UA0112017', + UA0112007 = 'UA0112007', + UA0112025 = 'UA0112025', + UA0112009 = 'UA0112009', + UA0112011 = 'UA0112011', + UA0112013 = 'UA0112013', + UA0112021 = 'UA0112021', + UA0112019 = 'UA0112019', + UA0112023 = 'UA0112023', + UA0112027 = 'UA0112027', + UA0112029 = 'UA0112029', + UA0112031 = 'UA0112031', + UA0112033 = 'UA0112033', + UA0112035 = 'UA0112035', + UA0112037 = 'UA0112037', + UA0112039 = 'UA0112039', + UA0112041 = 'UA0112041', + UA0112043 = 'UA0112043', + UA0112045 = 'UA0112045', + UA0112047 = 'UA0112047', + UA0112049 = 'UA0112049', + UA0112051 = 'UA0112051', + UA0112053 = 'UA0112053', + UA0112055 = 'UA0112055', + UA0112057 = 'UA0112057', + UA0112059 = 'UA0112059', + UA0112061 = 'UA0112061', + UA0112063 = 'UA0112063', + UA0108079 = 'UA0108079', + UA0108053 = 'UA0108053', + UA0108021 = 'UA0108021', + UA0108003 = 'UA0108003', + UA0108001 = 'UA0108001', + UA0108019 = 'UA0108019', + UA0108009 = 'UA0108009', + UA0108005 = 'UA0108005', + UA0108007 = 'UA0108007', + UA0108017 = 'UA0108017', + UA0108013 = 'UA0108013', + UA0108015 = 'UA0108015', + UA0108051 = 'UA0108051', + UA0108033 = 'UA0108033', + UA0108025 = 'UA0108025', + UA0108023 = 'UA0108023', + UA0108031 = 'UA0108031', + UA0108027 = 'UA0108027', + UA0108029 = 'UA0108029', + UA0108049 = 'UA0108049', + UA0108039 = 'UA0108039', + UA0108035 = 'UA0108035', + UA0108037 = 'UA0108037', + UA0108047 = 'UA0108047', + UA0108041 = 'UA0108041', + UA0108045 = 'UA0108045', + UA0108069 = 'UA0108069', + UA0108059 = 'UA0108059', + UA0108055 = 'UA0108055', + UA0108057 = 'UA0108057', + UA0108067 = 'UA0108067', + UA0108061 = 'UA0108061', + UA0108065 = 'UA0108065', + UA0108075 = 'UA0108075', + UA0108071 = 'UA0108071', + UA0108073 = 'UA0108073', + UA0108077 = 'UA0108077', + UA0108063 = 'UA0108063', + UA0108043 = 'UA0108043', + UA0108011 = 'UA0108011', + UA0104043 = 'UA0104043', + UA0104001 = 'UA0104001', + UA0104003 = 'UA0104003', + UA0104007 = 'UA0104007', + UA0104005 = 'UA0104005', + UA0104011 = 'UA0104011', + UA0104013 = 'UA0104013', + UA0104009 = 'UA0104009', + UA0104015 = 'UA0104015', + UA0104017 = 'UA0104017', + UA0104019 = 'UA0104019', + UA0104021 = 'UA0104021', + UA0104035 = 'UA0104035', + UA0104029 = 'UA0104029', + UA0104031 = 'UA0104031', + UA0104033 = 'UA0104033', + UA0104027 = 'UA0104027', + UA0104037 = 'UA0104037', + UA0104025 = 'UA0104025', + UA0104023 = 'UA0104023', + UA0104041 = 'UA0104041', + UA0104063 = 'UA0104063', + UA0104061 = 'UA0104061', + UA0104045 = 'UA0104045', + UA0104059 = 'UA0104059', + UA0104051 = 'UA0104051', + UA0104049 = 'UA0104049', + UA0104057 = 'UA0104057', + UA0104055 = 'UA0104055', + UA0104069 = 'UA0104069', + UA0104067 = 'UA0104067', + UA0104065 = 'UA0104065', + UA0104071 = 'UA0104071', + UA0104075 = 'UA0104075', + UA0104039 = 'UA0104039', + UA0104073 = 'UA0104073', + UA0104053 = 'UA0104053', + UA0104047 = 'UA0104047', + UA0106049 = 'UA0106049', + UA0106047 = 'UA0106047', + UA0106045 = 'UA0106045', + UA0106011 = 'UA0106011', + UA0106009 = 'UA0106009', + UA0106001 = 'UA0106001', + UA0106007 = 'UA0106007', + UA0106005 = 'UA0106005', + UA0106043 = 'UA0106043', + UA0106029 = 'UA0106029', + UA0106019 = 'UA0106019', + UA0106015 = 'UA0106015', + UA0106017 = 'UA0106017', + UA0106027 = 'UA0106027', + UA0106021 = 'UA0106021', + UA0106025 = 'UA0106025', + UA0106041 = 'UA0106041', + UA0106035 = 'UA0106035', + UA0106033 = 'UA0106033', + UA0106039 = 'UA0106039', + UA0106037 = 'UA0106037', + UA0106013 = 'UA0106013', + UA0106053 = 'UA0106053', + UA0106051 = 'UA0106051', + UA0106057 = 'UA0106057', + UA0106055 = 'UA0106055', + UA0106031 = 'UA0106031', + UA0106023 = 'UA0106023', + UA0106003 = 'UA0106003', + UA0102003 = 'UA0102003', + UA0102000 = 'UA0102000', + UA0102009 = 'UA0102009', + UA0102005 = 'UA0102005', + UA0102011 = 'UA0102011', + UA0102017 = 'UA0102017', + UA0102013 = 'UA0102013', + UA0102015 = 'UA0102015', + UA0102019 = 'UA0102019', + UA0102033 = 'UA0102033', + UA0102025 = 'UA0102025', + UA0102029 = 'UA0102029', + UA0102027 = 'UA0102027', + UA0102039 = 'UA0102039', + UA0102035 = 'UA0102035', + UA0102037 = 'UA0102037', + UA0102041 = 'UA0102041', + UA0102045 = 'UA0102045', + UA0102047 = 'UA0102047', + UA0116041 = 'UA0116041', + UA0116001 = 'UA0116001', + UA0116003 = 'UA0116003', + UA0116005 = 'UA0116005', + UA0116007 = 'UA0116007', + UA0116009 = 'UA0116009', + UA0116011 = 'UA0116011', + UA0116013 = 'UA0116013', + UA0116015 = 'UA0116015', + UA0116017 = 'UA0116017', + UA0116019 = 'UA0116019', + UA0116021 = 'UA0116021', + UA0116023 = 'UA0116023', + UA0116025 = 'UA0116025', + UA0116027 = 'UA0116027', + UA0116029 = 'UA0116029', + UA0116031 = 'UA0116031', + UA0116033 = 'UA0116033', + UA0116035 = 'UA0116035', + UA0116037 = 'UA0116037', + UA0116039 = 'UA0116039', + UA0114017 = 'UA0114017', + UA0114015 = 'UA0114015', + UA0114037 = 'UA0114037', + UA0114001 = 'UA0114001', + UA0114021 = 'UA0114021', + UA0114033 = 'UA0114033', + UA0114003 = 'UA0114003', + UA0114005 = 'UA0114005', + UA0114007 = 'UA0114007', + UA0114011 = 'UA0114011', + UA0114031 = 'UA0114031', + UA0114013 = 'UA0114013', + UA0114029 = 'UA0114029', + UA0114035 = 'UA0114035', + UA0114019 = 'UA0114019', + UA0114023 = 'UA0114023', + UA0114025 = 'UA0114025', + UA0114027 = 'UA0114027', + UA0114039 = 'UA0114039', + UA0114041 = 'UA0114041', + UA0114043 = 'UA0114043', + UA0114045 = 'UA0114045', + UA0114047 = 'UA0114047', + UA0114049 = 'UA0114049', + UA0114051 = 'UA0114051', + UA0114053 = 'UA0114053', + UA0114009 = 'UA0114009', + UA0110027 = 'UA0110027', + UA0110003 = 'UA0110003', + UA0110011 = 'UA0110011', + UA0110029 = 'UA0110029', + UA0110039 = 'UA0110039', + UA0110031 = 'UA0110031', + UA0110013 = 'UA0110013', + UA0110033 = 'UA0110033', + UA0110035 = 'UA0110035', + UA0110015 = 'UA0110015', + UA0110037 = 'UA0110037', + UA0110017 = 'UA0110017', + UA0110041 = 'UA0110041', + UA0110005 = 'UA0110005', + UA0110019 = 'UA0110019', + UA0110043 = 'UA0110043', + UA0110007 = 'UA0110007', + UA0110045 = 'UA0110045', + UA0110047 = 'UA0110047', + UA0110021 = 'UA0110021', + UA0110049 = 'UA0110049', + UA0110051 = 'UA0110051', + UA0110001 = 'UA0110001', + UA0110023 = 'UA0110023', + UA0110053 = 'UA0110053', + UA0110009 = 'UA0110009', + UA0110025 = 'UA0110025', + UA0110055 = 'UA0110055', +} diff --git a/src/frontend/generated/models/Admin4Enum.ts b/src/frontend/generated/models/Admin4Enum.ts new file mode 100644 index 0000000000..d88bf70c1a --- /dev/null +++ b/src/frontend/generated/models/Admin4Enum.ts @@ -0,0 +1,5 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type Admin4Enum = boolean; diff --git a/src/frontend/generated/models/Area.ts b/src/frontend/generated/models/Area.ts new file mode 100644 index 0000000000..134759e183 --- /dev/null +++ b/src/frontend/generated/models/Area.ts @@ -0,0 +1,24 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type Area = { + readonly id: string; + readonly created_at: string; + readonly updated_at: string; + original_id?: string | null; + name: string; + p_code?: string | null; + geom?: string | null; + point?: string | null; + readonly valid_from: string | null; + valid_until?: string | null; + extras?: any; + readonly lft: number; + readonly rght: number; + readonly tree_id: number; + readonly level: number; + parent?: string | null; + area_type: string; +}; + diff --git a/src/frontend/generated/models/AreaList.ts b/src/frontend/generated/models/AreaList.ts new file mode 100644 index 0000000000..04e29322db --- /dev/null +++ b/src/frontend/generated/models/AreaList.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type AreaList = { + readonly id: string; + name: string; + p_code?: string | null; +}; + diff --git a/src/frontend/generated/models/AreaType.ts b/src/frontend/generated/models/AreaType.ts new file mode 100644 index 0000000000..3e7579f7cc --- /dev/null +++ b/src/frontend/generated/models/AreaType.ts @@ -0,0 +1,22 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type AreaType = { + readonly id: string; + readonly created_at: string; + readonly updated_at: string; + original_id?: string | null; + name: string; + area_level?: number; + readonly valid_from: string | null; + valid_until?: string | null; + extras?: any; + readonly lft: number; + readonly rght: number; + readonly tree_id: number; + readonly level: number; + country: string; + parent?: string | null; +}; + diff --git a/src/frontend/generated/models/BeneficiaryGroup.ts b/src/frontend/generated/models/BeneficiaryGroup.ts new file mode 100644 index 0000000000..fe1eaf3111 --- /dev/null +++ b/src/frontend/generated/models/BeneficiaryGroup.ts @@ -0,0 +1,14 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type BeneficiaryGroup = { + readonly id: string; + name: string; + group_label: string; + group_label_plural: string; + member_label: string; + member_label_plural: string; + master_detail?: boolean; +}; + diff --git a/src/frontend/generated/models/BlankEnum.ts b/src/frontend/generated/models/BlankEnum.ts new file mode 100644 index 0000000000..80941d70af --- /dev/null +++ b/src/frontend/generated/models/BlankEnum.ts @@ -0,0 +1,7 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export enum BlankEnum { + = '', +} diff --git a/src/frontend/generated/models/BusinessArea.ts b/src/frontend/generated/models/BusinessArea.ts new file mode 100644 index 0000000000..5ac16312d2 --- /dev/null +++ b/src/frontend/generated/models/BusinessArea.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type BusinessArea = { + readonly id: string; + name: string; + code: string; + long_name: string; + slug: string; + parent?: string | null; + is_split?: boolean; + active?: boolean; +}; + diff --git a/src/frontend/generated/models/CollectIndividualDataEnum.ts b/src/frontend/generated/models/CollectIndividualDataEnum.ts new file mode 100644 index 0000000000..68890bffa5 --- /dev/null +++ b/src/frontend/generated/models/CollectIndividualDataEnum.ts @@ -0,0 +1,17 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `` - Unknown + * * `2` - Partial individuals collected + * * `1` - Full individual collected + * * `3` - Size only collected + * * `0` - No individual data + */ +export enum CollectIndividualDataEnum { + _2 = '2', + _1 = '1', + _3 = '3', + _0 = '0', +} diff --git a/src/frontend/generated/models/CollectTypeEnum.ts b/src/frontend/generated/models/CollectTypeEnum.ts new file mode 100644 index 0000000000..46bcbcf5f4 --- /dev/null +++ b/src/frontend/generated/models/CollectTypeEnum.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `STANDARD` - Standard + * * `SINGLE` - Single + */ +export enum CollectTypeEnum { + STANDARD = 'STANDARD', + SINGLE = 'SINGLE', +} diff --git a/src/frontend/generated/models/CommsDisabilityEnum.ts b/src/frontend/generated/models/CommsDisabilityEnum.ts new file mode 100644 index 0000000000..9263cc7947 --- /dev/null +++ b/src/frontend/generated/models/CommsDisabilityEnum.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `` - None + * * `LOT_DIFFICULTY` - A lot of difficulty + * * `CANNOT_DO` - Cannot do at all + * * `SOME_DIFFICULTY` - Some difficulty + */ +export enum CommsDisabilityEnum { + LOT_DIFFICULTY = 'LOT_DIFFICULTY', + CANNOT_DO = 'CANNOT_DO', + SOME_DIFFICULTY = 'SOME_DIFFICULTY', +} diff --git a/src/frontend/generated/models/ConsentSharingEnum.ts b/src/frontend/generated/models/ConsentSharingEnum.ts new file mode 100644 index 0000000000..1ee67f80c3 --- /dev/null +++ b/src/frontend/generated/models/ConsentSharingEnum.ts @@ -0,0 +1,17 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `` - None + * * `GOVERNMENT_PARTNER` - Government partners + * * `HUMANITARIAN_PARTNER` - Humanitarian partners + * * `PRIVATE_PARTNER` - Private partners + * * `UNICEF` - UNICEF + */ +export enum ConsentSharingEnum { + GOVERNMENT_PARTNER = 'GOVERNMENT_PARTNER', + HUMANITARIAN_PARTNER = 'HUMANITARIAN_PARTNER', + PRIVATE_PARTNER = 'PRIVATE_PARTNER', + UNICEF = 'UNICEF', +} diff --git a/src/frontend/generated/models/Country.ts b/src/frontend/generated/models/Country.ts new file mode 100644 index 0000000000..7e9c34356a --- /dev/null +++ b/src/frontend/generated/models/Country.ts @@ -0,0 +1,16 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type Country = { + readonly id: string; + name: string; + short_name: string; + iso_code2: string; + iso_code3: string; + iso_num: string; + readonly valid_from: string | null; + valid_until?: string | null; + readonly updated_at: string; +}; + diff --git a/src/frontend/generated/models/CountryEnum.ts b/src/frontend/generated/models/CountryEnum.ts new file mode 100644 index 0000000000..acc5d5a11d --- /dev/null +++ b/src/frontend/generated/models/CountryEnum.ts @@ -0,0 +1,508 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `AF` - Afghanistan + * * `AX` - Åland Islands + * * `AL` - Albania + * * `DZ` - Algeria + * * `AS` - American Samoa + * * `AD` - Andorra + * * `AO` - Angola + * * `AI` - Anguilla + * * `AQ` - Antarctica + * * `AG` - Antigua and Barbuda + * * `AR` - Argentina + * * `AM` - Armenia + * * `AW` - Aruba + * * `AU` - Australia + * * `AT` - Austria + * * `AZ` - Azerbaijan + * * `BS` - Bahamas + * * `BH` - Bahrain + * * `BD` - Bangladesh + * * `BB` - Barbados + * * `BY` - Belarus + * * `BE` - Belgium + * * `BZ` - Belize + * * `BJ` - Benin + * * `BM` - Bermuda + * * `BT` - Bhutan + * * `BO` - Bolivia + * * `BQ` - Bonaire, Sint Eustatius and Saba + * * `BA` - Bosnia and Herzegovina + * * `BW` - Botswana + * * `BV` - Bouvet Island + * * `BR` - Brazil + * * `IO` - British Indian Ocean Territory + * * `BN` - Brunei + * * `BG` - Bulgaria + * * `BF` - Burkina Faso + * * `BI` - Burundi + * * `CV` - Cabo Verde + * * `KH` - Cambodia + * * `CM` - Cameroon + * * `CA` - Canada + * * `KY` - Cayman Islands + * * `CF` - Central African Republic + * * `TD` - Chad + * * `CL` - Chile + * * `CN` - China + * * `CX` - Christmas Island + * * `CC` - Cocos (Keeling) Islands + * * `CO` - Colombia + * * `KM` - Comoros + * * `CG` - Congo + * * `CD` - Congo (the Democratic Republic of the) + * * `CK` - Cook Islands + * * `CR` - Costa Rica + * * `CI` - Côte d'Ivoire + * * `HR` - Croatia + * * `CU` - Cuba + * * `CW` - Curaçao + * * `CY` - Cyprus + * * `CZ` - Czechia + * * `DK` - Denmark + * * `DJ` - Djibouti + * * `DM` - Dominica + * * `DO` - Dominican Republic + * * `EC` - Ecuador + * * `EG` - Egypt + * * `SV` - El Salvador + * * `GQ` - Equatorial Guinea + * * `ER` - Eritrea + * * `EE` - Estonia + * * `SZ` - Eswatini + * * `ET` - Ethiopia + * * `FK` - Falkland Islands (Malvinas) + * * `FO` - Faroe Islands + * * `FJ` - Fiji + * * `FI` - Finland + * * `FR` - France + * * `GF` - French Guiana + * * `PF` - French Polynesia + * * `TF` - French Southern Territories + * * `GA` - Gabon + * * `GM` - Gambia + * * `GE` - Georgia + * * `DE` - Germany + * * `GH` - Ghana + * * `GI` - Gibraltar + * * `GR` - Greece + * * `GL` - Greenland + * * `GD` - Grenada + * * `GP` - Guadeloupe + * * `GU` - Guam + * * `GT` - Guatemala + * * `GG` - Guernsey + * * `GN` - Guinea + * * `GW` - Guinea-Bissau + * * `GY` - Guyana + * * `HT` - Haiti + * * `HM` - Heard Island and McDonald Islands + * * `VA` - Holy See + * * `HN` - Honduras + * * `HK` - Hong Kong + * * `HU` - Hungary + * * `IS` - Iceland + * * `IN` - India + * * `ID` - Indonesia + * * `IR` - Iran + * * `IQ` - Iraq + * * `IE` - Ireland + * * `IM` - Isle of Man + * * `IL` - Israel + * * `IT` - Italy + * * `JM` - Jamaica + * * `JP` - Japan + * * `JE` - Jersey + * * `JO` - Jordan + * * `KZ` - Kazakhstan + * * `KE` - Kenya + * * `KI` - Kiribati + * * `KW` - Kuwait + * * `KG` - Kyrgyzstan + * * `LA` - Laos + * * `LV` - Latvia + * * `LB` - Lebanon + * * `LS` - Lesotho + * * `LR` - Liberia + * * `LY` - Libya + * * `LI` - Liechtenstein + * * `LT` - Lithuania + * * `LU` - Luxembourg + * * `MO` - Macao + * * `MG` - Madagascar + * * `MW` - Malawi + * * `MY` - Malaysia + * * `MV` - Maldives + * * `ML` - Mali + * * `MT` - Malta + * * `MH` - Marshall Islands + * * `MQ` - Martinique + * * `MR` - Mauritania + * * `MU` - Mauritius + * * `YT` - Mayotte + * * `MX` - Mexico + * * `FM` - Micronesia + * * `MD` - Moldova + * * `MC` - Monaco + * * `MN` - Mongolia + * * `ME` - Montenegro + * * `MS` - Montserrat + * * `MA` - Morocco + * * `MZ` - Mozambique + * * `MM` - Myanmar + * * `NA` - Namibia + * * `NR` - Nauru + * * `NP` - Nepal + * * `NL` - Netherlands + * * `NC` - New Caledonia + * * `NZ` - New Zealand + * * `NI` - Nicaragua + * * `NE` - Niger + * * `NG` - Nigeria + * * `NU` - Niue + * * `NF` - Norfolk Island + * * `KP` - North Korea + * * `MK` - North Macedonia + * * `MP` - Northern Mariana Islands + * * `NO` - Norway + * * `OM` - Oman + * * `PK` - Pakistan + * * `PW` - Palau + * * `PS` - Palestine, State of + * * `PA` - Panama + * * `PG` - Papua New Guinea + * * `PY` - Paraguay + * * `PE` - Peru + * * `PH` - Philippines + * * `PN` - Pitcairn + * * `PL` - Poland + * * `PT` - Portugal + * * `PR` - Puerto Rico + * * `QA` - Qatar + * * `RE` - Réunion + * * `RO` - Romania + * * `RU` - Russia + * * `RW` - Rwanda + * * `BL` - Saint Barthélemy + * * `SH` - Saint Helena, Ascension and Tristan da Cunha + * * `KN` - Saint Kitts and Nevis + * * `LC` - Saint Lucia + * * `MF` - Saint Martin (French part) + * * `PM` - Saint Pierre and Miquelon + * * `VC` - Saint Vincent and the Grenadines + * * `WS` - Samoa + * * `SM` - San Marino + * * `ST` - Sao Tome and Principe + * * `SA` - Saudi Arabia + * * `SN` - Senegal + * * `RS` - Serbia + * * `SC` - Seychelles + * * `SL` - Sierra Leone + * * `SG` - Singapore + * * `SX` - Sint Maarten (Dutch part) + * * `SK` - Slovakia + * * `SI` - Slovenia + * * `SB` - Solomon Islands + * * `SO` - Somalia + * * `ZA` - South Africa + * * `GS` - South Georgia and the South Sandwich Islands + * * `KR` - South Korea + * * `SS` - South Sudan + * * `ES` - Spain + * * `LK` - Sri Lanka + * * `SD` - Sudan + * * `SR` - Suriname + * * `SJ` - Svalbard and Jan Mayen + * * `SE` - Sweden + * * `CH` - Switzerland + * * `SY` - Syria + * * `TW` - Taiwan + * * `TJ` - Tajikistan + * * `TZ` - Tanzania + * * `TH` - Thailand + * * `TL` - Timor-Leste + * * `TG` - Togo + * * `TK` - Tokelau + * * `TO` - Tonga + * * `TT` - Trinidad and Tobago + * * `TN` - Tunisia + * * `TR` - Türkiye + * * `TM` - Turkmenistan + * * `TC` - Turks and Caicos Islands + * * `TV` - Tuvalu + * * `UG` - Uganda + * * `UA` - Ukraine + * * `AE` - United Arab Emirates + * * `GB` - United Kingdom + * * `UM` - United States Minor Outlying Islands + * * `US` - United States of America + * * `U` - Unknown or Not Applicable + * * `UY` - Uruguay + * * `UZ` - Uzbekistan + * * `VU` - Vanuatu + * * `VE` - Venezuela + * * `VN` - Vietnam + * * `VG` - Virgin Islands (British) + * * `VI` - Virgin Islands (U.S.) + * * `WF` - Wallis and Futuna + * * `EH` - Western Sahara + * * `YE` - Yemen + * * `ZM` - Zambia + * * `ZW` - Zimbabwe + */ +export enum CountryEnum { + AF = 'AF', + AX = 'AX', + AL = 'AL', + DZ = 'DZ', + AS = 'AS', + AD = 'AD', + AO = 'AO', + AI = 'AI', + AQ = 'AQ', + AG = 'AG', + AR = 'AR', + AM = 'AM', + AW = 'AW', + AU = 'AU', + AT = 'AT', + AZ = 'AZ', + BS = 'BS', + BH = 'BH', + BD = 'BD', + BB = 'BB', + BY = 'BY', + BE = 'BE', + BZ = 'BZ', + BJ = 'BJ', + BM = 'BM', + BT = 'BT', + BO = 'BO', + BQ = 'BQ', + BA = 'BA', + BW = 'BW', + BV = 'BV', + BR = 'BR', + IO = 'IO', + BN = 'BN', + BG = 'BG', + BF = 'BF', + BI = 'BI', + CV = 'CV', + KH = 'KH', + CM = 'CM', + CA = 'CA', + KY = 'KY', + CF = 'CF', + TD = 'TD', + CL = 'CL', + CN = 'CN', + CX = 'CX', + CC = 'CC', + CO = 'CO', + KM = 'KM', + CG = 'CG', + CD = 'CD', + CK = 'CK', + CR = 'CR', + CI = 'CI', + HR = 'HR', + CU = 'CU', + CW = 'CW', + CY = 'CY', + CZ = 'CZ', + DK = 'DK', + DJ = 'DJ', + DM = 'DM', + DO = 'DO', + EC = 'EC', + EG = 'EG', + SV = 'SV', + GQ = 'GQ', + ER = 'ER', + EE = 'EE', + SZ = 'SZ', + ET = 'ET', + FK = 'FK', + FO = 'FO', + FJ = 'FJ', + FI = 'FI', + FR = 'FR', + GF = 'GF', + PF = 'PF', + TF = 'TF', + GA = 'GA', + GM = 'GM', + GE = 'GE', + DE = 'DE', + GH = 'GH', + GI = 'GI', + GR = 'GR', + GL = 'GL', + GD = 'GD', + GP = 'GP', + GU = 'GU', + GT = 'GT', + GG = 'GG', + GN = 'GN', + GW = 'GW', + GY = 'GY', + HT = 'HT', + HM = 'HM', + VA = 'VA', + HN = 'HN', + HK = 'HK', + HU = 'HU', + IS = 'IS', + IN = 'IN', + ID = 'ID', + IR = 'IR', + IQ = 'IQ', + IE = 'IE', + IM = 'IM', + IL = 'IL', + IT = 'IT', + JM = 'JM', + JP = 'JP', + JE = 'JE', + JO = 'JO', + KZ = 'KZ', + KE = 'KE', + KI = 'KI', + KW = 'KW', + KG = 'KG', + LA = 'LA', + LV = 'LV', + LB = 'LB', + LS = 'LS', + LR = 'LR', + LY = 'LY', + LI = 'LI', + LT = 'LT', + LU = 'LU', + MO = 'MO', + MG = 'MG', + MW = 'MW', + MY = 'MY', + MV = 'MV', + ML = 'ML', + MT = 'MT', + MH = 'MH', + MQ = 'MQ', + MR = 'MR', + MU = 'MU', + YT = 'YT', + MX = 'MX', + FM = 'FM', + MD = 'MD', + MC = 'MC', + MN = 'MN', + ME = 'ME', + MS = 'MS', + MA = 'MA', + MZ = 'MZ', + MM = 'MM', + NA = 'NA', + NR = 'NR', + NP = 'NP', + NL = 'NL', + NC = 'NC', + NZ = 'NZ', + NI = 'NI', + NE = 'NE', + NG = 'NG', + NU = 'NU', + NF = 'NF', + KP = 'KP', + MK = 'MK', + MP = 'MP', + NO = 'NO', + OM = 'OM', + PK = 'PK', + PW = 'PW', + PS = 'PS', + PA = 'PA', + PG = 'PG', + PY = 'PY', + PE = 'PE', + PH = 'PH', + PN = 'PN', + PL = 'PL', + PT = 'PT', + PR = 'PR', + QA = 'QA', + RE = 'RE', + RO = 'RO', + RU = 'RU', + RW = 'RW', + BL = 'BL', + SH = 'SH', + KN = 'KN', + LC = 'LC', + MF = 'MF', + PM = 'PM', + VC = 'VC', + WS = 'WS', + SM = 'SM', + ST = 'ST', + SA = 'SA', + SN = 'SN', + RS = 'RS', + SC = 'SC', + SL = 'SL', + SG = 'SG', + SX = 'SX', + SK = 'SK', + SI = 'SI', + SB = 'SB', + SO = 'SO', + ZA = 'ZA', + GS = 'GS', + KR = 'KR', + SS = 'SS', + ES = 'ES', + LK = 'LK', + SD = 'SD', + SR = 'SR', + SJ = 'SJ', + SE = 'SE', + CH = 'CH', + SY = 'SY', + TW = 'TW', + TJ = 'TJ', + TZ = 'TZ', + TH = 'TH', + TL = 'TL', + TG = 'TG', + TK = 'TK', + TO = 'TO', + TT = 'TT', + TN = 'TN', + TR = 'TR', + TM = 'TM', + TC = 'TC', + TV = 'TV', + UG = 'UG', + UA = 'UA', + AE = 'AE', + GB = 'GB', + UM = 'UM', + US = 'US', + U = 'U', + UY = 'UY', + UZ = 'UZ', + VU = 'VU', + VE = 'VE', + VN = 'VN', + VG = 'VG', + VI = 'VI', + WF = 'WF', + EH = 'EH', + YE = 'YE', + ZM = 'ZM', + ZW = 'ZW', +} diff --git a/src/frontend/generated/models/CountryOriginEnum.ts b/src/frontend/generated/models/CountryOriginEnum.ts new file mode 100644 index 0000000000..6c50b2d9e3 --- /dev/null +++ b/src/frontend/generated/models/CountryOriginEnum.ts @@ -0,0 +1,508 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `AF` - Afghanistan + * * `AX` - Åland Islands + * * `AL` - Albania + * * `DZ` - Algeria + * * `AS` - American Samoa + * * `AD` - Andorra + * * `AO` - Angola + * * `AI` - Anguilla + * * `AQ` - Antarctica + * * `AG` - Antigua and Barbuda + * * `AR` - Argentina + * * `AM` - Armenia + * * `AW` - Aruba + * * `AU` - Australia + * * `AT` - Austria + * * `AZ` - Azerbaijan + * * `BS` - Bahamas + * * `BH` - Bahrain + * * `BD` - Bangladesh + * * `BB` - Barbados + * * `BY` - Belarus + * * `BE` - Belgium + * * `BZ` - Belize + * * `BJ` - Benin + * * `BM` - Bermuda + * * `BT` - Bhutan + * * `BO` - Bolivia + * * `BQ` - Bonaire, Sint Eustatius and Saba + * * `BA` - Bosnia and Herzegovina + * * `BW` - Botswana + * * `BV` - Bouvet Island + * * `BR` - Brazil + * * `IO` - British Indian Ocean Territory + * * `BN` - Brunei + * * `BG` - Bulgaria + * * `BF` - Burkina Faso + * * `BI` - Burundi + * * `CV` - Cabo Verde + * * `KH` - Cambodia + * * `CM` - Cameroon + * * `CA` - Canada + * * `KY` - Cayman Islands + * * `CF` - Central African Republic + * * `TD` - Chad + * * `CL` - Chile + * * `CN` - China + * * `CX` - Christmas Island + * * `CC` - Cocos (Keeling) Islands + * * `CO` - Colombia + * * `KM` - Comoros + * * `CG` - Congo + * * `CD` - Congo (the Democratic Republic of the) + * * `CK` - Cook Islands + * * `CR` - Costa Rica + * * `CI` - Côte d'Ivoire + * * `HR` - Croatia + * * `CU` - Cuba + * * `CW` - Curaçao + * * `CY` - Cyprus + * * `CZ` - Czechia + * * `DK` - Denmark + * * `DJ` - Djibouti + * * `DM` - Dominica + * * `DO` - Dominican Republic + * * `EC` - Ecuador + * * `EG` - Egypt + * * `SV` - El Salvador + * * `GQ` - Equatorial Guinea + * * `ER` - Eritrea + * * `EE` - Estonia + * * `SZ` - Eswatini + * * `ET` - Ethiopia + * * `FK` - Falkland Islands (Malvinas) + * * `FO` - Faroe Islands + * * `FJ` - Fiji + * * `FI` - Finland + * * `FR` - France + * * `GF` - French Guiana + * * `PF` - French Polynesia + * * `TF` - French Southern Territories + * * `GA` - Gabon + * * `GM` - Gambia + * * `GE` - Georgia + * * `DE` - Germany + * * `GH` - Ghana + * * `GI` - Gibraltar + * * `GR` - Greece + * * `GL` - Greenland + * * `GD` - Grenada + * * `GP` - Guadeloupe + * * `GU` - Guam + * * `GT` - Guatemala + * * `GG` - Guernsey + * * `GN` - Guinea + * * `GW` - Guinea-Bissau + * * `GY` - Guyana + * * `HT` - Haiti + * * `HM` - Heard Island and McDonald Islands + * * `VA` - Holy See + * * `HN` - Honduras + * * `HK` - Hong Kong + * * `HU` - Hungary + * * `IS` - Iceland + * * `IN` - India + * * `ID` - Indonesia + * * `IR` - Iran + * * `IQ` - Iraq + * * `IE` - Ireland + * * `IM` - Isle of Man + * * `IL` - Israel + * * `IT` - Italy + * * `JM` - Jamaica + * * `JP` - Japan + * * `JE` - Jersey + * * `JO` - Jordan + * * `KZ` - Kazakhstan + * * `KE` - Kenya + * * `KI` - Kiribati + * * `KW` - Kuwait + * * `KG` - Kyrgyzstan + * * `LA` - Laos + * * `LV` - Latvia + * * `LB` - Lebanon + * * `LS` - Lesotho + * * `LR` - Liberia + * * `LY` - Libya + * * `LI` - Liechtenstein + * * `LT` - Lithuania + * * `LU` - Luxembourg + * * `MO` - Macao + * * `MG` - Madagascar + * * `MW` - Malawi + * * `MY` - Malaysia + * * `MV` - Maldives + * * `ML` - Mali + * * `MT` - Malta + * * `MH` - Marshall Islands + * * `MQ` - Martinique + * * `MR` - Mauritania + * * `MU` - Mauritius + * * `YT` - Mayotte + * * `MX` - Mexico + * * `FM` - Micronesia + * * `MD` - Moldova + * * `MC` - Monaco + * * `MN` - Mongolia + * * `ME` - Montenegro + * * `MS` - Montserrat + * * `MA` - Morocco + * * `MZ` - Mozambique + * * `MM` - Myanmar + * * `NA` - Namibia + * * `NR` - Nauru + * * `NP` - Nepal + * * `NL` - Netherlands + * * `NC` - New Caledonia + * * `NZ` - New Zealand + * * `NI` - Nicaragua + * * `NE` - Niger + * * `NG` - Nigeria + * * `NU` - Niue + * * `NF` - Norfolk Island + * * `KP` - North Korea + * * `MK` - North Macedonia + * * `MP` - Northern Mariana Islands + * * `NO` - Norway + * * `OM` - Oman + * * `PK` - Pakistan + * * `PW` - Palau + * * `PS` - Palestine, State of + * * `PA` - Panama + * * `PG` - Papua New Guinea + * * `PY` - Paraguay + * * `PE` - Peru + * * `PH` - Philippines + * * `PN` - Pitcairn + * * `PL` - Poland + * * `PT` - Portugal + * * `PR` - Puerto Rico + * * `QA` - Qatar + * * `RE` - Réunion + * * `RO` - Romania + * * `RU` - Russia + * * `RW` - Rwanda + * * `BL` - Saint Barthélemy + * * `SH` - Saint Helena, Ascension and Tristan da Cunha + * * `KN` - Saint Kitts and Nevis + * * `LC` - Saint Lucia + * * `MF` - Saint Martin (French part) + * * `PM` - Saint Pierre and Miquelon + * * `VC` - Saint Vincent and the Grenadines + * * `WS` - Samoa + * * `SM` - San Marino + * * `ST` - Sao Tome and Principe + * * `SA` - Saudi Arabia + * * `SN` - Senegal + * * `RS` - Serbia + * * `SC` - Seychelles + * * `SL` - Sierra Leone + * * `SG` - Singapore + * * `SX` - Sint Maarten (Dutch part) + * * `SK` - Slovakia + * * `SI` - Slovenia + * * `SB` - Solomon Islands + * * `SO` - Somalia + * * `ZA` - South Africa + * * `GS` - South Georgia and the South Sandwich Islands + * * `KR` - South Korea + * * `SS` - South Sudan + * * `ES` - Spain + * * `LK` - Sri Lanka + * * `SD` - Sudan + * * `SR` - Suriname + * * `SJ` - Svalbard and Jan Mayen + * * `SE` - Sweden + * * `CH` - Switzerland + * * `SY` - Syria + * * `TW` - Taiwan + * * `TJ` - Tajikistan + * * `TZ` - Tanzania + * * `TH` - Thailand + * * `TL` - Timor-Leste + * * `TG` - Togo + * * `TK` - Tokelau + * * `TO` - Tonga + * * `TT` - Trinidad and Tobago + * * `TN` - Tunisia + * * `TR` - Türkiye + * * `TM` - Turkmenistan + * * `TC` - Turks and Caicos Islands + * * `TV` - Tuvalu + * * `UG` - Uganda + * * `UA` - Ukraine + * * `AE` - United Arab Emirates + * * `GB` - United Kingdom + * * `UM` - United States Minor Outlying Islands + * * `US` - United States of America + * * `U` - Unknown or Not Applicable + * * `UY` - Uruguay + * * `UZ` - Uzbekistan + * * `VU` - Vanuatu + * * `VE` - Venezuela + * * `VN` - Vietnam + * * `VG` - Virgin Islands (British) + * * `VI` - Virgin Islands (U.S.) + * * `WF` - Wallis and Futuna + * * `EH` - Western Sahara + * * `YE` - Yemen + * * `ZM` - Zambia + * * `ZW` - Zimbabwe + */ +export enum CountryOriginEnum { + AF = 'AF', + AX = 'AX', + AL = 'AL', + DZ = 'DZ', + AS = 'AS', + AD = 'AD', + AO = 'AO', + AI = 'AI', + AQ = 'AQ', + AG = 'AG', + AR = 'AR', + AM = 'AM', + AW = 'AW', + AU = 'AU', + AT = 'AT', + AZ = 'AZ', + BS = 'BS', + BH = 'BH', + BD = 'BD', + BB = 'BB', + BY = 'BY', + BE = 'BE', + BZ = 'BZ', + BJ = 'BJ', + BM = 'BM', + BT = 'BT', + BO = 'BO', + BQ = 'BQ', + BA = 'BA', + BW = 'BW', + BV = 'BV', + BR = 'BR', + IO = 'IO', + BN = 'BN', + BG = 'BG', + BF = 'BF', + BI = 'BI', + CV = 'CV', + KH = 'KH', + CM = 'CM', + CA = 'CA', + KY = 'KY', + CF = 'CF', + TD = 'TD', + CL = 'CL', + CN = 'CN', + CX = 'CX', + CC = 'CC', + CO = 'CO', + KM = 'KM', + CG = 'CG', + CD = 'CD', + CK = 'CK', + CR = 'CR', + CI = 'CI', + HR = 'HR', + CU = 'CU', + CW = 'CW', + CY = 'CY', + CZ = 'CZ', + DK = 'DK', + DJ = 'DJ', + DM = 'DM', + DO = 'DO', + EC = 'EC', + EG = 'EG', + SV = 'SV', + GQ = 'GQ', + ER = 'ER', + EE = 'EE', + SZ = 'SZ', + ET = 'ET', + FK = 'FK', + FO = 'FO', + FJ = 'FJ', + FI = 'FI', + FR = 'FR', + GF = 'GF', + PF = 'PF', + TF = 'TF', + GA = 'GA', + GM = 'GM', + GE = 'GE', + DE = 'DE', + GH = 'GH', + GI = 'GI', + GR = 'GR', + GL = 'GL', + GD = 'GD', + GP = 'GP', + GU = 'GU', + GT = 'GT', + GG = 'GG', + GN = 'GN', + GW = 'GW', + GY = 'GY', + HT = 'HT', + HM = 'HM', + VA = 'VA', + HN = 'HN', + HK = 'HK', + HU = 'HU', + IS = 'IS', + IN = 'IN', + ID = 'ID', + IR = 'IR', + IQ = 'IQ', + IE = 'IE', + IM = 'IM', + IL = 'IL', + IT = 'IT', + JM = 'JM', + JP = 'JP', + JE = 'JE', + JO = 'JO', + KZ = 'KZ', + KE = 'KE', + KI = 'KI', + KW = 'KW', + KG = 'KG', + LA = 'LA', + LV = 'LV', + LB = 'LB', + LS = 'LS', + LR = 'LR', + LY = 'LY', + LI = 'LI', + LT = 'LT', + LU = 'LU', + MO = 'MO', + MG = 'MG', + MW = 'MW', + MY = 'MY', + MV = 'MV', + ML = 'ML', + MT = 'MT', + MH = 'MH', + MQ = 'MQ', + MR = 'MR', + MU = 'MU', + YT = 'YT', + MX = 'MX', + FM = 'FM', + MD = 'MD', + MC = 'MC', + MN = 'MN', + ME = 'ME', + MS = 'MS', + MA = 'MA', + MZ = 'MZ', + MM = 'MM', + NA = 'NA', + NR = 'NR', + NP = 'NP', + NL = 'NL', + NC = 'NC', + NZ = 'NZ', + NI = 'NI', + NE = 'NE', + NG = 'NG', + NU = 'NU', + NF = 'NF', + KP = 'KP', + MK = 'MK', + MP = 'MP', + NO = 'NO', + OM = 'OM', + PK = 'PK', + PW = 'PW', + PS = 'PS', + PA = 'PA', + PG = 'PG', + PY = 'PY', + PE = 'PE', + PH = 'PH', + PN = 'PN', + PL = 'PL', + PT = 'PT', + PR = 'PR', + QA = 'QA', + RE = 'RE', + RO = 'RO', + RU = 'RU', + RW = 'RW', + BL = 'BL', + SH = 'SH', + KN = 'KN', + LC = 'LC', + MF = 'MF', + PM = 'PM', + VC = 'VC', + WS = 'WS', + SM = 'SM', + ST = 'ST', + SA = 'SA', + SN = 'SN', + RS = 'RS', + SC = 'SC', + SL = 'SL', + SG = 'SG', + SX = 'SX', + SK = 'SK', + SI = 'SI', + SB = 'SB', + SO = 'SO', + ZA = 'ZA', + GS = 'GS', + KR = 'KR', + SS = 'SS', + ES = 'ES', + LK = 'LK', + SD = 'SD', + SR = 'SR', + SJ = 'SJ', + SE = 'SE', + CH = 'CH', + SY = 'SY', + TW = 'TW', + TJ = 'TJ', + TZ = 'TZ', + TH = 'TH', + TL = 'TL', + TG = 'TG', + TK = 'TK', + TO = 'TO', + TT = 'TT', + TN = 'TN', + TR = 'TR', + TM = 'TM', + TC = 'TC', + TV = 'TV', + UG = 'UG', + UA = 'UA', + AE = 'AE', + GB = 'GB', + UM = 'UM', + US = 'US', + U = 'U', + UY = 'UY', + UZ = 'UZ', + VU = 'VU', + VE = 'VE', + VN = 'VN', + VG = 'VG', + VI = 'VI', + WF = 'WF', + EH = 'EH', + YE = 'YE', + ZM = 'ZM', + ZW = 'ZW', +} diff --git a/src/frontend/generated/models/CurrencyEnum.ts b/src/frontend/generated/models/CurrencyEnum.ts new file mode 100644 index 0000000000..759430eef9 --- /dev/null +++ b/src/frontend/generated/models/CurrencyEnum.ts @@ -0,0 +1,333 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `` - None + * * `AED` - United Arab Emirates dirham + * * `AFN` - Afghan afghani + * * `ALL` - Albanian lek + * * `AMD` - Armenian dram + * * `ANG` - Netherlands Antillean guilder + * * `AOA` - Angolan kwanza + * * `ARS` - Argentine peso + * * `AUD` - Australian dollar + * * `AWG` - Aruban florin + * * `AZN` - Azerbaijani manat + * * `BAM` - Bosnia and Herzegovina convertible mark + * * `BBD` - Barbados dollar + * * `BDT` - Bangladeshi taka + * * `BGN` - Bulgarian lev + * * `BHD` - Bahraini dinar + * * `BIF` - Burundian franc + * * `BMD` - Bermudian dollar + * * `BND` - Brunei dollar + * * `BOB` - Boliviano + * * `BOV` - Bolivian Mvdol (funds code) + * * `BRL` - Brazilian real + * * `BSD` - Bahamian dollar + * * `BTN` - Bhutanese ngultrum + * * `BWP` - Botswana pula + * * `BYN` - Belarusian ruble + * * `BZD` - Belize dollar + * * `CAD` - Canadian dollar + * * `CDF` - Congolese franc + * * `CHF` - Swiss franc + * * `CLP` - Chilean peso + * * `CNY` - Chinese yuan + * * `COP` - Colombian peso + * * `CRC` - Costa Rican colon + * * `CUC` - Cuban convertible peso + * * `CUP` - Cuban peso + * * `CVE` - Cape Verdean escudo + * * `CZK` - Czech koruna + * * `DJF` - Djiboutian franc + * * `DKK` - Danish krone + * * `DOP` - Dominican peso + * * `DZD` - Algerian dinar + * * `EGP` - Egyptian pound + * * `ERN` - Eritrean nakfa + * * `ETB` - Ethiopian birr + * * `EUR` - Euro + * * `FJD` - Fiji dollar + * * `FKP` - Falkland Islands pound + * * `GBP` - Pound sterling + * * `GEL` - Georgian lari + * * `GHS` - Ghanaian cedi + * * `GIP` - Gibraltar pound + * * `GMD` - Gambian dalasi + * * `GNF` - Guinean franc + * * `GTQ` - Guatemalan quetzal + * * `GYD` - Guyanese dollar + * * `HKD` - Hong Kong dollar + * * `HNL` - Honduran lempira + * * `HRK` - Croatian kuna + * * `HTG` - Haitian gourde + * * `HUF` - Hungarian forint + * * `IDR` - Indonesian rupiah + * * `ILS` - Israeli new shekel + * * `INR` - Indian rupee + * * `IQD` - Iraqi dinar + * * `IRR` - Iranian rial + * * `ISK` - Icelandic króna + * * `JMD` - Jamaican dollar + * * `JOD` - Jordanian dinar + * * `JPY` - Japanese yen + * * `KES` - Kenyan shilling + * * `KGS` - Kyrgyzstani som + * * `KHR` - Cambodian riel + * * `KMF` - Comoro franc + * * `KPW` - North Korean won + * * `KRW` - South Korean won + * * `KWD` - Kuwaiti dinar + * * `KYD` - Cayman Islands dollar + * * `KZT` - Kazakhstani tenge + * * `LAK` - Lao kip + * * `LBP` - Lebanese pound + * * `LKR` - Sri Lankan rupee + * * `LRD` - Liberian dollar + * * `LSL` - Lesotho loti + * * `LYD` - Libyan dinar + * * `MAD` - Moroccan dirham + * * `MDL` - Moldovan leu + * * `MGA` - Malagasy ariary + * * `MKD` - Macedonian denar + * * `MMK` - Myanmar kyat + * * `MNT` - Mongolian tögrög + * * `MOP` - Macanese pataca + * * `MRU` - Mauritanian ouguiya + * * `MUR` - Mauritian rupee + * * `MVR` - Maldivian rufiyaa + * * `MWK` - Malawian kwacha + * * `MXN` - Mexican peso + * * `MYR` - Malaysian ringgit + * * `MZN` - Mozambican metical + * * `NAD` - Namibian dollar + * * `NGN` - Nigerian naira + * * `NIO` - Nicaraguan córdoba + * * `NOK` - Norwegian krone + * * `NPR` - Nepalese rupee + * * `NZD` - New Zealand dollar + * * `OMR` - Omani rial + * * `PAB` - Panamanian balboa + * * `PEN` - Peruvian sol + * * `PGK` - Papua New Guinean kina + * * `PHP` - Philippine peso + * * `PKR` - Pakistani rupee + * * `PLN` - Polish złoty + * * `PYG` - Paraguayan guaraní + * * `QAR` - Qatari riyal + * * `RON` - Romanian leu + * * `RSD` - Serbian dinar + * * `RUB` - Russian ruble + * * `RWF` - Rwandan franc + * * `SAR` - Saudi riyal + * * `SBD` - Solomon Islands dollar + * * `SCR` - Seychelles rupee + * * `SDG` - Sudanese pound + * * `SEK` - Swedish krona/kronor + * * `SGD` - Singapore dollar + * * `SHP` - Saint Helena pound + * * `SLL` - Sierra Leonean leone + * * `SOS` - Somali shilling + * * `SRD` - Surinamese dollar + * * `SSP` - South Sudanese pound + * * `STN` - São Tomé and Príncipe dobra + * * `SVC` - Salvadoran colón + * * `SYP` - Syrian pound + * * `SZL` - Swazi lilangeni + * * `THB` - Thai baht + * * `TJS` - Tajikistani somoni + * * `TMT` - Turkmenistan manat + * * `TND` - Tunisian dinar + * * `TOP` - Tongan paʻanga + * * `TRY` - Turkish lira + * * `TTD` - Trinidad and Tobago dollar + * * `TWD` - New Taiwan dollar + * * `TZS` - Tanzanian shilling + * * `UAH` - Ukrainian hryvnia + * * `UGX` - Ugandan shilling + * * `USD` - United States dollar + * * `UYU` - Uruguayan peso + * * `UYW` - Unidad previsional[14] + * * `UZS` - Uzbekistan som + * * `VES` - Venezuelan bolívar soberano + * * `VND` - Vietnamese đồng + * * `VUV` - Vanuatu vatu + * * `WST` - Samoan tala + * * `XAF` - CFA franc BEAC + * * `XAG` - Silver (one troy ounce) + * * `XAU` - Gold (one troy ounce) + * * `XCD` - East Caribbean dollar + * * `XOF` - CFA franc BCEAO + * * `XPF` - CFP franc (franc Pacifique) + * * `YER` - Yemeni rial + * * `ZAR` - South African rand + * * `ZMW` - Zambian kwacha + * * `ZWL` - Zimbabwean dollar + * * `USDC` - USD Coin + */ +export enum CurrencyEnum { + AED = 'AED', + AFN = 'AFN', + ALL = 'ALL', + AMD = 'AMD', + ANG = 'ANG', + AOA = 'AOA', + ARS = 'ARS', + AUD = 'AUD', + AWG = 'AWG', + AZN = 'AZN', + BAM = 'BAM', + BBD = 'BBD', + BDT = 'BDT', + BGN = 'BGN', + BHD = 'BHD', + BIF = 'BIF', + BMD = 'BMD', + BND = 'BND', + BOB = 'BOB', + BOV = 'BOV', + BRL = 'BRL', + BSD = 'BSD', + BTN = 'BTN', + BWP = 'BWP', + BYN = 'BYN', + BZD = 'BZD', + CAD = 'CAD', + CDF = 'CDF', + CHF = 'CHF', + CLP = 'CLP', + CNY = 'CNY', + COP = 'COP', + CRC = 'CRC', + CUC = 'CUC', + CUP = 'CUP', + CVE = 'CVE', + CZK = 'CZK', + DJF = 'DJF', + DKK = 'DKK', + DOP = 'DOP', + DZD = 'DZD', + EGP = 'EGP', + ERN = 'ERN', + ETB = 'ETB', + EUR = 'EUR', + FJD = 'FJD', + FKP = 'FKP', + GBP = 'GBP', + GEL = 'GEL', + GHS = 'GHS', + GIP = 'GIP', + GMD = 'GMD', + GNF = 'GNF', + GTQ = 'GTQ', + GYD = 'GYD', + HKD = 'HKD', + HNL = 'HNL', + HRK = 'HRK', + HTG = 'HTG', + HUF = 'HUF', + IDR = 'IDR', + ILS = 'ILS', + INR = 'INR', + IQD = 'IQD', + IRR = 'IRR', + ISK = 'ISK', + JMD = 'JMD', + JOD = 'JOD', + JPY = 'JPY', + KES = 'KES', + KGS = 'KGS', + KHR = 'KHR', + KMF = 'KMF', + KPW = 'KPW', + KRW = 'KRW', + KWD = 'KWD', + KYD = 'KYD', + KZT = 'KZT', + LAK = 'LAK', + LBP = 'LBP', + LKR = 'LKR', + LRD = 'LRD', + LSL = 'LSL', + LYD = 'LYD', + MAD = 'MAD', + MDL = 'MDL', + MGA = 'MGA', + MKD = 'MKD', + MMK = 'MMK', + MNT = 'MNT', + MOP = 'MOP', + MRU = 'MRU', + MUR = 'MUR', + MVR = 'MVR', + MWK = 'MWK', + MXN = 'MXN', + MYR = 'MYR', + MZN = 'MZN', + NAD = 'NAD', + NGN = 'NGN', + NIO = 'NIO', + NOK = 'NOK', + NPR = 'NPR', + NZD = 'NZD', + OMR = 'OMR', + PAB = 'PAB', + PEN = 'PEN', + PGK = 'PGK', + PHP = 'PHP', + PKR = 'PKR', + PLN = 'PLN', + PYG = 'PYG', + QAR = 'QAR', + RON = 'RON', + RSD = 'RSD', + RUB = 'RUB', + RWF = 'RWF', + SAR = 'SAR', + SBD = 'SBD', + SCR = 'SCR', + SDG = 'SDG', + SEK = 'SEK', + SGD = 'SGD', + SHP = 'SHP', + SLL = 'SLL', + SOS = 'SOS', + SRD = 'SRD', + SSP = 'SSP', + STN = 'STN', + SVC = 'SVC', + SYP = 'SYP', + SZL = 'SZL', + THB = 'THB', + TJS = 'TJS', + TMT = 'TMT', + TND = 'TND', + TOP = 'TOP', + TRY = 'TRY', + TTD = 'TTD', + TWD = 'TWD', + TZS = 'TZS', + UAH = 'UAH', + UGX = 'UGX', + USD = 'USD', + UYU = 'UYU', + UYW = 'UYW', + UZS = 'UZS', + VES = 'VES', + VND = 'VND', + VUV = 'VUV', + WST = 'WST', + XAF = 'XAF', + XAG = 'XAG', + XAU = 'XAU', + XCD = 'XCD', + XOF = 'XOF', + XPF = 'XPF', + YER = 'YER', + ZAR = 'ZAR', + ZMW = 'ZMW', + ZWL = 'ZWL', + USDC = 'USDC', +} diff --git a/src/frontend/generated/models/DeduplicationGoldenRecordStatusEnum.ts b/src/frontend/generated/models/DeduplicationGoldenRecordStatusEnum.ts new file mode 100644 index 0000000000..ddf5d1a50e --- /dev/null +++ b/src/frontend/generated/models/DeduplicationGoldenRecordStatusEnum.ts @@ -0,0 +1,18 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `DUPLICATE` - Duplicate + * * `NEEDS_ADJUDICATION` - Needs Adjudication + * * `NOT_PROCESSED` - Not Processed + * * `POSTPONE` - Postpone + * * `UNIQUE` - Unique + */ +export enum DeduplicationGoldenRecordStatusEnum { + DUPLICATE = 'DUPLICATE', + NEEDS_ADJUDICATION = 'NEEDS_ADJUDICATION', + NOT_PROCESSED = 'NOT_PROCESSED', + POSTPONE = 'POSTPONE', + UNIQUE = 'UNIQUE', +} diff --git a/src/frontend/generated/models/Delegate.ts b/src/frontend/generated/models/Delegate.ts new file mode 100644 index 0000000000..8bb79acef9 --- /dev/null +++ b/src/frontend/generated/models/Delegate.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type Delegate = { + delegate_id: string; + delegated_for: Array; +}; + diff --git a/src/frontend/generated/models/DelegatePeople.ts b/src/frontend/generated/models/DelegatePeople.ts new file mode 100644 index 0000000000..9bc541e2f8 --- /dev/null +++ b/src/frontend/generated/models/DelegatePeople.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Delegate } from './Delegate'; +export type DelegatePeople = { + delegates: Array; +}; + diff --git a/src/frontend/generated/models/DisabilityEnum.ts b/src/frontend/generated/models/DisabilityEnum.ts new file mode 100644 index 0000000000..c27e2106d9 --- /dev/null +++ b/src/frontend/generated/models/DisabilityEnum.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `disabled` - disabled + * * `not disabled` - not disabled + */ +export enum DisabilityEnum { + DISABLED = 'disabled', + NOT_DISABLED = 'not disabled', +} diff --git a/src/frontend/generated/models/Document.ts b/src/frontend/generated/models/Document.ts new file mode 100644 index 0000000000..9e30749fd8 --- /dev/null +++ b/src/frontend/generated/models/Document.ts @@ -0,0 +1,33 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { CountryEnum } from './CountryEnum'; +import type { DocumentStatusEnum } from './DocumentStatusEnum'; +import type { DocumentTypeEnum } from './DocumentTypeEnum'; +import type { RdiMergeStatusEnum } from './RdiMergeStatusEnum'; +export type Document = { + readonly id: string; + type: DocumentTypeEnum; + country: CountryEnum; + image?: string; + document_number: string; + rdi_merge_status?: RdiMergeStatusEnum; + is_removed?: boolean; + is_original?: boolean; + readonly created_at: string; + readonly updated_at: string; + last_sync_at?: string | null; + status?: DocumentStatusEnum; + cleared?: boolean; + cleared_date?: string; + issuance_date?: string | null; + expiry_date?: string | null; + is_migration_handled?: boolean; + cleared_by?: string | null; + /** + * If this object was copied from another, this field will contain the object it was copied from. + */ + copied_from?: string | null; +}; + diff --git a/src/frontend/generated/models/DocumentStatusEnum.ts b/src/frontend/generated/models/DocumentStatusEnum.ts new file mode 100644 index 0000000000..27b528b467 --- /dev/null +++ b/src/frontend/generated/models/DocumentStatusEnum.ts @@ -0,0 +1,16 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `PENDING` - Pending + * * `VALID` - Valid + * * `NEED_INVESTIGATION` - Need Investigation + * * `INVALID` - Invalid + */ +export enum DocumentStatusEnum { + PENDING = 'PENDING', + VALID = 'VALID', + NEED_INVESTIGATION = 'NEED_INVESTIGATION', + INVALID = 'INVALID', +} diff --git a/src/frontend/generated/models/DocumentTypeEnum.ts b/src/frontend/generated/models/DocumentTypeEnum.ts new file mode 100644 index 0000000000..ba16e84653 --- /dev/null +++ b/src/frontend/generated/models/DocumentTypeEnum.ts @@ -0,0 +1,30 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `birth_certificate` - Birth Certificate + * * `drivers_license` - Driver's License + * * `electoral_card` - Electoral Card + * * `national_id` - National ID + * * `national_passport` - National Passport + * * `tax_id` - Tax Number Identification + * * `residence_permit_no` - Foreigner's Residence Permit + * * `bank_statement` - Bank Statement + * * `disability_certificate` - Disability Certificate + * * `foster_child` - Foster Child + * * `other_id` - Other + */ +export enum DocumentTypeEnum { + BIRTH_CERTIFICATE = 'birth_certificate', + DRIVERS_LICENSE = 'drivers_license', + ELECTORAL_CARD = 'electoral_card', + NATIONAL_ID = 'national_id', + NATIONAL_PASSPORT = 'national_passport', + TAX_ID = 'tax_id', + RESIDENCE_PERMIT_NO = 'residence_permit_no', + BANK_STATEMENT = 'bank_statement', + DISABILITY_CERTIFICATE = 'disability_certificate', + FOSTER_CHILD = 'foster_child', + OTHER_ID = 'other_id', +} diff --git a/src/frontend/generated/models/FollowUpPaymentPlan.ts b/src/frontend/generated/models/FollowUpPaymentPlan.ts new file mode 100644 index 0000000000..862388eb28 --- /dev/null +++ b/src/frontend/generated/models/FollowUpPaymentPlan.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type FollowUpPaymentPlan = { + readonly id: string; + unicef_id?: string | null; +}; + diff --git a/src/frontend/generated/models/FrequencyOfPaymentsEnum.ts b/src/frontend/generated/models/FrequencyOfPaymentsEnum.ts new file mode 100644 index 0000000000..ecbfa21717 --- /dev/null +++ b/src/frontend/generated/models/FrequencyOfPaymentsEnum.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `ONE_OFF` - One-off + * * `REGULAR` - Regular + */ +export enum FrequencyOfPaymentsEnum { + ONE_OFF = 'ONE_OFF', + REGULAR = 'REGULAR', +} diff --git a/src/frontend/generated/models/HearingDisabilityEnum.ts b/src/frontend/generated/models/HearingDisabilityEnum.ts new file mode 100644 index 0000000000..44ab2febb4 --- /dev/null +++ b/src/frontend/generated/models/HearingDisabilityEnum.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `` - None + * * `LOT_DIFFICULTY` - A lot of difficulty + * * `CANNOT_DO` - Cannot do at all + * * `SOME_DIFFICULTY` - Some difficulty + */ +export enum HearingDisabilityEnum { + LOT_DIFFICULTY = 'LOT_DIFFICULTY', + CANNOT_DO = 'CANNOT_DO', + SOME_DIFFICULTY = 'SOME_DIFFICULTY', +} diff --git a/src/frontend/generated/models/Household.ts b/src/frontend/generated/models/Household.ts new file mode 100644 index 0000000000..3eca5dc0cc --- /dev/null +++ b/src/frontend/generated/models/Household.ts @@ -0,0 +1,113 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { BlankEnum } from './BlankEnum'; +import type { CollectTypeEnum } from './CollectTypeEnum'; +import type { ConsentSharingEnum } from './ConsentSharingEnum'; +import type { CountryEnum } from './CountryEnum'; +import type { CountryOriginEnum } from './CountryOriginEnum'; +import type { CurrencyEnum } from './CurrencyEnum'; +import type { Individual } from './Individual'; +import type { OrgEnumeratorEnum } from './OrgEnumeratorEnum'; +import type { RdiMergeStatusEnum } from './RdiMergeStatusEnum'; +import type { RegistrationMethodEnum } from './RegistrationMethodEnum'; +import type { ResidenceStatusEnum } from './ResidenceStatusEnum'; +export type Household = { + collect_individual_data: string; + first_registration_date?: string; + last_registration_date?: string; + members: Array; + country: CountryEnum; + country_origin?: CountryOriginEnum; + size?: number | null; + rdi_merge_status?: RdiMergeStatusEnum; + is_original?: boolean; + readonly created_at: string; + readonly updated_at: string; + is_removed?: boolean; + removed_date?: string | null; + last_sync_at?: string | null; + unicef_id?: string | null; + withdrawn?: boolean; + withdrawn_date?: string | null; + consent_sign?: string; + consent?: boolean | null; + consent_sharing?: (ConsentSharingEnum | BlankEnum); + residence_status?: (ResidenceStatusEnum | BlankEnum); + address?: string; + zip_code?: string | null; + female_age_group_0_5_count?: number | null; + female_age_group_6_11_count?: number | null; + female_age_group_12_17_count?: number | null; + female_age_group_18_59_count?: number | null; + female_age_group_60_count?: number | null; + pregnant_count?: number | null; + male_age_group_0_5_count?: number | null; + male_age_group_6_11_count?: number | null; + male_age_group_12_17_count?: number | null; + male_age_group_18_59_count?: number | null; + male_age_group_60_count?: number | null; + female_age_group_0_5_disabled_count?: number | null; + female_age_group_6_11_disabled_count?: number | null; + female_age_group_12_17_disabled_count?: number | null; + female_age_group_18_59_disabled_count?: number | null; + female_age_group_60_disabled_count?: number | null; + male_age_group_0_5_disabled_count?: number | null; + male_age_group_6_11_disabled_count?: number | null; + male_age_group_12_17_disabled_count?: number | null; + male_age_group_18_59_disabled_count?: number | null; + male_age_group_60_disabled_count?: number | null; + children_count?: number | null; + male_children_count?: number | null; + female_children_count?: number | null; + children_disabled_count?: number | null; + male_children_disabled_count?: number | null; + female_children_disabled_count?: number | null; + returnee?: boolean | null; + flex_fields?: any; + fchild_hoh?: boolean | null; + child_hoh?: boolean | null; + start?: string | null; + deviceid?: string; + name_enumerator?: string; + org_enumerator?: (OrgEnumeratorEnum | BlankEnum); + org_name_enumerator?: string; + village?: string; + registration_method?: (RegistrationMethodEnum | BlankEnum); + currency?: (CurrencyEnum | BlankEnum); + unhcr_id?: string; + user_fields?: any; + registration_id?: string | null; + program_registration_id?: string | null; + total_cash_received_usd?: string | null; + total_cash_received?: string | null; + family_id?: string | null; + origin_unicef_id?: string | null; + is_migration_handled?: boolean; + migrated_at?: string | null; + is_recalculated_group_ages?: boolean; + collect_type?: CollectTypeEnum; + enumerator_rec_id?: number | null; + mis_unicef_id?: string | null; + flex_registrations_record_id?: number | null; + household_collection?: number | null; + admin_area?: string | null; + admin1?: string | null; + admin2?: string | null; + admin3?: string | null; + admin4?: string | null; + storage_obj?: number | null; + /** + * If this household was copied from another household, this field will contain the household it was copied from. + */ + copied_from?: string | null; + /** + * This is only used to track collector (primary or secondary) of a household. + * They may still be a HOH of this household or any other household. + * Through model will contain the role (ROLE_CHOICE) they are connected with on. + */ + readonly representatives: Array; + programs?: Array; +}; + diff --git a/src/frontend/generated/models/Individual.ts b/src/frontend/generated/models/Individual.ts new file mode 100644 index 0000000000..6c0a9b4f6e --- /dev/null +++ b/src/frontend/generated/models/Individual.ts @@ -0,0 +1,124 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { BlankEnum } from './BlankEnum'; +import type { CommsDisabilityEnum } from './CommsDisabilityEnum'; +import type { DeduplicationGoldenRecordStatusEnum } from './DeduplicationGoldenRecordStatusEnum'; +import type { DisabilityEnum } from './DisabilityEnum'; +import type { Document } from './Document'; +import type { HearingDisabilityEnum } from './HearingDisabilityEnum'; +import type { MemoryDisabilityEnum } from './MemoryDisabilityEnum'; +import type { NullEnum } from './NullEnum'; +import type { PhysicalDisabilityEnum } from './PhysicalDisabilityEnum'; +import type { PreferredLanguageEnum } from './PreferredLanguageEnum'; +import type { RdiMergeStatusEnum } from './RdiMergeStatusEnum'; +import type { RelationshipEnum } from './RelationshipEnum'; +import type { SeeingDisabilityEnum } from './SeeingDisabilityEnum'; +import type { SelfcareDisabilityEnum } from './SelfcareDisabilityEnum'; +import type { SexEnum } from './SexEnum'; +import type { WorkStatusEnum } from './WorkStatusEnum'; +export type Individual = { + first_registration_date?: string; + last_registration_date?: string; + readonly household: string; + role?: string; + observed_disability?: string; + country_origin?: string; + marital_status?: string; + documents?: Array; + birth_date: string; + rdi_merge_status?: RdiMergeStatusEnum; + is_original?: boolean; + is_removed?: boolean; + removed_date?: string | null; + last_sync_at?: string | null; + unicef_id?: string | null; + duplicate?: boolean; + duplicate_date?: string | null; + withdrawn?: boolean; + withdrawn_date?: string | null; + individual_id?: string; + photo?: string; + full_name: string; + given_name?: string; + middle_name?: string; + family_name?: string; + sex: SexEnum; + estimated_birth_date?: boolean; + phone_no?: string; + phone_no_valid?: boolean | null; + phone_no_alternative?: string; + phone_no_alternative_valid?: boolean | null; + email?: string; + payment_delivery_phone_no?: string | null; + /** + * This represents the MEMBER relationship. can be blank + * as well if household is null! + * + * * `UNKNOWN` - Unknown + * * `AUNT_UNCLE` - Aunt / Uncle + * * `BROTHER_SISTER` - Brother / Sister + * * `COUSIN` - Cousin + * * `DAUGHTERINLAW_SONINLAW` - Daughter-in-law / Son-in-law + * * `GRANDDAUGHER_GRANDSON` - Granddaughter / Grandson + * * `GRANDMOTHER_GRANDFATHER` - Grandmother / Grandfather + * * `HEAD` - Head of household (self) + * * `MOTHER_FATHER` - Mother / Father + * * `MOTHERINLAW_FATHERINLAW` - Mother-in-law / Father-in-law + * * `NEPHEW_NIECE` - Nephew / Niece + * * `NON_BENEFICIARY` - Not a Family Member. Can only act as a recipient. + * * `OTHER` - Other + * * `SISTERINLAW_BROTHERINLAW` - Sister-in-law / Brother-in-law + * * `SON_DAUGHTER` - Son / Daughter + * * `WIFE_HUSBAND` - Wife / Husband + * * `FOSTER_CHILD` - Foster child + * * `FREE_UNION` - Free union + */ + relationship?: (RelationshipEnum | BlankEnum); + work_status?: (WorkStatusEnum | BlankEnum); + flex_fields?: any; + user_fields?: any; + enrolled_in_nutrition_programme?: boolean | null; + administration_of_rutf?: boolean | null; + deduplication_golden_record_status?: DeduplicationGoldenRecordStatusEnum; + imported_individual_id?: string | null; + sanction_list_possible_match?: boolean; + sanction_list_confirmed_match?: boolean; + pregnant?: boolean | null; + disability?: DisabilityEnum; + disability_certificate_picture?: string | null; + seeing_disability?: (SeeingDisabilityEnum | BlankEnum); + hearing_disability?: (HearingDisabilityEnum | BlankEnum); + physical_disability?: (PhysicalDisabilityEnum | BlankEnum); + memory_disability?: (MemoryDisabilityEnum | BlankEnum); + selfcare_disability?: (SelfcareDisabilityEnum | BlankEnum); + comms_disability?: (CommsDisabilityEnum | BlankEnum); + who_answers_phone?: string; + who_answers_alt_phone?: string; + fchild_hoh?: boolean; + child_hoh?: boolean; + /** + * Kobo asset ID, Xlsx row ID, Aurora source ID + */ + detail_id?: string | null; + registration_id?: string | null; + program_registration_id?: string | null; + preferred_language?: (PreferredLanguageEnum | BlankEnum | NullEnum) | null; + relationship_confirmed?: boolean; + age_at_registration?: number | null; + wallet_name?: string; + blockchain_name?: string; + wallet_address?: string; + origin_unicef_id?: string | null; + is_migration_handled?: boolean; + migrated_at?: string | null; + mis_unicef_id?: string | null; + individual_collection?: number | null; + program?: string | null; + /** + * If this individual was copied from another individual, this field will contain the individual it was copied from. + */ + copied_from?: string | null; +}; + diff --git a/src/frontend/generated/models/MemoryDisabilityEnum.ts b/src/frontend/generated/models/MemoryDisabilityEnum.ts new file mode 100644 index 0000000000..bb7417cc8f --- /dev/null +++ b/src/frontend/generated/models/MemoryDisabilityEnum.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `` - None + * * `LOT_DIFFICULTY` - A lot of difficulty + * * `CANNOT_DO` - Cannot do at all + * * `SOME_DIFFICULTY` - Some difficulty + */ +export enum MemoryDisabilityEnum { + LOT_DIFFICULTY = 'LOT_DIFFICULTY', + CANNOT_DO = 'CANNOT_DO', + SOME_DIFFICULTY = 'SOME_DIFFICULTY', +} diff --git a/src/frontend/generated/models/NullEnum.ts b/src/frontend/generated/models/NullEnum.ts new file mode 100644 index 0000000000..231d6bdd61 --- /dev/null +++ b/src/frontend/generated/models/NullEnum.ts @@ -0,0 +1,7 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type NullEnum = { +}; + diff --git a/src/frontend/generated/models/OrgEnumeratorEnum.ts b/src/frontend/generated/models/OrgEnumeratorEnum.ts new file mode 100644 index 0000000000..6fb2d07e33 --- /dev/null +++ b/src/frontend/generated/models/OrgEnumeratorEnum.ts @@ -0,0 +1,13 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `` - None + * * `PARTNER` - Partner + * * `UNICEF` - UNICEF + */ +export enum OrgEnumeratorEnum { + PARTNER = 'PARTNER', + UNICEF = 'UNICEF', +} diff --git a/src/frontend/generated/models/PaginatedAreaList.ts b/src/frontend/generated/models/PaginatedAreaList.ts new file mode 100644 index 0000000000..33f099fb57 --- /dev/null +++ b/src/frontend/generated/models/PaginatedAreaList.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Area } from './Area'; +export type PaginatedAreaList = { + count: number; + next?: string | null; + previous?: string | null; + results: Array; +}; + diff --git a/src/frontend/generated/models/PaginatedAreaListList.ts b/src/frontend/generated/models/PaginatedAreaListList.ts new file mode 100644 index 0000000000..a8e4733fba --- /dev/null +++ b/src/frontend/generated/models/PaginatedAreaListList.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { AreaList } from './AreaList'; +export type PaginatedAreaListList = { + count: number; + next?: string | null; + previous?: string | null; + results: Array; +}; + diff --git a/src/frontend/generated/models/PaginatedAreaTypeList.ts b/src/frontend/generated/models/PaginatedAreaTypeList.ts new file mode 100644 index 0000000000..8d23f1dff3 --- /dev/null +++ b/src/frontend/generated/models/PaginatedAreaTypeList.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { AreaType } from './AreaType'; +export type PaginatedAreaTypeList = { + count: number; + next?: string | null; + previous?: string | null; + results: Array; +}; + diff --git a/src/frontend/generated/models/PaginatedBeneficiaryGroupList.ts b/src/frontend/generated/models/PaginatedBeneficiaryGroupList.ts new file mode 100644 index 0000000000..b57b4dd8ce --- /dev/null +++ b/src/frontend/generated/models/PaginatedBeneficiaryGroupList.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { BeneficiaryGroup } from './BeneficiaryGroup'; +export type PaginatedBeneficiaryGroupList = { + count: number; + next?: string | null; + previous?: string | null; + results: Array; +}; + diff --git a/src/frontend/generated/models/PaginatedBusinessAreaList.ts b/src/frontend/generated/models/PaginatedBusinessAreaList.ts new file mode 100644 index 0000000000..083d867080 --- /dev/null +++ b/src/frontend/generated/models/PaginatedBusinessAreaList.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { BusinessArea } from './BusinessArea'; +export type PaginatedBusinessAreaList = { + count: number; + next?: string | null; + previous?: string | null; + results: Array; +}; + diff --git a/src/frontend/generated/models/PaginatedCountryList.ts b/src/frontend/generated/models/PaginatedCountryList.ts new file mode 100644 index 0000000000..31d6598e43 --- /dev/null +++ b/src/frontend/generated/models/PaginatedCountryList.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Country } from './Country'; +export type PaginatedCountryList = { + count: number; + next?: string | null; + previous?: string | null; + results: Array; +}; + diff --git a/src/frontend/generated/models/PaginatedPaymentPlanList.ts b/src/frontend/generated/models/PaginatedPaymentPlanList.ts new file mode 100644 index 0000000000..28b171f165 --- /dev/null +++ b/src/frontend/generated/models/PaginatedPaymentPlanList.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { PaymentPlan } from './PaymentPlan'; +export type PaginatedPaymentPlanList = { + count: number; + next?: string | null; + previous?: string | null; + results: Array; +}; + diff --git a/src/frontend/generated/models/PaginatedPeriodicDataUpdateTemplateListList.ts b/src/frontend/generated/models/PaginatedPeriodicDataUpdateTemplateListList.ts new file mode 100644 index 0000000000..3a4ea7705e --- /dev/null +++ b/src/frontend/generated/models/PaginatedPeriodicDataUpdateTemplateListList.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { PeriodicDataUpdateTemplateList } from './PeriodicDataUpdateTemplateList'; +export type PaginatedPeriodicDataUpdateTemplateListList = { + count: number; + next?: string | null; + previous?: string | null; + results: Array; +}; + diff --git a/src/frontend/generated/models/PaginatedPeriodicDataUpdateUploadListList.ts b/src/frontend/generated/models/PaginatedPeriodicDataUpdateUploadListList.ts new file mode 100644 index 0000000000..647e2b1afd --- /dev/null +++ b/src/frontend/generated/models/PaginatedPeriodicDataUpdateUploadListList.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { PeriodicDataUpdateUploadList } from './PeriodicDataUpdateUploadList'; +export type PaginatedPeriodicDataUpdateUploadListList = { + count: number; + next?: string | null; + previous?: string | null; + results: Array; +}; + diff --git a/src/frontend/generated/models/PaginatedPeriodicFieldList.ts b/src/frontend/generated/models/PaginatedPeriodicFieldList.ts new file mode 100644 index 0000000000..f6d048d7fb --- /dev/null +++ b/src/frontend/generated/models/PaginatedPeriodicFieldList.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { PeriodicField } from './PeriodicField'; +export type PaginatedPeriodicFieldList = { + count: number; + next?: string | null; + previous?: string | null; + results: Array; +}; + diff --git a/src/frontend/generated/models/PaginatedProgramCycleListList.ts b/src/frontend/generated/models/PaginatedProgramCycleListList.ts new file mode 100644 index 0000000000..0a805fa263 --- /dev/null +++ b/src/frontend/generated/models/PaginatedProgramCycleListList.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { ProgramCycleList } from './ProgramCycleList'; +export type PaginatedProgramCycleListList = { + count: number; + next?: string | null; + previous?: string | null; + results: Array; +}; + diff --git a/src/frontend/generated/models/PaginatedProgramGlobalList.ts b/src/frontend/generated/models/PaginatedProgramGlobalList.ts new file mode 100644 index 0000000000..168285da8f --- /dev/null +++ b/src/frontend/generated/models/PaginatedProgramGlobalList.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { ProgramGlobal } from './ProgramGlobal'; +export type PaginatedProgramGlobalList = { + count: number; + next?: string | null; + previous?: string | null; + results: Array; +}; + diff --git a/src/frontend/generated/models/PaginatedRegistrationDataImportListList.ts b/src/frontend/generated/models/PaginatedRegistrationDataImportListList.ts new file mode 100644 index 0000000000..e6ebd10a75 --- /dev/null +++ b/src/frontend/generated/models/PaginatedRegistrationDataImportListList.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { RegistrationDataImportList } from './RegistrationDataImportList'; +export type PaginatedRegistrationDataImportListList = { + count: number; + next?: string | null; + previous?: string | null; + results: Array; +}; + diff --git a/src/frontend/generated/models/PaginatedTargetPopulationListList.ts b/src/frontend/generated/models/PaginatedTargetPopulationListList.ts new file mode 100644 index 0000000000..0f3af7faa3 --- /dev/null +++ b/src/frontend/generated/models/PaginatedTargetPopulationListList.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { TargetPopulationList } from './TargetPopulationList'; +export type PaginatedTargetPopulationListList = { + count: number; + next?: string | null; + previous?: string | null; + results: Array; +}; + diff --git a/src/frontend/generated/models/PatchedProgramCycleUpdate.ts b/src/frontend/generated/models/PatchedProgramCycleUpdate.ts new file mode 100644 index 0000000000..ed3f8058b9 --- /dev/null +++ b/src/frontend/generated/models/PatchedProgramCycleUpdate.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type PatchedProgramCycleUpdate = { + title?: string; + start_date?: string; + end_date?: string; +}; + diff --git a/src/frontend/generated/models/PatchedRDI.ts b/src/frontend/generated/models/PatchedRDI.ts new file mode 100644 index 0000000000..7e12ed225d --- /dev/null +++ b/src/frontend/generated/models/PatchedRDI.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type PatchedRDI = { + name?: string; + program?: string; +}; + diff --git a/src/frontend/generated/models/PaymentPlan.ts b/src/frontend/generated/models/PaymentPlan.ts new file mode 100644 index 0000000000..2f45797695 --- /dev/null +++ b/src/frontend/generated/models/PaymentPlan.ts @@ -0,0 +1,26 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { FollowUpPaymentPlan } from './FollowUpPaymentPlan'; +export type PaymentPlan = { + id: string; + unicef_id?: string | null; + name?: string | null; + status: string; + target_population: string; + total_households_count?: number; + currency: string; + total_entitled_quantity?: string | null; + total_delivered_quantity?: string | null; + total_undelivered_quantity?: string | null; + dispersion_start_date: string; + dispersion_end_date: string; + is_follow_up?: boolean; + readonly follow_ups: Array; + program: string; + program_id: string; + readonly last_approval_process_date: string | null; + readonly last_approval_process_by: string | null; +}; + diff --git a/src/frontend/generated/models/PaymentPlanBulkAction.ts b/src/frontend/generated/models/PaymentPlanBulkAction.ts new file mode 100644 index 0000000000..d028538669 --- /dev/null +++ b/src/frontend/generated/models/PaymentPlanBulkAction.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { ActionEnum } from './ActionEnum'; +export type PaymentPlanBulkAction = { + ids: Array; + action: ActionEnum; + comment?: string; +}; + diff --git a/src/frontend/generated/models/PaymentPlanSupportingDocument.ts b/src/frontend/generated/models/PaymentPlanSupportingDocument.ts new file mode 100644 index 0000000000..1079e93a32 --- /dev/null +++ b/src/frontend/generated/models/PaymentPlanSupportingDocument.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type PaymentPlanSupportingDocument = { + readonly id: string; + title: string; + file: string; + readonly uploaded_at: string; + created_by?: string | null; +}; + diff --git a/src/frontend/generated/models/PeriodicDataUpdateTemplateCreate.ts b/src/frontend/generated/models/PeriodicDataUpdateTemplateCreate.ts new file mode 100644 index 0000000000..6f03e6ecc6 --- /dev/null +++ b/src/frontend/generated/models/PeriodicDataUpdateTemplateCreate.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type PeriodicDataUpdateTemplateCreate = { + readonly id: number; + rounds_data: any; + filters?: any; +}; + diff --git a/src/frontend/generated/models/PeriodicDataUpdateTemplateDetail.ts b/src/frontend/generated/models/PeriodicDataUpdateTemplateDetail.ts new file mode 100644 index 0000000000..a80bca3307 --- /dev/null +++ b/src/frontend/generated/models/PeriodicDataUpdateTemplateDetail.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type PeriodicDataUpdateTemplateDetail = { + readonly id: number; + rounds_data: any; +}; + diff --git a/src/frontend/generated/models/PeriodicDataUpdateTemplateList.ts b/src/frontend/generated/models/PeriodicDataUpdateTemplateList.ts new file mode 100644 index 0000000000..99ba796684 --- /dev/null +++ b/src/frontend/generated/models/PeriodicDataUpdateTemplateList.ts @@ -0,0 +1,14 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type PeriodicDataUpdateTemplateList = { + readonly id: number; + number_of_records?: number | null; + readonly created_at: string; + created_by?: string; + status: string; + status_display: string; + can_export: boolean; +}; + diff --git a/src/frontend/generated/models/PeriodicDataUpdateUpload.ts b/src/frontend/generated/models/PeriodicDataUpdateUpload.ts new file mode 100644 index 0000000000..8eb83e4e3f --- /dev/null +++ b/src/frontend/generated/models/PeriodicDataUpdateUpload.ts @@ -0,0 +1,8 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type PeriodicDataUpdateUpload = { + file: string; +}; + diff --git a/src/frontend/generated/models/PeriodicDataUpdateUploadDetail.ts b/src/frontend/generated/models/PeriodicDataUpdateUploadDetail.ts new file mode 100644 index 0000000000..5cbc3269be --- /dev/null +++ b/src/frontend/generated/models/PeriodicDataUpdateUploadDetail.ts @@ -0,0 +1,14 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type PeriodicDataUpdateUploadDetail = { + readonly id: number; + template: number; + readonly created_at: string; + created_by?: string; + status: string; + status_display: string; + errors_info: any; +}; + diff --git a/src/frontend/generated/models/PeriodicDataUpdateUploadList.ts b/src/frontend/generated/models/PeriodicDataUpdateUploadList.ts new file mode 100644 index 0000000000..c4dc6819a0 --- /dev/null +++ b/src/frontend/generated/models/PeriodicDataUpdateUploadList.ts @@ -0,0 +1,13 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type PeriodicDataUpdateUploadList = { + readonly id: number; + template: number; + readonly created_at: string; + created_by?: string; + status: string; + status_display: string; +}; + diff --git a/src/frontend/generated/models/PeriodicField.ts b/src/frontend/generated/models/PeriodicField.ts new file mode 100644 index 0000000000..f68c196de3 --- /dev/null +++ b/src/frontend/generated/models/PeriodicField.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { PeriodicFieldData } from './PeriodicFieldData'; +export type PeriodicField = { + readonly id: string; + name: string; + readonly label: string; + pdu_data: PeriodicFieldData; +}; + diff --git a/src/frontend/generated/models/PeriodicFieldData.ts b/src/frontend/generated/models/PeriodicFieldData.ts new file mode 100644 index 0000000000..e1846a7474 --- /dev/null +++ b/src/frontend/generated/models/PeriodicFieldData.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { SubtypeEnum } from './SubtypeEnum'; +export type PeriodicFieldData = { + subtype: SubtypeEnum; + number_of_rounds: number; + rounds_names?: Array; +}; + diff --git a/src/frontend/generated/models/PhysicalDisabilityEnum.ts b/src/frontend/generated/models/PhysicalDisabilityEnum.ts new file mode 100644 index 0000000000..0635321703 --- /dev/null +++ b/src/frontend/generated/models/PhysicalDisabilityEnum.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `` - None + * * `LOT_DIFFICULTY` - A lot of difficulty + * * `CANNOT_DO` - Cannot do at all + * * `SOME_DIFFICULTY` - Some difficulty + */ +export enum PhysicalDisabilityEnum { + LOT_DIFFICULTY = 'LOT_DIFFICULTY', + CANNOT_DO = 'CANNOT_DO', + SOME_DIFFICULTY = 'SOME_DIFFICULTY', +} diff --git a/src/frontend/generated/models/PreferredLanguageEnum.ts b/src/frontend/generated/models/PreferredLanguageEnum.ts new file mode 100644 index 0000000000..e4adacf605 --- /dev/null +++ b/src/frontend/generated/models/PreferredLanguageEnum.ts @@ -0,0 +1,40 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `en-us` - English | English + * * `ar-ae` - | عربيArabic + * * `cs-cz` - čeština | Czech + * * `de-de` - Deutsch + * * `es-es` - Español | Spanish + * * `fr-fr` - Français | French + * * `hu-hu` - Magyar | Hungarian + * * `it-it` - Italiano + * * `pl-pl` - Polskie | Polish + * * `pt-pt` - Português + * * `ro-ro` - Română + * * `ru-ru` - Русский | Russian + * * `si-si` - සිංහල | Sinhala + * * `ta-ta` - தமிழ் | Tamil + * * `uk-ua` - український | Ukrainian + * * `hi-hi` - हिंदी + */ +export enum PreferredLanguageEnum { + EN_US = 'en-us', + AR_AE = 'ar-ae', + CS_CZ = 'cs-cz', + DE_DE = 'de-de', + ES_ES = 'es-es', + FR_FR = 'fr-fr', + HU_HU = 'hu-hu', + IT_IT = 'it-it', + PL_PL = 'pl-pl', + PT_PT = 'pt-pt', + RO_RO = 'ro-ro', + RU_RU = 'ru-ru', + SI_SI = 'si-si', + TA_TA = 'ta-ta', + UK_UA = 'uk-ua', + HI_HI = 'hi-hi', +} diff --git a/src/frontend/generated/models/Program.ts b/src/frontend/generated/models/Program.ts new file mode 100644 index 0000000000..0146bd58a1 --- /dev/null +++ b/src/frontend/generated/models/Program.ts @@ -0,0 +1,20 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { FrequencyOfPaymentsEnum } from './FrequencyOfPaymentsEnum'; +import type { SectorEnum } from './SectorEnum'; +export type Program = { + readonly id: string; + name: string; + start_date: string; + end_date?: string | null; + budget: string; + frequency_of_payments: FrequencyOfPaymentsEnum; + sector: SectorEnum; + cash_plus: boolean; + population_goal: number; + data_collecting_type: number; + beneficiary_group: string; +}; + diff --git a/src/frontend/generated/models/ProgramCycleCreate.ts b/src/frontend/generated/models/ProgramCycleCreate.ts new file mode 100644 index 0000000000..9cfc2e8e70 --- /dev/null +++ b/src/frontend/generated/models/ProgramCycleCreate.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type ProgramCycleCreate = { + title: string; + start_date: string; + end_date?: string; +}; + diff --git a/src/frontend/generated/models/ProgramCycleList.ts b/src/frontend/generated/models/ProgramCycleList.ts new file mode 100644 index 0000000000..655216dc88 --- /dev/null +++ b/src/frontend/generated/models/ProgramCycleList.ts @@ -0,0 +1,22 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type ProgramCycleList = { + readonly id: string; + title?: string | null; + status: string; + start_date: string; + end_date: string; + program_start_date: string; + program_end_date: string; + readonly created_at: string; + readonly total_entitled_quantity_usd: number; + readonly total_undelivered_quantity_usd: number; + readonly total_delivered_quantity_usd: number; + readonly frequency_of_payments: string; + readonly created_by: string; + readonly admin_url: string | null; + readonly can_remove_cycle: boolean; +}; + diff --git a/src/frontend/generated/models/ProgramCycleUpdate.ts b/src/frontend/generated/models/ProgramCycleUpdate.ts new file mode 100644 index 0000000000..7194f2af67 --- /dev/null +++ b/src/frontend/generated/models/ProgramCycleUpdate.ts @@ -0,0 +1,10 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type ProgramCycleUpdate = { + title?: string; + start_date?: string; + end_date?: string; +}; + diff --git a/src/frontend/generated/models/ProgramGlobal.ts b/src/frontend/generated/models/ProgramGlobal.ts new file mode 100644 index 0000000000..75ea27cbfc --- /dev/null +++ b/src/frontend/generated/models/ProgramGlobal.ts @@ -0,0 +1,26 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { BlankEnum } from './BlankEnum'; +import type { FrequencyOfPaymentsEnum } from './FrequencyOfPaymentsEnum'; +import type { NullEnum } from './NullEnum'; +import type { ProgramGlobalStatusEnum } from './ProgramGlobalStatusEnum'; +import type { ScopeEnum } from './ScopeEnum'; +import type { SectorEnum } from './SectorEnum'; +export type ProgramGlobal = { + readonly id: string; + name: string; + programme_code?: string | null; + status: ProgramGlobalStatusEnum; + start_date: string; + end_date?: string | null; + budget: string; + frequency_of_payments: FrequencyOfPaymentsEnum; + sector: SectorEnum; + scope?: (ScopeEnum | BlankEnum | NullEnum) | null; + cash_plus: boolean; + population_goal: number; + readonly business_area_code: string; +}; + diff --git a/src/frontend/generated/models/ProgramGlobalStatusEnum.ts b/src/frontend/generated/models/ProgramGlobalStatusEnum.ts new file mode 100644 index 0000000000..ff22365e2a --- /dev/null +++ b/src/frontend/generated/models/ProgramGlobalStatusEnum.ts @@ -0,0 +1,14 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `ACTIVE` - Active + * * `DRAFT` - Draft + * * `FINISHED` - Finished + */ +export enum ProgramGlobalStatusEnum { + ACTIVE = 'ACTIVE', + DRAFT = 'DRAFT', + FINISHED = 'FINISHED', +} diff --git a/src/frontend/generated/models/PushPeople.ts b/src/frontend/generated/models/PushPeople.ts new file mode 100644 index 0000000000..f49fd92589 --- /dev/null +++ b/src/frontend/generated/models/PushPeople.ts @@ -0,0 +1,140 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Admin1Enum } from './Admin1Enum'; +import type { Admin2Enum } from './Admin2Enum'; +import type { Admin3Enum } from './Admin3Enum'; +import type { Admin4Enum } from './Admin4Enum'; +import type { BlankEnum } from './BlankEnum'; +import type { CollectIndividualDataEnum } from './CollectIndividualDataEnum'; +import type { CommsDisabilityEnum } from './CommsDisabilityEnum'; +import type { CountryEnum } from './CountryEnum'; +import type { CountryOriginEnum } from './CountryOriginEnum'; +import type { DeduplicationGoldenRecordStatusEnum } from './DeduplicationGoldenRecordStatusEnum'; +import type { DisabilityEnum } from './DisabilityEnum'; +import type { Document } from './Document'; +import type { HearingDisabilityEnum } from './HearingDisabilityEnum'; +import type { MemoryDisabilityEnum } from './MemoryDisabilityEnum'; +import type { NullEnum } from './NullEnum'; +import type { PhysicalDisabilityEnum } from './PhysicalDisabilityEnum'; +import type { PreferredLanguageEnum } from './PreferredLanguageEnum'; +import type { PushPeopleTypeEnum } from './PushPeopleTypeEnum'; +import type { RdiMergeStatusEnum } from './RdiMergeStatusEnum'; +import type { RelationshipEnum } from './RelationshipEnum'; +import type { ResidenceStatusEnum } from './ResidenceStatusEnum'; +import type { SeeingDisabilityEnum } from './SeeingDisabilityEnum'; +import type { SelfcareDisabilityEnum } from './SelfcareDisabilityEnum'; +import type { SexEnum } from './SexEnum'; +import type { WorkStatusEnum } from './WorkStatusEnum'; +export type PushPeople = { + first_registration_date?: string; + last_registration_date?: string; + observed_disability?: string; + marital_status?: string; + documents?: Array; + birth_date: string; + type: (PushPeopleTypeEnum | BlankEnum); + country_origin?: CountryOriginEnum; + country: CountryEnum; + collect_individual_data: (CollectIndividualDataEnum | BlankEnum); + residence_status: (ResidenceStatusEnum | BlankEnum); + village?: string | null; + phone_no?: string | null; + phone_no_alternative?: string | null; + admin1?: (Admin1Enum | BlankEnum | NullEnum) | null; + admin2?: (Admin2Enum | BlankEnum | NullEnum) | null; + admin3?: (Admin3Enum | BlankEnum | NullEnum) | null; + admin4?: (Admin4Enum | BlankEnum | NullEnum) | null; + rdi_merge_status?: RdiMergeStatusEnum; + is_original?: boolean; + is_removed?: boolean; + removed_date?: string | null; + last_sync_at?: string | null; + /** + * record revision number + */ + version?: number; + duplicate?: boolean; + duplicate_date?: string | null; + withdrawn?: boolean; + withdrawn_date?: string | null; + individual_id?: string; + photo?: string; + full_name: string; + given_name?: string; + middle_name?: string; + family_name?: string; + sex: SexEnum; + estimated_birth_date?: boolean; + phone_no_valid?: boolean | null; + phone_no_alternative_valid?: boolean | null; + email?: string; + payment_delivery_phone_no?: string | null; + /** + * This represents the MEMBER relationship. can be blank + * as well if household is null! + * + * * `UNKNOWN` - Unknown + * * `AUNT_UNCLE` - Aunt / Uncle + * * `BROTHER_SISTER` - Brother / Sister + * * `COUSIN` - Cousin + * * `DAUGHTERINLAW_SONINLAW` - Daughter-in-law / Son-in-law + * * `GRANDDAUGHER_GRANDSON` - Granddaughter / Grandson + * * `GRANDMOTHER_GRANDFATHER` - Grandmother / Grandfather + * * `HEAD` - Head of household (self) + * * `MOTHER_FATHER` - Mother / Father + * * `MOTHERINLAW_FATHERINLAW` - Mother-in-law / Father-in-law + * * `NEPHEW_NIECE` - Nephew / Niece + * * `NON_BENEFICIARY` - Not a Family Member. Can only act as a recipient. + * * `OTHER` - Other + * * `SISTERINLAW_BROTHERINLAW` - Sister-in-law / Brother-in-law + * * `SON_DAUGHTER` - Son / Daughter + * * `WIFE_HUSBAND` - Wife / Husband + * * `FOSTER_CHILD` - Foster child + * * `FREE_UNION` - Free union + */ + relationship?: (RelationshipEnum | BlankEnum); + work_status?: (WorkStatusEnum | BlankEnum); + flex_fields?: any; + user_fields?: any; + enrolled_in_nutrition_programme?: boolean | null; + administration_of_rutf?: boolean | null; + deduplication_golden_record_status?: DeduplicationGoldenRecordStatusEnum; + imported_individual_id?: string | null; + sanction_list_possible_match?: boolean; + sanction_list_confirmed_match?: boolean; + pregnant?: boolean | null; + disability?: DisabilityEnum; + disability_certificate_picture?: string | null; + seeing_disability?: (SeeingDisabilityEnum | BlankEnum); + hearing_disability?: (HearingDisabilityEnum | BlankEnum); + physical_disability?: (PhysicalDisabilityEnum | BlankEnum); + memory_disability?: (MemoryDisabilityEnum | BlankEnum); + selfcare_disability?: (SelfcareDisabilityEnum | BlankEnum); + comms_disability?: (CommsDisabilityEnum | BlankEnum); + who_answers_phone?: string; + who_answers_alt_phone?: string; + fchild_hoh?: boolean; + child_hoh?: boolean; + registration_id?: string | null; + program_registration_id?: string | null; + preferred_language?: (PreferredLanguageEnum | BlankEnum | NullEnum) | null; + relationship_confirmed?: boolean; + age_at_registration?: number | null; + wallet_name?: string; + blockchain_name?: string; + wallet_address?: string; + origin_unicef_id?: string | null; + is_migration_handled?: boolean; + migrated_at?: string | null; + mis_unicef_id?: string | null; + vector_column?: string | null; + individual_collection?: number | null; + program?: string | null; + /** + * If this individual was copied from another individual, this field will contain the individual it was copied from. + */ + copied_from?: string | null; +}; + diff --git a/src/frontend/generated/models/PushPeopleTypeEnum.ts b/src/frontend/generated/models/PushPeopleTypeEnum.ts new file mode 100644 index 0000000000..d09e54fef2 --- /dev/null +++ b/src/frontend/generated/models/PushPeopleTypeEnum.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `` - None + * * `NON_BENEFICIARY` - Non Beneficiary + */ +export enum PushPeopleTypeEnum { + NON_BENEFICIARY = 'NON_BENEFICIARY', +} diff --git a/src/frontend/generated/models/RDI.ts b/src/frontend/generated/models/RDI.ts new file mode 100644 index 0000000000..062643700c --- /dev/null +++ b/src/frontend/generated/models/RDI.ts @@ -0,0 +1,9 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type RDI = { + name: string; + program: string; +}; + diff --git a/src/frontend/generated/models/RDINested.ts b/src/frontend/generated/models/RDINested.ts new file mode 100644 index 0000000000..c3c4f4117f --- /dev/null +++ b/src/frontend/generated/models/RDINested.ts @@ -0,0 +1,11 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { Household } from './Household'; +export type RDINested = { + name: string; + households: Array; + program: string; +}; + diff --git a/src/frontend/generated/models/RdiMergeStatusEnum.ts b/src/frontend/generated/models/RdiMergeStatusEnum.ts new file mode 100644 index 0000000000..ec5feb792d --- /dev/null +++ b/src/frontend/generated/models/RdiMergeStatusEnum.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `PENDING` - Pending + * * `MERGED` - Merged + */ +export enum RdiMergeStatusEnum { + PENDING = 'PENDING', + MERGED = 'MERGED', +} diff --git a/src/frontend/generated/models/RegistrationDataImportList.ts b/src/frontend/generated/models/RegistrationDataImportList.ts new file mode 100644 index 0000000000..255af0d15e --- /dev/null +++ b/src/frontend/generated/models/RegistrationDataImportList.ts @@ -0,0 +1,13 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type RegistrationDataImportList = { + readonly id: string; + name: string; + status: string; + data_source: string; + imported_by?: string; + readonly created_at: string; +}; + diff --git a/src/frontend/generated/models/RegistrationMethodEnum.ts b/src/frontend/generated/models/RegistrationMethodEnum.ts new file mode 100644 index 0000000000..2fa9eb3197 --- /dev/null +++ b/src/frontend/generated/models/RegistrationMethodEnum.ts @@ -0,0 +1,13 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `` - None + * * `COMMUNITY` - Community-level Registration + * * `HH_REGISTRATION` - Household Registration + */ +export enum RegistrationMethodEnum { + COMMUNITY = 'COMMUNITY', + HH_REGISTRATION = 'HH_REGISTRATION', +} diff --git a/src/frontend/generated/models/RelationshipEnum.ts b/src/frontend/generated/models/RelationshipEnum.ts new file mode 100644 index 0000000000..8863da6c94 --- /dev/null +++ b/src/frontend/generated/models/RelationshipEnum.ts @@ -0,0 +1,44 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `UNKNOWN` - Unknown + * * `AUNT_UNCLE` - Aunt / Uncle + * * `BROTHER_SISTER` - Brother / Sister + * * `COUSIN` - Cousin + * * `DAUGHTERINLAW_SONINLAW` - Daughter-in-law / Son-in-law + * * `GRANDDAUGHER_GRANDSON` - Granddaughter / Grandson + * * `GRANDMOTHER_GRANDFATHER` - Grandmother / Grandfather + * * `HEAD` - Head of household (self) + * * `MOTHER_FATHER` - Mother / Father + * * `MOTHERINLAW_FATHERINLAW` - Mother-in-law / Father-in-law + * * `NEPHEW_NIECE` - Nephew / Niece + * * `NON_BENEFICIARY` - Not a Family Member. Can only act as a recipient. + * * `OTHER` - Other + * * `SISTERINLAW_BROTHERINLAW` - Sister-in-law / Brother-in-law + * * `SON_DAUGHTER` - Son / Daughter + * * `WIFE_HUSBAND` - Wife / Husband + * * `FOSTER_CHILD` - Foster child + * * `FREE_UNION` - Free union + */ +export enum RelationshipEnum { + UNKNOWN = 'UNKNOWN', + AUNT_UNCLE = 'AUNT_UNCLE', + BROTHER_SISTER = 'BROTHER_SISTER', + COUSIN = 'COUSIN', + DAUGHTERINLAW_SONINLAW = 'DAUGHTERINLAW_SONINLAW', + GRANDDAUGHER_GRANDSON = 'GRANDDAUGHER_GRANDSON', + GRANDMOTHER_GRANDFATHER = 'GRANDMOTHER_GRANDFATHER', + HEAD = 'HEAD', + MOTHER_FATHER = 'MOTHER_FATHER', + MOTHERINLAW_FATHERINLAW = 'MOTHERINLAW_FATHERINLAW', + NEPHEW_NIECE = 'NEPHEW_NIECE', + NON_BENEFICIARY = 'NON_BENEFICIARY', + OTHER = 'OTHER', + SISTERINLAW_BROTHERINLAW = 'SISTERINLAW_BROTHERINLAW', + SON_DAUGHTER = 'SON_DAUGHTER', + WIFE_HUSBAND = 'WIFE_HUSBAND', + FOSTER_CHILD = 'FOSTER_CHILD', + FREE_UNION = 'FREE_UNION', +} diff --git a/src/frontend/generated/models/ResidenceStatusEnum.ts b/src/frontend/generated/models/ResidenceStatusEnum.ts new file mode 100644 index 0000000000..9d2c6168d2 --- /dev/null +++ b/src/frontend/generated/models/ResidenceStatusEnum.ts @@ -0,0 +1,21 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `` - None + * * `IDP` - Displaced | Internally Displaced People + * * `REFUGEE` - Displaced | Refugee / Asylum Seeker + * * `OTHERS_OF_CONCERN` - Displaced | Others of Concern + * * `HOST` - Non-displaced | Host + * * `NON_HOST` - Non-displaced | Non-host + * * `RETURNEE` - Displaced | Returnee + */ +export enum ResidenceStatusEnum { + IDP = 'IDP', + REFUGEE = 'REFUGEE', + OTHERS_OF_CONCERN = 'OTHERS_OF_CONCERN', + HOST = 'HOST', + NON_HOST = 'NON_HOST', + RETURNEE = 'RETURNEE', +} diff --git a/src/frontend/generated/models/ScopeEnum.ts b/src/frontend/generated/models/ScopeEnum.ts new file mode 100644 index 0000000000..82936aed86 --- /dev/null +++ b/src/frontend/generated/models/ScopeEnum.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `FOR_PARTNERS` - For partners + * * `UNICEF` - Unicef + */ +export enum ScopeEnum { + FOR_PARTNERS = 'FOR_PARTNERS', + UNICEF = 'UNICEF', +} diff --git a/src/frontend/generated/models/SectorEnum.ts b/src/frontend/generated/models/SectorEnum.ts new file mode 100644 index 0000000000..d3d3d90ee8 --- /dev/null +++ b/src/frontend/generated/models/SectorEnum.ts @@ -0,0 +1,22 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `CHILD_PROTECTION` - Child Protection + * * `EDUCATION` - Education + * * `HEALTH` - Health + * * `MULTI_PURPOSE` - Multi Purpose + * * `NUTRITION` - Nutrition + * * `SOCIAL_POLICY` - Social Policy + * * `WASH` - WASH + */ +export enum SectorEnum { + CHILD_PROTECTION = 'CHILD_PROTECTION', + EDUCATION = 'EDUCATION', + HEALTH = 'HEALTH', + MULTI_PURPOSE = 'MULTI_PURPOSE', + NUTRITION = 'NUTRITION', + SOCIAL_POLICY = 'SOCIAL_POLICY', + WASH = 'WASH', +} diff --git a/src/frontend/generated/models/SeeingDisabilityEnum.ts b/src/frontend/generated/models/SeeingDisabilityEnum.ts new file mode 100644 index 0000000000..f3e84a286f --- /dev/null +++ b/src/frontend/generated/models/SeeingDisabilityEnum.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `` - None + * * `LOT_DIFFICULTY` - A lot of difficulty + * * `CANNOT_DO` - Cannot do at all + * * `SOME_DIFFICULTY` - Some difficulty + */ +export enum SeeingDisabilityEnum { + LOT_DIFFICULTY = 'LOT_DIFFICULTY', + CANNOT_DO = 'CANNOT_DO', + SOME_DIFFICULTY = 'SOME_DIFFICULTY', +} diff --git a/src/frontend/generated/models/SelfcareDisabilityEnum.ts b/src/frontend/generated/models/SelfcareDisabilityEnum.ts new file mode 100644 index 0000000000..a50b79643f --- /dev/null +++ b/src/frontend/generated/models/SelfcareDisabilityEnum.ts @@ -0,0 +1,15 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `` - None + * * `LOT_DIFFICULTY` - A lot of difficulty + * * `CANNOT_DO` - Cannot do at all + * * `SOME_DIFFICULTY` - Some difficulty + */ +export enum SelfcareDisabilityEnum { + LOT_DIFFICULTY = 'LOT_DIFFICULTY', + CANNOT_DO = 'CANNOT_DO', + SOME_DIFFICULTY = 'SOME_DIFFICULTY', +} diff --git a/src/frontend/generated/models/SexEnum.ts b/src/frontend/generated/models/SexEnum.ts new file mode 100644 index 0000000000..bad33e7690 --- /dev/null +++ b/src/frontend/generated/models/SexEnum.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `MALE` - Male + * * `FEMALE` - Female + */ +export enum SexEnum { + MALE = 'MALE', + FEMALE = 'FEMALE', +} diff --git a/src/frontend/generated/models/SubtypeEnum.ts b/src/frontend/generated/models/SubtypeEnum.ts new file mode 100644 index 0000000000..d4f65d58fa --- /dev/null +++ b/src/frontend/generated/models/SubtypeEnum.ts @@ -0,0 +1,16 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `DATE` - Date + * * `DECIMAL` - Number + * * `STRING` - Text + * * `BOOL` - Boolean (true/false) + */ +export enum SubtypeEnum { + DATE = 'DATE', + DECIMAL = 'DECIMAL', + STRING = 'STRING', + BOOL = 'BOOL', +} diff --git a/src/frontend/generated/models/TargetPopulationList.ts b/src/frontend/generated/models/TargetPopulationList.ts new file mode 100644 index 0000000000..15adb8d0a6 --- /dev/null +++ b/src/frontend/generated/models/TargetPopulationList.ts @@ -0,0 +1,12 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export type TargetPopulationList = { + readonly id: string; + name: string; + status: string; + created_by?: string; + readonly created_at: string; +}; + diff --git a/src/frontend/generated/models/WorkStatusEnum.ts b/src/frontend/generated/models/WorkStatusEnum.ts new file mode 100644 index 0000000000..8797602a52 --- /dev/null +++ b/src/frontend/generated/models/WorkStatusEnum.ts @@ -0,0 +1,14 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +/** + * * `1` - Yes + * * `0` - No + * * `NOT_PROVIDED` - Not provided + */ +export enum WorkStatusEnum { + _1 = '1', + _0 = '0', + NOT_PROVIDED = 'NOT_PROVIDED', +} diff --git a/src/frontend/generated/services/FieldsAttributesService.ts b/src/frontend/generated/services/FieldsAttributesService.ts new file mode 100644 index 0000000000..6028765090 --- /dev/null +++ b/src/frontend/generated/services/FieldsAttributesService.ts @@ -0,0 +1,19 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { CancelablePromise } from '../core/CancelablePromise'; +import { OpenAPI } from '../core/OpenAPI'; +import { request as __request } from '../core/request'; +export class FieldsAttributesService { + /** + * @returns any No response body + * @throws ApiError + */ + public static fieldsAttributesRetrieve(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/fields_attributes/', + }); + } +} diff --git a/src/frontend/generated/services/HhStatusService.ts b/src/frontend/generated/services/HhStatusService.ts new file mode 100644 index 0000000000..738fe417cc --- /dev/null +++ b/src/frontend/generated/services/HhStatusService.ts @@ -0,0 +1,19 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { CancelablePromise } from '../core/CancelablePromise'; +import { OpenAPI } from '../core/OpenAPI'; +import { request as __request } from '../core/request'; +export class HhStatusService { + /** + * @returns any No response body + * @throws ApiError + */ + public static hhStatusRetrieve(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/hh-status', + }); + } +} diff --git a/src/frontend/generated/services/RestService.ts b/src/frontend/generated/services/RestService.ts new file mode 100644 index 0000000000..6bd325d91b --- /dev/null +++ b/src/frontend/generated/services/RestService.ts @@ -0,0 +1,1350 @@ +/* generated using openapi-typescript-codegen -- do not edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +import type { DelegatePeople } from '../models/DelegatePeople'; +import type { PaginatedAreaList } from '../models/PaginatedAreaList'; +import type { PaginatedAreaListList } from '../models/PaginatedAreaListList'; +import type { PaginatedAreaTypeList } from '../models/PaginatedAreaTypeList'; +import type { PaginatedBeneficiaryGroupList } from '../models/PaginatedBeneficiaryGroupList'; +import type { PaginatedBusinessAreaList } from '../models/PaginatedBusinessAreaList'; +import type { PaginatedCountryList } from '../models/PaginatedCountryList'; +import type { PaginatedPaymentPlanList } from '../models/PaginatedPaymentPlanList'; +import type { PaginatedPeriodicDataUpdateTemplateListList } from '../models/PaginatedPeriodicDataUpdateTemplateListList'; +import type { PaginatedPeriodicDataUpdateUploadListList } from '../models/PaginatedPeriodicDataUpdateUploadListList'; +import type { PaginatedPeriodicFieldList } from '../models/PaginatedPeriodicFieldList'; +import type { PaginatedProgramCycleListList } from '../models/PaginatedProgramCycleListList'; +import type { PaginatedProgramGlobalList } from '../models/PaginatedProgramGlobalList'; +import type { PaginatedRegistrationDataImportListList } from '../models/PaginatedRegistrationDataImportListList'; +import type { PaginatedTargetPopulationListList } from '../models/PaginatedTargetPopulationListList'; +import type { PatchedProgramCycleUpdate } from '../models/PatchedProgramCycleUpdate'; +import type { PatchedRDI } from '../models/PatchedRDI'; +import type { PaymentPlanBulkAction } from '../models/PaymentPlanBulkAction'; +import type { PaymentPlanSupportingDocument } from '../models/PaymentPlanSupportingDocument'; +import type { PeriodicDataUpdateTemplateCreate } from '../models/PeriodicDataUpdateTemplateCreate'; +import type { PeriodicDataUpdateTemplateDetail } from '../models/PeriodicDataUpdateTemplateDetail'; +import type { PeriodicDataUpdateUpload } from '../models/PeriodicDataUpdateUpload'; +import type { PeriodicDataUpdateUploadDetail } from '../models/PeriodicDataUpdateUploadDetail'; +import type { Program } from '../models/Program'; +import type { ProgramCycleCreate } from '../models/ProgramCycleCreate'; +import type { ProgramCycleList } from '../models/ProgramCycleList'; +import type { ProgramCycleUpdate } from '../models/ProgramCycleUpdate'; +import type { PushPeople } from '../models/PushPeople'; +import type { RDI } from '../models/RDI'; +import type { RDINested } from '../models/RDINested'; +import type { RegistrationDataImportList } from '../models/RegistrationDataImportList'; +import type { CancelablePromise } from '../core/CancelablePromise'; +import { OpenAPI } from '../core/OpenAPI'; +import { request as __request } from '../core/request'; +export class RestService { + /** + * OpenApi3 schema for this API. Format can be selected via content negotiation. + * + * - YAML: application/vnd.oai.openapi + * - JSON: application/vnd.oai.openapi+json + * @param format + * @param lang + * @returns any + * @throws ApiError + */ + public static restRetrieve( + format?: 'json' | 'yaml', + lang?: 'af' | 'ar' | 'ar-dz' | 'ast' | 'az' | 'be' | 'bg' | 'bn' | 'br' | 'bs' | 'ca' | 'cs' | 'cy' | 'da' | 'de' | 'dsb' | 'el' | 'en' | 'en-au' | 'en-gb' | 'eo' | 'es' | 'es-ar' | 'es-co' | 'es-mx' | 'es-ni' | 'es-ve' | 'et' | 'eu' | 'fa' | 'fi' | 'fr' | 'fy' | 'ga' | 'gd' | 'gl' | 'he' | 'hi' | 'hr' | 'hsb' | 'hu' | 'hy' | 'ia' | 'id' | 'ig' | 'io' | 'is' | 'it' | 'ja' | 'ka' | 'kab' | 'kk' | 'km' | 'kn' | 'ko' | 'ky' | 'lb' | 'lt' | 'lv' | 'mk' | 'ml' | 'mn' | 'mr' | 'my' | 'nb' | 'ne' | 'nl' | 'nn' | 'os' | 'pa' | 'pl' | 'pt' | 'pt-br' | 'ro' | 'ru' | 'sk' | 'sl' | 'sq' | 'sr' | 'sr-latn' | 'sv' | 'sw' | 'ta' | 'te' | 'tg' | 'th' | 'tk' | 'tr' | 'tt' | 'udm' | 'uk' | 'ur' | 'uz' | 'vi' | 'zh-hans' | 'zh-hant', + ): CancelablePromise> { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/', + query: { + 'format': format, + 'lang': lang, + }, + }); + } + /** + * @param businessArea + * @param limit Number of results to return per page. + * @param offset The initial index from which to return the results. + * @param ordering Which field to use when ordering the results. + * @returns PaginatedAreaListList + * @throws ApiError + */ + public static restGeoAreasList( + businessArea: string, + limit?: number, + offset?: number, + ordering?: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/{business_area}/geo/areas/', + path: { + 'business_area': businessArea, + }, + query: { + 'limit': limit, + 'offset': offset, + 'ordering': ordering, + }, + }); + } + /** + * @param businessArea + * @param limit Number of results to return per page. + * @param offset The initial index from which to return the results. + * @param ordering Which field to use when ordering the results. + * @param search A search term. + * @returns PaginatedPaymentPlanList + * @throws ApiError + */ + public static restPaymentsPaymentPlansManagerialList( + businessArea: string, + limit?: number, + offset?: number, + ordering?: string, + search?: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/{business_area}/payments/payment-plans-managerial/', + path: { + 'business_area': businessArea, + }, + query: { + 'limit': limit, + 'offset': offset, + 'ordering': ordering, + 'search': search, + }, + }); + } + /** + * @param businessArea + * @param requestBody + * @returns PaymentPlanBulkAction + * @throws ApiError + */ + public static restPaymentsPaymentPlansManagerialBulkActionCreate( + businessArea: string, + requestBody: PaymentPlanBulkAction, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/rest/{business_area}/payments/payment-plans-managerial/bulk-action/', + path: { + 'business_area': businessArea, + }, + body: requestBody, + mediaType: 'application/json', + }); + } + /** + * @param businessArea + * @param ordering Which field to use when ordering the results. + * @param updatedAtAfter + * @param updatedAtBefore + * @returns Program + * @throws ApiError + */ + public static restProgramList( + businessArea: string, + ordering?: string, + updatedAtAfter?: string, + updatedAtBefore?: string, + ): CancelablePromise> { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/{business_area}/program/', + path: { + 'business_area': businessArea, + }, + query: { + 'ordering': ordering, + 'updated_at_after': updatedAtAfter, + 'updated_at_before': updatedAtBefore, + }, + }); + } + /** + * @param businessArea + * @param requestBody + * @returns Program + * @throws ApiError + */ + public static restProgramCreateCreate( + businessArea: string, + requestBody: Program, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/rest/{business_area}/program/create/', + path: { + 'business_area': businessArea, + }, + body: requestBody, + mediaType: 'application/json', + }); + } + /** + * @param businessArea + * @param programId + * @param limit Number of results to return per page. + * @param offset The initial index from which to return the results. + * @param ordering Which field to use when ordering the results. + * @returns PaginatedProgramCycleListList + * @throws ApiError + */ + public static restProgramsCyclesList( + businessArea: string, + programId: string, + limit?: number, + offset?: number, + ordering?: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/{business_area}/programs/{program_id}/cycles/', + path: { + 'business_area': businessArea, + 'program_id': programId, + }, + query: { + 'limit': limit, + 'offset': offset, + 'ordering': ordering, + }, + }); + } + /** + * @param businessArea + * @param programId + * @param requestBody + * @returns ProgramCycleCreate + * @throws ApiError + */ + public static restProgramsCyclesCreate( + businessArea: string, + programId: string, + requestBody: ProgramCycleCreate, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/rest/{business_area}/programs/{program_id}/cycles/', + path: { + 'business_area': businessArea, + 'program_id': programId, + }, + body: requestBody, + mediaType: 'application/json', + }); + } + /** + * @param businessArea + * @param id + * @param programId + * @returns ProgramCycleList + * @throws ApiError + */ + public static restProgramsCyclesRetrieve( + businessArea: string, + id: string, + programId: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/{business_area}/programs/{program_id}/cycles/{id}/', + path: { + 'business_area': businessArea, + 'id': id, + 'program_id': programId, + }, + }); + } + /** + * @param businessArea + * @param id + * @param programId + * @param requestBody + * @returns ProgramCycleUpdate + * @throws ApiError + */ + public static restProgramsCyclesUpdate( + businessArea: string, + id: string, + programId: string, + requestBody?: ProgramCycleUpdate, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/rest/{business_area}/programs/{program_id}/cycles/{id}/', + path: { + 'business_area': businessArea, + 'id': id, + 'program_id': programId, + }, + body: requestBody, + mediaType: 'application/json', + }); + } + /** + * @param businessArea + * @param id + * @param programId + * @param requestBody + * @returns ProgramCycleUpdate + * @throws ApiError + */ + public static restProgramsCyclesPartialUpdate( + businessArea: string, + id: string, + programId: string, + requestBody?: PatchedProgramCycleUpdate, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/rest/{business_area}/programs/{program_id}/cycles/{id}/', + path: { + 'business_area': businessArea, + 'id': id, + 'program_id': programId, + }, + body: requestBody, + mediaType: 'application/json', + }); + } + /** + * @param businessArea + * @param id + * @param programId + * @returns void + * @throws ApiError + */ + public static restProgramsCyclesDestroy( + businessArea: string, + id: string, + programId: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/rest/{business_area}/programs/{program_id}/cycles/{id}/', + path: { + 'business_area': businessArea, + 'id': id, + 'program_id': programId, + }, + }); + } + /** + * @param businessArea + * @param id + * @param programId + * @returns any No response body + * @throws ApiError + */ + public static restProgramsCyclesFinishCreate( + businessArea: string, + id: string, + programId: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/rest/{business_area}/programs/{program_id}/cycles/{id}/finish/', + path: { + 'business_area': businessArea, + 'id': id, + 'program_id': programId, + }, + }); + } + /** + * @param businessArea + * @param id + * @param programId + * @returns any No response body + * @throws ApiError + */ + public static restProgramsCyclesReactivateCreate( + businessArea: string, + id: string, + programId: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/rest/{business_area}/programs/{program_id}/cycles/{id}/reactivate/', + path: { + 'business_area': businessArea, + 'id': id, + 'program_id': programId, + }, + }); + } + /** + * @param businessArea + * @param paymentPlanId + * @param programId + * @param requestBody + * @returns PaymentPlanSupportingDocument + * @throws ApiError + */ + public static restProgramsPaymentPlansSupportingDocumentsCreate( + businessArea: string, + paymentPlanId: string, + programId: string, + requestBody: PaymentPlanSupportingDocument, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/rest/{business_area}/programs/{program_id}/payment-plans/{payment_plan_id}/supporting-documents/', + path: { + 'business_area': businessArea, + 'payment_plan_id': paymentPlanId, + 'program_id': programId, + }, + body: requestBody, + mediaType: 'application/json', + }); + } + /** + * @param businessArea + * @param fileId + * @param paymentPlanId + * @param programId + * @returns void + * @throws ApiError + */ + public static restProgramsPaymentPlansSupportingDocumentsDestroy( + businessArea: string, + fileId: string, + paymentPlanId: string, + programId: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'DELETE', + url: '/api/rest/{business_area}/programs/{program_id}/payment-plans/{payment_plan_id}/supporting-documents/{file_id}/', + path: { + 'business_area': businessArea, + 'file_id': fileId, + 'payment_plan_id': paymentPlanId, + 'program_id': programId, + }, + }); + } + /** + * @param businessArea + * @param fileId + * @param paymentPlanId + * @param programId + * @returns PaymentPlanSupportingDocument + * @throws ApiError + */ + public static restProgramsPaymentPlansSupportingDocumentsDownloadRetrieve( + businessArea: string, + fileId: string, + paymentPlanId: string, + programId: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/{business_area}/programs/{program_id}/payment-plans/{payment_plan_id}/supporting-documents/{file_id}/download/', + path: { + 'business_area': businessArea, + 'file_id': fileId, + 'payment_plan_id': paymentPlanId, + 'program_id': programId, + }, + }); + } + /** + * @param businessArea + * @param programId + * @param limit Number of results to return per page. + * @param offset The initial index from which to return the results. + * @param ordering Which field to use when ordering the results. + * @returns PaginatedPeriodicDataUpdateTemplateListList + * @throws ApiError + */ + public static restProgramsPeriodicDataUpdatePeriodicDataUpdateTemplatesList( + businessArea: string, + programId: string, + limit?: number, + offset?: number, + ordering?: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/{business_area}/programs/{program_id}/periodic-data-update/periodic-data-update-templates/', + path: { + 'business_area': businessArea, + 'program_id': programId, + }, + query: { + 'limit': limit, + 'offset': offset, + 'ordering': ordering, + }, + }); + } + /** + * @param businessArea + * @param programId + * @param requestBody + * @returns PeriodicDataUpdateTemplateCreate + * @throws ApiError + */ + public static restProgramsPeriodicDataUpdatePeriodicDataUpdateTemplatesCreate( + businessArea: string, + programId: string, + requestBody: PeriodicDataUpdateTemplateCreate, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/rest/{business_area}/programs/{program_id}/periodic-data-update/periodic-data-update-templates/', + path: { + 'business_area': businessArea, + 'program_id': programId, + }, + body: requestBody, + mediaType: 'application/json', + }); + } + /** + * @param businessArea + * @param id + * @param programId + * @returns PeriodicDataUpdateTemplateDetail + * @throws ApiError + */ + public static restProgramsPeriodicDataUpdatePeriodicDataUpdateTemplatesRetrieve( + businessArea: string, + id: string, + programId: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/{business_area}/programs/{program_id}/periodic-data-update/periodic-data-update-templates/{id}/', + path: { + 'business_area': businessArea, + 'id': id, + 'program_id': programId, + }, + }); + } + /** + * @param businessArea + * @param id + * @param programId + * @returns any No response body + * @throws ApiError + */ + public static restProgramsPeriodicDataUpdatePeriodicDataUpdateTemplatesDownloadRetrieve( + businessArea: string, + id: string, + programId: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/{business_area}/programs/{program_id}/periodic-data-update/periodic-data-update-templates/{id}/download/', + path: { + 'business_area': businessArea, + 'id': id, + 'program_id': programId, + }, + }); + } + /** + * @param businessArea + * @param id + * @param programId + * @returns any No response body + * @throws ApiError + */ + public static restProgramsPeriodicDataUpdatePeriodicDataUpdateTemplatesExportCreate( + businessArea: string, + id: string, + programId: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/rest/{business_area}/programs/{program_id}/periodic-data-update/periodic-data-update-templates/{id}/export/', + path: { + 'business_area': businessArea, + 'id': id, + 'program_id': programId, + }, + }); + } + /** + * @param businessArea + * @param programId + * @param limit Number of results to return per page. + * @param offset The initial index from which to return the results. + * @param ordering Which field to use when ordering the results. + * @returns PaginatedPeriodicDataUpdateUploadListList + * @throws ApiError + */ + public static restProgramsPeriodicDataUpdatePeriodicDataUpdateUploadsList( + businessArea: string, + programId: string, + limit?: number, + offset?: number, + ordering?: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/{business_area}/programs/{program_id}/periodic-data-update/periodic-data-update-uploads/', + path: { + 'business_area': businessArea, + 'program_id': programId, + }, + query: { + 'limit': limit, + 'offset': offset, + 'ordering': ordering, + }, + }); + } + /** + * @param businessArea + * @param id + * @param programId + * @returns PeriodicDataUpdateUploadDetail + * @throws ApiError + */ + public static restProgramsPeriodicDataUpdatePeriodicDataUpdateUploadsRetrieve( + businessArea: string, + id: string, + programId: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/{business_area}/programs/{program_id}/periodic-data-update/periodic-data-update-uploads/{id}/', + path: { + 'business_area': businessArea, + 'id': id, + 'program_id': programId, + }, + }); + } + /** + * @param businessArea + * @param programId + * @param requestBody + * @returns PeriodicDataUpdateUpload + * @throws ApiError + */ + public static restProgramsPeriodicDataUpdatePeriodicDataUpdateUploadsUploadCreate( + businessArea: string, + programId: string, + requestBody: PeriodicDataUpdateUpload, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/rest/{business_area}/programs/{program_id}/periodic-data-update/periodic-data-update-uploads/upload/', + path: { + 'business_area': businessArea, + 'program_id': programId, + }, + body: requestBody, + mediaType: 'application/json', + }); + } + /** + * @param businessArea + * @param programId + * @param limit Number of results to return per page. + * @param offset The initial index from which to return the results. + * @param ordering Which field to use when ordering the results. + * @returns PaginatedPeriodicFieldList + * @throws ApiError + */ + public static restProgramsPeriodicDataUpdatePeriodicFieldsList( + businessArea: string, + programId: string, + limit?: number, + offset?: number, + ordering?: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/{business_area}/programs/{program_id}/periodic-data-update/periodic-fields/', + path: { + 'business_area': businessArea, + 'program_id': programId, + }, + query: { + 'limit': limit, + 'offset': offset, + 'ordering': ordering, + }, + }); + } + /** + * @param businessArea + * @param programId + * @param limit Number of results to return per page. + * @param offset The initial index from which to return the results. + * @param ordering Which field to use when ordering the results. + * @returns PaginatedRegistrationDataImportListList + * @throws ApiError + */ + public static restProgramsRegistrationDataRegistrationDataImportsList( + businessArea: string, + programId: string, + limit?: number, + offset?: number, + ordering?: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/{business_area}/programs/{program_id}/registration-data/registration-data-imports/', + path: { + 'business_area': businessArea, + 'program_id': programId, + }, + query: { + 'limit': limit, + 'offset': offset, + 'ordering': ordering, + }, + }); + } + /** + * @param businessArea + * @param programId + * @param requestBody + * @returns RegistrationDataImportList + * @throws ApiError + */ + public static restProgramsRegistrationDataRegistrationDataImportsRunDeduplicationCreate( + businessArea: string, + programId: string, + requestBody: RegistrationDataImportList, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/rest/{business_area}/programs/{program_id}/registration-data/registration-data-imports/run-deduplication/', + path: { + 'business_area': businessArea, + 'program_id': programId, + }, + body: requestBody, + mediaType: 'application/json', + }); + } + /** + * @param businessArea + * @param programId + * @returns any No response body + * @throws ApiError + */ + public static restProgramsRegistrationDataWebhookdeduplicationRetrieve( + businessArea: string, + programId: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/{business_area}/programs/{program_id}/registration-data/webhookdeduplication/', + path: { + 'business_area': businessArea, + 'program_id': programId, + }, + }); + } + /** + * @param businessArea + * @param programId + * @param limit Number of results to return per page. + * @param offset The initial index from which to return the results. + * @param ordering Which field to use when ordering the results. + * @returns PaginatedTargetPopulationListList + * @throws ApiError + */ + public static restProgramsTargetingTargetPopulationsList( + businessArea: string, + programId: string, + limit?: number, + offset?: number, + ordering?: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/{business_area}/programs/{program_id}/targeting/target-populations/', + path: { + 'business_area': businessArea, + 'program_id': programId, + }, + query: { + 'limit': limit, + 'offset': offset, + 'ordering': ordering, + }, + }); + } + /** + * Api to Create RDI for selected business area + * @param businessArea + * @param rdi + * @param requestBody + * @returns RDI + * @throws ApiError + */ + public static restRdiCompletedCreate( + businessArea: string, + rdi: string, + requestBody: RDI, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/rest/{business_area}/rdi/{rdi}/completed/', + path: { + 'business_area': businessArea, + 'rdi': rdi, + }, + body: requestBody, + mediaType: 'application/json', + }); + } + /** + * Api to Create RDI for selected business area + * @param businessArea + * @param rdi + * @param requestBody + * @returns RDI + * @throws ApiError + */ + public static restRdiCompletedUpdate( + businessArea: string, + rdi: string, + requestBody: RDI, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'PUT', + url: '/api/rest/{business_area}/rdi/{rdi}/completed/', + path: { + 'business_area': businessArea, + 'rdi': rdi, + }, + body: requestBody, + mediaType: 'application/json', + }); + } + /** + * Api to Create RDI for selected business area + * @param businessArea + * @param rdi + * @param requestBody + * @returns RDI + * @throws ApiError + */ + public static restRdiCompletedPartialUpdate( + businessArea: string, + rdi: string, + requestBody?: PatchedRDI, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'PATCH', + url: '/api/rest/{business_area}/rdi/{rdi}/completed/', + path: { + 'business_area': businessArea, + 'rdi': rdi, + }, + body: requestBody, + mediaType: 'application/json', + }); + } + /** + * @param businessArea + * @param rdi + * @param requestBody + * @returns any No response body + * @throws ApiError + */ + public static restRdiDelegatePeopleCreate( + businessArea: string, + rdi: string, + requestBody: DelegatePeople, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/rest/{business_area}/rdi/{rdi}/delegate/people/', + path: { + 'business_area': businessArea, + 'rdi': rdi, + }, + body: requestBody, + mediaType: 'application/json', + }); + } + /** + * Api to link Households with selected RDI + * @param businessArea + * @param rdi + * @returns any No response body + * @throws ApiError + */ + public static restRdiPushCreate( + businessArea: string, + rdi: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/rest/{business_area}/rdi/{rdi}/push/', + path: { + 'business_area': businessArea, + 'rdi': rdi, + }, + }); + } + /** + * Api to link Households with selected RDI + * @param businessArea + * @param rdi + * @returns any No response body + * @throws ApiError + */ + public static restRdiPushLaxCreate( + businessArea: string, + rdi: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/rest/{business_area}/rdi/{rdi}/push/lax/', + path: { + 'business_area': businessArea, + 'rdi': rdi, + }, + }); + } + /** + * @param businessArea + * @param rdi + * @param requestBody + * @returns any No response body + * @throws ApiError + */ + public static restRdiPushPeopleCreate( + businessArea: string, + rdi: string, + requestBody: PushPeople, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/rest/{business_area}/rdi/{rdi}/push/people/', + path: { + 'business_area': businessArea, + 'rdi': rdi, + }, + body: requestBody, + mediaType: 'application/json', + }); + } + /** + * Api to Create RDI for selected business area + * @param businessArea + * @param requestBody + * @returns RDI + * @throws ApiError + */ + public static restRdiCreateCreate( + businessArea: string, + requestBody: RDI, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/rest/{business_area}/rdi/create/', + path: { + 'business_area': businessArea, + }, + body: requestBody, + mediaType: 'application/json', + }); + } + /** + * @param businessArea + * @param requestBody + * @returns any No response body + * @throws ApiError + */ + public static restRdiUploadCreate( + businessArea: string, + requestBody: RDINested, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/rest/{business_area}/rdi/upload/', + path: { + 'business_area': businessArea, + }, + body: requestBody, + mediaType: 'application/json', + }); + } + /** + * @param areaTypeAreaLevel + * @param countryIsoCode2 + * @param countryIsoCode3 + * @param limit Number of results to return per page. + * @param offset The initial index from which to return the results. + * @param ordering Which field to use when ordering the results. + * @param parentId + * @param parentPCode + * @param search A search term. + * @param updatedAtAfter + * @param updatedAtBefore + * @param validFromAfter + * @param validFromBefore + * @param validUntilAfter + * @param validUntilBefore + * @returns PaginatedAreaList + * @throws ApiError + */ + public static restAreasList( + areaTypeAreaLevel?: number, + countryIsoCode2?: string, + countryIsoCode3?: string, + limit?: number, + offset?: number, + ordering?: string, + parentId?: string, + parentPCode?: string, + search?: string, + updatedAtAfter?: string, + updatedAtBefore?: string, + validFromAfter?: string, + validFromBefore?: string, + validUntilAfter?: string, + validUntilBefore?: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/areas/', + query: { + 'area_type_area_level': areaTypeAreaLevel, + 'country_iso_code2': countryIsoCode2, + 'country_iso_code3': countryIsoCode3, + 'limit': limit, + 'offset': offset, + 'ordering': ordering, + 'parent_id': parentId, + 'parent_p_code': parentPCode, + 'search': search, + 'updated_at_after': updatedAtAfter, + 'updated_at_before': updatedAtBefore, + 'valid_from_after': validFromAfter, + 'valid_from_before': validFromBefore, + 'valid_until_after': validUntilAfter, + 'valid_until_before': validUntilBefore, + }, + }); + } + /** + * @param areaLevel + * @param countryIsoCode2 + * @param countryIsoCode3 + * @param limit Number of results to return per page. + * @param offset The initial index from which to return the results. + * @param ordering Which field to use when ordering the results. + * @param parentAreaLevel + * @param search A search term. + * @param updatedAtAfter + * @param updatedAtBefore + * @returns PaginatedAreaTypeList + * @throws ApiError + */ + public static restAreatypesList( + areaLevel?: number, + countryIsoCode2?: string, + countryIsoCode3?: string, + limit?: number, + offset?: number, + ordering?: string, + parentAreaLevel?: number, + search?: string, + updatedAtAfter?: string, + updatedAtBefore?: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/areatypes/', + query: { + 'area_level': areaLevel, + 'country_iso_code2': countryIsoCode2, + 'country_iso_code3': countryIsoCode3, + 'limit': limit, + 'offset': offset, + 'ordering': ordering, + 'parent_area_level': parentAreaLevel, + 'search': search, + 'updated_at_after': updatedAtAfter, + 'updated_at_before': updatedAtBefore, + }, + }); + } + /** + * @param limit Number of results to return per page. + * @param offset The initial index from which to return the results. + * @returns PaginatedBeneficiaryGroupList + * @throws ApiError + */ + public static restBeneficiaryGroupsList( + limit?: number, + offset?: number, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/beneficiary-groups/', + query: { + 'limit': limit, + 'offset': offset, + }, + }); + } + /** + * @param active + * @param limit Number of results to return per page. + * @param offset The initial index from which to return the results. + * @param ordering Which field to use when ordering the results. + * @param updatedAtAfter + * @param updatedAtBefore + * @returns PaginatedBusinessAreaList + * @throws ApiError + */ + public static restBusinessAreasList( + active?: boolean, + limit?: number, + offset?: number, + ordering?: string, + updatedAtAfter?: string, + updatedAtBefore?: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/business_areas/', + query: { + 'active': active, + 'limit': limit, + 'offset': offset, + 'ordering': ordering, + 'updated_at_after': updatedAtAfter, + 'updated_at_before': updatedAtBefore, + }, + }); + } + /** + * @returns any No response body + * @throws ApiError + */ + public static restConstanceRetrieve(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/constance/', + }); + } + /** + * Retrieve dashboard data for a given business area from Redis cache. + * If data is not cached or needs updating, refresh it. + * @param businessAreaSlug + * @returns any No response body + * @throws ApiError + */ + public static restDashboardDataRetrieve( + businessAreaSlug: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/dashboard/{business_area_slug}/data/', + path: { + 'business_area_slug': businessAreaSlug, + }, + }); + } + /** + * API to trigger the creation or update of a DashReport for a given business area. + * Restricted to superusers and users with the required permissions. + * @param businessAreaSlug + * @returns any No response body + * @throws ApiError + */ + public static restDashboardGenerateCreate( + businessAreaSlug: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'POST', + url: '/api/rest/dashboard/generate/{business_area_slug}/', + path: { + 'business_area_slug': businessAreaSlug, + }, + }); + } + /** + * @param limit Number of results to return per page. + * @param offset The initial index from which to return the results. + * @param ordering Which field to use when ordering the results. + * @param search A search term. + * @param updatedAtAfter + * @param updatedAtBefore + * @param validFromAfter + * @param validFromBefore + * @param validUntilAfter + * @param validUntilBefore + * @returns PaginatedCountryList + * @throws ApiError + */ + public static restLookupsCountryList( + limit?: number, + offset?: number, + ordering?: string, + search?: string, + updatedAtAfter?: string, + updatedAtBefore?: string, + validFromAfter?: string, + validFromBefore?: string, + validUntilAfter?: string, + validUntilBefore?: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/lookups/country/', + query: { + 'limit': limit, + 'offset': offset, + 'ordering': ordering, + 'search': search, + 'updated_at_after': updatedAtAfter, + 'updated_at_before': updatedAtBefore, + 'valid_from_after': validFromAfter, + 'valid_from_before': validFromBefore, + 'valid_until_after': validUntilAfter, + 'valid_until_before': validUntilBefore, + }, + }); + } + /** + * @returns any No response body + * @throws ApiError + */ + public static restLookupsDatacollectingpolicyRetrieve(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/lookups/datacollectingpolicy/', + }); + } + /** + * @returns any No response body + * @throws ApiError + */ + public static restLookupsDocumentRetrieve(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/lookups/document/', + }); + } + /** + * @returns any No response body + * @throws ApiError + */ + public static restLookupsMaritalstatusRetrieve(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/lookups/maritalstatus/', + }); + } + /** + * @returns any No response body + * @throws ApiError + */ + public static restLookupsObserveddisabilityRetrieve(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/lookups/observeddisability/', + }); + } + /** + * @returns any No response body + * @throws ApiError + */ + public static restLookupsProgramStatusesRetrieve(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/lookups/program-statuses/', + }); + } + /** + * @returns any No response body + * @throws ApiError + */ + public static restLookupsRelationshipRetrieve(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/lookups/relationship/', + }); + } + /** + * @returns any No response body + * @throws ApiError + */ + public static restLookupsResidencestatusRetrieve(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/lookups/residencestatus/', + }); + } + /** + * @returns any No response body + * @throws ApiError + */ + public static restLookupsRoleRetrieve(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/lookups/role/', + }); + } + /** + * @returns any No response body + * @throws ApiError + */ + public static restLookupsSexRetrieve(): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/lookups/sex/', + }); + } + /** + * @param active + * @param businessArea + * @param limit Number of results to return per page. + * @param offset The initial index from which to return the results. + * @param ordering Which field to use when ordering the results. + * @param status * `ACTIVE` - Active + * * `DRAFT` - Draft + * * `FINISHED` - Finished + * @param updatedAtAfter + * @param updatedAtBefore + * @returns PaginatedProgramGlobalList + * @throws ApiError + */ + public static restProgramsList( + active?: boolean, + businessArea?: string, + limit?: number, + offset?: number, + ordering?: string, + status?: 'ACTIVE' | 'DRAFT' | 'FINISHED', + updatedAtAfter?: string, + updatedAtBefore?: string, + ): CancelablePromise { + return __request(OpenAPI, { + method: 'GET', + url: '/api/rest/programs/', + query: { + 'active': active, + 'business_area': businessArea, + 'limit': limit, + 'offset': offset, + 'ordering': ordering, + 'status': status, + 'updated_at_after': updatedAtAfter, + 'updated_at_before': updatedAtBefore, + }, + }); + } +} diff --git a/src/frontend/src/__generated__/graphql.tsx b/src/frontend/src/__generated__/graphql.tsx index 4945b88c06..e29a656a6e 100644 --- a/src/frontend/src/__generated__/graphql.tsx +++ b/src/frontend/src/__generated__/graphql.tsx @@ -415,6 +415,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>>; @@ -1098,6 +1122,7 @@ export type CreateProgram = { export type CreateProgramInput = { administrativeAreasOfImplementation?: InputMaybe; + beneficiaryGroup?: InputMaybe; budget?: InputMaybe; businessAreaSlug?: InputMaybe; cashPlus?: InputMaybe; @@ -4837,6 +4862,7 @@ export type ProgramNode = Node & { adminAreas: AreaNodeConnection; adminUrl?: Maybe; administrativeAreasOfImplementation: Scalars['String']['output']; + beneficiaryGroup?: Maybe; biometricDeduplicationEnabled: Scalars['Boolean']['output']; budget?: Maybe; businessArea: UserBusinessAreaNode; @@ -5317,6 +5343,7 @@ export type QueryAllAccountabilityCommunicationMessagesArgs = { export type QueryAllActiveProgramsArgs = { after?: InputMaybe; before?: InputMaybe; + beneficiaryGroupMatch?: InputMaybe; budget?: InputMaybe; businessArea: Scalars['String']['input']; compatibleDct?: InputMaybe; @@ -5745,6 +5772,7 @@ export type QueryAllPduFieldsArgs = { export type QueryAllProgramsArgs = { after?: InputMaybe; before?: InputMaybe; + beneficiaryGroupMatch?: InputMaybe; budget?: InputMaybe; businessArea: Scalars['String']['input']; compatibleDct?: InputMaybe; @@ -7953,6 +7981,7 @@ export type UpdateProgram = { export type UpdateProgramInput = { administrativeAreasOfImplementation?: InputMaybe; + beneficiaryGroup?: InputMaybe; budget?: InputMaybe; cashPlus?: InputMaybe; dataCollectingTypeCode?: InputMaybe; @@ -8644,7 +8673,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 }; @@ -9101,7 +9130,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; @@ -9109,7 +9138,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; @@ -10029,10 +10058,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; @@ -10064,7 +10094,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; }>; @@ -11293,6 +11323,15 @@ export const ProgramDetailsFragmentDoc = gql` } } canFinish + beneficiaryGroup { + id + name + groupLabel + groupLabelPlural + memberLabel + memberLabelPlural + masterDetail + } } `; export const RegistrationMinimalFragmentDoc = gql` @@ -20030,7 +20069,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 @@ -20047,6 +20086,7 @@ export const AllProgramsForChoicesDocument = gql` endDate: $endDate name: $name compatibleDct: $compatibleDct + beneficiaryGroupMatch: $beneficiaryGroupMatch ) { pageInfo { hasNextPage @@ -20072,6 +20112,17 @@ export const AllProgramsForChoicesDocument = gql` householdFiltersAvailable description } + beneficiaryGroup { + id + createdAt + updatedAt + name + groupLabel + groupLabelPlural + memberLabel + memberLabelPlural + masterDetail + } pduFields { id } @@ -20108,6 +20159,7 @@ export const AllProgramsForChoicesDocument = gql` * orderBy: // value for 'orderBy' * name: // value for 'name' * compatibleDct: // value for 'compatibleDct' + * beneficiaryGroupMatch: // value for 'beneficiaryGroupMatch' * }, * }); */ @@ -22305,7 +22357,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 ) | ( TargetPopulationNode ) | ( 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 ) | ( TargetPopulationNode ) | ( 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 */ @@ -22343,6 +22395,7 @@ export type ResolversTypes = { BankAccountInfoNodeEdge: ResolverTypeWrapper; BankAccountInfoRdiMergeStatus: BankAccountInfoRdiMergeStatus; BankTransferObjectType: BankTransferObjectType; + BeneficiaryGroupNode: ResolverTypeWrapper; BigInt: ResolverTypeWrapper; Boolean: ResolverTypeWrapper; BulkGrievanceAddNoteMutation: ResolverTypeWrapper; @@ -22856,6 +22909,7 @@ export type ResolversParentTypes = { BankAccountInfoNodeConnection: BankAccountInfoNodeConnection; BankAccountInfoNodeEdge: BankAccountInfoNodeEdge; BankTransferObjectType: BankTransferObjectType; + BeneficiaryGroupNode: BeneficiaryGroupNode; BigInt: Scalars['BigInt']['output']; Boolean: Scalars['Boolean']['output']; BulkGrievanceAddNoteMutation: BulkGrievanceAddNoteMutation; @@ -23460,6 +23514,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'; } @@ -25092,7 +25160,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' | 'TargetPopulationNode' | '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' | 'TargetPopulationNode' | 'TicketAddIndividualDetailsNode' | 'TicketComplaintDetailsNode' | 'TicketDeleteHouseholdDetailsNode' | 'TicketDeleteIndividualDetailsNode' | 'TicketHouseholdDataUpdateDetailsNode' | 'TicketIndividualDataUpdateDetailsNode' | 'TicketNeedsAdjudicationDetailsNode' | 'TicketNegativeFeedbackDetailsNode' | 'TicketNoteNode' | 'TicketPaymentVerificationDetailsNode' | 'TicketPositiveFeedbackDetailsNode' | 'TicketReferralDetailsNode' | 'TicketSensitiveDetailsNode' | 'TicketSystemFlaggingDetailsNode' | 'UserBusinessAreaNode' | 'UserNode' | 'VolumeByDeliveryMechanismNode', ParentType, ContextType>; id?: Resolver; }; @@ -25618,6 +25686,7 @@ export type ProgramNodeResolvers>; adminUrl?: Resolver, ParentType, ContextType>; administrativeAreasOfImplementation?: Resolver; + beneficiaryGroup?: Resolver, ParentType, ContextType>; biometricDeduplicationEnabled?: Resolver; budget?: Resolver, ParentType, ContextType>; businessArea?: Resolver; @@ -27203,6 +27272,7 @@ export type Resolvers = { BankAccountInfoNode?: BankAccountInfoNodeResolvers; BankAccountInfoNodeConnection?: BankAccountInfoNodeConnectionResolvers; BankAccountInfoNodeEdge?: BankAccountInfoNodeEdgeResolvers; + BeneficiaryGroupNode?: BeneficiaryGroupNodeResolvers; BigInt?: GraphQLScalarType; BulkGrievanceAddNoteMutation?: BulkGrievanceAddNoteMutationResolvers; BulkUpdateGrievanceTicketsAssigneesMutation?: BulkUpdateGrievanceTicketsAssigneesMutationResolvers; diff --git a/src/frontend/src/__generated__/introspection-result.ts b/src/frontend/src/__generated__/introspection-result.ts index 91a7ea27ce..65db8c37d4 100644 --- a/src/frontend/src/__generated__/introspection-result.ts +++ b/src/frontend/src/__generated__/introspection-result.ts @@ -11,6 +11,7 @@ "AreaNode", "AreaTypeNode", "BankAccountInfoNode", + "BeneficiaryGroupNode", "BusinessAreaNode", "CommunicationMessageNode", "CommunicationMessageRecipientMapNode", diff --git a/src/frontend/src/api/programsApi.ts b/src/frontend/src/api/programsApi.ts new file mode 100644 index 0000000000..9d269d4e4e --- /dev/null +++ b/src/frontend/src/api/programsApi.ts @@ -0,0 +1,24 @@ +import { api } from './api'; + +interface BeneficiaryGroup { + id: string; + name: string; + group_label: string; + group_label_plural: string; + member_label: string; + member_label_plural: string; + master_detail: boolean; +} + +export interface PaginatedListResponse { + count: number; + next?: string; + previous?: string; + results: T[]; +} + +export const fetchBeneficiaryGroups = async (): Promise< + PaginatedListResponse +> => { + return api.get('beneficiary-groups/'); +}; diff --git a/src/frontend/src/apollo/fragments/ProgramDetailsFragment.ts b/src/frontend/src/apollo/fragments/ProgramDetailsFragment.ts index 3e2022f136..d105b64d3b 100644 --- a/src/frontend/src/apollo/fragments/ProgramDetailsFragment.ts +++ b/src/frontend/src/apollo/fragments/ProgramDetailsFragment.ts @@ -58,5 +58,14 @@ export const programDetails = gql` } } canFinish + beneficiaryGroup { + id + name + groupLabel + groupLabelPlural + memberLabel + memberLabelPlural + masterDetail + } } `; diff --git a/src/frontend/src/apollo/queries/program/AllProgramsForChoices.ts b/src/frontend/src/apollo/queries/program/AllProgramsForChoices.ts index e1e2f25d3b..eed20aa26d 100644 --- a/src/frontend/src/apollo/queries/program/AllProgramsForChoices.ts +++ b/src/frontend/src/apollo/queries/program/AllProgramsForChoices.ts @@ -17,6 +17,7 @@ export const AllProgramsForChoices = gql` $orderBy: String $name: String $compatibleDct: Boolean + $beneficiaryGroupMatch: Boolean ) { allPrograms( before: $before @@ -34,6 +35,7 @@ export const AllProgramsForChoices = gql` endDate: $endDate name: $name compatibleDct: $compatibleDct + beneficiaryGroupMatch: $beneficiaryGroupMatch ) { pageInfo { hasNextPage @@ -59,6 +61,17 @@ export const AllProgramsForChoices = gql` householdFiltersAvailable description } + beneficiaryGroup { + id + createdAt + updatedAt + name + groupLabel + groupLabelPlural + memberLabel + memberLabelPlural + masterDetail + } pduFields { id } diff --git a/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpHouseholdFiltersCommunication.tsx b/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpHouseholdFiltersCommunication.tsx index a5e740b0be..3a13355704 100644 --- a/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpHouseholdFiltersCommunication.tsx +++ b/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpHouseholdFiltersCommunication.tsx @@ -5,12 +5,13 @@ import { useTranslation } from 'react-i18next'; import { useLocation, useNavigate } from 'react-router-dom'; import { HouseholdChoiceDataQuery } from '@generated/graphql'; import { AdminAreaAutocomplete } from '@shared/autocompletes/AdminAreaAutocomplete'; -import { householdTableOrderOptions } from '@utils/constants'; +import { generateTableOrderOptionsGroup } from '@utils/constants'; import { createHandleApplyFilterChange } from '@utils/utils'; import { FiltersSection } from '@core/FiltersSection'; import { NumberTextField } from '@core/NumberTextField'; import { SearchTextField } from '@core/SearchTextField'; import { SelectFilter } from '@core/SelectFilter'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; interface LookUpHouseholdFiltersCommunicationProps { @@ -33,6 +34,8 @@ export function LookUpHouseholdFiltersCommunication({ const { t } = useTranslation(); const navigate = useNavigate(); const location = useLocation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const { handleFilterChange, applyFilterChanges, clearFilter } = createHandleApplyFilterChange( @@ -53,6 +56,9 @@ export function LookUpHouseholdFiltersCommunication({ clearFilter(); }; + const householdTableOrderOptions = + generateTableOrderOptionsGroup(beneficiaryGroup); + return ( } diff --git a/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpSelectionCommunication.tsx b/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpSelectionCommunication.tsx index 79ff8758a6..55b17770e4 100644 --- a/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpSelectionCommunication.tsx +++ b/src/frontend/src/components/accountability/Communication/LookUpsCommunication/LookUpSelectionCommunication.tsx @@ -13,8 +13,7 @@ import { LookUpHouseholdFiltersCommunication } from './LookUpHouseholdFiltersCom import { LookUpRegistrationFiltersCommunication } from './LookUpRegistrationFiltersCommunication'; import { LookUpSelectionTablesCommunication } from './LookUpSelectionTablesCommunication'; import { LookUpTargetPopulationFiltersCommunication } from './LookUpTargetPopulationFiltersCommunication'; - -const communicationTabs = ['Household', 'Target Population', 'RDI']; +import { useProgramContext } from 'src/programContext'; const BoxWithBorderBottom = styled(Box)` border-bottom: 1px solid ${({ theme }) => theme.hctPalette.lighterGray}; @@ -37,6 +36,13 @@ export function LookUpSelectionCommunication({ setSelectedTab; }): ReactElement { const location = useLocation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + const communicationTabs = [ + `${beneficiaryGroup?.groupLabel}`, + 'Target Population', + 'RDI', + ]; const initialFilterRDI = { search: '', diff --git a/src/frontend/src/components/accountability/Feedback/FeedbackDetails/FeedbackDetails.tsx b/src/frontend/src/components/accountability/Feedback/FeedbackDetails/FeedbackDetails.tsx index 1c65518def..d4a7c27c91 100644 --- a/src/frontend/src/components/accountability/Feedback/FeedbackDetails/FeedbackDetails.tsx +++ b/src/frontend/src/components/accountability/Feedback/FeedbackDetails/FeedbackDetails.tsx @@ -9,6 +9,7 @@ import { OverviewContainer } from '@core/OverviewContainer'; import { Title } from '@core/Title'; import { UniversalMoment } from '@core/UniversalMoment'; import { useBaseUrl } from '@hooks/useBaseUrl'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; interface FeedbackDetailsProps { @@ -24,6 +25,8 @@ export function FeedbackDetails({ }: FeedbackDetailsProps): ReactElement { const { t } = useTranslation(); const { baseUrl, isAllPrograms } = useBaseUrl(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; return ( @@ -51,7 +54,7 @@ export function FeedbackDetails({ size: 3, }, { - label: t('Household ID'), + label: `${beneficiaryGroup?.groupLabel} ID`, value: ( {feedback.householdLookup?.id && @@ -74,7 +77,7 @@ export function FeedbackDetails({ size: 3, }, { - label: t('Individual ID'), + label: `${beneficiaryGroup?.memberLabel} ID`, value: ( {feedback.individualLookup?.id && diff --git a/src/frontend/src/components/accountability/Feedback/HouseholdQuestionnaire/HouseholdQuestionnaire.tsx b/src/frontend/src/components/accountability/Feedback/HouseholdQuestionnaire/HouseholdQuestionnaire.tsx index df934eaf33..cf0d90c91c 100644 --- a/src/frontend/src/components/accountability/Feedback/HouseholdQuestionnaire/HouseholdQuestionnaire.tsx +++ b/src/frontend/src/components/accountability/Feedback/HouseholdQuestionnaire/HouseholdQuestionnaire.tsx @@ -4,6 +4,7 @@ import { useTranslation } from 'react-i18next'; import { FormikCheckboxField } from '@shared/Formik/FormikCheckboxField'; import { ContentLink } from '@core/ContentLink'; import { useBaseUrl } from '@hooks/useBaseUrl'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; interface HouseholdQuestionnaireProps { @@ -16,12 +17,15 @@ export function HouseholdQuestionnaire({ const { baseUrl } = useBaseUrl(); const { t } = useTranslation(); const selectedHouseholdData = values.selectedHousehold; + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + return ( {[ { name: 'questionnaire_size', - label: t('Household Size'), + label: `${beneficiaryGroup?.groupLabel} Size`, value: selectedHouseholdData.size, size: 3, }, @@ -45,7 +49,7 @@ export function HouseholdQuestionnaire({ }, { name: 'questionnaire_headOfHousehold', - label: t('Head of Household'), + label: `Head of ${beneficiaryGroup?.groupLabel}`, value: ( {[ { name: 'questionnaire_fullName', - label: t('Individual Full Name'), + label: t(`${beneficiaryGroup?.memberLabel} Full Name`), value: ( diff --git a/src/frontend/src/components/core/ActivityLogPageFilters.tsx b/src/frontend/src/components/core/ActivityLogPageFilters.tsx index d6dc50f95e..29c53b35aa 100644 --- a/src/frontend/src/components/core/ActivityLogPageFilters.tsx +++ b/src/frontend/src/components/core/ActivityLogPageFilters.tsx @@ -7,6 +7,7 @@ import { createHandleApplyFilterChange } from '@utils/utils'; import { FiltersSection } from './FiltersSection'; import { SearchTextField } from './SearchTextField'; import { SelectFilter } from './SelectFilter'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; interface ActivityLogPageFiltersProps { @@ -26,6 +27,8 @@ export function ActivityLogPageFilters({ const { t } = useTranslation(); const navigate = useNavigate(); const location = useLocation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const { handleFilterChange, applyFilterChanges, clearFilter } = createHandleApplyFilterChange( @@ -48,8 +51,8 @@ export function ActivityLogPageFilters({ const modules = { program: 'Programme', - household: 'Household', - individual: 'Individual', + household: `${beneficiaryGroup?.groupLabel}`, + individual: `${beneficiaryGroup?.memberLabel}`, grievanceticket: 'Grievance Tickets', paymentverificationplan: 'Payment Plan Payment Verification', targetpopulation: 'Target Population', diff --git a/src/frontend/src/components/core/Drawer/DrawerItems.tsx b/src/frontend/src/components/core/Drawer/DrawerItems.tsx index c3ea5d9700..ca545cf5b6 100644 --- a/src/frontend/src/components/core/Drawer/DrawerItems.tsx +++ b/src/frontend/src/components/core/Drawer/DrawerItems.tsx @@ -21,7 +21,7 @@ import { SCOPE_ALL_PROGRAMS, SCOPE_PROGRAM, } from './menuItems'; -import { useProgramContext } from 'src/programContext'; +import { ProgramInterface, useProgramContext } from 'src/programContext'; const Text = styled(ListItemText)` .MuiTypography-body1 { @@ -61,12 +61,13 @@ export const DrawerItems = ({ open, }: DrawerItemsProps): ReactElement => { const { baseUrl, businessArea, programId, isAllPrograms } = useBaseUrl(); - const { isSocialDctType } = useProgramContext(); + const { isSocialDctType, selectedProgram } = useProgramContext(); const permissions = usePermissions(); const { data: businessAreaData } = useBusinessAreaDataQuery({ variables: { businessAreaSlug: businessArea }, fetchPolicy: 'cache-first', }); + const clearLocation = currentLocation.replace(`/${baseUrl}`, ''); const navigate = useNavigate(); const initialIndex = menuItems.findIndex((item) => { @@ -121,7 +122,38 @@ export const DrawerItems = ({ return updatedMenuItems; }; - const preparedMenuItems = prepareMenuItems(menuItems); + const beneficiaryGroupTransformator = ( + array: MenuItem[], + _beneficiaryGroup: ProgramInterface['beneficiaryGroup'], + ): MenuItem[] => { + if (!_beneficiaryGroup) { + return array; + } + + return array.map((item, index) => { + if (index === 2 && !isAllPrograms) { + item.name = _beneficiaryGroup.name; + if (item.secondaryActions) { + item.secondaryActions = item.secondaryActions.map( + (action, actionIndex) => { + if (actionIndex === 0) { + action.name = _beneficiaryGroup.groupLabelPlural; + } else if (actionIndex === 1) { + action.name = _beneficiaryGroup.memberLabelPlural; + } + return action; + }, + ); + } + } + return item; + }); + }; + + const preparedMenuItems = beneficiaryGroupTransformator( + prepareMenuItems(menuItems), + selectedProgram?.beneficiaryGroup, + ); const { isPaymentPlanApplicable, isAccountabilityApplicable } = businessAreaData.businessArea; diff --git a/src/frontend/src/components/dashboard/sections/PaymentVerificationSection/PaymentVerificationSection.tsx b/src/frontend/src/components/dashboard/sections/PaymentVerificationSection/PaymentVerificationSection.tsx index 8debe92513..06fef4d34f 100644 --- a/src/frontend/src/components/dashboard/sections/PaymentVerificationSection/PaymentVerificationSection.tsx +++ b/src/frontend/src/components/dashboard/sections/PaymentVerificationSection/PaymentVerificationSection.tsx @@ -3,6 +3,7 @@ import { useTranslation } from 'react-i18next'; import { AllChartsQuery } from '@generated/graphql'; import { PaymentVerificationChart } from '../../charts/PaymentVerificationChart'; import { DashboardPaper } from '../../DashboardPaper'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; interface PaymentVerificationSectionProps { @@ -12,12 +13,15 @@ export function PaymentVerificationSection({ data, }: PaymentVerificationSectionProps): ReactElement { const { t } = useTranslation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + if (!data) return null; const renderContacted = () => { return data.households === 1 - ? t('Household contacted') - : t('Households contacted'); + ? `${beneficiaryGroup?.groupLabel} contacted` + : `${beneficiaryGroup?.groupLabelPlural} contacted`; }; return ( diff --git a/src/frontend/src/components/grievances/AddIndividualDataChange.tsx b/src/frontend/src/components/grievances/AddIndividualDataChange.tsx index 38b5c4a0cd..16b03b2202 100644 --- a/src/frontend/src/components/grievances/AddIndividualDataChange.tsx +++ b/src/frontend/src/components/grievances/AddIndividualDataChange.tsx @@ -19,6 +19,7 @@ import { AgencyField } from './AgencyField'; import { DocumentField } from './DocumentField'; import { FormikBoolFieldGrievances } from './FormikBoolFieldGrievances'; import { removeItemById } from './utils/helpers'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; export interface AddIndividualDataChangeFieldProps { @@ -122,6 +123,8 @@ export function AddIndividualDataChange({ const { t } = useTranslation(); const location = useLocation(); const isEditTicket = location.pathname.indexOf('edit-ticket') !== -1; + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const { data, loading } = useAllAddIndividualFieldsQuery(); if (loading) { @@ -138,7 +141,9 @@ export function AddIndividualDataChange({ !isEditTicket && ( <> - <Typography variant="h6">{t('Individual Data')}</Typography> + <Typography variant="h6"> + {t(`${beneficiaryGroup?.memberLabel} Data`)} + </Typography> diff --git a/src/frontend/src/components/grievances/AddIndividualGrievanceDetails.tsx b/src/frontend/src/components/grievances/AddIndividualGrievanceDetails.tsx index e556fc708e..c24c0bba9e 100644 --- a/src/frontend/src/components/grievances/AddIndividualGrievanceDetails.tsx +++ b/src/frontend/src/components/grievances/AddIndividualGrievanceDetails.tsx @@ -15,6 +15,7 @@ import { LabelizedField } from '@core/LabelizedField'; import { LoadingComponent } from '@core/LoadingComponent'; import { Title } from '@core/Title'; import { ApproveBox } from './GrievancesApproveSection/ApproveSectionStyles'; +import { useProgramContext } from 'src/programContext'; import { ReactElement, ReactNode } from 'react'; export function AddIndividualGrievanceDetails({ @@ -27,6 +28,9 @@ export function AddIndividualGrievanceDetails({ const { t } = useTranslation(); const { data, loading } = useAllAddIndividualFieldsQuery(); const [mutate] = useApproveAddIndividualDataChangeMutation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + const confirm = useConfirmation(); const { showMessage } = useSnackbar(); if (loading) { @@ -117,11 +121,11 @@ export function AddIndividualGrievanceDetails({ ]; let dialogText = t( - 'You did not approve the following add individual data. Are you sure you want to continue?', + `You did not approve the following add ${beneficiaryGroup?.memberLabel} data. Are you sure you want to continue?`, ); if (!ticket.addIndividualTicketDetails.approveStatus) { dialogText = t( - 'You are approving the following Add individual data. Are you sure you want to continue?', + `You are approving the following Add ${beneficiaryGroup?.memberLabel} data. Are you sure you want to continue?`, ); } @@ -129,7 +133,9 @@ export function AddIndividualGrievanceDetails({ <Box display="flex" justifyContent="space-between"> - <Typography variant="h6">{t('Individual Data')}</Typography> + <Typography variant="h6"> + {t(`${beneficiaryGroup?.memberLabel} Data`)} + </Typography> {canApproveDataChange && ( <Button data-cy="button-approve" diff --git a/src/frontend/src/components/grievances/ApproveDeleteHouseholdGrievanceDetails.tsx b/src/frontend/src/components/grievances/ApproveDeleteHouseholdGrievanceDetails.tsx index 919991429f..00cf7ac81d 100644 --- a/src/frontend/src/components/grievances/ApproveDeleteHouseholdGrievanceDetails.tsx +++ b/src/frontend/src/components/grievances/ApproveDeleteHouseholdGrievanceDetails.tsx @@ -27,6 +27,7 @@ import { GrievanceTicketQuery, useApproveDeleteHouseholdDataChangeMutation, } from '@generated/graphql'; +import { useProgramContext } from 'src/programContext'; const EditIcon = styled(Edit)` color: ${({ theme }) => theme.hctPalette.darkerBlue}; @@ -47,6 +48,8 @@ export const ApproveDeleteHouseholdGrievanceDetails = ({ const isForApproval = ticket.status === GRIEVANCE_TICKET_STATES.FOR_APPROVAL; const { approveStatus, reasonHousehold } = ticket.deleteHouseholdTicketDetails; + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const validationSchema = Yup.object().shape({ reasonHhId: Yup.string().when( @@ -55,7 +58,7 @@ export const ApproveDeleteHouseholdGrievanceDetails = ({ const value = String(withdrawReasonValue); if (value === 'duplicate' && !approveStatus) { return Yup.string() - .required('Household Unicef Id is required') + .required(`${beneficiaryGroup?.groupLabel} Unicef Id is required`) .max(15, 'Too long'); } return Yup.string(); @@ -159,10 +162,10 @@ export const ApproveDeleteHouseholdGrievanceDetails = ({ <Typography variant="body2"> {showWithdraw() ? t( - 'Please provide the reason of withdrawal of this household.', + `Please provide the reason of withdrawal of this ${beneficiaryGroup?.groupLabel}.`, ) : t( - 'You did not approve the following household to be withdrawn. Are you sure you want to continue?', + `You did not approve the following ${beneficiaryGroup?.groupLabel} to be withdrawn. Are you sure you want to continue?`, )} </Typography> </Box> @@ -173,7 +176,7 @@ export const ApproveDeleteHouseholdGrievanceDetails = ({ choices={[ { value: 'duplicate', - name: 'This household is a duplicate of another household', + name: `This ${beneficiaryGroup?.groupLabel} is a duplicate of another ${beneficiaryGroup?.groupLabel}`, }, ]} component={FormikRadioGroup} @@ -186,7 +189,7 @@ export const ApproveDeleteHouseholdGrievanceDetails = ({ name="reasonHhId" fullWidth variant="outlined" - label={t('Household Unicef Id')} + label={`${beneficiaryGroup?.groupLabel} Unicef Id`} component={FormikTextField} required /> diff --git a/src/frontend/src/components/grievances/CreateGrievance/Description/Description.tsx b/src/frontend/src/components/grievances/CreateGrievance/Description/Description.tsx index fe73e4d6fc..587257f4b1 100644 --- a/src/frontend/src/components/grievances/CreateGrievance/Description/Description.tsx +++ b/src/frontend/src/components/grievances/CreateGrievance/Description/Description.tsx @@ -23,6 +23,7 @@ import { NewDocumentationFieldArray } from '../../Documentation/NewDocumentation import { LookUpLinkedTickets } from '../../LookUps/LookUpLinkedTickets/LookUpLinkedTickets'; import { LookUpPaymentRecord } from '../../LookUps/LookUpPaymentRecord/LookUpPaymentRecord'; import { useProgramContext } from 'src/programContext'; +import { replaceLabels } from '@components/grievances/utils/createGrievanceUtils'; const BoxPadding = styled.div` padding: 15px 0; @@ -73,6 +74,8 @@ export function Description({ }, fetchPolicy: 'network-only', }); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; // Set program value based on selected household or individual useEffect(() => { @@ -121,11 +124,15 @@ export function Description({ }, showIssueType(values) && { label: t('Issue Type'), - value: <span>{selectedIssueType(values)}</span>, + value: ( + <span> + {replaceLabels(selectedIssueType(values), beneficiaryGroup)} + </span> + ), size: 9, }, { - label: t('Household ID'), + label: `${beneficiaryGroup?.groupLabel} ID`, value: ( <span> {values.selectedHousehold?.id && @@ -144,7 +151,7 @@ export function Description({ size: 3, }, { - label: t('Individual ID'), + label: `${beneficiaryGroup?.memberLabel} ID`, value: ( <span> {values.selectedIndividual?.id && diff --git a/src/frontend/src/components/grievances/CreateGrievance/Selection/Selection.tsx b/src/frontend/src/components/grievances/CreateGrievance/Selection/Selection.tsx index 38d31e07b6..8368879a9c 100644 --- a/src/frontend/src/components/grievances/CreateGrievance/Selection/Selection.tsx +++ b/src/frontend/src/components/grievances/CreateGrievance/Selection/Selection.tsx @@ -4,15 +4,15 @@ import { useTranslation } from 'react-i18next'; import { GrievancesChoiceDataQuery } from '@generated/graphql'; import { useArrayToDict } from '@hooks/useArrayToDict'; import { FormikSelectField } from '@shared/Formik/FormikSelectField'; +import { DividerLine } from '@core/DividerLine'; +import { LabelizedField } from '@core/LabelizedField'; +import { useProgramContext } from 'src/programContext'; import { + getGrievanceCategoryDescriptions, + getGrievanceIssueTypeDescriptions, GRIEVANCE_CATEGORIES_NAMES, - GRIEVANCE_CATEGORY_DESCRIPTIONS, GRIEVANCE_ISSUE_TYPES_NAMES, - GRIEVANCE_ISSUE_TYPE_DESCRIPTIONS, } from '@utils/constants'; -import { DividerLine } from '@core/DividerLine'; -import { LabelizedField } from '@core/LabelizedField'; -import { useProgramContext } from 'src/programContext'; import { ChangeEvent, ReactElement } from 'react'; export interface SelectionProps { @@ -40,14 +40,40 @@ export function Selection({ '*', ); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + const dataChangeIssueTypes = [ - { name: 'Household Data Update', value: '13' }, - { name: 'Individual Data Update', value: '14' }, + { name: `${beneficiaryGroup?.groupLabel} Data Update`, value: '13' }, + { name: `${beneficiaryGroup?.memberLabel} Data Update`, value: '14' }, ]; + function replaceLabels(choices, _beneficiaryGroup) { + if (!choices) return []; + return choices.map((choice) => { + let newName = choice.name; + if (_beneficiaryGroup?.memberLabel) { + newName = newName.replace(/Individual/g, _beneficiaryGroup.memberLabel); + } + if (_beneficiaryGroup?.groupLabel) { + newName = newName.replace(/Household/g, _beneficiaryGroup.groupLabel); + } + return { ...choice, name: newName }; + }); + } + const updatedChoices = replaceLabels( + issueTypeDict[values.category]?.subCategories, + beneficiaryGroup, + ); + + const categoryDescriptions = + getGrievanceCategoryDescriptions(beneficiaryGroup); + const issueTypeDescriptions = + getGrievanceIssueTypeDescriptions(beneficiaryGroup); + const issueTypeChoices = redirectedFromRelatedTicket ? dataChangeIssueTypes - : issueTypeDict[values.category]?.subCategories; + : updatedChoices; const addDisabledProperty = (choices) => { if (!choices) return []; @@ -69,13 +95,9 @@ export function Selection({ ); const categoryDescription = - GRIEVANCE_CATEGORY_DESCRIPTIONS[ - GRIEVANCE_CATEGORIES_NAMES[values.category] - ] || ''; + categoryDescriptions[GRIEVANCE_CATEGORIES_NAMES[values.category]] || ''; const issueTypeDescription = - GRIEVANCE_ISSUE_TYPE_DESCRIPTIONS[ - GRIEVANCE_ISSUE_TYPES_NAMES[values.issueType] - ] || ''; + issueTypeDescriptions[GRIEVANCE_ISSUE_TYPES_NAMES[values.issueType]] || ''; return ( <Grid container spacing={3}> diff --git a/src/frontend/src/components/grievances/CreateGrievance/Verification/Verification.tsx b/src/frontend/src/components/grievances/CreateGrievance/Verification/Verification.tsx index bb1e23fc40..f913feb807 100644 --- a/src/frontend/src/components/grievances/CreateGrievance/Verification/Verification.tsx +++ b/src/frontend/src/components/grievances/CreateGrievance/Verification/Verification.tsx @@ -26,7 +26,9 @@ export interface VerificationProps { export function Verification({ values }: VerificationProps): ReactElement { const { t } = useTranslation(); - const { isSocialDctType } = useProgramContext(); + const { selectedProgram, isSocialDctType } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + return ( <BoxWithBorders> <> @@ -39,7 +41,7 @@ export function Verification({ values }: VerificationProps): ReactElement { {values.selectedHousehold && !isSocialDctType && ( <Box py={4}> <Typography variant="subtitle2"> - {t('Household Questionnaire')} + {`${beneficiaryGroup?.groupLabel} Questionnaire`} </Typography> <Box py={4}> <HouseholdQuestionnaire values={values} /> @@ -49,7 +51,7 @@ export function Verification({ values }: VerificationProps): ReactElement { {values.selectedIndividual && ( <> <Typography variant="subtitle2"> - {t('Individual Questionnaire')} + {`${beneficiaryGroup?.memberLabel} Questionnaire`} </Typography> <Box py={4}> <IndividualQuestionnaire values={values} /> diff --git a/src/frontend/src/components/grievances/DeleteHouseholdGrievanceDetails.tsx b/src/frontend/src/components/grievances/DeleteHouseholdGrievanceDetails.tsx index be19c22844..228a1a32f1 100644 --- a/src/frontend/src/components/grievances/DeleteHouseholdGrievanceDetails.tsx +++ b/src/frontend/src/components/grievances/DeleteHouseholdGrievanceDetails.tsx @@ -15,6 +15,7 @@ import { LoadingComponent } from '@core/LoadingComponent'; import { Title } from '@core/Title'; import { ApproveDeleteHouseholdGrievanceDetails } from './ApproveDeleteHouseholdGrievanceDetails'; import { ApproveBox } from './GrievancesApproveSection/ApproveSectionStyles'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; const Info = styled(InfoIcon)` @@ -31,6 +32,8 @@ export function DeleteHouseholdGrievanceDetails({ }): ReactElement { const { t } = useTranslation(); const { baseUrl, isAllPrograms } = useBaseUrl(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const { data: choicesData, loading: choicesLoading } = useHouseholdChoiceDataQuery(); @@ -48,13 +51,16 @@ export function DeleteHouseholdGrievanceDetails({ <ApproveBox> <Title> <Box display="flex" justifyContent="space-between" alignItems="center"> - <Typography variant="h6">{t('Household to be withdrawn')}</Typography> + <Typography variant="h6">{`${beneficiaryGroup?.groupLabel} to be withdrawn`}</Typography> {approveStatus && ticket.deleteHouseholdTicketDetails.reasonHousehold && ( <Box display="flex" alignItems="center"> <Info /> <Box mr={2}> - <p>This household is a duplicate of a household ID:</p> + <p> + This {beneficiaryGroup?.groupLabel} is a duplicate of a{' '} + {beneficiaryGroup?.groupLabel} ID: + </p> </Box> {!isAllPrograms ? ( <BlackLink @@ -91,7 +97,7 @@ export function DeleteHouseholdGrievanceDetails({ - + {ticket.household.size} @@ -101,7 +107,7 @@ export function DeleteHouseholdGrievanceDetails({ - + diff --git a/src/frontend/src/components/grievances/DeleteIndividualGrievanceDetails.tsx b/src/frontend/src/components/grievances/DeleteIndividualGrievanceDetails.tsx index 1ac12667e5..d5b8afb322 100644 --- a/src/frontend/src/components/grievances/DeleteIndividualGrievanceDetails.tsx +++ b/src/frontend/src/components/grievances/DeleteIndividualGrievanceDetails.tsx @@ -18,6 +18,7 @@ import { LoadingComponent } from '@core/LoadingComponent'; import { Title } from '@core/Title'; import { UniversalMoment } from '@core/UniversalMoment'; import { ApproveBox } from './GrievancesApproveSection/ApproveSectionStyles'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; export type RoleReassignData = { @@ -36,6 +37,8 @@ export function DeleteIndividualGrievanceDetails({ const { t } = useTranslation(); const { showMessage } = useSnackbar(); const confirm = useConfirmation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const isForApproval = ticket.status === GRIEVANCE_TICKET_STATES.FOR_APPROVAL; const isHeadOfHousehold = @@ -154,11 +157,11 @@ export function DeleteIndividualGrievanceDetails({ const allLabels = [...labels, ...documentLabels]; let dialogText = t( - 'You did not approve the following individual to be withdrawn. Are you sure you want to continue?', + `You did not approve the following ${beneficiaryGroup?.memberLabel} to be withdrawn. Are you sure you want to continue?`, ); if (!ticket.deleteIndividualTicketDetails.approveStatus) { dialogText = t( - 'You are approving the following individual to be withdrawn. Are you sure you want to continue?', + `You are approving the following ${beneficiaryGroup?.memberLabel} to be withdrawn. Are you sure you want to continue?`, ); } return ( @@ -166,7 +169,7 @@ export function DeleteIndividualGrievanceDetails({ <Box display="flex" justifyContent="space-between"> <Typography variant="h6"> - {t('Individual to be withdrawn')} + {t(`${beneficiaryGroup?.memberLabel} to be withdrawn`)} </Typography> {canApproveDataChange && ( <Button diff --git a/src/frontend/src/components/grievances/EditHouseholdDataChange/EditHouseholdDataChange.tsx b/src/frontend/src/components/grievances/EditHouseholdDataChange/EditHouseholdDataChange.tsx index 3ab5fc1636..85ef346d14 100644 --- a/src/frontend/src/components/grievances/EditHouseholdDataChange/EditHouseholdDataChange.tsx +++ b/src/frontend/src/components/grievances/EditHouseholdDataChange/EditHouseholdDataChange.tsx @@ -12,6 +12,7 @@ import { import { LoadingComponent } from '@core/LoadingComponent'; import { Title } from '@core/Title'; import { EditHouseholdDataChangeFieldRow } from './EditHouseholdDataChangeFieldRow'; +import { useProgramContext } from 'src/programContext'; export interface EditHouseholdDataChangeProps { values; @@ -23,6 +24,9 @@ export function EditHouseholdDataChange({ }: EditHouseholdDataChangeProps): ReactElement { const { t } = useTranslation(); const location = useLocation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + const isEditTicket = location.pathname.includes('edit-ticket'); const household: AllHouseholdsQuery['allHouseholds']['edges'][number]['node'] = values.selectedHousehold; @@ -52,7 +56,9 @@ export function EditHouseholdDataChange({ householdFieldsData?.allEditHouseholdFieldsAttributes; if (!household) { - return <div>{t('You have to select a household earlier')}</div>; + return ( + <div>{`You have to select a ${beneficiaryGroup?.groupLabel} earlier`}</div> + ); } if (fullHouseholdLoading || householdFieldsLoading || !fullHousehold) { return <LoadingComponent />; @@ -64,7 +70,7 @@ export function EditHouseholdDataChange({ !isEditTicket && ( <> <Title> - <Typography variant="h6">{t('Household Data')}</Typography> + <Typography variant="h6">{`${beneficiaryGroup?.groupLabel} Data`}</Typography> theme.hctPalette.lighterGray}; @@ -38,6 +39,9 @@ export function EditIndividualDataChange({ }: EditIndividualDataChangeProps): ReactElement { const { t } = useTranslation(); const location = useLocation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + const isEditTicket = location.pathname.indexOf('edit-ticket') !== -1; const individual: AllIndividualsQuery['allIndividuals']['edges'][number]['node'] = values.selectedIndividual; @@ -68,7 +72,11 @@ export function EditIndividualDataChange({ // eslint-disable-next-line react-hooks/exhaustive-deps }, []); if (!individual) { - return
{t('You have to select an individual earlier')}
; + return ( +
+ {t(`You have to select a ${beneficiaryGroup?.memberLabel} earlier`)} +
+ ); } if ( addIndividualFieldsLoading || diff --git a/src/frontend/src/components/grievances/GrievanceDetailsToolbar.tsx b/src/frontend/src/components/grievances/GrievanceDetailsToolbar.tsx index c2a2c1e82b..d3c9a80c9b 100644 --- a/src/frontend/src/components/grievances/GrievanceDetailsToolbar.tsx +++ b/src/frontend/src/components/grievances/GrievanceDetailsToolbar.tsx @@ -74,7 +74,8 @@ export const GrievanceDetailsToolbar = ({ const { baseUrl } = useBaseUrl(); const confirm = useConfirmation(); const navigate = useNavigate(); - const { isActiveProgram } = useProgramContext(); + const { isActiveProgram, selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const breadCrumbsItems: BreadCrumbsItem[] = [ { @@ -193,7 +194,7 @@ export const GrievanceDetailsToolbar = ({ confirmationMessage = ''; } else if (isDeduplicationCategory) { confirmationMessage = t( - 'By continuing you acknowledge that individuals in this ticket were reviewed and all were deemed either distinct or duplicates in the system.', + `By continuing you acknowledge that ${beneficiaryGroup?.memberLabelPlural} in this ticket were reviewed and all were deemed either distinct or duplicates in the system.`, ); } return confirmationMessage; @@ -248,7 +249,7 @@ export const GrievanceDetailsToolbar = ({ if (notApprovedSystemFlaggingChanges) { additionalContent = t( - ' By continuing you acknowledge that individuals in this ticket was compared with sanction list. No matches were found', + `By continuing you acknowledge that ${beneficiaryGroup?.memberLabelPlural} in this ticket were compared with the sanction list. No matches were found`, ); } @@ -259,7 +260,7 @@ export const GrievanceDetailsToolbar = ({ householdHasOneIndividual ) { additionalContent += t( - ' When you close this ticket, the household that this Individual is a member of will be deactivated.', + `When you close this ticket, the ${beneficiaryGroup?.groupLabel} that this ${beneficiaryGroup?.memberLabel} is a member of will be deactivated.`, ); } @@ -292,7 +293,7 @@ export const GrievanceDetailsToolbar = ({ title={t('Duplicate Document Conflict')} buttonText={t('Close Ticket')} message={t( - 'The individuals have matching document numbers. HOPE requires that document numbers are unique. Please resolve before closing the ticket.', + `The ${beneficiaryGroup?.memberLabelPlural} have matching document numbers. HOPE requires that document numbers are unique. Please resolve before closing the ticket.`, )} /> ) : ( diff --git a/src/frontend/src/components/grievances/GrievancesDetails/GrievancesDetails.tsx b/src/frontend/src/components/grievances/GrievancesDetails/GrievancesDetails.tsx index b6c58caff9..1a8f5ee0bd 100644 --- a/src/frontend/src/components/grievances/GrievancesDetails/GrievancesDetails.tsx +++ b/src/frontend/src/components/grievances/GrievancesDetails/GrievancesDetails.tsx @@ -23,6 +23,7 @@ import { import { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; import { useProgramContext } from 'src/programContext'; +import { replaceLabels } from '../utils/createGrievanceUtils'; interface GrievancesDetailsProps { ticket: GrievanceTicketQuery['grievanceTicket']; @@ -41,7 +42,9 @@ export function GrievancesDetails({ }: GrievancesDetailsProps): ReactElement { const { t } = useTranslation(); const { isAllPrograms } = useBaseUrl(); - const { isSocialDctType } = useProgramContext(); + const { selectedProgram, isSocialDctType } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + const statusChoices: { [id: number]: string; } = choicesToDict(choicesData.grievanceTicketStatusChoices); @@ -247,11 +250,13 @@ export function GrievancesDetails({ }, showIssueType && { label: t('Issue Type'), - value: {issueType}, + value: ( + {replaceLabels(issueType, beneficiaryGroup)} + ), size: 3, }, !isAllPrograms && { - label: t('Household ID'), + label: `${beneficiaryGroup?.groupLabel} ID`, value: ( {ticket.household?.id && @@ -275,7 +280,8 @@ export function GrievancesDetails({ label: isAllPrograms || isSocialDctType ? t('Target ID') - : t('Individual ID'), + : `${beneficiaryGroup?.memberLabel} ID`, + value: isAllPrograms || isSocialDctType ? (
{ticket?.targetId || '-'}
diff --git a/src/frontend/src/components/grievances/GrievancesTable/GrievancesTable.tsx b/src/frontend/src/components/grievances/GrievancesTable/GrievancesTable.tsx index 3f6d3d3fca..68d08c7f10 100644 --- a/src/frontend/src/components/grievances/GrievancesTable/GrievancesTable.tsx +++ b/src/frontend/src/components/grievances/GrievancesTable/GrievancesTable.tsx @@ -19,7 +19,7 @@ import { GRIEVANCE_CATEGORIES, GRIEVANCE_TICKET_STATES, } from '@utils/constants'; -import { choicesToDict, dateToIsoString } from '@utils/utils'; +import { adjustHeadCells, choicesToDict, dateToIsoString } from '@utils/utils'; import get from 'lodash/get'; import { ReactElement, useEffect, useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -47,9 +47,21 @@ export const GrievancesTable = ({ filter, }: GrievancesTableProps): ReactElement => { const { businessArea, programId, isAllPrograms } = useBaseUrl(); - const { isSocialDctType } = useProgramContext(); + const { isSocialDctType, selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const { t } = useTranslation(); + const replacements = { + household_unicef_id: (_beneficiaryGroup) => + `${_beneficiaryGroup?.groupLabel} ID`, + }; + + const adjustedHeadCells = adjustHeadCells( + headCellsStandardProgram, + beneficiaryGroup, + replacements, + ); + const initialVariables: AllGrievanceTicketQueryVariables = { businessArea, search: filter.search.trim(), @@ -204,7 +216,7 @@ export const GrievancesTable = ({ const baseCells = isSocialDctType || isAllPrograms ? headCellsSocialProgram - : headCellsStandardProgram; + : adjustedHeadCells; if (isAllPrograms) { return [ diff --git a/src/frontend/src/components/grievances/HouseholdQuestionnaire/HouseholdQuestionnaire.tsx b/src/frontend/src/components/grievances/HouseholdQuestionnaire/HouseholdQuestionnaire.tsx index 1f0da3e64d..10220b8156 100644 --- a/src/frontend/src/components/grievances/HouseholdQuestionnaire/HouseholdQuestionnaire.tsx +++ b/src/frontend/src/components/grievances/HouseholdQuestionnaire/HouseholdQuestionnaire.tsx @@ -7,6 +7,7 @@ import { ContentLink } from '@core/ContentLink'; import { useBaseUrl } from '@hooks/useBaseUrl'; import { AllHouseholdsQuery, useHouseholdLazyQuery } from '@generated/graphql'; import { LoadingComponent } from '@core/LoadingComponent'; +import { useProgramContext } from 'src/programContext'; interface HouseholdQuestionnaireProps { values; @@ -17,6 +18,8 @@ export function HouseholdQuestionnaire({ }: HouseholdQuestionnaireProps): ReactElement { const { baseUrl } = useBaseUrl(); const { t } = useTranslation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const household: AllHouseholdsQuery['allHouseholds']['edges'][number]['node'] = values.selectedHousehold; const [getHousehold, { data: fullHousehold, loading: fullHouseholdLoading }] = @@ -39,7 +42,7 @@ export function HouseholdQuestionnaire({ {[ { name: 'questionnaire_size', - label: t('Household Size'), + label: t(`${beneficiaryGroup?.groupLabel} Size`), value: selectedHouseholdData.size, size: 3, }, @@ -63,7 +66,7 @@ export function HouseholdQuestionnaire({ }, { name: 'questionnaire_headOfHousehold', - label: t('Head of Household'), + label: t(`Head of ${beneficiaryGroup?.groupLabel}`), value: ( { const { t } = useTranslation(); const { baseUrl } = useBaseUrl(); - const { isSocialDctType } = useProgramContext(); + const { isSocialDctType, selectedProgram } = useProgramContext(); const selectedIndividualData = values.selectedIndividual || values.selectedHousehold.headOfHousehold; + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const questionFields = isSocialDctType ? [ { name: 'questionnaire_fullName', - label: t('Individual Full Name'), + label: t(`${beneficiaryGroup?.memberLabel} Full Name`), value: ( {!isSocialDctType && ( - + )} diff --git a/src/frontend/src/components/grievances/LookUps/LookUpHouseholdIndividual/LookUpHouseholdIndividualSelectionDisplay.tsx b/src/frontend/src/components/grievances/LookUps/LookUpHouseholdIndividual/LookUpHouseholdIndividualSelectionDisplay.tsx index f7b2b0f0f6..4d681ca54c 100644 --- a/src/frontend/src/components/grievances/LookUps/LookUpHouseholdIndividual/LookUpHouseholdIndividualSelectionDisplay.tsx +++ b/src/frontend/src/components/grievances/LookUps/LookUpHouseholdIndividual/LookUpHouseholdIndividualSelectionDisplay.tsx @@ -1,10 +1,9 @@ -import { Box, Grid } from '@mui/material'; import DeleteIcon from '@mui/icons-material/Delete'; -import styled from 'styled-components'; -import { useTranslation } from 'react-i18next'; -import { StyledBox, BlueText, DarkGrey } from '../LookUpStyles'; +import { Box, Grid } from '@mui/material'; +import * as React from 'react'; import { useProgramContext } from 'src/programContext'; -import { ReactElement } from 'react'; +import styled from 'styled-components'; +import { BlueText, DarkGrey, StyledBox } from '../LookUpStyles'; const Types = { household: 'household', individual: 'individual' }; @@ -31,9 +30,10 @@ export const LookUpHouseholdIndividualSelectionDisplay = ({ setSelectedHousehold, selectedIndividual, setSelectedIndividual, -}: LookUpHouseholdIndividualSelectionDisplayProps): ReactElement => { - const { t } = useTranslation(); - const { isSocialDctType } = useProgramContext(); +}: LookUpHouseholdIndividualSelectionDisplayProps): React.ReactElement => { + const { selectedProgram, isSocialDctType } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + const handleRemove = (type): void => { if (type === Types.household) { onValueChange('selectedHousehold', null); @@ -54,7 +54,7 @@ export const LookUpHouseholdIndividualSelectionDisplay = ({ - {t('Household ID')}: + {`${beneficiaryGroup?.groupLabel} ID`}:   {selectedHousehold?.unicefId || '-'} @@ -83,7 +83,7 @@ export const LookUpHouseholdIndividualSelectionDisplay = ({ - {t('Individual ID')}: + {`${beneficiaryGroup?.memberLabel} ID`}:   {selectedIndividual?.unicefId || '-'} diff --git a/src/frontend/src/components/grievances/LookUps/LookUpHouseholdTable/LookUpHouseholdTable.tsx b/src/frontend/src/components/grievances/LookUps/LookUpHouseholdTable/LookUpHouseholdTable.tsx index f2c08c7743..aa193f9b3f 100644 --- a/src/frontend/src/components/grievances/LookUps/LookUpHouseholdTable/LookUpHouseholdTable.tsx +++ b/src/frontend/src/components/grievances/LookUps/LookUpHouseholdTable/LookUpHouseholdTable.tsx @@ -11,6 +11,8 @@ import { useBaseUrl } from '@hooks/useBaseUrl'; import { TableWrapper } from '@core/TableWrapper'; import { headCells } from './LookUpHouseholdTableHeadCells'; import { LookUpHouseholdTableRow } from './LookUpHouseholdTableRow'; +import { useProgramContext } from 'src/programContext'; +import { adjustHeadCells } from '@utils/utils'; interface LookUpHouseholdTableProps { businessArea: string; @@ -47,6 +49,9 @@ export function LookUpHouseholdTable({ isFeedbackWithHouseholdOnly, }: LookUpHouseholdTableProps): ReactElement { const { isAllPrograms, programId } = useBaseUrl(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + const matchWithdrawnValue = (): boolean | undefined => { if (filter.withdrawn === 'true') { return true; @@ -123,8 +128,21 @@ export function LookUpHouseholdTable({ setFieldValue('identityVerified', false); }; + const replacements = { + unicefId: (_beneficiaryGroup) => `${_beneficiaryGroup?.groupLabel} ID`, + head_of_household__full_name: (_beneficiaryGroup) => + `Head of ${_beneficiaryGroup?.groupLabel}`, + size: (_beneficiaryGroup) => `${_beneficiaryGroup?.groupLabel} Size`, + }; + + const adjustedHeadCells = adjustHeadCells( + headCells, + beneficiaryGroup, + replacements, + ); + const headCellsWithProgramColumn = [ - ...headCells, + ...adjustedHeadCells, { disablePadding: false, label: 'Programme', @@ -136,7 +154,7 @@ export function LookUpHouseholdTable({ const preparedHeadcells = isAllPrograms ? headCellsWithProgramColumn - : headCells; + : adjustedHeadCells; const renderTable = (): ReactElement => ( { setSelectedIndividual(individual); @@ -92,12 +94,23 @@ export function LookUpIndividualTable({ isActiveProgram: filter.programState === 'active' ? true : null, }; + const replacements = { + unicefId: (_beneficiaryGroup) => `${_beneficiaryGroup?.memberLabel} ID`, + household__id: (_beneficiaryGroup) => `${_beneficiaryGroup?.groupLabel} ID`, + }; + const headCells = isSocialDctType ? headCellsSocialProgram : headCellsStandardProgram; + const adjustedHeadCells = adjustHeadCells( + headCells, + beneficiaryGroup, + replacements, + ); + const headCellsWithProgramColumn = [ - ...headCells, + ...adjustedHeadCells, { disablePadding: false, label: 'Programme', @@ -109,7 +122,7 @@ export function LookUpIndividualTable({ const preparedHeadcells = isAllPrograms ? headCellsWithProgramColumn - : headCells; + : adjustedHeadCells; const renderTable = (): ReactElement => ( - {t('Household ID')}: + {`${beneficiaryGroup?.groupLabel} ID`}: {selectedHousehold?.unicefId || '-'} - {t('Individual ID')}: + {`${beneficiaryGroup?.memberLabel} ID`}: {selectedIndividual?.unicefId || '-'} diff --git a/src/frontend/src/components/grievances/LookUps/LookUpReassignRole/ReassignRoleUnique.tsx b/src/frontend/src/components/grievances/LookUps/LookUpReassignRole/ReassignRoleUnique.tsx index 801dab31c7..2bd699d496 100644 --- a/src/frontend/src/components/grievances/LookUps/LookUpReassignRole/ReassignRoleUnique.tsx +++ b/src/frontend/src/components/grievances/LookUps/LookUpReassignRole/ReassignRoleUnique.tsx @@ -8,6 +8,7 @@ import { useReassignRoleGrievanceMutation, } from '@generated/graphql'; import { Button } from '@mui/material'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; const ReassignRoleButton = styled(Button)` @@ -35,6 +36,8 @@ export function ReassignRoleUnique({ const { id } = useParams(); const { showMessage } = useSnackbar(); const [mutate] = useReassignRoleGrievanceMutation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; return ( - {t('Reassign To Unique Individual')} + {t(`Reassign To Unique ${beneficiaryGroup?.memberLabel}`)} )} diff --git a/src/frontend/src/components/grievances/NeedsAdjudication/BiometricsResults.tsx b/src/frontend/src/components/grievances/NeedsAdjudication/BiometricsResults.tsx index cf14fc6610..60bfad21ac 100644 --- a/src/frontend/src/components/grievances/NeedsAdjudication/BiometricsResults.tsx +++ b/src/frontend/src/components/grievances/NeedsAdjudication/BiometricsResults.tsx @@ -16,6 +16,7 @@ import { import { FC, ReactElement, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { hasPermissions, PERMISSIONS } from 'src/config/permissions'; +import { useProgramContext } from 'src/programContext'; export interface Individual { __typename?: 'DeduplicationEngineSimilarityPairIndividualNode'; @@ -58,6 +59,8 @@ export const BiometricsResults = ({ PERMISSIONS.GRIEVANCES_VIEW_BIOMETRIC_RESULTS, permissions, ); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const [loadData] = useGrievanceTicketLazyQuery({ variables: { @@ -113,7 +116,8 @@ export const BiometricsResults = ({ )} - Individual {individual1?.unicefId}: {individual1?.fullName} + {beneficiaryGroup?.memberLabel} {individual1?.unicefId}:{' '} + {individual1?.fullName} @@ -132,7 +136,8 @@ export const BiometricsResults = ({ )} - Individual {individual2?.unicefId}: {individual2?.fullName} + {beneficiaryGroup?.memberLabel} {individual2?.unicefId}:{' '} + {individual2?.fullName} diff --git a/src/frontend/src/components/grievances/NeedsAdjudication/NeedsAdjudicationDetailsOld.tsx b/src/frontend/src/components/grievances/NeedsAdjudication/NeedsAdjudicationDetailsOld.tsx index e2efce460d..c2d98d5cfb 100644 --- a/src/frontend/src/components/grievances/NeedsAdjudication/NeedsAdjudicationDetailsOld.tsx +++ b/src/frontend/src/components/grievances/NeedsAdjudication/NeedsAdjudicationDetailsOld.tsx @@ -40,6 +40,8 @@ export const NeedsAdjudicationDetailsOld = ({ const navigate = useNavigate(); const confirm = useConfirmation(); const { isActiveProgram } = useProgramContext(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const [approve] = useApproveNeedsAdjudicationMutation({ refetchQueries: () => [ @@ -165,10 +167,10 @@ export const NeedsAdjudicationDetailsOld = ({ - {t('Individual ID')} + {`${beneficiaryGroup?.memberLabel} ID`} - {t('Household ID')} + {`${beneficiaryGroup?.groupLabel} ID`} {t('Full Name')} diff --git a/src/frontend/src/components/grievances/NeedsAdjudication/NeedsAdjudicationTable.tsx b/src/frontend/src/components/grievances/NeedsAdjudication/NeedsAdjudicationTable.tsx index 8474bbee51..cf3f2a174c 100644 --- a/src/frontend/src/components/grievances/NeedsAdjudication/NeedsAdjudicationTable.tsx +++ b/src/frontend/src/components/grievances/NeedsAdjudication/NeedsAdjudicationTable.tsx @@ -1,4 +1,4 @@ -import React, { ChangeEvent } from 'react'; +import { ChangeEvent } from 'react'; import { BlackLink } from '@core/BlackLink'; import { UniversalMoment } from '@core/UniversalMoment'; import PeopleIcon from '@mui/icons-material/People'; @@ -44,6 +44,9 @@ export const NeedsAdjudicationTable = ({ const { t } = useTranslation(); const { baseUrl, isAllPrograms } = useBaseUrl(); const { isActiveProgram, isSocialDctType } = useProgramContext(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + const details = ticket?.needsAdjudicationTicketDetails; const handleSelect = (id: string) => { @@ -97,7 +100,10 @@ export const NeedsAdjudicationTable = ({ !isActiveProgram; const renderPossibleDuplicateRow = (possibleDuplicate) => ( - + - {t('Individual ID')} + {beneficiaryGroup?.memberLabel} ID {!isSocialDctType && ( - {t('Household ID')} + {beneficiaryGroup?.groupLabel} ID )} @@ -236,7 +242,9 @@ export const NeedsAdjudicationTable = ({ - + <>{renderIds(openExistingTickets)} @@ -100,9 +103,7 @@ export function OtherRelatedTickets({ {t('Closed Tickets')} <>{renderIds(closedExistingTickets)} diff --git a/src/frontend/src/components/grievances/OtherRelatedTicketsCreate.tsx b/src/frontend/src/components/grievances/OtherRelatedTicketsCreate.tsx index 7a022b61dd..7cdf481b9a 100644 --- a/src/frontend/src/components/grievances/OtherRelatedTicketsCreate.tsx +++ b/src/frontend/src/components/grievances/OtherRelatedTicketsCreate.tsx @@ -14,10 +14,13 @@ import { BlueBold, } from './GrievancesApproveSection/ApproveSectionStyles'; import { getGrievanceDetailsPath } from './utils/createGrievanceUtils'; +import { useProgramContext } from 'src/programContext'; export function OtherRelatedTicketsCreate({ values }): ReactElement { const { t } = useTranslation(); const { baseUrl, businessArea } = useBaseUrl(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const [show, setShow] = useState(false); const { data, loading } = useExistingGrievanceTicketsQuery({ @@ -70,9 +73,7 @@ export function OtherRelatedTicketsCreate({ values }): ReactElement { <>{renderIds(openExistingTickets)} @@ -87,9 +88,7 @@ export function OtherRelatedTicketsCreate({ values }): ReactElement { {t('Closed Tickets')} <>{renderIds(closedExistingTickets)} diff --git a/src/frontend/src/components/grievances/ReassignMultipleRoleBox.tsx b/src/frontend/src/components/grievances/ReassignMultipleRoleBox.tsx index a6af1d500c..a33adddec3 100644 --- a/src/frontend/src/components/grievances/ReassignMultipleRoleBox.tsx +++ b/src/frontend/src/components/grievances/ReassignMultipleRoleBox.tsx @@ -11,6 +11,7 @@ import { useBaseUrl } from '@hooks/useBaseUrl'; import { ContentLink } from '@core/ContentLink'; import { LabelizedField } from '@core/LabelizedField'; import { LookUpReassignRole } from './LookUps/LookUpReassignRole/LookUpReassignRole'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; const StyledBox = styled(Paper)` @@ -40,12 +41,16 @@ export function ReassignMultipleRoleBox({ }): ReactElement { const { t } = useTranslation(); const { baseUrl } = useBaseUrl(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + const reassignData = JSON.parse( ticket.needsAdjudicationTicketDetails.roleReassignData, ); const reassignDataDictByIndividualId = {}; for (const key of Object.keys(reassignData)) { - reassignDataDictByIndividualId[reassignData[key].individual] = reassignData[key]; + reassignDataDictByIndividualId[reassignData[key].individual] = + reassignData[key]; } const selectedIndividualsToReassign = ticket.needsAdjudicationTicketDetails.selectedDuplicates?.filter( @@ -72,7 +77,9 @@ export function ReassignMultipleRoleBox({ <>{capitalize(householdAndRole.role)} Collector - + @@ -80,7 +87,9 @@ export function ReassignMultipleRoleBox({ {' '} {householdAndRole.individual.fullName} - + @@ -97,7 +106,11 @@ export function ReassignMultipleRoleBox({ ticket={ticket} household={householdAndRole.household} individualToReassign={selectedIndividualToReassign} - initialSelectedIndividualId={reassignDataDictByIndividualId[selectedIndividualToReassign.id].new_individual} + initialSelectedIndividualId={ + reassignDataDictByIndividualId[ + selectedIndividualToReassign.id + ].new_individual + } /> )); @@ -113,9 +126,13 @@ export function ReassignMultipleRoleBox({ - <>{t('Head of Household')} + <>{t(`Head of ${beneficiaryGroup?.groupLabel}`)} - + @@ -123,7 +140,11 @@ export function ReassignMultipleRoleBox({ {' '} {ticket.individual.fullName} - + @@ -137,7 +158,11 @@ export function ReassignMultipleRoleBox({ ticket={ticket} household={household} individualToReassign={selectedIndividualToReassign} - initialSelectedIndividualId={reassignDataDictByIndividualId[selectedIndividualToReassign.id].new_individual} + initialSelectedIndividualId={ + reassignDataDictByIndividualId[ + selectedIndividualToReassign.id + ].new_individual + } /> )} @@ -153,17 +178,19 @@ export function ReassignMultipleRoleBox({ - {t('Individual is the HOH or the collector for the household')} + {t( + `${beneficiaryGroup?.memberLabel} is the Head of ${beneficiaryGroup?.groupLabel} or the collector for the ${beneficiaryGroup?.groupLabel}`, + )} {t( - 'Upon changing you will need to select new individual(s) for this role.', + `Upon changing you will need to select new ${beneficiaryGroup?.memberLabelPlural} for this role.`, )} {t( - 'Upon removing you will need to select new individual(s) for this role.', + `Upon removing you will need to select new ${beneficiaryGroup?.memberLabelPlural} for this role.`, )} diff --git a/src/frontend/src/components/grievances/ReassignRoleBox.tsx b/src/frontend/src/components/grievances/ReassignRoleBox.tsx index fa567aae9b..d9a9d6a790 100644 --- a/src/frontend/src/components/grievances/ReassignRoleBox.tsx +++ b/src/frontend/src/components/grievances/ReassignRoleBox.tsx @@ -11,6 +11,7 @@ import { ContentLink } from '@core/ContentLink'; import { LabelizedField } from '@core/LabelizedField'; import { LookUpReassignRole } from './LookUps/LookUpReassignRole/LookUpReassignRole'; import { ReassignRoleUnique } from './LookUps/LookUpReassignRole/ReassignRoleUnique'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; const StyledBox = styled(Paper)` @@ -44,6 +45,9 @@ export const ReassignRoleBox = ({ }): ReactElement => { const { t } = useTranslation(); const { baseUrl } = useBaseUrl(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + let { individual } = ticket; let { household } = ticket; let reassignData; @@ -88,7 +92,8 @@ export const ReassignRoleBox = ({ } const reassignDataDictByIndividualId = {}; for (const key of Object.keys(reassignData)) { - reassignDataDictByIndividualId[reassignData[key].individual] = reassignData[key]; + reassignDataDictByIndividualId[reassignData[key].individual] = + reassignData[key]; } const mappedLookUpsForExternalHouseholds = householdsAndRoles .filter((el) => el.role !== 'NO_ROLE') @@ -98,7 +103,7 @@ export const ReassignRoleBox = ({ <>{capitalize(el.role)} Collector - + @@ -149,7 +154,7 @@ export const ReassignRoleBox = ({ return ( {t( - 'Upon removing you will need to select new individual(s) for this role.', + `Upon removing you will need to select new ${beneficiaryGroup?.memberLabelPlural} for this role.`, )} ); @@ -162,7 +167,9 @@ export const ReassignRoleBox = ({ - {t('Individual is the HOH or the collector for the household')} + {t( + `${beneficiaryGroup?.memberLabel} is the Head of Household or the collector for the ${beneficiaryGroup?.groupLabel}`, + )}{' '} {showMessage()} @@ -171,9 +178,9 @@ export const ReassignRoleBox = ({ - <>{t('Head of Household')} + <>{t(`Head of ${beneficiaryGroup?.groupLabel}`)} - + diff --git a/src/frontend/src/components/grievances/utils/createGrievanceUtils.ts b/src/frontend/src/components/grievances/utils/createGrievanceUtils.ts index 6bc5aa401b..ce93ecb49e 100644 --- a/src/frontend/src/components/grievances/utils/createGrievanceUtils.ts +++ b/src/frontend/src/components/grievances/utils/createGrievanceUtils.ts @@ -3,6 +3,12 @@ import { GRIEVANCE_CATEGORIES, GRIEVANCE_ISSUE_TYPES } from '@utils/constants'; import { thingForSpecificGrievanceType } from '@utils/utils'; import { removeIdPropertyFromObjects } from './helpers'; +export const replaceLabels = (text, _beneficiaryGroup) => { + return text + .replace(/Individual/g, _beneficiaryGroup.memberLabel) + .replace(/Household/g, _beneficiaryGroup.groupLabel); +}; + export const selectedIssueType = ( formValues, grievanceTicketIssueTypeChoices, diff --git a/src/frontend/src/components/grievances/utils/validateGrievance.ts b/src/frontend/src/components/grievances/utils/validateGrievance.ts index eb3063cc1c..6b4ca38fcd 100644 --- a/src/frontend/src/components/grievances/utils/validateGrievance.ts +++ b/src/frontend/src/components/grievances/utils/validateGrievance.ts @@ -18,6 +18,7 @@ export function validate( allAddIndividualFieldsData: AllAddIndividualFieldsQuery, individualFieldsDict, householdFieldsDict, + beneficiaryGroup, ) { const category = values.category?.toString(); const issueType = values.issueType?.toString(); @@ -25,7 +26,7 @@ export function validate( if (category === GRIEVANCE_CATEGORIES.DATA_CHANGE) { if (issueType === GRIEVANCE_ISSUE_TYPES.ADD_INDIVIDUAL) { if (!values.selectedHousehold) { - errors.selectedHousehold = 'Household is Required'; + errors.selectedHousehold = `${beneficiaryGroup?.groupLabel} is Required`; } if (values.individualData?.documents?.length) { values.individualData.documents @@ -40,14 +41,14 @@ export function validate( } if (issueType === GRIEVANCE_ISSUE_TYPES.EDIT_HOUSEHOLD) { if (!values.selectedHousehold) { - errors.selectedHousehold = 'Household is Required'; + errors.selectedHousehold = `${beneficiaryGroup?.groupLabel} is Required`; } if ( // xD values.selectedHousehold && !values.householdDataUpdateFields?.[0]?.fieldName ) { - errors.householdDataUpdateFields = 'Household Data Change is Required'; + errors.householdDataUpdateFields = `${beneficiaryGroup?.groupLabel} Data Change is Required`; } if ( values.householdDataUpdateFields?.length && @@ -68,17 +69,17 @@ export function validate( } if (issueType === GRIEVANCE_ISSUE_TYPES.DELETE_INDIVIDUAL) { if (!values.selectedIndividual) { - errors.selectedIndividual = 'Individual is Required'; + errors.selectedIndividual = `${beneficiaryGroup?.memberLabel} is Required`; } } if (issueType === GRIEVANCE_ISSUE_TYPES.DELETE_HOUSEHOLD) { if (!values.selectedHousehold) { - errors.selectedHousehold = 'Household is Required'; + errors.selectedHousehold = `${beneficiaryGroup?.groupLabel} is Required`; } } if (issueType === GRIEVANCE_ISSUE_TYPES.EDIT_INDIVIDUAL) { if (!values.selectedIndividual) { - errors.selectedIndividual = 'Individual is Required'; + errors.selectedIndividual = `${beneficiaryGroup?.memberLabel} is Required`; } if ( values.selectedIndividual && @@ -94,8 +95,7 @@ export function validate( !values.individualDataUpdatePaymentChannelsToEdit?.length && !values.individualDataUpdateDeliveryMechanismDataToEdit?.length ) { - errors.individualDataUpdateFields = - 'Individual Data Change is Required'; + errors.individualDataUpdateFields = `${beneficiaryGroup?.memberLabel} Data Change is Required`; } if (values.individualDataUpdateFields?.length) { values.individualDataUpdateFields.forEach((el) => { @@ -240,6 +240,7 @@ export function validateUsingSteps( householdFieldsDict, activeStep, setValidateData, + beneficiaryGroup, ) { const category = values.category?.toString(); const issueType = values.issueType?.toString(); @@ -270,12 +271,12 @@ export function validateUsingSteps( if (category === GRIEVANCE_CATEGORIES.DATA_CHANGE) { if (issueType === GRIEVANCE_ISSUE_TYPES.ADD_INDIVIDUAL) { if (!values.selectedHousehold && activeStep === GrievanceSteps.Lookup) { - errors.selectedHousehold = 'Household is Required'; + errors.selectedHousehold = `${beneficiaryGroup?.groupLabel} is Required`; } } if (issueType === GRIEVANCE_ISSUE_TYPES.EDIT_HOUSEHOLD) { if (!values.selectedHousehold && activeStep === GrievanceSteps.Lookup) { - errors.selectedHousehold = 'Household is Required'; + errors.selectedHousehold = `${beneficiaryGroup?.groupLabel} is Required`; } if ( // xD @@ -283,7 +284,7 @@ export function validateUsingSteps( !values.householdDataUpdateFields?.[0]?.fieldName && activeStep === GrievanceSteps.Description ) { - errors.householdDataUpdateFields = 'Household Data Change is Required'; + errors.householdDataUpdateFields = `${beneficiaryGroup?.groupLabel} Data Change is Required`; } if ( values.householdDataUpdateFields?.length && @@ -304,12 +305,12 @@ export function validateUsingSteps( } if (issueType === GRIEVANCE_ISSUE_TYPES.DELETE_INDIVIDUAL) { if (!values.selectedIndividual && activeStep === GrievanceSteps.Lookup) { - errors.selectedIndividual = 'Individual is Required'; + errors.selectedIndividual = `${beneficiaryGroup?.memberLabel} is Required`; } } if (issueType === GRIEVANCE_ISSUE_TYPES.DELETE_HOUSEHOLD) { if (!values.selectedHousehold && activeStep === GrievanceSteps.Lookup) { - errors.selectedHousehold = 'Household is Required'; + errors.selectedHousehold = `${beneficiaryGroup?.groupLabel} is Required`; } } if (issueType === GRIEVANCE_ISSUE_TYPES.EDIT_INDIVIDUAL) { @@ -328,8 +329,7 @@ export function validateUsingSteps( !values.individualDataUpdatePaymentChannelsToEdit?.length && activeStep === GrievanceSteps.Description ) { - errors.individualDataUpdateFields = - 'Individual Data Change is Required'; + errors.individualDataUpdateFields = `${beneficiaryGroup?.memberLabel} Data Change is Required`; } if (values.individualDataUpdateFields?.length) { values.individualDataUpdateFields.forEach((el) => { @@ -470,7 +470,7 @@ export function validateUsingSteps( !values.selectedHousehold && householdRequiredGrievanceTypes.includes(values.issueType) ) { - errors.selectedHousehold = 'Household is Required'; + errors.selectedHousehold = `${beneficiaryGroup?.groupLabel} is Required`; } if (activeStep === GrievanceSteps.Lookup) { const individualRequiredIssueTypes = [ @@ -488,9 +488,9 @@ export function validateUsingSteps( values.issueType, ); if (isIndividualRequired && !values.selectedIndividual) { - errors.selectedIndividual = 'Individual is Required'; + errors.selectedIndividual = `${beneficiaryGroup?.memberLabel} is Required`; } else if (isHouseholdRequired && !values.selectedHousehold) { - errors.selectedHousehold = 'Household is Required'; + errors.selectedHousehold = `${beneficiaryGroup?.groupLabel} is Required`; } } if ( diff --git a/src/frontend/src/components/paymentmodule/CreateFollowUpPaymentPlan/CreateFollowUpPaymentPlan.tsx b/src/frontend/src/components/paymentmodule/CreateFollowUpPaymentPlan/CreateFollowUpPaymentPlan.tsx index 5127cd885f..a57aedca4b 100644 --- a/src/frontend/src/components/paymentmodule/CreateFollowUpPaymentPlan/CreateFollowUpPaymentPlan.tsx +++ b/src/frontend/src/components/paymentmodule/CreateFollowUpPaymentPlan/CreateFollowUpPaymentPlan.tsx @@ -50,6 +50,8 @@ export function CreateFollowUpPaymentPlan({ const [mutate, { loading }] = useCreateFollowUpPpMutation(); const { isActiveProgram } = useProgramContext(); const { showMessage } = useSnackbar(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const { id, totalWithdrawnHouseholdsCount, unsuccessfulPaymentsCount } = paymentPlan; @@ -154,7 +156,7 @@ export function CreateFollowUpPaymentPlan({ {t( - 'Withdrawn Household cannot be added into follow-up payment plan', + `Withdrawn ${beneficiaryGroup?.groupLabel} cannot be added into follow-up payment plan`, )} @@ -189,7 +191,11 @@ export function CreateFollowUpPaymentPlan({ */} - + {totalWithdrawnHouseholdsCount} diff --git a/src/frontend/src/components/paymentmodule/PaymentDetails/PaymentDetails.tsx b/src/frontend/src/components/paymentmodule/PaymentDetails/PaymentDetails.tsx index fe8806b7d6..726e9f1938 100644 --- a/src/frontend/src/components/paymentmodule/PaymentDetails/PaymentDetails.tsx +++ b/src/frontend/src/components/paymentmodule/PaymentDetails/PaymentDetails.tsx @@ -1,13 +1,18 @@ -import { Grid, Paper, Typography } from '@mui/material'; -import { useTranslation } from 'react-i18next'; -import styled from 'styled-components'; +import { UniversalActivityLogTable } from '@containers/tables/UniversalActivityLogTable'; +import { BlackLink } from '@core/BlackLink'; +import { ContainerColumnWithBorder } from '@core/ContainerColumnWithBorder'; +import { DividerLine } from '@core/DividerLine'; +import { LabelizedField } from '@core/LabelizedField'; +import { StatusBox } from '@core/StatusBox'; +import { Title } from '@core/Title'; +import { UniversalMoment } from '@core/UniversalMoment'; import { PaymentQuery, PaymentStatus, PaymentVerificationStatus, } from '@generated/graphql'; -import { UniversalActivityLogTable } from '@containers/tables/UniversalActivityLogTable'; -import { useBusinessArea } from '@hooks/useBusinessArea'; +import { useBaseUrl } from '@hooks/useBaseUrl'; +import { Grid, Paper, Typography } from '@mui/material'; import { formatCurrencyWithSymbol, getPhoneNoLabel, @@ -15,15 +20,10 @@ import { paymentStatusToColor, verificationRecordsStatusToColor, } from '@utils/utils'; -import { BlackLink } from '@core/BlackLink'; -import { ContainerColumnWithBorder } from '@core/ContainerColumnWithBorder'; -import { DividerLine } from '@core/DividerLine'; -import { LabelizedField } from '@core/LabelizedField'; -import { StatusBox } from '@core/StatusBox'; -import { Title } from '@core/Title'; -import { UniversalMoment } from '@core/UniversalMoment'; -import { useBaseUrl } from '@hooks/useBaseUrl'; import { ReactElement } from 'react'; +import { useTranslation } from 'react-i18next'; +import { useProgramContext } from 'src/programContext'; +import styled from 'styled-components'; const Overview = styled(Paper)` margin: 20px; @@ -42,9 +42,10 @@ export function PaymentDetails({ canViewActivityLog, canViewHouseholdDetails, }: PaymentDetailsProps): ReactElement { - const businessArea = useBusinessArea(); const { t } = useTranslation(); - const { programId } = useBaseUrl(); + const { businessArea, programId } = useBaseUrl(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; let paymentVerification: PaymentQuery['payment']['verification'] = null; if ( @@ -149,11 +150,11 @@ export function PaymentDetails({ ) : null} - <Typography variant="h6">{t('Household')}</Typography> + <Typography variant="h6">{beneficiaryGroup?.groupLabel}</Typography> - + {payment.household?.id && canViewHouseholdDetails ? ( el.unicefId, @@ -65,9 +67,7 @@ export function ExcludeSection({ const getTooltipText = (): string => { if (!hasOpenOrLockedStatus) { - return t( - 'Households can only be excluded from a Payment Plan in status open or locked', - ); + return `${beneficiaryGroup?.groupLabelPlural} can only be excluded from a Payment Plan in status open or locked`; } if (!hasExcludePermission) { return t('Permission denied'); @@ -114,7 +114,7 @@ export function ExcludeSection({ awaitRefetchQueries: true, }); if (!error) { - showMessage(t('Households exclusion started')); + showMessage(`${beneficiaryGroup?.groupLabelPlural} exclusion started`); setExclusionsOpen(false); } } catch (e) { @@ -173,7 +173,7 @@ export function ExcludeSection({ const numberOfExcluded = excludedIds.length - deletedIds.length; - const renderButtons = (submitForm, values, resetForm): ReactElement => { + const renderButtons = (submitForm, _values, resetForm): ReactElement => { const noExclusions = numberOfExcluded === 0; const editMode = isExclusionsOpen && isEdit; const previewMode = @@ -310,7 +310,7 @@ export function ExcludeSection({ {`${numberOfExcluded} ${ - numberOfExcluded === 1 ? 'Household' : 'Households' + numberOfExcluded === 1 + ? `${beneficiaryGroup?.groupLabel}` + : `${beneficiaryGroup?.groupLabelPlural}` } excluded`} diff --git a/src/frontend/src/components/paymentmodule/PaymentPlanDetails/PaymentPlanDetailsHeader/LockPaymentPlan.tsx b/src/frontend/src/components/paymentmodule/PaymentPlanDetails/PaymentPlanDetailsHeader/LockPaymentPlan.tsx index 0d3bf49b87..ed479dc378 100644 --- a/src/frontend/src/components/paymentmodule/PaymentPlanDetails/PaymentPlanDetailsHeader/LockPaymentPlan.tsx +++ b/src/frontend/src/components/paymentmodule/PaymentPlanDetails/PaymentPlanDetailsHeader/LockPaymentPlan.tsx @@ -16,6 +16,7 @@ import { useSnackbar } from '@hooks/useSnackBar'; import { Action, PaymentPlanQuery } from '@generated/graphql'; import { GreyText } from '@core/GreyText'; import { LoadingButton } from '@core/LoadingButton'; +import { useProgramContext } from 'src/programContext'; export interface LockPaymentPlanProps { paymentPlan: PaymentPlanQuery['paymentPlan']; @@ -26,6 +27,8 @@ export function LockPaymentPlan({ }: LockPaymentPlanProps): ReactElement { const { t } = useTranslation(); const { showMessage } = useSnackbar(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const [lockDialogOpen, setLockDialogOpen] = useState(false); const { mutatePaymentPlanAction: lock, loading: loadingLock } = usePaymentPlanAction( @@ -73,8 +76,8 @@ export function LockPaymentPlan({ : t('There are')}{' '} {paymentPlan.paymentsConflictsCount}{' '} {paymentPlan.paymentsConflictsCount === 1 - ? t('household') - : t('households')}{' '} + ? t(beneficiaryGroup?.groupLabel) + : t(beneficiaryGroup?.groupLabelPlural)}{' '} {t('that will be ignored in this Payment Plan.')} diff --git a/src/frontend/src/components/paymentmodule/PaymentPlanDetails/PaymentPlanDetailsResults/ResultsForHouseholds.tsx b/src/frontend/src/components/paymentmodule/PaymentPlanDetails/PaymentPlanDetailsResults/ResultsForHouseholds.tsx index 483afbb244..a8a6f869f4 100644 --- a/src/frontend/src/components/paymentmodule/PaymentPlanDetails/PaymentPlanDetailsResults/ResultsForHouseholds.tsx +++ b/src/frontend/src/components/paymentmodule/PaymentPlanDetails/PaymentPlanDetailsResults/ResultsForHouseholds.tsx @@ -1,4 +1,3 @@ -import { useTranslation } from 'react-i18next'; import { Grid } from '@mui/material'; import { SummaryBorder, @@ -6,6 +5,7 @@ import { } from '@components/paymentmodule/PaymentPlanDetails/PaymentPlanDetailsResults/Styles'; import { LabelizedField } from '@core/LabelizedField'; import { PaymentPlanQuery } from '@generated/graphql'; +import { useProgramContext } from 'src/programContext'; interface ResultsForHouseholdsProps { paymentPlan: PaymentPlanQuery['paymentPlan']; @@ -14,22 +14,27 @@ interface ResultsForHouseholdsProps { export const ResultsForHouseholds = ({ paymentPlan, }: ResultsForHouseholdsProps) => { - const { t } = useTranslation(); const { totalHouseholdsCount, totalIndividualsCount } = paymentPlan; + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; return ( - + {totalHouseholdsCount || '0'} - + {totalIndividualsCount || '0'} diff --git a/src/frontend/src/components/paymentmodulepeople/CreateFollowUpPaymentPlan/CreateFollowUpPaymentPlan.tsx b/src/frontend/src/components/paymentmodulepeople/CreateFollowUpPaymentPlan/CreateFollowUpPaymentPlan.tsx index 5127cd885f..dc85c22a8a 100644 --- a/src/frontend/src/components/paymentmodulepeople/CreateFollowUpPaymentPlan/CreateFollowUpPaymentPlan.tsx +++ b/src/frontend/src/components/paymentmodulepeople/CreateFollowUpPaymentPlan/CreateFollowUpPaymentPlan.tsx @@ -48,8 +48,9 @@ export function CreateFollowUpPaymentPlan({ const { baseUrl } = useBaseUrl(); const permissions = usePermissions(); const [mutate, { loading }] = useCreateFollowUpPpMutation(); - const { isActiveProgram } = useProgramContext(); + const { isActiveProgram, selectedProgram } = useProgramContext(); const { showMessage } = useSnackbar(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const { id, totalWithdrawnHouseholdsCount, unsuccessfulPaymentsCount } = paymentPlan; @@ -154,7 +155,7 @@ export function CreateFollowUpPaymentPlan({ {t( - 'Withdrawn Household cannot be added into follow-up payment plan', + `Withdrawn ${beneficiaryGroup?.groupLabel} cannot be added into follow-up payment plan`, )} @@ -189,7 +190,12 @@ export function CreateFollowUpPaymentPlan({ */} - + + {' '} {totalWithdrawnHouseholdsCount} diff --git a/src/frontend/src/components/paymentmodulepeople/PaymentDetails/PaymentDetails.tsx b/src/frontend/src/components/paymentmodulepeople/PaymentDetails/PaymentDetails.tsx index fc5624cab3..5ac343ee26 100644 --- a/src/frontend/src/components/paymentmodulepeople/PaymentDetails/PaymentDetails.tsx +++ b/src/frontend/src/components/paymentmodulepeople/PaymentDetails/PaymentDetails.tsx @@ -23,6 +23,7 @@ import { StatusBox } from '@core/StatusBox'; import { Title } from '@core/Title'; import { UniversalMoment } from '@core/UniversalMoment'; import { useBaseUrl } from '@hooks/useBaseUrl'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; const Overview = styled(Paper)` @@ -45,6 +46,8 @@ export function PaymentDetails({ const businessArea = useBusinessArea(); const { t } = useTranslation(); const { programId } = useBaseUrl(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; let paymentVerification: PaymentQuery['payment']['verification'] = null; if ( @@ -149,11 +152,11 @@ export function PaymentDetails({ ) : null} - <Typography variant="h6">{t('Household')}</Typography> + <Typography variant="h6">{beneficiaryGroup?.groupLabel}</Typography> - + {payment.household?.id && canViewHouseholdDetails ? ( { const { t } = useTranslation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + return ( - <Typography variant="h6">{t('Household')}</Typography> + <Typography variant="h6">{beneficiaryGroup?.groupLabel}</Typography> diff --git a/src/frontend/src/components/payments/IndividualDetails.tsx b/src/frontend/src/components/payments/IndividualDetails.tsx index 53da9bccb0..3fdb893fbb 100644 --- a/src/frontend/src/components/payments/IndividualDetails.tsx +++ b/src/frontend/src/components/payments/IndividualDetails.tsx @@ -4,24 +4,33 @@ import { Title } from '@core/Title'; import { Grid, Typography } from '@mui/material'; import { LabelizedField } from '@core/LabelizedField'; import { getPhoneNoLabel } from '@utils/utils'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; export const IndividualDetails = ({ individual }): ReactElement => { const { t } = useTranslation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + return ( - <Typography variant="h6">{t('Individual')}</Typography> + <Typography variant="h6"> + {t(`${beneficiaryGroup?.memberLabel}`)} + </Typography>{' '} - + @@ -74,7 +76,7 @@ export function HouseholdDetails({ - + {household?.size} @@ -84,7 +86,7 @@ export function HouseholdDetails({ - + @@ -93,12 +95,16 @@ export function HouseholdDetails({ - + {household?.fchildHoh ? t('Yes') : t('No')} - + {household?.childHoh ? t('Yes') : t('No')} @@ -171,7 +177,11 @@ export function HouseholdDetails({ - + {household?.returnee ? t('Yes') : t('No')} @@ -185,6 +195,16 @@ export function HouseholdDetails({ /> )} + + {household?.unicefId && ( + + )} + {selectedProgram?.dataCollectingType?.label} diff --git a/src/frontend/src/components/population/HouseholdDetails/__snapshots__/HouseholdDetails.test.tsx.snap b/src/frontend/src/components/population/HouseholdDetails/__snapshots__/HouseholdDetails.test.tsx.snap index 7be85f37d5..69a1810f18 100644 --- a/src/frontend/src/components/population/HouseholdDetails/__snapshots__/HouseholdDetails.test.tsx.snap +++ b/src/frontend/src/components/population/HouseholdDetails/__snapshots__/HouseholdDetails.test.tsx.snap @@ -99,10 +99,10 @@ exports[`components/population/HouseholdDetails should render 1`] = ` class="sc-gtLWhw bkWrmx" color="textSecondary" > - FEMALE CHILD HEADED HOUSEHOLD + FEMALE CHILD HEADED Household
- CHILD HEADED HOUSEHOLD + CHILD HEADED Household
- IS THIS A RETURNEE HOUSEHOLD? + IS THIS A RETURNEE Household?
+
+
+ + Linked Grievances + +
+ + + - + + +
+
+
diff --git a/src/frontend/src/components/population/HouseholdFilter.tsx b/src/frontend/src/components/population/HouseholdFilter.tsx index e55f2b11df..0fc7e70687 100644 --- a/src/frontend/src/components/population/HouseholdFilter.tsx +++ b/src/frontend/src/components/population/HouseholdFilter.tsx @@ -7,14 +7,15 @@ import { useLocation, useNavigate } from 'react-router-dom'; import { HouseholdChoiceDataQuery, ProgramNode } from '@generated/graphql'; import { useBaseUrl } from '@hooks/useBaseUrl'; import { AdminAreaAutocomplete } from '@shared/autocompletes/AdminAreaAutocomplete'; -import { householdTableOrderOptions } from '@utils/constants'; import { createHandleApplyFilterChange } from '@utils/utils'; import { FiltersSection } from '@core/FiltersSection'; import { NumberTextField } from '@core/NumberTextField'; import { SearchTextField } from '@core/SearchTextField'; import { SelectFilter } from '@core/SelectFilter'; import { DocumentSearchField } from '@core/DocumentSearchField'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; +import { generateTableOrderOptionsGroup } from '@utils/constants'; interface HouseholdFiltersProps { filter; @@ -38,6 +39,8 @@ export function HouseholdFilters({ isOnPaper = true, }: HouseholdFiltersProps): ReactElement { const { t } = useTranslation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const navigate = useNavigate(); const location = useLocation(); const { isAllPrograms } = useBaseUrl(); @@ -59,6 +62,9 @@ export function HouseholdFilters({ clearFilter(); }; + const householdTableOrderOptions = + generateTableOrderOptionsGroup(beneficiaryGroup); + return ( } data-cy="hh-filters-program" > - {programs.map((program) => ( + {programs?.map((program) => ( {program.name} @@ -118,7 +124,7 @@ export function HouseholdFilters({ } @@ -149,7 +155,7 @@ export function HouseholdFilters({ data-cy="hh-filters-order-by" disableClearable > - {householdTableOrderOptions.map((order) => ( + {householdTableOrderOptions?.map((order) => ( {order.name} diff --git a/src/frontend/src/components/population/IndividualBioData/IndividualBioData.tsx b/src/frontend/src/components/population/IndividualBioData/IndividualBioData.tsx index de74d2c410..ea53e8ad20 100644 --- a/src/frontend/src/components/population/IndividualBioData/IndividualBioData.tsx +++ b/src/frontend/src/components/population/IndividualBioData/IndividualBioData.tsx @@ -20,6 +20,7 @@ import { Title } from '@core/Title'; import { UniversalMoment } from '@core/UniversalMoment'; import { DocumentPopulationPhotoModal } from '../DocumentPopulationPhotoModal'; import { LinkedGrievancesModal } from '../LinkedGrievancesModal/LinkedGrievancesModal'; +import { useProgramContext } from 'src/programContext'; import { ReactElement, ReactNode } from 'react'; const Overview = styled(Paper)` @@ -46,6 +47,9 @@ export const IndividualBioData = ({ grievancesChoices, }: IndividualBioDataProps): ReactElement => { const { t } = useTranslation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + const relationshipChoicesDict = choicesToDict( choicesData.relationshipChoices, ); @@ -99,7 +103,7 @@ export const IndividualBioData = ({ const mappedRoles = ( - + {individual?.householdsAndRoles?.length ? individual?.householdsAndRoles?.map((item) => ( @@ -231,7 +235,7 @@ export const IndividualBioData = ({ - + {individual?.household?.id ? ( - + {relationshipChoicesDict[individual?.relationship]} diff --git a/src/frontend/src/components/population/IndividualBioData/__snapshots__/IndividualBioData.test.tsx.snap b/src/frontend/src/components/population/IndividualBioData/__snapshots__/IndividualBioData.test.tsx.snap index c67373dc40..6f68f01019 100644 --- a/src/frontend/src/components/population/IndividualBioData/__snapshots__/IndividualBioData.test.tsx.snap +++ b/src/frontend/src/components/population/IndividualBioData/__snapshots__/IndividualBioData.test.tsx.snap @@ -315,10 +315,10 @@ exports[`components/population/IndividualBioData should render 1`] = ` class="sc-gtLWhw bkWrmx" color="textSecondary" > - Relationship to HOH + Relationship to Head Of Household
<Typography variant="h6"> - {t('Individual Delivery Mechanisms')} + {t(`${beneficiaryGroup?.memberLabel} Delivery Mechanisms`)} </Typography> diff --git a/src/frontend/src/components/population/IndividualsFilter.tsx b/src/frontend/src/components/population/IndividualsFilter.tsx index 38acef7444..a156f6cfb1 100644 --- a/src/frontend/src/components/population/IndividualsFilter.tsx +++ b/src/frontend/src/components/population/IndividualsFilter.tsx @@ -10,7 +10,7 @@ import { } from '@generated/graphql'; import { useBaseUrl } from '@hooks/useBaseUrl'; import { AdminAreaAutocomplete } from '@shared/autocompletes/AdminAreaAutocomplete'; -import { individualTableOrderOptions } from '@utils/constants'; +import { generateTableOrderOptionsMember } from '@utils/constants'; import { createHandleApplyFilterChange } from '@utils/utils'; import { DatePickerFilter } from '@core/DatePickerFilter'; import { FiltersSection } from '@core/FiltersSection'; @@ -47,6 +47,7 @@ export function IndividualsFilter({ const location = useLocation(); const { isAllPrograms } = useBaseUrl(); const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const { handleFilterChange, applyFilterChanges, clearFilter } = createHandleApplyFilterChange( @@ -71,6 +72,9 @@ export function IndividualsFilter({ selectedProgram?.dataCollectingType?.type?.toUpperCase() === DataCollectingTypeType.Social; + const individualTableOrderOptions = + generateTableOrderOptionsMember(beneficiaryGroup); + return ( } data-cy="filters-program" > - {programs.map((program) => ( + {programs?.map((program) => ( {program.name} diff --git a/src/frontend/src/components/population/LinkedGrievancesModal/LinkedGrievancesModal.tsx b/src/frontend/src/components/population/LinkedGrievancesModal/LinkedGrievancesModal.tsx index ca06995f22..0aa8294a71 100644 --- a/src/frontend/src/components/population/LinkedGrievancesModal/LinkedGrievancesModal.tsx +++ b/src/frontend/src/components/population/LinkedGrievancesModal/LinkedGrievancesModal.tsx @@ -31,6 +31,7 @@ import { StatusBox } from '@core/StatusBox'; import { ClickableTableRow } from '@core/Table/ClickableTableRow'; import { getGrievanceDetailsPath } from '../../grievances/utils/createGrievanceUtils'; import { Bold } from '@components/core/Bold'; +import { useProgramContext } from 'src/programContext'; export const StyledLink = styled.div` color: #000; @@ -62,6 +63,8 @@ export function LinkedGrievancesModal({ const [dialogOpen, setDialogOpen] = useState(false); const navigate = useNavigate(); const { t } = useTranslation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const { data: grievances } = useAllGrievanceTicketQuery({ variables: { businessArea, household: household.unicefId }, @@ -173,8 +176,7 @@ export function LinkedGrievancesModal({ - Household ID - {household.unicefId} + {beneficiaryGroup?.groupLabel} ID {household.unicefId} is linked to following Grievances. diff --git a/src/frontend/src/components/programs/CreateProgram/DetailsStep.tsx b/src/frontend/src/components/programs/CreateProgram/DetailsStep.tsx index 2ea93c2aef..5c93699c6a 100644 --- a/src/frontend/src/components/programs/CreateProgram/DetailsStep.tsx +++ b/src/frontend/src/components/programs/CreateProgram/DetailsStep.tsx @@ -10,6 +10,7 @@ interface DetailsStepProps { handleNext?: () => Promise; errors: any; programId?: string; + programHasRdi?: boolean; } export const DetailsStep: FC = ({ @@ -17,6 +18,7 @@ export const DetailsStep: FC = ({ handleNext, errors, programId: formProgramId, + programHasRdi, }) => { const { t } = useTranslation(); const { businessArea, programId, baseUrl } = useBaseUrl(); @@ -29,7 +31,7 @@ export const DetailsStep: FC = ({ return ( <> - +
+
+
+ + Beneficiary Group + +
+ - +
+
+
diff --git a/src/frontend/src/components/rdi/RegistrationFilters.tsx b/src/frontend/src/components/rdi/RegistrationFilters.tsx index a9cb4fe438..1331e0ad3a 100644 --- a/src/frontend/src/components/rdi/RegistrationFilters.tsx +++ b/src/frontend/src/components/rdi/RegistrationFilters.tsx @@ -10,6 +10,7 @@ import { NumberTextField } from '@core/NumberTextField'; import { SearchTextField } from '@core/SearchTextField'; import { SelectFilter } from '@core/SelectFilter'; import { FiltersSection } from '@core/FiltersSection'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; interface RegistrationFiltersProps { @@ -29,6 +30,8 @@ export const RegistrationFilters = ({ }: RegistrationFiltersProps): ReactElement => { const navigate = useNavigate(); const location = useLocation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const { handleFilterChange, applyFilterChanges, clearFilter } = createHandleApplyFilterChange( @@ -100,7 +103,7 @@ export const RegistrationFilters = ({ } diff --git a/src/frontend/src/components/rdi/create/ImportCounters.tsx b/src/frontend/src/components/rdi/create/ImportCounters.tsx index 75accf186c..46fdac4b33 100644 --- a/src/frontend/src/components/rdi/create/ImportCounters.tsx +++ b/src/frontend/src/components/rdi/create/ImportCounters.tsx @@ -1,6 +1,7 @@ import { useTranslation } from 'react-i18next'; import { useBaseUrl } from '@hooks/useBaseUrl'; import { useProgramQuery } from '@generated/graphql'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; export interface ImportCountersPropTypes { @@ -14,6 +15,9 @@ export function ImportCounters({ }: ImportCountersPropTypes): ReactElement { const { t } = useTranslation(); const { programId } = useBaseUrl(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + const { data: programData } = useProgramQuery({ variables: { id: programId }, }); @@ -34,7 +38,7 @@ export function ImportCounters({
{numberOfHouseholds}{' '} {t( - 'Household' + `${beneficiaryGroup?.groupLabel}` .concat(numberOfHouseholds > 1 ? 's' : '') .concat(' available to import'), )} @@ -42,7 +46,7 @@ export function ImportCounters({
{numberOfIndividuals}{' '} {t( - 'Individual' + `${beneficiaryGroup?.memberLabel}` .concat(numberOfIndividuals > 1 ? 's' : '') .concat(' available to import'), )} diff --git a/src/frontend/src/components/rdi/create/programPopulation/CreateImportFromProgramPopulation.tsx b/src/frontend/src/components/rdi/create/programPopulation/CreateImportFromProgramPopulation.tsx index 8aea2eb8c2..3ee5d1f046 100644 --- a/src/frontend/src/components/rdi/create/programPopulation/CreateImportFromProgramPopulation.tsx +++ b/src/frontend/src/components/rdi/create/programPopulation/CreateImportFromProgramPopulation.tsx @@ -39,6 +39,7 @@ export const CreateImportFromProgramPopulationForm = ({ first: 100, businessArea, compatibleDct: true, + beneficiaryGroupMatch: true, }, fetchPolicy: 'network-only', }); diff --git a/src/frontend/src/components/rdi/details/DedupeResults.tsx b/src/frontend/src/components/rdi/details/DedupeResults.tsx index 9594e35f60..f0262f6dde 100644 --- a/src/frontend/src/components/rdi/details/DedupeResults.tsx +++ b/src/frontend/src/components/rdi/details/DedupeResults.tsx @@ -24,6 +24,7 @@ import { DialogFooter } from '@containers/dialogs/DialogFooter'; import { DialogTitleWrapper } from '@containers/dialogs/DialogTitleWrapper'; import { DialogDescription } from '@containers/dialogs/DialogDescription'; import { useBaseUrl } from '@hooks/useBaseUrl'; +import { useProgramContext } from 'src/programContext'; const Error = styled.span` color: ${({ theme }: { theme: MiśTheme }) => theme.hctPalette.red}; @@ -56,6 +57,8 @@ export function DedupeResults({ const { t } = useTranslation(); const [open, setOpen] = useState(false); const { baseUrl } = useBaseUrl(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; function createData( hitId, @@ -136,7 +139,7 @@ export function DedupeResults({ - {t('Individual ID')} + {t(`${beneficiaryGroup?.memberLabel} ID`)} {t('Full Name')} {t('Age')} diff --git a/src/frontend/src/components/rdi/details/RegistrationDetails/RegistrationDetails.tsx b/src/frontend/src/components/rdi/details/RegistrationDetails/RegistrationDetails.tsx index ac11ee42bc..1c2e2cc139 100644 --- a/src/frontend/src/components/rdi/details/RegistrationDetails/RegistrationDetails.tsx +++ b/src/frontend/src/components/rdi/details/RegistrationDetails/RegistrationDetails.tsx @@ -17,6 +17,7 @@ import { } from '@generated/graphql'; import { DedupeBox, OptionType } from '../DedupeBox'; import { Title } from '@core/Title'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; export const BigValueContainer = styled.div` @@ -56,6 +57,9 @@ export function RegistrationDetails({ isSocialWorkerProgram, }: RegistrationDetailsProps): ReactElement { const { t } = useTranslation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + const withinBatchOptions: OptionType[] = [ { name: 'Unique', @@ -112,7 +116,7 @@ export function RegistrationDetails({ {registration?.numberOfHouseholds} @@ -122,7 +126,7 @@ export function RegistrationDetails({ {registration?.numberOfIndividuals} diff --git a/src/frontend/src/components/rdi/details/RegistrationDetails/__snapshots__/RegistrationDetails.test.tsx.snap b/src/frontend/src/components/rdi/details/RegistrationDetails/__snapshots__/RegistrationDetails.test.tsx.snap index cea5d3369b..91aa7fc334 100644 --- a/src/frontend/src/components/rdi/details/RegistrationDetails/__snapshots__/RegistrationDetails.test.tsx.snap +++ b/src/frontend/src/components/rdi/details/RegistrationDetails/__snapshots__/RegistrationDetails.test.tsx.snap @@ -184,10 +184,10 @@ exports[`components/rdi/details/RegistrationDetails should render 1`] = ` class="sc-gtLWhw bkWrmx" color="textSecondary" > - Total Number of Registered Individuals + Total Number of Individuals
@@ -42,7 +44,7 @@ export function HouseholdDetails({ <Overview> <Grid container spacing={6}> <Grid item xs={3}> - <LabelizedField label={t('Household Size')}> + <LabelizedField label={`${beneficiaryGroup?.groupLabel} Size`}> {household.size} </LabelizedField> </Grid> @@ -62,7 +64,7 @@ export function HouseholdDetails({ </LabelizedField> </Grid> <Grid item xs={3}> - <LabelizedField label={t('Head of Household')}> + <LabelizedField label={`Head of ${beneficiaryGroup?.groupLabel}`}> <ContentLink href={`/${baseUrl}/registration-data-import/individual/${household.headOfHousehold.id}`} > diff --git a/src/frontend/src/components/rdi/details/individual/RegistrationIndividualBioData/RegistrationIndividualBioData.tsx b/src/frontend/src/components/rdi/details/individual/RegistrationIndividualBioData/RegistrationIndividualBioData.tsx index f4c6d7c058..5a127a05f7 100644 --- a/src/frontend/src/components/rdi/details/individual/RegistrationIndividualBioData/RegistrationIndividualBioData.tsx +++ b/src/frontend/src/components/rdi/details/individual/RegistrationIndividualBioData/RegistrationIndividualBioData.tsx @@ -18,6 +18,7 @@ import { Title } from '@core/Title'; import { UniversalMoment } from '@core/UniversalMoment'; import { DocumentRegistrationPhotoModal } from '../DocumentRegistrationPhotoModal'; import { useBaseUrl } from '@hooks/useBaseUrl'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; const Overview = styled(Paper)` @@ -40,6 +41,9 @@ export function RegistrationIndividualBioData({ }: RegistrationIndividualBioDataProps): ReactElement { const { baseUrl } = useBaseUrl(); const { t } = useTranslation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + const relationshipChoicesDict = choicesToDict( choicesData.relationshipChoices, ); @@ -150,7 +154,8 @@ export function RegistrationIndividualBioData({ </LabelizedField> </Grid> <Grid item xs={3}> - <LabelizedField label={t('Household ID')}> + <LabelizedField label={t(`${beneficiaryGroup?.groupLabel} ID`)}> + {' '} {individual?.household?.id ? ( <ContentLink href={`/${baseUrl}/registration-data-import/household/${individual?.household?.id}`} diff --git a/src/frontend/src/components/rdi/details/individual/RegistrationIndividualBioData/__snapshots__/RegistrationIndividualBioData.test.tsx.snap b/src/frontend/src/components/rdi/details/individual/RegistrationIndividualBioData/__snapshots__/RegistrationIndividualBioData.test.tsx.snap index 5bf71c0e9e..332291d84d 100644 --- a/src/frontend/src/components/rdi/details/individual/RegistrationIndividualBioData/__snapshots__/RegistrationIndividualBioData.test.tsx.snap +++ b/src/frontend/src/components/rdi/details/individual/RegistrationIndividualBioData/__snapshots__/RegistrationIndividualBioData.test.tsx.snap @@ -275,6 +275,7 @@ exports[`components/rdi/details/individual/RegistrationIndividualBioData should class="sc-egkSDF XYdBd" color="textSecondary" > + <a class="sc-blHHSb hLtlEI" href="/afghanistan/programs/UHJvZ3JhbU5vZGU6YzRkNTY1N2QtMWEyOS00NmUxLTgxOTAtZGY3Zjg1YTBkMmVm/registration-data-import/household/SG91c2Vob2xkTm9kZTowMTk1YTEzYi0wYThkLTRiYTEtYjM0OS00MDY4YWNmOTViNDE=" diff --git a/src/frontend/src/components/targeting/CreateTargetPopulation/EmptyTargetingCriteria.tsx b/src/frontend/src/components/targeting/CreateTargetPopulation/EmptyTargetingCriteria.tsx index d2464c727f..b0aafb0fd7 100644 --- a/src/frontend/src/components/targeting/CreateTargetPopulation/EmptyTargetingCriteria.tsx +++ b/src/frontend/src/components/targeting/CreateTargetPopulation/EmptyTargetingCriteria.tsx @@ -2,6 +2,7 @@ import { Typography } from '@mui/material'; import { useTranslation } from 'react-i18next'; import styled from 'styled-components'; import { PaperContainer } from '../PaperContainer'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; const Label = styled.p` @@ -10,10 +11,12 @@ const Label = styled.p` export function EmptyTargetingCriteria(): ReactElement { const { t } = useTranslation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; return ( <PaperContainer> <Typography variant="h6"> - {t('Target Population Entries (Households)')} + {t(`Target Population Entries (${beneficiaryGroup?.groupLabelPlural})`)} </Typography> <Label>{t('Add targeting criteria to see results.')}</Label> </PaperContainer> diff --git a/src/frontend/src/components/targeting/CreateTargetPopulation/Exclusions.tsx b/src/frontend/src/components/targeting/CreateTargetPopulation/Exclusions.tsx index 8bf6990b45..77daef5db1 100644 --- a/src/frontend/src/components/targeting/CreateTargetPopulation/Exclusions.tsx +++ b/src/frontend/src/components/targeting/CreateTargetPopulation/Exclusions.tsx @@ -16,15 +16,16 @@ export function Exclusions({ const [isExclusionsOpen, setExclusionsOpen] = useState(initialOpen); const { t } = useTranslation(); const { isSocialDctType } = useProgramContext(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + return ( <PaperContainer> <Box display="flex" justifyContent="space-between"> <Typography data-cy="title-excluded-entries" variant="h6"> {isSocialDctType ? t('Excluded Target Population Entries') - : t( - 'Excluded Target Population Entries (Households or Individuals)', - )} + : `Excluded Target Population Entries (${beneficiaryGroup?.groupLabelPlural} or ${beneficiaryGroup?.memberLabelPlural})`} </Typography> <Button variant="outlined" @@ -49,8 +50,10 @@ export function Exclusions({ variant="outlined" label={ isSocialDctType - ? t('Individual IDs to exclude') - : t('Household or Individual IDs to exclude') + ? t(`${beneficiaryGroup?.memberLabel} IDs to exclude`) + : t( + `${beneficiaryGroup?.groupLabel} or ${beneficiaryGroup?.memberLabel} IDs to exclude`, + ) } component={FormikTextField} /> diff --git a/src/frontend/src/components/targeting/EditTargetPopulation/EditTargetPopulation.tsx b/src/frontend/src/components/targeting/EditTargetPopulation/EditTargetPopulation.tsx index 7fe4e91e22..a860cf9ac2 100644 --- a/src/frontend/src/components/targeting/EditTargetPopulation/EditTargetPopulation.tsx +++ b/src/frontend/src/components/targeting/EditTargetPopulation/EditTargetPopulation.tsx @@ -57,14 +57,16 @@ export const EditTargetPopulation = ({ const [mutate, { loading }] = useUpdateTpMutation(); const { showMessage } = useSnackbar(); const { baseUrl } = useBaseUrl(); - const { isSocialDctType, isStandardDctType } = useProgramContext(); + const { selectedProgram, isSocialDctType, isStandardDctType } = + useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const handleValidate = (values): { targetingCriteria?: string } => { const { targetingCriteria, householdIds, individualIds } = values; const errors: { targetingCriteria?: string } = {}; if (!targetingCriteria.length && !householdIds && !individualIds) { errors.targetingCriteria = t( - 'You need to select at least one targeting criteria or individual ID or household ID', + `You need to select at least one targeting criteria or ${beneficiaryGroup?.memberLabel} ID or ${beneficiaryGroup?.groupLabel} ID`, ); } return errors; @@ -192,10 +194,14 @@ export const EditTargetPopulation = ({ data-cy="save-message-box" > <Typography style={{ color: '#b1b1b5' }} variant="h6"> - {t('Save to see the list of households')} + {t( + `Save to see the list of ${beneficiaryGroup?.groupLabelPlural}`, + )} </Typography> <Typography style={{ color: '#b1b1b5' }} variant="subtitle1"> - {t('List of households will be available after saving')} + {t( + `List of ${beneficiaryGroup?.groupLabelPlural} will be available after saving`, + )}{' '} </Typography> </Box> </Form> diff --git a/src/frontend/src/components/targeting/ResultsForHouseholds.tsx b/src/frontend/src/components/targeting/ResultsForHouseholds.tsx index 8987ceb780..6dab57e360 100644 --- a/src/frontend/src/components/targeting/ResultsForHouseholds.tsx +++ b/src/frontend/src/components/targeting/ResultsForHouseholds.tsx @@ -10,6 +10,7 @@ import { MiśTheme } from '../../theme'; import { FieldBorder } from '@core/FieldBorder'; import { LabelizedField } from '@core/LabelizedField'; import { PaperContainer } from './PaperContainer'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; const colors = { @@ -57,6 +58,9 @@ export function ResultsForHouseholds({ targetPopulation, }: ResultsProps): ReactElement { const { t } = useTranslation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + if (targetPopulation.buildStatus !== TargetPopulationBuildStatus.Ok) { return null; } @@ -156,7 +160,9 @@ export function ResultsForHouseholds({ <Grid container spacing={0} justifyContent="flex-end"> <Grid item xs={6}> <SummaryBorder> - <LabelizedField label={t('Total Number of Households')}> + <LabelizedField + label={`Total Number of ${beneficiaryGroup?.groupLabelPlural}`} + > <SummaryValue data-cy="total-number-of-households-count"> {targetPopulation.totalHouseholdsCount || '0'} </SummaryValue> @@ -165,7 +171,9 @@ export function ResultsForHouseholds({ </Grid> <Grid item xs={6}> <SummaryBorder> - <LabelizedField label={t('Targeted Individuals')}> + <LabelizedField + label={`Targeted ${beneficiaryGroup?.memberLabelPlural}`} + > <SummaryValue> {targetPopulation.totalIndividualsCount || '0'} </SummaryValue> diff --git a/src/frontend/src/components/targeting/TargetPopulationCore.tsx b/src/frontend/src/components/targeting/TargetPopulationCore.tsx index 0942317575..98e05b4bfc 100644 --- a/src/frontend/src/components/targeting/TargetPopulationCore.tsx +++ b/src/frontend/src/components/targeting/TargetPopulationCore.tsx @@ -14,6 +14,7 @@ import { TargetingHouseholds } from './TargetingHouseholds'; import { useBaseUrl } from '@hooks/useBaseUrl'; import { TargetPopulationPeopleTable } from '@containers/tables/targeting/TargetPopulationPeopleTable'; import { ResultsForPeople } from '@components/targeting/ResultsForPeople'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; import { AddFilterTargetingCriteriaDisplay } from './TargetingCriteriaDisplay/AddFilterTargetingCriteriaDisplay'; @@ -40,6 +41,9 @@ export const TargetPopulationCore = ({ }: TargetPopulationCoreProps): ReactElement => { const { t } = useTranslation(); const { businessArea } = useBaseUrl(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + if (!targetPopulation) return null; const ResultComponent = targetPopulation.program.isSocialWorkerProgram @@ -75,8 +79,8 @@ export const TargetPopulationCore = ({ {t('Target Population is building')} </Typography> <Label> - Target population is processing, the list of households will be - available when the process is finished + {`Target population is processing, the list of ${beneficiaryGroup?.groupLabelPlural} will be + available when the process is finished`} </Label> </PaperContainer> ); @@ -103,7 +107,7 @@ export const TargetPopulationCore = ({ {isSocialDctType ? t('Excluded Target Population Entries') : t( - 'Excluded Target Population Entries (Households or Individuals)', + `Excluded Target Population Entries (${beneficiaryGroup?.groupLabelPlural} or ${beneficiaryGroup?.memberLabelPlural})`, )} </Typography> <Box mt={2}> diff --git a/src/frontend/src/components/targeting/TargetPopulationTableFilters.tsx b/src/frontend/src/components/targeting/TargetPopulationTableFilters.tsx index c51961864f..7cbb12c1a7 100644 --- a/src/frontend/src/components/targeting/TargetPopulationTableFilters.tsx +++ b/src/frontend/src/components/targeting/TargetPopulationTableFilters.tsx @@ -12,6 +12,7 @@ import { NumberTextField } from '@core/NumberTextField'; import { SearchTextField } from '@core/SearchTextField'; import { SelectFilter } from '@core/SelectFilter'; import { FiltersSection } from '@core/FiltersSection'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; interface TargetPopulationTableFiltersProps { @@ -32,6 +33,8 @@ export const TargetPopulationTableFilters = ({ const navigate = useNavigate(); const location = useLocation(); const isAccountability = location.pathname.includes('accountability'); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const { handleFilterChange, applyFilterChanges, clearFilter } = createHandleApplyFilterChange( @@ -88,7 +91,7 @@ export const TargetPopulationTableFilters = ({ </Grid> <Grid item xs={3}> <NumberTextField - topLabel={t('Number of Households')} + topLabel={t(`Number of ${beneficiaryGroup?.groupLabelPlural}`)} value={filter.totalHouseholdsCountMin} placeholder={t('From')} onChange={(e) => diff --git a/src/frontend/src/components/targeting/TargetingCriteriaDisplay/Criteria.tsx b/src/frontend/src/components/targeting/TargetingCriteriaDisplay/Criteria.tsx index 251518f606..3b0ed4097d 100644 --- a/src/frontend/src/components/targeting/TargetingCriteriaDisplay/Criteria.tsx +++ b/src/frontend/src/components/targeting/TargetingCriteriaDisplay/Criteria.tsx @@ -23,6 +23,7 @@ import { BlueText } from '@components/grievances/LookUps/LookUpStyles'; import { ReactElement, useState } from 'react'; import { Fragment } from 'react/jsx-runtime'; import { t } from 'i18next'; +import { useProgramContext } from 'src/programContext'; interface CriteriaElementProps { alternative?: boolean; @@ -266,6 +267,8 @@ export function Criteria({ householdIds, individualIds, }: CriteriaProps): ReactElement { + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const [openHH, setOpenHH] = useState(false); const [openIND, setOpenIND] = useState(false); const [currentHouseholdIds, setCurrentHouseholdIds] = useState<string[]>([]); @@ -326,7 +329,7 @@ export function Criteria({ {householdIds && ( <div> <Typography data-cy="household-ids-modal-title" variant="body1"> - {t('Household IDs selected')}: + {t(`${beneficiaryGroup?.groupLabel} IDs selected`)}: </Typography> <BlueText onClick={() => handleOpenHouseholdIds(householdIds)} @@ -340,7 +343,7 @@ export function Criteria({ {individualIds && ( <div> <Typography data-cy="individual-ids-modal-title" variant="body1"> - {t('Individual IDs selected')}: + {t(`${beneficiaryGroup?.groupLabel} IDs selected`)}: </Typography> <BlueText onClick={() => handleOpenIndividualIds(individualIds)} @@ -408,7 +411,9 @@ export function Criteria({ </ButtonsContainer> )} <Dialog open={openHH} onClose={handleClose} maxWidth="sm" fullWidth> - <DialogTitle>{t('Selected Households')}</DialogTitle> + <DialogTitle> + {t(`Selected ${beneficiaryGroup?.groupLabelPlural}`)} + </DialogTitle> <DialogContent> <Table> <TableHead> diff --git a/src/frontend/src/components/targeting/TargetingCriteriaDisplay/ExcludeCheckboxes.tsx b/src/frontend/src/components/targeting/TargetingCriteriaDisplay/ExcludeCheckboxes.tsx index b0536ff30c..d877ba1d7f 100644 --- a/src/frontend/src/components/targeting/TargetingCriteriaDisplay/ExcludeCheckboxes.tsx +++ b/src/frontend/src/components/targeting/TargetingCriteriaDisplay/ExcludeCheckboxes.tsx @@ -4,6 +4,7 @@ import { Box, Checkbox, FormControlLabel, Grid } from '@mui/material'; import styled from 'styled-components'; import { FormikCheckboxField } from '@shared/Formik/FormikCheckboxField'; import { FC } from 'react'; +import { useProgramContext } from 'src/programContext'; const NoWrapCheckbox = styled(FormControlLabel)` white-space: nowrap; @@ -25,6 +26,8 @@ export const ExcludeCheckboxes: FC<ExcludeCheckboxesProps> = ({ targetPopulation, }) => { const { t } = useTranslation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; return ( <Box mt={3} p={3}> @@ -47,7 +50,7 @@ export const ExcludeCheckboxes: FC<ExcludeCheckboxesProps> = ({ /> } label={t( - 'Exclude Households with Active Adjudication Ticket', + `Exclude ${beneficiaryGroup?.groupLabelPlural} with Active Adjudication Ticket`, )} /> )} @@ -85,7 +88,7 @@ export const ExcludeCheckboxes: FC<ExcludeCheckboxesProps> = ({ ?.flagExcludeIfOnSanctionList, )} label={t( - 'Exclude People with an Active Sanction Screen Flag', + `Exclude ${beneficiaryGroup?.memberLabelPlural} with an Active Sanction Screen Flag`, )} /> )} @@ -104,7 +107,7 @@ export const ExcludeCheckboxes: FC<ExcludeCheckboxesProps> = ({ ?.flagExcludeIfOnSanctionList, )} label={t( - 'Exclude Households with an Active Sanction Screen Flag', + `Exclude ${beneficiaryGroup?.groupLabelPlural} with an Active Sanction Screen Flag`, )} /> )} @@ -119,7 +122,7 @@ export const ExcludeCheckboxes: FC<ExcludeCheckboxesProps> = ({ <Field name="flagExcludeIfActiveAdjudicationTicket" label={t( - 'Exclude Households with Active Adjudication Ticket', + `Exclude ${beneficiaryGroup?.groupLabelPlural} with Active Adjudication Ticket`, )} color="primary" component={FormikCheckboxField} @@ -131,7 +134,9 @@ export const ExcludeCheckboxes: FC<ExcludeCheckboxesProps> = ({ <Grid item xs={6}> <Field name="flagExcludeIfActiveAdjudicationTicket" - label={t('Exclude People with Active Adjudication Ticket')} + label={t( + `Exclude ${beneficiaryGroup?.memberLabelPlural} with Active Adjudication Ticket`, + )} color="primary" component={FormikCheckboxField} data-cy="input-active-adjudication-ticket" @@ -143,7 +148,7 @@ export const ExcludeCheckboxes: FC<ExcludeCheckboxesProps> = ({ <Field name="flagExcludeIfOnSanctionList" label={t( - 'Exclude Households with an Active Sanction Screen Flag', + `Exclude ${beneficiaryGroup?.groupLabelPlural} with an Active Sanction Screen Flag`, )} color="primary" component={FormikCheckboxField} @@ -156,7 +161,7 @@ export const ExcludeCheckboxes: FC<ExcludeCheckboxesProps> = ({ <Field name="flagExcludeIfOnSanctionList" label={t( - 'Exclude People with an Active Sanction Screen Flag', + `Exclude ${beneficiaryGroup?.memberLabelPlural} with an Active Sanction Screen Flag`, )} color="primary" component={FormikCheckboxField} diff --git a/src/frontend/src/containers/GlobalProgramSelect.tsx b/src/frontend/src/containers/GlobalProgramSelect.tsx index 7f778ca0b8..c48d801d13 100644 --- a/src/frontend/src/containers/GlobalProgramSelect.tsx +++ b/src/frontend/src/containers/GlobalProgramSelect.tsx @@ -155,6 +155,27 @@ export const GlobalProgramSelect = () => { }; }, []); + useEffect(() => { + // Initial setup for selectedProgram + setSelectedProgram({ + beneficiaryGroup: { + id: 'default-id', + name: 'Beneficiaries', + groupLabel: 'Group', + groupLabelPlural: 'Groups', + memberLabel: 'Member', + memberLabelPlural: 'Members', + masterDetail: false, + }, + id: 'all', + name: 'All Programmes', + status: ProgramStatus.Active, + dataCollectingType: null, + pduFields: null, + }); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + useEffect(() => { if (programId !== 'all') { const program = programData?.program; @@ -163,7 +184,8 @@ export const GlobalProgramSelect = () => { isMounted.current && (!selectedProgram || selectedProgram?.id !== programId) ) { - const { id, name, status, dataCollectingType } = program; + const { id, name, status, dataCollectingType, beneficiaryGroup } = + program; setSelectedProgram({ id, @@ -182,10 +204,9 @@ export const GlobalProgramSelect = () => { // dataCollectingType?.collectorFieldsAvailable, }, pduFields: program.pduFields, + beneficiaryGroup: beneficiaryGroup, }); } - } else { - setSelectedProgram(null); } }, [programId, selectedProgram, setSelectedProgram, programData]); @@ -240,6 +261,22 @@ export const GlobalProgramSelect = () => { if (selectedValue) { handleClose(); if (selectedValue.id === 'all') { + setSelectedProgram({ + beneficiaryGroup: { + id: 'default-id', + name: 'Beneficiaries', + groupLabel: 'Group', + groupLabelPlural: 'Groups', + memberLabel: 'Member', + memberLabelPlural: 'Members', + masterDetail: false, + }, + id: 'all', + name: 'All Programmes', + status: ProgramStatus.Active, + dataCollectingType: null, + pduFields: null, + }); navigate(`/${businessArea}/programs/all/list`); } else { navigate( @@ -328,19 +365,22 @@ export const GlobalProgramSelect = () => { onChange={onChange} PopperComponent={PopperComponent} noOptionsText="No results" - renderOption={(props, option) => ( - <li {...props}> - <NameBox data-cy="select-option-name" title={option.name}> - {option.name} - </NameBox> - {option.status && ( - <StatusBox - status={option.status} - statusToColor={programStatusToColor} - /> - )} - </li> - )} + renderOption={(props, option) => { + const { key, ...restProps } = props; + return ( + <li key={key} {...restProps}> + <NameBox data-cy="select-option-name" title={option.name}> + {option.name} + </NameBox> + {option.status && ( + <StatusBox + status={option.status} + statusToColor={programStatusToColor} + /> + )} + </li> + ); + }} filterOptions={(x) => x} options={programs} getOptionLabel={(option) => option.name} diff --git a/src/frontend/src/containers/forms/ProgramForm.tsx b/src/frontend/src/containers/forms/ProgramForm.tsx index b698b0ef8d..1c24ca4f1d 100644 --- a/src/frontend/src/containers/forms/ProgramForm.tsx +++ b/src/frontend/src/containers/forms/ProgramForm.tsx @@ -1,7 +1,7 @@ import { Grid } from '@mui/material'; import CalendarTodayRoundedIcon from '@mui/icons-material/CalendarTodayRounded'; -import { Field, Form } from 'formik'; -import { ReactElement } from 'react'; +import { Field, Form, useFormikContext } from 'formik'; +import { ReactElement, useMemo } from 'react'; import { useTranslation } from 'react-i18next'; import { useDataCollectionTypeChoiceDataQuery, @@ -10,26 +10,58 @@ import { import { FormikCheckboxField } from '@shared/Formik/FormikCheckboxField'; import { FormikDateField } from '@shared/Formik/FormikDateField'; import { FormikRadioGroup } from '@shared/Formik/FormikRadioGroup'; +import { useQuery } from '@tanstack/react-query'; +import { fetchBeneficiaryGroups } from '@api/programsApi'; import { FormikSelectField } from '@shared/Formik/FormikSelectField'; import { FormikTextField } from '@shared/Formik/FormikTextField'; interface ProgramFormPropTypes { values; + programHasRdi?: boolean; } -export const ProgramForm = ({ values }: ProgramFormPropTypes): ReactElement => { +export const ProgramForm = ({ + values, + programHasRdi, +}: ProgramFormPropTypes): ReactElement => { const { t } = useTranslation(); const { data } = useProgrammeChoiceDataQuery(); const { data: dataCollectionTypeChoicesData } = useDataCollectionTypeChoiceDataQuery(); - if (!data || !dataCollectionTypeChoicesData) return null; + const { data: beneficiaryGroupsData } = useQuery({ + queryKey: ['beneficiaryGroups'], + queryFn: async () => fetchBeneficiaryGroups(), + }); + + const { setFieldValue } = useFormikContext(); const filteredDataCollectionTypeChoicesData = dataCollectionTypeChoicesData?.dataCollectionTypeChoices.filter( (el) => el.name !== '', ); + const mappedBeneficiaryGroupsData = useMemo(() => { + if (!beneficiaryGroupsData?.results) return []; + const filteredBeneficiaryGroups = + values.dataCollectingTypeCode === 'partial' + ? beneficiaryGroupsData.results.filter( + (el) => el.master_detail === false, + ) + : beneficiaryGroupsData.results.filter( + (el) => el.master_detail === true, + ); + + return filteredBeneficiaryGroups.map((el) => ({ + name: el.name, + value: el.id, + })); + }, [values.dataCollectingTypeCode, beneficiaryGroupsData]); + + const isCopyProgramPage = location.pathname.includes('duplicate'); + if (!data || !dataCollectionTypeChoicesData || !beneficiaryGroupsData) + return null; + return ( <Form> <Grid container spacing={3}> @@ -76,6 +108,7 @@ export const ProgramForm = ({ values }: ProgramFormPropTypes): ReactElement => { disabled={!values.startDate} initialFocusedDate={values.startDate} fullWidth + required={values.editMode} decoratorEnd={<CalendarTodayRoundedIcon color="disabled" />} minDate={values.startDate} data-cy="input-end-date" @@ -100,12 +133,27 @@ export const ProgramForm = ({ values }: ProgramFormPropTypes): ReactElement => { fullWidth variant="outlined" required + onChange={(e) => { + setFieldValue('beneficiaryGroup', ''); + setFieldValue('dataCollectingTypeCode', e.target.value); + }} choices={filteredDataCollectionTypeChoicesData || []} component={FormikSelectField} data-cy="input-data-collecting-type" /> </Grid> - <Grid item xs={6} /> + <Grid item xs={6}> + <Field + name="beneficiaryGroup" + label={t('Beneficiary Group')} + fullWidth + variant="outlined" + choices={mappedBeneficiaryGroupsData} + component={FormikSelectField} + data-cy="input-beneficiary-group" + disabled={programHasRdi || isCopyProgramPage} + /> + </Grid> <Grid item xs={12}> <Field name="description" diff --git a/src/frontend/src/containers/forms/TargetingCriteriaForm.tsx b/src/frontend/src/containers/forms/TargetingCriteriaForm.tsx index 9797183524..991462776e 100644 --- a/src/frontend/src/containers/forms/TargetingCriteriaForm.tsx +++ b/src/frontend/src/containers/forms/TargetingCriteriaForm.tsx @@ -41,6 +41,7 @@ import { DialogTitleWrapper } from '../dialogs/DialogTitleWrapper'; import { TargetingCriteriaIndividualFilterBlocks } from './TargetingCriteriaIndividualFilterBlocks'; import { AndDivider, AndDividerLabel } from '@components/targeting/AndDivider'; import { TargetingCriteriaHouseholdFilter } from './TargetingCriteriaHouseholdFilter'; +import { useProgramContext } from 'src/programContext'; import { FormikTextField } from '@shared/Formik/FormikTextField'; import { TargetingCriteriaCollectorFilterBlocks } from './TargetingCriteriaCollectorFilterBlocks'; import { useAllCollectorFieldsAttributesQuery } from '@generated/graphql'; @@ -148,6 +149,8 @@ export const TargetingCriteriaForm = ({ }: TargetingCriteriaFormPropTypes): ReactElement => { const { t } = useTranslation(); const { businessArea, programId } = useBaseUrl(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const { data, loading } = useCachedIndividualFieldsQuery( businessArea, @@ -269,7 +272,7 @@ export const TargetingCriteriaForm = ({ (!values.individualIds || values.individualIds.length === 0) ) { errors.nonFieldErrors = [ - 'You need to add at least one household filter, an individual block filter, a collector block filter, a household ID, or an individual ID.', + `You need to add at least one ${beneficiaryGroup?.groupLabel} filter or an ${beneficiaryGroup?.memberLabel} block filter.`, ]; } else if ( values.individualsFiltersBlocks.filter( @@ -280,7 +283,7 @@ export const TargetingCriteriaForm = ({ ).length > 0 ) { errors.nonFieldErrors = [ - 'You need to add at least one household filter, an individual block filter, a collector block filter, a household IDs, or an individual IDs.', + `You need to add at least one ${beneficiaryGroup?.groupLabel} filter or an ${beneficiaryGroup?.memberLabel} block filter.`, ]; } return errors; @@ -356,7 +359,7 @@ export const TargetingCriteriaForm = ({ <DialogDescription> {isSocialWorkingProgram ? '' - : 'All rules defined below have to be true for the entire household.'} + : `All rules defined below have to be true for the entire ${beneficiaryGroup?.groupLabelPlural}.`}{' '} </DialogDescription> <Grid container spacing={3}> {householdFiltersAvailable && ( @@ -367,7 +370,7 @@ export const TargetingCriteriaForm = ({ fullWidth multiline variant="outlined" - label={t('Household IDs')} + label={t(`${beneficiaryGroup?.groupLabelPlural} IDs`)} component={FormikTextField} /> </Grid> @@ -425,7 +428,10 @@ export const TargetingCriteriaForm = ({ startIcon={<AddCircleOutline />} data-cy="button-household-rule" > - ADD {isSocialWorkingProgram ? 'PEOPLE' : 'HOUSEHOLD'}{' '} + ADD{' '} + {isSocialWorkingProgram + ? 'PEOPLE' + : beneficiaryGroup?.groupLabel.toUpperCase()}{' '} RULE </Button> </ButtonBox> @@ -447,7 +453,9 @@ export const TargetingCriteriaForm = ({ name="individualIds" fullWidth variant="outlined" - label={t('Individual IDs')} + label={t( + `${beneficiaryGroup?.memberLabelPlural} IDs`, + )} component={FormikTextField} /> </Box> @@ -496,7 +504,8 @@ export const TargetingCriteriaForm = ({ color="primary" startIcon={<AddCircleOutline />} > - ADD INDIVIDUAL RULE GROUP + {`ADD ${beneficiaryGroup?.memberLabel.toUpperCase()} + RULE GROUP`} </Button> </ButtonBox> </Box> diff --git a/src/frontend/src/containers/forms/TargetingCriteriaIndividualFilterBlocks.tsx b/src/frontend/src/containers/forms/TargetingCriteriaIndividualFilterBlocks.tsx index f18c4ff7e5..a756f9c2ab 100644 --- a/src/frontend/src/containers/forms/TargetingCriteriaIndividualFilterBlocks.tsx +++ b/src/frontend/src/containers/forms/TargetingCriteriaIndividualFilterBlocks.tsx @@ -7,6 +7,7 @@ import styled from 'styled-components'; import { chooseFieldType, clearField } from '@utils/targetingUtils'; import { IndividualFieldsQuery } from '@generated/graphql'; import { TargetingCriteriaIndividualBlockFilter } from './TargetingCriteriaIndividualBlockFilter'; +import { useProgramContext } from 'src/programContext'; const Divider = styled.div` border-top: 1px solid #e2e2e2; @@ -84,9 +85,12 @@ export function TargetingCriteriaIndividualFilterBlocks({ const { t } = useTranslation(); const shouldShowAndDivider = blockIndex + 1 < values.individualsFiltersBlocks.length; + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + return ( <div> - Set Individual Criteria + {`Set ${beneficiaryGroup?.memberLabel} Criteria`} <FieldArray name={`individualsFiltersBlocks[${blockIndex}].individualBlockFilters`} render={(arrayHelpers) => ( diff --git a/src/frontend/src/containers/pages/accountability/feedback/CreateFeedbackPage.tsx b/src/frontend/src/containers/pages/accountability/feedback/CreateFeedbackPage.tsx index 8c922b8c51..abcf28ba97 100644 --- a/src/frontend/src/containers/pages/accountability/feedback/CreateFeedbackPage.tsx +++ b/src/frontend/src/containers/pages/accountability/feedback/CreateFeedbackPage.tsx @@ -48,13 +48,7 @@ import { FormikSelectField } from '@shared/Formik/FormikSelectField'; import { FormikTextField } from '@shared/Formik/FormikTextField'; import { FeedbackSteps } from '@utils/constants'; import { UniversalErrorBoundary } from '@components/core/UniversalErrorBoundary'; - -const steps = [ - 'Category Selection', - 'Household/Individual Look up', - 'Identity Verification', - 'Description', -]; +import { useProgramContext } from 'src/programContext'; const BoxPadding = styled.div` padding: 15px 0; @@ -153,6 +147,15 @@ export function CreateFeedbackPage(): ReactElement { const { baseUrl, businessArea, isAllPrograms, programId } = useBaseUrl(); const permissions = usePermissions(); const { showMessage } = useSnackbar(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + + const steps = [ + 'Category Selection', + `${beneficiaryGroup?.groupLabel}/${beneficiaryGroup?.memberLabel} Look up`, + 'Identity Verification', + 'Description', + ]; const [activeStep, setActiveStep] = useState(FeedbackSteps.Selection); const [validateData, setValidateData] = useState(false); @@ -360,14 +363,18 @@ export function CreateFeedbackPage(): ReactElement { </Typography> */} <Box py={4}> <Typography variant="subtitle2"> - {t('Household Questionnaire')} + {t( + `${beneficiaryGroup?.groupLabel} Questionnaire`, + )} </Typography> <Box py={4}> <HouseholdQuestionnaire values={values} /> </Box> </Box> <Typography variant="subtitle2"> - {t('Individual Questionnaire')} + {t( + `${beneficiaryGroup?.memberLabel} Questionnaire`, + )} </Typography> <Box py={4}> <IndividualQuestionnaire values={values} /> @@ -407,12 +414,20 @@ export function CreateFeedbackPage(): ReactElement { </LabelizedField> </Grid> <Grid item xs={6}> - <LabelizedField label={t('Household')}> + <LabelizedField + label={t( + `${beneficiaryGroup?.groupLabel}`, + )} + > {values.selectedHousehold?.unicefId} </LabelizedField> </Grid> <Grid item xs={6}> - <LabelizedField label={t('Individual')}> + <LabelizedField + label={t( + `${beneficiaryGroup?.memberLabel}`, + )} + > {values.selectedIndividual?.unicefId} </LabelizedField> </Grid> diff --git a/src/frontend/src/containers/pages/accountability/feedback/EditFeedbackPage.tsx b/src/frontend/src/containers/pages/accountability/feedback/EditFeedbackPage.tsx index adf35bf44e..0d5811853e 100644 --- a/src/frontend/src/containers/pages/accountability/feedback/EditFeedbackPage.tsx +++ b/src/frontend/src/containers/pages/accountability/feedback/EditFeedbackPage.tsx @@ -31,6 +31,7 @@ import { FormikAdminAreaAutocomplete } from '@shared/Formik/FormikAdminAreaAutoc import { FormikTextField } from '@shared/Formik/FormikTextField'; import { FormikSelectField } from '@shared/Formik/FormikSelectField'; import { UniversalErrorBoundary } from '@components/core/UniversalErrorBoundary'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; export const validationSchema = Yup.object().shape({ @@ -51,6 +52,9 @@ export const EditFeedbackPage = (): ReactElement => { const { baseUrl, businessArea, isAllPrograms } = useBaseUrl(); const permissions = usePermissions(); const { showMessage } = useSnackbar(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + const { data: feedbackData, loading: feedbackDataLoading } = useFeedbackQuery( { variables: { id }, @@ -219,7 +223,10 @@ export const EditFeedbackPage = (): ReactElement => { </Grid> <Grid container xs={6} spacing={6}> <Grid item xs={6}> - <LabelizedField label={t('Household ID')}> + <LabelizedField + label={t(`${beneficiaryGroup?.groupLabel} ID`)} + > + {' '} {feedback.householdLookup?.id && canViewHouseholdDetails && !isAllPrograms ? ( @@ -238,7 +245,10 @@ export const EditFeedbackPage = (): ReactElement => { </LabelizedField> </Grid> <Grid item xs={6}> - <LabelizedField label={t('Individual ID')}> + <LabelizedField + label={t(`${beneficiaryGroup?.memberLabel} ID`)} + > + {' '} {feedback.individualLookup?.id && canViewIndividualDetails && !isAllPrograms ? ( diff --git a/src/frontend/src/containers/pages/grievances/CreateGrievancePage.tsx b/src/frontend/src/containers/pages/grievances/CreateGrievancePage.tsx index b42c8df4c3..2ecac2541d 100644 --- a/src/frontend/src/containers/pages/grievances/CreateGrievancePage.tsx +++ b/src/frontend/src/containers/pages/grievances/CreateGrievancePage.tsx @@ -82,6 +82,8 @@ export const CreateGrievancePage = (): ReactElement => { const { isSocialDctType } = useProgramContext(); const permissions = usePermissions(); const { showMessage } = useSnackbar(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const [activeStep, setActiveStep] = useState(GrievanceSteps.Selection); const [validateData, setValidateData] = useState(false); @@ -235,13 +237,13 @@ export const CreateGrievancePage = (): ReactElement => { let steps = isSocialDctType ? [ 'Category Selection', - 'Individual Look up', + `${beneficiaryGroup?.memberLabel} Look up`, 'Identity Verification', 'Description', ] : [ 'Category Selection', - 'Household/Individual Look up', + `${beneficiaryGroup?.groupLabel}/${beneficiaryGroup?.memberLabel} Look up`, 'Identity Verification', 'Description', ]; @@ -317,6 +319,7 @@ export const CreateGrievancePage = (): ReactElement => { householdFieldsDict, activeStep, setValidateData, + beneficiaryGroup, ) } validationSchema={validationSchemaWithSteps(activeStep)} diff --git a/src/frontend/src/containers/pages/grievances/EditGrievancePage.tsx b/src/frontend/src/containers/pages/grievances/EditGrievancePage.tsx index ecb4b4d389..b078489cd1 100644 --- a/src/frontend/src/containers/pages/grievances/EditGrievancePage.tsx +++ b/src/frontend/src/containers/pages/grievances/EditGrievancePage.tsx @@ -56,12 +56,12 @@ import { FormikAdminAreaAutocomplete } from '@shared/Formik/FormikAdminAreaAutoc import { FormikSelectField } from '@shared/Formik/FormikSelectField'; import { FormikTextField } from '@shared/Formik/FormikTextField'; import { + getGrievanceCategoryDescriptions, + getGrievanceIssueTypeDescriptions, GRIEVANCE_CATEGORIES, GRIEVANCE_CATEGORIES_NAMES, - GRIEVANCE_CATEGORY_DESCRIPTIONS, GRIEVANCE_ISSUE_TYPES, GRIEVANCE_ISSUE_TYPES_NAMES, - GRIEVANCE_ISSUE_TYPE_DESCRIPTIONS, GRIEVANCE_TICKET_STATES, } from '@utils/constants'; import { @@ -72,8 +72,8 @@ import { } from '@utils/utils'; import { grievancePermissions } from './GrievancesDetailsPage/grievancePermissions'; import { UniversalErrorBoundary } from '@components/core/UniversalErrorBoundary'; -import { ReactElement } from 'react'; import { useProgramContext } from 'src/programContext'; +import { ReactElement } from 'react'; const BoxPadding = styled.div` padding: 15px 0; @@ -92,10 +92,11 @@ export const EditGrievancePage = (): ReactElement => { const location = useLocation(); const { t } = useTranslation(); const { baseUrl, businessArea, isAllPrograms } = useBaseUrl(); - const { isSocialDctType } = useProgramContext(); + const { selectedProgram, isSocialDctType } = useProgramContext(); const permissions = usePermissions(); const { showMessage } = useSnackbar(); const { id } = useParams(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const { data: ticketData, @@ -251,15 +252,6 @@ export const EditGrievancePage = (): ReactElement => { baseUrl, ); - const categoryDescription = - GRIEVANCE_CATEGORY_DESCRIPTIONS[ - GRIEVANCE_CATEGORIES_NAMES[ticket.category] - ] || ''; - const issueTypeDescription = - GRIEVANCE_ISSUE_TYPE_DESCRIPTIONS[ - GRIEVANCE_ISSUE_TYPES_NAMES[ticket.issueType] - ] || ''; - const mappedProgramChoices = programsData?.allPrograms?.edges?.map( (element) => ({ name: element.node.name, value: element.node.id }), ); @@ -317,6 +309,7 @@ export const EditGrievancePage = (): ReactElement => { allAddIndividualFieldsData, individualFieldsDictForValidation, householdFieldsDict, + beneficiaryGroup, ) } validationSchema={validationSchema} @@ -327,6 +320,18 @@ export const EditGrievancePage = (): ReactElement => { dataChangeComponentDict, EmptyComponent, ); + const categoryDescriptions = + getGrievanceCategoryDescriptions(beneficiaryGroup); + const issueTypeDescriptions = + getGrievanceIssueTypeDescriptions(beneficiaryGroup); + + const categoryDescription = + categoryDescriptions[GRIEVANCE_CATEGORIES_NAMES[values.category]] || + ''; + const issueTypeDescription = + issueTypeDescriptions[ + GRIEVANCE_ISSUE_TYPES_NAMES[values.issueType] + ] || ''; return ( <> <AutoSubmitFormOnEnter /> @@ -393,7 +398,9 @@ export const EditGrievancePage = (): ReactElement => { )} <Grid container xs={12} item> <Grid item xs={3}> - <LabelizedField label={t('Household ID')}> + <LabelizedField + label={`${beneficiaryGroup?.groupLabel}`} + > <span> {ticket.household?.id && canViewHouseholdDetails && diff --git a/src/frontend/src/containers/pages/grievances/GrievancesTablePage.tsx b/src/frontend/src/containers/pages/grievances/GrievancesTablePage.tsx index 41a3335d7e..43e7d22f10 100644 --- a/src/frontend/src/containers/pages/grievances/GrievancesTablePage.tsx +++ b/src/frontend/src/containers/pages/grievances/GrievancesTablePage.tsx @@ -24,7 +24,6 @@ import { ButtonTooltip } from '@components/core/ButtonTooltip'; import { t } from 'i18next'; import { useProgramContext } from 'src/programContext'; import { UniversalErrorBoundary } from '@components/core/UniversalErrorBoundary'; - export const GrievancesTablePage = (): ReactElement => { const { baseUrl } = useBaseUrl(); const { isActiveProgram } = useProgramContext(); diff --git a/src/frontend/src/containers/pages/householdMembers/NewTemplatePage.tsx b/src/frontend/src/containers/pages/householdMembers/NewTemplatePage.tsx index ecfbeefe19..51ea746c33 100644 --- a/src/frontend/src/containers/pages/householdMembers/NewTemplatePage.tsx +++ b/src/frontend/src/containers/pages/householdMembers/NewTemplatePage.tsx @@ -20,8 +20,11 @@ import { ReactElement, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { Link, useLocation, useNavigate } from 'react-router-dom'; import { hasPermissions, PERMISSIONS } from 'src/config/permissions'; +import { useProgramContext } from 'src/programContext'; export const NewTemplatePage = (): ReactElement => { + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const { t } = useTranslation(); const navigate = useNavigate(); const location = useLocation(); @@ -73,7 +76,7 @@ export const NewTemplatePage = (): ReactElement => { const [activeStep, setActiveStep] = useState(0); const steps = [ - `Filter ${isPeople ? 'People' : 'Individuals'}`, + `Filter ${isPeople ? 'People' : beneficiaryGroup?.memberLabelPlural}`, 'Fields to Update', ]; @@ -120,7 +123,7 @@ export const NewTemplatePage = (): ReactElement => { const breadCrumbsItems: BreadCrumbsItem[] = [ { - title: t('Household Members'), + title: beneficiaryGroup?.memberLabelPlural, to: `/${baseUrl}/population/individuals`, }, ]; diff --git a/src/frontend/src/containers/pages/managerialConsole/ManagerialConsolePage.tsx b/src/frontend/src/containers/pages/managerialConsole/ManagerialConsolePage.tsx index 7796c4d327..07298b55dd 100644 --- a/src/frontend/src/containers/pages/managerialConsole/ManagerialConsolePage.tsx +++ b/src/frontend/src/containers/pages/managerialConsole/ManagerialConsolePage.tsx @@ -14,11 +14,12 @@ import { usePermissions } from '@hooks/usePermissions'; import { useSnackbar } from '@hooks/useSnackBar'; import { Box } from '@mui/material'; import { useMutation, useQuery } from '@tanstack/react-query'; -import React, { FC, SetStateAction, useState } from 'react'; +import { FC, SetStateAction, useState } from 'react'; import { useTranslation } from 'react-i18next'; import { PERMISSIONS, hasPermissions } from '../../../config/permissions'; import { UniversalErrorBoundary } from '@components/core/UniversalErrorBoundary'; import { useLocation } from 'react-router-dom'; + export const ManagerialConsolePage: FC = () => { const { t } = useTranslation(); const { businessArea } = useBaseUrl(); diff --git a/src/frontend/src/containers/pages/paymentmodule/ProgramCycle/ProgramCycleDetails/PaymentPlansTable.tsx b/src/frontend/src/containers/pages/paymentmodule/ProgramCycle/ProgramCycleDetails/PaymentPlansTable.tsx index bf231efdbb..3fa7943237 100644 --- a/src/frontend/src/containers/pages/paymentmodule/ProgramCycle/ProgramCycleDetails/PaymentPlansTable.tsx +++ b/src/frontend/src/containers/pages/paymentmodule/ProgramCycle/ProgramCycleDetails/PaymentPlansTable.tsx @@ -9,6 +9,8 @@ import { import { UniversalTable } from '@containers/tables/UniversalTable'; import { headCells } from '@containers/pages/paymentmodule/ProgramCycle/ProgramCycleDetails/PaymentPlansHeadCells'; import { PaymentPlanTableRow } from '@containers/pages/paymentmodule/ProgramCycle/ProgramCycleDetails/PaymentPlanTableRow'; +import { adjustHeadCells } from '@utils/utils'; +import { useProgramContext } from 'src/programContext'; interface PaymentPlansTableProps { programCycle: ProgramCycle; @@ -24,6 +26,9 @@ export const PaymentPlansTable = ({ title, }: PaymentPlansTableProps): ReactElement => { const { programId, businessArea } = useBaseUrl(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + const initialVariables: AllPaymentPlansForTableQueryVariables = { businessArea, search: filter.search, @@ -37,6 +42,17 @@ export const PaymentPlansTable = ({ programCycle: programCycle.id, }; + const replacements = { + totalHouseholdsCount: (_beneficiaryGroup) => + `Num. of ${_beneficiaryGroup?.groupLabelPlural}`, + }; + + const adjustedHeadCells = adjustHeadCells( + headCells, + beneficiaryGroup, + replacements, + ); + return ( <UniversalTable< AllPaymentPlansForTableQuery['allPaymentPlans']['edges'][0]['node'], @@ -44,7 +60,7 @@ export const PaymentPlansTable = ({ > defaultOrderBy="-createdAt" title={title} - headCells={headCells} + headCells={adjustedHeadCells} query={useAllPaymentPlansForTableQuery} queriedObjectName="allPaymentPlans" initialVariables={initialVariables} diff --git a/src/frontend/src/containers/pages/paymentmodule/ProgramCycle/ProgramCyclePage.tsx b/src/frontend/src/containers/pages/paymentmodule/ProgramCycle/ProgramCyclePage.tsx index 97c2a8fa50..4783394705 100644 --- a/src/frontend/src/containers/pages/paymentmodule/ProgramCycle/ProgramCyclePage.tsx +++ b/src/frontend/src/containers/pages/paymentmodule/ProgramCycle/ProgramCyclePage.tsx @@ -2,7 +2,7 @@ import React, { ReactElement, useState } from 'react'; import { PageHeader } from '@core/PageHeader'; import { useTranslation } from 'react-i18next'; import { ProgramCyclesFilters } from '@containers/tables/ProgramCyclesTablePaymentModule/ProgramCyclesFilters'; -import { getFilterFromQueryParams } from '@utils/utils'; +import { adjustHeadCells, getFilterFromQueryParams } from '@utils/utils'; import { useLocation } from 'react-router-dom'; import { usePermissions } from '@hooks/usePermissions'; import { hasPermissions, PERMISSIONS } from '../../../../config/permissions'; @@ -11,6 +11,7 @@ import { useProgramContext } from '../../../../programContext'; import { TableWrapper } from '@core/TableWrapper'; import { ProgramCyclesTablePaymentModule } from '@containers/tables/ProgramCyclesTablePaymentModule/ProgramCyclesTablePaymentModule'; import { UniversalErrorBoundary } from '@components/core/UniversalErrorBoundary'; +import { headCells } from '@containers/tables/ProgramCyclesTablePaymentModule/HeadCells'; const initialFilter = { search: '', @@ -26,6 +27,7 @@ export const ProgramCyclePage = (): ReactElement => { const permissions = usePermissions(); const location = useLocation(); const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const [filter, setFilter] = useState( getFilterFromQueryParams(location, initialFilter), @@ -34,6 +36,17 @@ export const ProgramCyclePage = (): ReactElement => { getFilterFromQueryParams(location, initialFilter), ); + const replacements = { + totalHouseholdsCount: (_beneficiaryGroup) => + `Total ${_beneficiaryGroup?.groupLabelPlural} Count`, + }; + + const adjustedHeadCells = adjustHeadCells( + headCells, + beneficiaryGroup, + replacements, + ); + if (permissions === null) return null; if (!selectedProgram) return null; if (!hasPermissions(PERMISSIONS.PM_VIEW_LIST, permissions)) @@ -61,6 +74,7 @@ export const ProgramCyclePage = (): ReactElement => { <ProgramCyclesTablePaymentModule program={selectedProgram} filters={appliedFilter} + adjustedHeadCells={adjustedHeadCells} /> </TableWrapper> </> diff --git a/src/frontend/src/containers/pages/population/HouseholdMembersPage.tsx b/src/frontend/src/containers/pages/population/HouseholdMembersPage.tsx index c40c1abc73..15a73cf506 100644 --- a/src/frontend/src/containers/pages/population/HouseholdMembersPage.tsx +++ b/src/frontend/src/containers/pages/population/HouseholdMembersPage.tsx @@ -23,7 +23,9 @@ import { UniversalErrorBoundary } from '@components/core/UniversalErrorBoundary' export const HouseholdMembersPage = (): ReactElement => { const { t } = useTranslation(); const location = useLocation(); - const { programHasPdu } = useProgramContext(); + const { programHasPdu, selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + const { businessArea } = useBaseUrl(); const isNewTemplateJustCreated = location.state?.isNewTemplateJustCreated || false; @@ -90,7 +92,7 @@ export const HouseholdMembersPage = (): ReactElement => { > <> <PageHeader - title={t('Household Members')} + title={beneficiaryGroup?.memberLabelPlural} tabs={ <Tabs value={currentTab} @@ -98,7 +100,10 @@ export const HouseholdMembersPage = (): ReactElement => { setCurrentTab(newValue); }} > - <Tab data-cy="tab-individuals" label="Individuals" /> + <Tab + data-cy="tab-individuals" + label={beneficiaryGroup?.memberLabelPlural} + /> {programHasPdu ? ( canViewPDUListAndDetails ? ( <Tab diff --git a/src/frontend/src/containers/pages/population/PopulationHouseholdDetailsPage.tsx b/src/frontend/src/containers/pages/population/PopulationHouseholdDetailsPage.tsx index 72e34c8885..674d6ba1e0 100644 --- a/src/frontend/src/containers/pages/population/PopulationHouseholdDetailsPage.tsx +++ b/src/frontend/src/containers/pages/population/PopulationHouseholdDetailsPage.tsx @@ -32,6 +32,7 @@ import { AdminButton } from '@core/AdminButton'; import { CollectorsTable } from '@containers/tables/population/CollectorsTable'; import { HouseholdMembersTable } from '@containers/tables/population/HouseholdMembersTable'; import { UniversalErrorBoundary } from '@components/core/UniversalErrorBoundary'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; const Container = styled.div` @@ -62,8 +63,11 @@ export const PopulationHouseholdDetailsPage = (): ReactElement => { const { t } = useTranslation(); const { id } = useParams(); const { baseUrl, businessArea } = useBaseUrl(); + const location = useLocation(); const permissions = usePermissions(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const { data, loading, error } = useHouseholdQuery({ variables: { id }, @@ -97,7 +101,7 @@ export const PopulationHouseholdDetailsPage = (): ReactElement => { let breadCrumbsItems: BreadCrumbsItem[] = [ { - title: t('Households'), + title: beneficiaryGroup?.groupLabelPlural, to: `/${baseUrl}/population/household`, }, ]; @@ -125,7 +129,7 @@ export const PopulationHouseholdDetailsPage = (): ReactElement => { componentName="PopulationHouseholdDetailsPage" > <PageHeader - title={`${t('Household ID')}: ${renderSomethingOrDash( + title={`${beneficiaryGroup?.memberLabel}: ${renderSomethingOrDash( household?.unicefId, )}`} breadCrumbs={ @@ -142,7 +146,7 @@ export const PopulationHouseholdDetailsPage = (): ReactElement => { {household?.hasDuplicates && ( <WarningTooltip confirmed - message={t('Houesehold has Duplicates')} + message={`${beneficiaryGroup?.groupLabel} has Duplicates`} /> )} </Box> diff --git a/src/frontend/src/containers/pages/population/PopulationHouseholdPage.tsx b/src/frontend/src/containers/pages/population/PopulationHouseholdPage.tsx index aced83580d..2b0062cb23 100644 --- a/src/frontend/src/containers/pages/population/PopulationHouseholdPage.tsx +++ b/src/frontend/src/containers/pages/population/PopulationHouseholdPage.tsx @@ -1,22 +1,23 @@ -import { Box } from '@mui/material'; -import { ReactElement, useState } from 'react'; -import { useTranslation } from 'react-i18next'; -import { useLocation } from 'react-router-dom'; -import { useHouseholdChoiceDataQuery } from '@generated/graphql'; import { LoadingComponent } from '@components/core/LoadingComponent'; import { PageHeader } from '@components/core/PageHeader'; import { PermissionDenied } from '@components/core/PermissionDenied'; +import { UniversalErrorBoundary } from '@components/core/UniversalErrorBoundary'; import { HouseholdFilters } from '@components/population/HouseholdFilter'; -import { PERMISSIONS, hasPermissions } from '../../../config/permissions'; +import { useHouseholdChoiceDataQuery } from '@generated/graphql'; import { useBaseUrl } from '@hooks/useBaseUrl'; import { usePermissions } from '@hooks/usePermissions'; +import { Box } from '@mui/material'; import { getFilterFromQueryParams } from '@utils/utils'; +import { ReactElement, useState } from 'react'; +import { useLocation } from 'react-router-dom'; +import { useProgramContext } from 'src/programContext'; +import { PERMISSIONS, hasPermissions } from '../../../config/permissions'; import { HouseholdTable } from '../../tables/population/HouseholdTable'; -import { UniversalErrorBoundary } from '@components/core/UniversalErrorBoundary'; export function PopulationHouseholdPage(): ReactElement { - const { t } = useTranslation(); const location = useLocation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const { data: choicesData, loading: choicesLoading } = useHouseholdChoiceDataQuery({ fetchPolicy: 'cache-first', @@ -62,7 +63,7 @@ export function PopulationHouseholdPage(): ReactElement { componentName="PopulationHouseholdPage" > <> - <PageHeader title={t('Households')} /> + <PageHeader title={beneficiaryGroup?.groupLabelPlural} /> <HouseholdFilters filter={filter} choicesData={choicesData} diff --git a/src/frontend/src/containers/pages/population/PopulationIndividualsDetailsPage.tsx b/src/frontend/src/containers/pages/population/PopulationIndividualsDetailsPage.tsx index 17e117a02f..2c79908ce1 100644 --- a/src/frontend/src/containers/pages/population/PopulationIndividualsDetailsPage.tsx +++ b/src/frontend/src/containers/pages/population/PopulationIndividualsDetailsPage.tsx @@ -27,6 +27,7 @@ import { fetchPeriodicFields } from '@api/periodicDataUpdateApi'; import { useQuery } from '@tanstack/react-query'; import { IndividualDeliveryMechanisms } from '@components/population/IndividualDeliveryMechanisms'; import { UniversalErrorBoundary } from '@components/core/UniversalErrorBoundary'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; import { useTranslation } from 'react-i18next'; @@ -42,6 +43,8 @@ const Container = styled.div` export const PopulationIndividualsDetailsPage = (): ReactElement => { const { id } = useParams(); const location = useLocation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const { t } = useTranslation(); const { baseUrl, businessArea, programId } = useBaseUrl(); @@ -93,7 +96,7 @@ export const PopulationIndividualsDetailsPage = (): ReactElement => { let breadCrumbsItems: BreadCrumbsItem[] = [ { - title: 'Individuals', + title: `${beneficiaryGroup?.groupLabelPlural}`, to: `/${baseUrl}/population/individuals`, }, ]; @@ -122,7 +125,7 @@ export const PopulationIndividualsDetailsPage = (): ReactElement => { componentName="PopulationIndividualsDetailsPage" > <PageHeader - title={`${t('Individual ID')}: ${individual?.unicefId}`} + title={`${t(`${beneficiaryGroup?.memberLabel} ID`)}: ${individual?.unicefId}`} breadCrumbs={ hasPermissions( PERMISSIONS.POPULATION_VIEW_INDIVIDUALS_LIST, diff --git a/src/frontend/src/containers/pages/program/CreateProgramPage.tsx b/src/frontend/src/containers/pages/program/CreateProgramPage.tsx index c32e31f8e8..47215e1e35 100644 --- a/src/frontend/src/containers/pages/program/CreateProgramPage.tsx +++ b/src/frontend/src/containers/pages/program/CreateProgramPage.tsx @@ -29,6 +29,7 @@ import { } from '@components/programs/CreateProgram/ProgramStepper'; import { programValidationSchema } from '@components/programs/CreateProgram/programValidationSchema'; import { UniversalErrorBoundary } from '@components/core/UniversalErrorBoundary'; +import { useProgramContext } from 'src/programContext'; import { omit } from 'lodash'; export const CreateProgramPage = (): ReactElement => { @@ -39,6 +40,8 @@ export const CreateProgramPage = (): ReactElement => { const [step, setStep] = useState(0); const { showMessage } = useSnackbar(); const { baseUrl, businessArea } = useBaseUrl(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const { data: treeData, loading: treeLoading } = useAllAreasTreeQuery({ variables: { businessArea }, @@ -174,6 +177,7 @@ export const CreateProgramPage = (): ReactElement => { endDate: undefined, sector: '', dataCollectingTypeCode: '', + beneficiaryGroup: '', description: '', budget: '', administrativeAreasOfImplementation: '', @@ -280,7 +284,7 @@ export const CreateProgramPage = (): ReactElement => { { title: t('Programme Time Series Fields'), description: t( - 'The Time Series Fields feature allows serial updating of individual data through an XLSX file.', + `The Time Series Fields feature allows serial updating of ${beneficiaryGroup?.memberLabel} data through an XLSX file.`, ), dataCy: 'step-button-time-series-fields', }, diff --git a/src/frontend/src/containers/pages/program/DuplicateProgramPage.tsx b/src/frontend/src/containers/pages/program/DuplicateProgramPage.tsx index d8930ec4e0..19bf98011a 100644 --- a/src/frontend/src/containers/pages/program/DuplicateProgramPage.tsx +++ b/src/frontend/src/containers/pages/program/DuplicateProgramPage.tsx @@ -3,7 +3,6 @@ import { LoadingComponent } from '@components/core/LoadingComponent'; import { PageHeader } from '@components/core/PageHeader'; import { DetailsStep } from '@components/programs/CreateProgram/DetailsStep'; import { PartnersStep } from '@components/programs/CreateProgram/PartnersStep'; -import { programValidationSchema } from '@components/programs/CreateProgram/programValidationSchema'; import { AllProgramsForChoicesDocument, ProgramPartnerAccess, @@ -31,6 +30,7 @@ import { } from '@components/programs/CreateProgram/ProgramStepper'; import { UniversalErrorBoundary } from '@components/core/UniversalErrorBoundary'; import { omit } from 'lodash'; +import { editProgramDetailsValidationSchema } from '@components/programs/CreateProgram/editProgramValidationSchema'; export const DuplicateProgramPage = (): ReactElement => { const navigate = useNavigate(); @@ -70,7 +70,7 @@ export const DuplicateProgramPage = (): ReactElement => { })) : []; - const requestValues = omit(values, ['editMode']); + const requestValues = omit(values, ['editMode', 'beneficiaryGroup']); const initialPduFieldState = { label: '', pduData: { @@ -177,6 +177,7 @@ export const DuplicateProgramPage = (): ReactElement => { endDate, sector, dataCollectingType, + beneficiaryGroup, description, budget = '', administrativeAreasOfImplementation, @@ -188,13 +189,14 @@ export const DuplicateProgramPage = (): ReactElement => { } = data.program; const initialValues = { - editMode: false, + editMode: true, name: `Copy of Programme: (${name})`, programmeCode: '', startDate, endDate, sector, dataCollectingTypeCode: dataCollectingType?.code, + beneficiaryGroup: decodeIdString(beneficiaryGroup?.id), description, budget, administrativeAreasOfImplementation, @@ -222,6 +224,7 @@ export const DuplicateProgramPage = (): ReactElement => { 'endDate', 'sector', 'dataCollectingTypeCode', + 'beneficiaryGroup', 'description', 'budget', 'administrativeAreasOfImplementation', @@ -283,7 +286,8 @@ export const DuplicateProgramPage = (): ReactElement => { onSubmit={(values) => { handleSubmit(values); }} - validationSchema={programValidationSchema(t)} + validationSchema={editProgramDetailsValidationSchema(t, initialValues)} + validateOnChange={true} > {({ submitForm, diff --git a/src/frontend/src/containers/pages/program/EditProgramPage.tsx b/src/frontend/src/containers/pages/program/EditProgramPage.tsx index 1f3138fe26..c4604f3651 100644 --- a/src/frontend/src/containers/pages/program/EditProgramPage.tsx +++ b/src/frontend/src/containers/pages/program/EditProgramPage.tsx @@ -104,6 +104,7 @@ export const EditProgramPage = (): ReactElement => { endDate, sector, dataCollectingType, + beneficiaryGroup, description, budget = '', administrativeAreasOfImplementation, @@ -232,6 +233,7 @@ export const EditProgramPage = (): ReactElement => { endDate, sector, dataCollectingTypeCode: dataCollectingType?.code, + beneficiaryGroup: decodeIdString(beneficiaryGroup?.id), description, budget, administrativeAreasOfImplementation, @@ -268,6 +270,7 @@ export const EditProgramPage = (): ReactElement => { 'endDate', 'sector', 'dataCollectingTypeCode', + 'beneficiaryGroup', 'description', 'budget', 'administrativeAreasOfImplementation', @@ -331,6 +334,7 @@ export const EditProgramPage = (): ReactElement => { t, initialValuesProgramDetails, )} + validateOnChange={true} > {({ submitForm, @@ -341,6 +345,7 @@ export const EditProgramPage = (): ReactElement => { errors, setErrors, }) => { + const handleNextStep = async () => { await handleNext({ validateForm, @@ -374,6 +379,7 @@ export const EditProgramPage = (): ReactElement => { handleNext={handleNextStep} programId={id} errors={errors} + programHasRdi={programHasRdi} /> )} </div> diff --git a/src/frontend/src/containers/pages/program/ProgramDetailsPage.tsx b/src/frontend/src/containers/pages/program/ProgramDetailsPage.tsx index fed6b60896..31e54259b9 100644 --- a/src/frontend/src/containers/pages/program/ProgramDetailsPage.tsx +++ b/src/frontend/src/containers/pages/program/ProgramDetailsPage.tsx @@ -67,7 +67,8 @@ export function ProgramDetailsPage(): ReactElement { if (isPermissionDeniedError(error)) return <PermissionDenied />; - if (!choices || !businessAreaData || permissions === null) return null; + if (!choices || !businessAreaData || permissions === null || !data) + return null; const { program } = data; const canFinish = hasPermissions(PERMISSIONS.PROGRAMME_FINISH, permissions); diff --git a/src/frontend/src/containers/pages/rdi/RegistrationDataImportDetailsPage.tsx b/src/frontend/src/containers/pages/rdi/RegistrationDataImportDetailsPage.tsx index eab7839cf4..9a73cbe62d 100644 --- a/src/frontend/src/containers/pages/rdi/RegistrationDataImportDetailsPage.tsx +++ b/src/frontend/src/containers/pages/rdi/RegistrationDataImportDetailsPage.tsx @@ -23,6 +23,7 @@ import { isPermissionDeniedError } from '@utils/utils'; import { ImportedHouseholdTable } from '../../tables/rdi/ImportedHouseholdsTable'; import { ImportedIndividualsTable } from '../../tables/rdi/ImportedIndividualsTable'; import { UniversalErrorBoundary } from '@components/core/UniversalErrorBoundary'; +import { useProgramContext } from 'src/programContext'; const Container = styled.div` && { @@ -59,6 +60,8 @@ export const RegistrationDataImportDetailsPage = (): ReactElement => { const { id } = useParams(); const permissions = usePermissions(); const location = useLocation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const { businessArea } = useBaseUrl(); const { data, loading, error, stopPolling, startPolling } = @@ -124,8 +127,14 @@ export const RegistrationDataImportDetailsPage = (): ReactElement => { variant="fullWidth" aria-label="full width tabs example" > - <Tab data-cy="tab-Households" label={t('Households')} /> - <Tab data-cy="tab-Individuals" label={t('Individuals')} /> + <Tab + data-cy="tab-Households" + label={beneficiaryGroup?.groupLabelPlural} + /> + <Tab + data-cy="tab-Individuals" + label={beneficiaryGroup?.memberLabelPlural} + /> </StyledTabs> </TabsContainer> <TabPanel value={selectedTab} index={0}> diff --git a/src/frontend/src/containers/pages/targeting/TargetPopulationsPage.tsx b/src/frontend/src/containers/pages/targeting/TargetPopulationsPage.tsx index fd0aebc632..699a56d098 100644 --- a/src/frontend/src/containers/pages/targeting/TargetPopulationsPage.tsx +++ b/src/frontend/src/containers/pages/targeting/TargetPopulationsPage.tsx @@ -32,6 +32,7 @@ export const TargetPopulationsPage = (): ReactElement => { const { t } = useTranslation(); const permissions = usePermissions(); const { programId } = useBaseUrl(); + const { data: programData } = useProgramQuery({ variables: { id: programId }, }); @@ -54,6 +55,7 @@ export const TargetPopulationsPage = (): ReactElement => { Table = TargetPopulationForPeopleTable; Filters = TargetPopulationForPeopleFilters; } + return ( <UniversalErrorBoundary location={location} diff --git a/src/frontend/src/containers/tables/Communication/LookUpHouseholdTableCommunication/LookUpHouseholdTableCommunication.tsx b/src/frontend/src/containers/tables/Communication/LookUpHouseholdTableCommunication/LookUpHouseholdTableCommunication.tsx index 9ab2f2349b..b06126d9f5 100644 --- a/src/frontend/src/containers/tables/Communication/LookUpHouseholdTableCommunication/LookUpHouseholdTableCommunication.tsx +++ b/src/frontend/src/containers/tables/Communication/LookUpHouseholdTableCommunication/LookUpHouseholdTableCommunication.tsx @@ -12,6 +12,8 @@ import { useBaseUrl } from '@hooks/useBaseUrl'; import { UniversalTable } from '../../UniversalTable'; import { headCells } from './LookUpHouseholdComunicationTableHeadCells'; import { LookUpHouseholdTableRowCommunication } from './LookUpHouseholdTableRowCommunication'; +import { adjustHeadCells } from '@utils/utils'; +import { useProgramContext } from 'src/programContext'; interface LookUpHouseholdTableCommunicationProps { businessArea: string; @@ -48,6 +50,9 @@ export function LookUpHouseholdTableCommunication({ isFeedbackWithHouseholdOnly, }: LookUpHouseholdTableCommunicationProps): ReactElement { const { programId } = useBaseUrl(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + const matchWithdrawnValue = (): boolean | undefined => { if (filter.withdrawn === 'true') { return true; @@ -123,12 +128,27 @@ export function LookUpHouseholdTableCommunication({ setFieldValue('identityVerified', false); }; + const replacements = { + unicefId: (_beneficiaryGroup) => `${_beneficiaryGroup?.groupLabel} ID`, + head_of_household__full_name: (_beneficiaryGroup) => + `Head of ${_beneficiaryGroup?.groupLabel}`, + size: (_beneficiaryGroup) => `${_beneficiaryGroup?.groupLabel} Size`, + }; + + const adjustedHeadCells = adjustHeadCells( + headCells, + beneficiaryGroup, + replacements, + ); + const renderTable = (): ReactElement => ( <UniversalTable< AllHouseholdsQuery['allHouseholds']['edges'][number]['node'], AllHouseholdsQueryVariables > - headCells={householdMultiSelect ? headCells.slice(1) : headCells} + headCells={ + householdMultiSelect ? adjustedHeadCells.slice(1) : adjustedHeadCells + } rowsPerPageOptions={[5, 10, 15, 20]} query={useAllHouseholdsForPopulationTableQuery} queriedObjectName="allHouseholds" diff --git a/src/frontend/src/containers/tables/Communication/RecipientsTable/RecipientsTable.tsx b/src/frontend/src/containers/tables/Communication/RecipientsTable/RecipientsTable.tsx index a117cc4e72..3b3568bc43 100644 --- a/src/frontend/src/containers/tables/Communication/RecipientsTable/RecipientsTable.tsx +++ b/src/frontend/src/containers/tables/Communication/RecipientsTable/RecipientsTable.tsx @@ -8,6 +8,8 @@ import { import { UniversalTable } from '../../UniversalTable'; import { headCells } from './RecipientsTableHeadCells'; import { RecipientsTableRow } from './RecipientsTableRow'; +import { useProgramContext } from 'src/programContext'; +import { adjustHeadCells } from '@utils/utils'; import { ReactElement } from 'react'; interface RecipientsTableProps { @@ -20,11 +22,26 @@ export function RecipientsTable({ canViewDetails, }: RecipientsTableProps): ReactElement { const { t } = useTranslation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const initialVariables: AllAccountabilityCommunicationMessageRecipientsQueryVariables = { messageId: id, }; + const replacements = { + unicefId: (_beneficiaryGroup) => `${_beneficiaryGroup?.groupLabel} ID`, + head_of_household__full_name: (_beneficiaryGroup) => + `Head of ${_beneficiaryGroup?.groupLabel}`, + size: (_beneficiaryGroup) => `${_beneficiaryGroup?.groupLabel} Size`, + }; + + const adjustedHeadCells = adjustHeadCells( + headCells, + beneficiaryGroup, + replacements, + ); + return ( <TableWrapper> <UniversalTable< @@ -32,7 +49,7 @@ export function RecipientsTable({ AllAccountabilityCommunicationMessageRecipientsQueryVariables > title={t('Recipients')} - headCells={headCells} + headCells={adjustedHeadCells} rowsPerPageOptions={[10, 15, 20]} query={useAllAccountabilityCommunicationMessageRecipientsQuery} queriedObjectName="allAccountabilityCommunicationMessageRecipients" diff --git a/src/frontend/src/containers/tables/Feedback/FeedbackTable.tsx b/src/frontend/src/containers/tables/Feedback/FeedbackTable.tsx index 55ac511424..d081a7efca 100644 --- a/src/frontend/src/containers/tables/Feedback/FeedbackTable.tsx +++ b/src/frontend/src/containers/tables/Feedback/FeedbackTable.tsx @@ -7,10 +7,11 @@ import { } from '@generated/graphql'; import { TableWrapper } from '@components/core/TableWrapper'; import { useBaseUrl } from '@hooks/useBaseUrl'; -import { dateToIsoString, decodeIdString } from '@utils/utils'; +import { adjustHeadCells, dateToIsoString, decodeIdString } from '@utils/utils'; import { UniversalTable } from '../UniversalTable'; import { headCells } from './FeedbackTableHeadCells'; import { FeedbackTableRow } from './FeedbackTableRow'; +import { useProgramContext } from 'src/programContext'; interface FeedbackTableProps { filter; @@ -22,6 +23,9 @@ export function FeedbackTable({ canViewDetails, }: FeedbackTableProps): ReactElement { const { t } = useTranslation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + const { isAllPrograms, programId } = useBaseUrl(); const initialVariables: AllFeedbacksQueryVariables = { feedbackId: filter.feedbackId, @@ -30,16 +34,27 @@ export function FeedbackTable({ createdAtRange: filter.createdAtRangeMin || filter.createdAtRangeMax ? JSON.stringify({ - min: dateToIsoString(filter.createdAtRangeMin, 'startOfDay'), - max: dateToIsoString(filter.createdAtRangeMax, 'endOfDay'), - }) + min: dateToIsoString(filter.createdAtRangeMin, 'startOfDay'), + max: dateToIsoString(filter.createdAtRangeMax, 'endOfDay'), + }) : '', program: isAllPrograms ? filter.program : programId, isActiveProgram: filter.programState === 'active' ? 'true' : '', }; + const replacements = { + household_lookup: (_beneficiaryGroup) => + `${_beneficiaryGroup?.groupLabel} ID`, + }; + + const adjustedHeadCells = adjustHeadCells( + headCells, + beneficiaryGroup, + replacements, + ); + const headCellsWithProgramColumn = [ - ...headCells, + ...adjustedHeadCells, { disablePadding: false, label: 'Programme', @@ -52,7 +67,9 @@ export function FeedbackTable({ return ( <TableWrapper> <UniversalTable<FeedbackNode, AllFeedbacksQueryVariables> - headCells={isAllPrograms ? headCellsWithProgramColumn : headCells} + headCells={ + isAllPrograms ? headCellsWithProgramColumn : adjustedHeadCells + } title={t('Feedbacks List')} rowsPerPageOptions={[10, 15, 20]} query={useAllFeedbacksQuery} diff --git a/src/frontend/src/containers/tables/ProgramCycle/ProgramCycleTable.tsx b/src/frontend/src/containers/tables/ProgramCycle/ProgramCycleTable.tsx index 7b7bac0fcc..cf9c93a8d4 100644 --- a/src/frontend/src/containers/tables/ProgramCycle/ProgramCycleTable.tsx +++ b/src/frontend/src/containers/tables/ProgramCycle/ProgramCycleTable.tsx @@ -1,6 +1,6 @@ import { ProgramQuery, ProgramStatus } from '@generated/graphql'; import { UniversalRestTable } from '@components/rest/UniversalRestTable/UniversalRestTable'; -import React, { ReactElement, useState } from 'react'; +import { ReactElement, useState } from 'react'; import { ClickableTableRow } from '@core/Table/ClickableTableRow'; import TableCell from '@mui/material/TableCell'; import { UniversalMoment } from '@core/UniversalMoment'; diff --git a/src/frontend/src/containers/tables/ProgramCyclesTablePaymentModule/ProgramCyclesTablePaymentModule.tsx b/src/frontend/src/containers/tables/ProgramCyclesTablePaymentModule/ProgramCyclesTablePaymentModule.tsx index ebdbaa2ee7..79c30ced5d 100644 --- a/src/frontend/src/containers/tables/ProgramCyclesTablePaymentModule/ProgramCyclesTablePaymentModule.tsx +++ b/src/frontend/src/containers/tables/ProgramCyclesTablePaymentModule/ProgramCyclesTablePaymentModule.tsx @@ -5,7 +5,6 @@ import { StatusBox } from '@core/StatusBox'; import { decodeIdString, programCycleStatusToColor } from '@utils/utils'; import { UniversalMoment } from '@core/UniversalMoment'; import { UniversalRestTable } from '@components/rest/UniversalRestTable/UniversalRestTable'; -import { headCells } from '@containers/tables/ProgramCyclesTablePaymentModule/HeadCells'; import { useBaseUrl } from '@hooks/useBaseUrl'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; import { @@ -23,11 +22,13 @@ import { useSnackbar } from '@hooks/useSnackBar'; interface ProgramCyclesTablePaymentModuleProps { program; filters; + adjustedHeadCells; } export const ProgramCyclesTablePaymentModule = ({ program, filters, + adjustedHeadCells, }: ProgramCyclesTablePaymentModuleProps) => { const { showMessage } = useSnackbar(); const [queryVariables, setQueryVariables] = useState<ProgramCyclesQuery>({ @@ -150,7 +151,7 @@ export const ProgramCyclesTablePaymentModule = ({ <UniversalRestTable title="Programme Cycles" renderRow={renderRow} - headCells={headCells} + headCells={adjustedHeadCells} data={data} error={error} isLoading={isLoading} diff --git a/src/frontend/src/containers/tables/Surveys/LookUpProgrammesTableSurveys/LookUpProgrammesTableSurveys.tsx b/src/frontend/src/containers/tables/Surveys/LookUpProgrammesTableSurveys/LookUpProgrammesTableSurveys.tsx index b9bef1a99a..4090dee13e 100644 --- a/src/frontend/src/containers/tables/Surveys/LookUpProgrammesTableSurveys/LookUpProgrammesTableSurveys.tsx +++ b/src/frontend/src/containers/tables/Surveys/LookUpProgrammesTableSurveys/LookUpProgrammesTableSurveys.tsx @@ -10,6 +10,8 @@ import { TableWrapper } from '@components/core/TableWrapper'; import { UniversalTable } from '../../UniversalTable'; import { headCells } from './LookUpProgrammesHeadCellsSurveys'; import { LookUpProgrammesTableRowSurveys } from './LookUpProgrammesTableRowSurveys'; +import { adjustHeadCells } from '@utils/utils'; +import { useProgramContext } from 'src/programContext'; const NoTableStyling = styled.div` .MuiPaper-elevation1 { @@ -35,6 +37,8 @@ export function LookUpProgrammesTableSurveys({ handleChange, setFieldValue, }: LookUpProgrammesTableSurveysProps): ReactElement { + const { selectedProgram: programFromContext } = useProgramContext(); + const beneficiaryGroup = programFromContext?.beneficiaryGroup; const initialVariables: AllActiveProgramsQueryVariables = { businessArea, search: filter.search, @@ -55,14 +59,25 @@ export function LookUpProgrammesTableSurveys({ setFieldValue('program', id); }; + const replacements = { + totalHhCount: (_beneficiaryGroup) => + `Num. of ${_beneficiaryGroup?.groupLabelPlural}`, + }; + + const adjustedHeadCells = adjustHeadCells( + headCells, + beneficiaryGroup, + replacements, + ); + return ( <NoTableStyling> <TableWrapper> <UniversalTable< - AllProgramsQuery['allPrograms']['edges'][number]['node'], - AllActiveProgramsQueryVariables + AllProgramsQuery['allPrograms']['edges'][number]['node'], + AllActiveProgramsQueryVariables > - headCells={headCells} + headCells={adjustedHeadCells} query={useAllActiveProgramsQuery} queriedObjectName="allActivePrograms" initialVariables={initialVariables} diff --git a/src/frontend/src/containers/tables/Surveys/RecipientsTable/RecipientsTable.tsx b/src/frontend/src/containers/tables/Surveys/RecipientsTable/RecipientsTable.tsx index e13245ed6b..ebe3056707 100644 --- a/src/frontend/src/containers/tables/Surveys/RecipientsTable/RecipientsTable.tsx +++ b/src/frontend/src/containers/tables/Surveys/RecipientsTable/RecipientsTable.tsx @@ -9,6 +9,8 @@ import { UniversalTable } from '../../UniversalTable'; import { headCells } from './RecipientsTableHeadCells'; import { RecipientsTableRow } from './RecipientsTableRow'; import { ReactElement } from 'react'; +import { adjustHeadCells } from '@utils/utils'; +import { useProgramContext } from 'src/programContext'; interface RecipientsTableProps { id: string; @@ -20,15 +22,30 @@ export function RecipientsTable({ canViewDetails, }: RecipientsTableProps): ReactElement { const { t } = useTranslation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const initialVariables: RecipientsQueryVariables = { survey: id, }; + const replacements = { + unicefId: (_beneficiaryGroup) => `${_beneficiaryGroup?.groupLabel} ID`, + head_of_household__full_name: (_beneficiaryGroup) => + `Head of ${_beneficiaryGroup?.groupLabel}`, + size: (_beneficiaryGroup) => `${_beneficiaryGroup?.groupLabel} Size`, + }; + + const adjustedHeadCells = adjustHeadCells( + headCells, + beneficiaryGroup, + replacements, + ); + return ( <TableWrapper> <UniversalTable<RecipientNode, RecipientsQueryVariables> title={t('Recipients')} - headCells={headCells} + headCells={adjustedHeadCells} rowsPerPageOptions={[10, 15, 20]} query={useRecipientsQuery} queriedObjectName="recipients" diff --git a/src/frontend/src/containers/tables/paymentmodule/PaymentPlansTable/PaymentPlansTable.tsx b/src/frontend/src/containers/tables/paymentmodule/PaymentPlansTable/PaymentPlansTable.tsx index 8ca8999202..e4cda0f291 100644 --- a/src/frontend/src/containers/tables/paymentmodule/PaymentPlansTable/PaymentPlansTable.tsx +++ b/src/frontend/src/containers/tables/paymentmodule/PaymentPlansTable/PaymentPlansTable.tsx @@ -9,6 +9,8 @@ import { useBaseUrl } from '@hooks/useBaseUrl'; import { UniversalTable } from '../../UniversalTable'; import { PaymentPlanTableRow } from './PaymentPlanTableRow'; import { headCells } from './PaymentPlansHeadCells'; +import { useProgramContext } from 'src/programContext'; +import { adjustHeadCells } from '@utils/utils'; interface PaymentPlansTableProps { filter; @@ -21,6 +23,9 @@ export function PaymentPlansTable({ }: PaymentPlansTableProps): ReactElement { const { t } = useTranslation(); const { programId, businessArea } = useBaseUrl(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + const initialVariables: AllPaymentPlansForTableQueryVariables = { businessArea, search: filter.search, @@ -32,12 +37,22 @@ export function PaymentPlansTable({ isFollowUp: filter.isFollowUp ? true : null, program: programId, }; + const replacements = { + totalHouseholdsCount: (_beneficiaryGroup) => + `Num. of ${_beneficiaryGroup?.groupLabelPlural}`, + }; + + const adjustedHeadCells = adjustHeadCells( + headCells, + beneficiaryGroup, + replacements, + ); return ( <UniversalTable<PaymentPlanNode, AllPaymentPlansForTableQueryVariables> defaultOrderBy="-createdAt" title={t('Payment Plans')} - headCells={headCells} + headCells={adjustedHeadCells} query={useAllPaymentPlansForTableQuery} queriedObjectName="allPaymentPlans" initialVariables={initialVariables} diff --git a/src/frontend/src/containers/tables/paymentmodule/PaymentsTable/PaymentsTable.tsx b/src/frontend/src/containers/tables/paymentmodule/PaymentsTable/PaymentsTable.tsx index d6ac86da17..540f4253f6 100644 --- a/src/frontend/src/containers/tables/paymentmodule/PaymentsTable/PaymentsTable.tsx +++ b/src/frontend/src/containers/tables/paymentmodule/PaymentsTable/PaymentsTable.tsx @@ -16,6 +16,8 @@ import { headCells } from './PaymentsTableHeadCells'; import { PaymentsTableRow } from './PaymentsTableRow'; import { WarningTooltipTable } from './WarningTooltipTable'; import { useBaseUrl } from '@hooks/useBaseUrl'; +import { useProgramContext } from 'src/programContext'; +import { adjustHeadCells } from '@utils/utils'; const StyledBox = styled(Box)` background-color: #fff; @@ -35,6 +37,9 @@ export function PaymentsTable({ }: PaymentsTableProps): ReactElement { const { baseUrl } = useBaseUrl(); const { t } = useTranslation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + const [dialogPayment, setDialogPayment] = useState< AllPaymentsForTableQuery['allPayments']['edges'][number]['node'] | null >(); @@ -43,6 +48,19 @@ export function PaymentsTable({ paymentPlanId: paymentPlan.id, }; + const replacements = { + household__unicef_id: (_beneficiaryGroup) => + `${_beneficiaryGroup?.groupLabel} ${t('ID')}`, + household__size: (_beneficiaryGroup) => + `${_beneficiaryGroup?.groupLabel} ${t('Size')}`, + }; + + const adjustedHeadCells = adjustHeadCells( + headCells, + beneficiaryGroup, + replacements, + ); + return ( <> <TableWrapper> @@ -64,7 +82,7 @@ export function PaymentsTable({ AllPaymentsForTableQueryVariables > isOnPaper={false} - headCells={headCells} + headCells={adjustedHeadCells} query={useAllPaymentsForTableQuery} rowsPerPageOptions={[10, 25, 50]} queriedObjectName="allPayments" diff --git a/src/frontend/src/containers/tables/paymentmodule/PaymentsTable/WarningTooltipTable/WarningTooltipTable.tsx b/src/frontend/src/containers/tables/paymentmodule/PaymentsTable/WarningTooltipTable/WarningTooltipTable.tsx index c8358d1f41..15a91a9cfd 100644 --- a/src/frontend/src/containers/tables/paymentmodule/PaymentsTable/WarningTooltipTable/WarningTooltipTable.tsx +++ b/src/frontend/src/containers/tables/paymentmodule/PaymentsTable/WarningTooltipTable/WarningTooltipTable.tsx @@ -27,6 +27,7 @@ import { } from '@generated/graphql'; import { DialogFooter } from '../../../../dialogs/DialogFooter'; import { DialogTitleWrapper } from '../../../../dialogs/DialogTitleWrapper'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; const StyledTable = styled(Table)` @@ -57,6 +58,9 @@ export function WarningTooltipTable({ canViewDetails = false, }: WarningTooltipTableProps): ReactElement { const { t } = useTranslation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + if (!payment) return null; const mappedPaymentPlanRows = (): ReactElement[] => { const { @@ -135,7 +139,8 @@ export function WarningTooltipTable({ </Grid> </GreyBox> <Box mt={10} mb={10} display="flex"> - {t('Household ID')} <Bold>{payment.household?.unicefId}</Bold>{' '} + {`${beneficiaryGroup?.groupLabel} ID`}{' '} + <Bold>{payment.household?.unicefId}</Bold>{' '} {t('is also included in the following Payment Plans')}: </Box> <StyledTable> diff --git a/src/frontend/src/containers/tables/paymentmodulePeople/PeoplePaymentsTable/WarningTooltipTable/WarningTooltipTable.tsx b/src/frontend/src/containers/tables/paymentmodulePeople/PeoplePaymentsTable/WarningTooltipTable/WarningTooltipTable.tsx index c8358d1f41..15a91a9cfd 100644 --- a/src/frontend/src/containers/tables/paymentmodulePeople/PeoplePaymentsTable/WarningTooltipTable/WarningTooltipTable.tsx +++ b/src/frontend/src/containers/tables/paymentmodulePeople/PeoplePaymentsTable/WarningTooltipTable/WarningTooltipTable.tsx @@ -27,6 +27,7 @@ import { } from '@generated/graphql'; import { DialogFooter } from '../../../../dialogs/DialogFooter'; import { DialogTitleWrapper } from '../../../../dialogs/DialogTitleWrapper'; +import { useProgramContext } from 'src/programContext'; import { ReactElement } from 'react'; const StyledTable = styled(Table)` @@ -57,6 +58,9 @@ export function WarningTooltipTable({ canViewDetails = false, }: WarningTooltipTableProps): ReactElement { const { t } = useTranslation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + if (!payment) return null; const mappedPaymentPlanRows = (): ReactElement[] => { const { @@ -135,7 +139,8 @@ export function WarningTooltipTable({ </Grid> </GreyBox> <Box mt={10} mb={10} display="flex"> - {t('Household ID')} <Bold>{payment.household?.unicefId}</Bold>{' '} + {`${beneficiaryGroup?.groupLabel} ID`}{' '} + <Bold>{payment.household?.unicefId}</Bold>{' '} {t('is also included in the following Payment Plans')}: </Box> <StyledTable> diff --git a/src/frontend/src/containers/tables/payments/PaymentRecordAndPaymentHouseholdTable/PaymentRecordAndPaymentHouseholdTable.tsx b/src/frontend/src/containers/tables/payments/PaymentRecordAndPaymentHouseholdTable/PaymentRecordAndPaymentHouseholdTable.tsx index 84df276f52..67c9c8f9f2 100644 --- a/src/frontend/src/containers/tables/payments/PaymentRecordAndPaymentHouseholdTable/PaymentRecordAndPaymentHouseholdTable.tsx +++ b/src/frontend/src/containers/tables/payments/PaymentRecordAndPaymentHouseholdTable/PaymentRecordAndPaymentHouseholdTable.tsx @@ -9,6 +9,8 @@ import { import { UniversalTable } from '../../UniversalTable'; import { headCells } from './PaymentRecordAndPaymentHouseholdTableHeadCells'; import { PaymentRecordAndPaymentHouseholdTableRow } from './PaymentRecordAndPaymentHouseholdTableRow'; +import { adjustHeadCells } from '@utils/utils'; +import { useProgramContext } from 'src/programContext'; import { useBaseUrl } from '@hooks/useBaseUrl'; interface PaymentRecordAndPaymentTableProps { @@ -30,13 +32,30 @@ export function PaymentRecordHouseholdTable({ businessArea, program: programId, }; + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + + const replacements = { + headOfHousehold: (_beneficiaryGroup) => + `Head of ${_beneficiaryGroup?.groupLabel}`, + fullName: (_beneficiaryGroup) => `${_beneficiaryGroup?.memberLabel}`, + relationship: (_beneficiaryGroup) => + `Relationship to Head of ${_beneficiaryGroup?.groupLabel}`, + }; + + const adjustedHeadCells = adjustHeadCells( + headCells, + beneficiaryGroup, + replacements, + ); + return ( <UniversalTable< PaymentRecordAndPaymentNode, AllPaymentRecordsAndPaymentsQueryVariables > title={t('Payment Records')} - headCells={headCells} + headCells={adjustedHeadCells} query={useAllPaymentRecordsAndPaymentsQuery} queriedObjectName="allPaymentRecordsAndPayments" initialVariables={initialVariables} diff --git a/src/frontend/src/containers/tables/payments/VerificationRecordsTable/VerificationRecordsTable.tsx b/src/frontend/src/containers/tables/payments/VerificationRecordsTable/VerificationRecordsTable.tsx index ea2a842230..48bebfad65 100644 --- a/src/frontend/src/containers/tables/payments/VerificationRecordsTable/VerificationRecordsTable.tsx +++ b/src/frontend/src/containers/tables/payments/VerificationRecordsTable/VerificationRecordsTable.tsx @@ -8,6 +8,8 @@ import { import { UniversalTable } from '../../UniversalTable'; import { headCells } from './VerificationRecordsHeadCells'; import { VerificationRecordsTableRow } from './VerificationRecordsTableRow'; +import { useProgramContext } from 'src/programContext'; +import { adjustHeadCells } from '@utils/utils'; interface VerificationRecordsTableProps { paymentPlanId?: string; @@ -23,6 +25,23 @@ export function VerificationRecordsTable({ businessArea, }: VerificationRecordsTableProps): ReactElement { const { t } = useTranslation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + + const replacements = { + payment_record__head_of_household__family_name: (_beneficiaryGroup) => + `Head of ${_beneficiaryGroup?.groupLabel}`, + payment_record__household__unicef_id: (_beneficiaryGroup) => + `${_beneficiaryGroup?.groupLabel} ID`, + payment_record__household__status: (_beneficiaryGroup) => + `${_beneficiaryGroup?.groupLabel} Status`, + }; + + const adjustedHeadCells = adjustHeadCells( + headCells, + beneficiaryGroup, + replacements, + ); const initialVariables: AllPaymentVerificationsQueryVariables = { ...filter, @@ -36,7 +55,7 @@ export function VerificationRecordsTable({ AllPaymentVerificationsQueryVariables > title={t('Verification Records')} - headCells={headCells} + headCells={adjustedHeadCells} query={useAllPaymentVerificationsQuery} queriedObjectName="allPaymentVerifications" initialVariables={initialVariables} diff --git a/src/frontend/src/containers/tables/payments/VerificationRecordsTable/VerificationsTable.tsx b/src/frontend/src/containers/tables/payments/VerificationRecordsTable/VerificationsTable.tsx index a97a137d82..17f7121168 100644 --- a/src/frontend/src/containers/tables/payments/VerificationRecordsTable/VerificationsTable.tsx +++ b/src/frontend/src/containers/tables/payments/VerificationRecordsTable/VerificationsTable.tsx @@ -8,6 +8,8 @@ import { import { UniversalTable } from '../../UniversalTable'; import { headCells } from './VerificationsHeadCells'; import { VerificationRecordsTableRow } from './VerificationRecordsTableRow'; +import { adjustHeadCells } from '@utils/utils'; +import { useProgramContext } from 'src/programContext'; interface VerificationsTableProps { paymentPlanId?: string; @@ -30,13 +32,29 @@ export function VerificationsTable({ paymentPlanId, }; + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + + const replacements = { + payment_record__head_of_household__family_name: (_beneficiaryGroup) => + `Head of ${_beneficiaryGroup?.groupLabel}`, + payment_record__household__unicef_id: (_beneficiaryGroup) => + `${_beneficiaryGroup?.groupLabel} ID`, + }; + + const adjustedHeadCells = adjustHeadCells( + headCells, + beneficiaryGroup, + replacements, + ); + return ( <UniversalTable< PaymentVerificationNode, AllPaymentVerificationsQueryVariables > title={t('Verification Records')} - headCells={headCells} + headCells={adjustedHeadCells} query={useAllPaymentVerificationsQuery} queriedObjectName="allPaymentVerifications" initialVariables={initialVariables} diff --git a/src/frontend/src/containers/tables/population/CollectorsTable/CollectorsTable.tsx b/src/frontend/src/containers/tables/population/CollectorsTable/CollectorsTable.tsx index ebf129244f..151c197ac1 100644 --- a/src/frontend/src/containers/tables/population/CollectorsTable/CollectorsTable.tsx +++ b/src/frontend/src/containers/tables/population/CollectorsTable/CollectorsTable.tsx @@ -4,7 +4,7 @@ import { useNavigate } from 'react-router-dom'; import { ClickableTableRow } from '@components/core/Table/ClickableTableRow'; import { HeadCell } from '@components/core/Table/EnhancedTableHead'; import { Order, TableComponent } from '@components/core/Table/TableComponent'; -import { choicesToDict } from '@utils/utils'; +import { adjustHeadCells, choicesToDict } from '@utils/utils'; import { HouseholdChoiceDataQuery, HouseholdNode, @@ -14,6 +14,7 @@ import { import { useBaseUrl } from '@hooks/useBaseUrl'; import { Bold } from '@components/core/Bold'; import { BlackLink } from '@components/core/BlackLink'; +import { useProgramContext } from 'src/programContext'; const headCells: HeadCell<IndividualNode>[] = [ { @@ -53,6 +54,20 @@ export const CollectorsTable = ({ const handleClick = (row): void => { navigate(`/${baseUrl}/population/individuals/${row.id}`); }; + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + + const replacements = { + fullName: (_beneficiaryGroup) => `${_beneficiaryGroup?.memberLabel}`, + relationship: (_beneficiaryGroup) => + `Relationship to ${_beneficiaryGroup?.groupLabel}`, + }; + + const adjustedHeadCells = adjustHeadCells( + headCells, + beneficiaryGroup, + replacements, + ); const roleChoicesDict = choicesToDict(choicesData?.roleChoices); const relationshipChoicesDict = choicesToDict( @@ -142,7 +157,7 @@ export const CollectorsTable = ({ </ClickableTableRow> ); }} - headCells={headCells} + headCells={adjustedHeadCells} rowsPerPageOptions={totalCount < 5 ? [totalCount] : [5, 10, 15]} rowsPerPage={totalCount > 5 ? rowsPerPage : totalCount} page={page} diff --git a/src/frontend/src/containers/tables/population/HouseholdCompositionTable/HouseholdCompositionTable.tsx b/src/frontend/src/containers/tables/population/HouseholdCompositionTable/HouseholdCompositionTable.tsx index 377b6753de..575cd0e1f4 100644 --- a/src/frontend/src/containers/tables/population/HouseholdCompositionTable/HouseholdCompositionTable.tsx +++ b/src/frontend/src/containers/tables/population/HouseholdCompositionTable/HouseholdCompositionTable.tsx @@ -12,6 +12,7 @@ import { useTranslation } from 'react-i18next'; import styled from 'styled-components'; import { Title } from '@components/core/Title'; import { HouseholdNode } from '@generated/graphql'; +import { useProgramContext } from 'src/programContext'; const GreyTableCell = styled(TableCell)` background-color: #eeeeee; @@ -28,10 +29,12 @@ export function HouseholdCompositionTable({ household, }: HouseholdCompositionTableProps): ReactElement { const { t } = useTranslation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; return ( <OverviewPaper> <Title> - <Typography variant="h6">{t('Household Composition')}</Typography> + <Typography variant="h6">{`${beneficiaryGroup?.groupLabel} Composition`}</Typography> diff --git a/src/frontend/src/containers/tables/population/HouseholdMembersTable/HouseholdMembersTable.tsx b/src/frontend/src/containers/tables/population/HouseholdMembersTable/HouseholdMembersTable.tsx index 6367da82b0..d1ab109106 100644 --- a/src/frontend/src/containers/tables/population/HouseholdMembersTable/HouseholdMembersTable.tsx +++ b/src/frontend/src/containers/tables/population/HouseholdMembersTable/HouseholdMembersTable.tsx @@ -8,6 +8,7 @@ import { HeadCell } from '@components/core/Table/EnhancedTableHead'; import { Order, TableComponent } from '@components/core/Table/TableComponent'; import { UniversalMoment } from '@components/core/UniversalMoment'; import { + adjustHeadCells, choicesToDict, populationStatusToColor, sexToCapitalize, @@ -19,6 +20,7 @@ import { } from '@generated/graphql'; import { useBaseUrl } from '@hooks/useBaseUrl'; import { Bold } from '@components/core/Bold'; +import { useProgramContext } from 'src/programContext'; const headCells: HeadCell[] = [ { @@ -83,6 +85,9 @@ export const HouseholdMembersTable = ({ const allIndividuals = household?.individuals?.edges?.map( (edge) => edge.node, ); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + if (orderBy) { if (orderDirection === 'asc') { allIndividuals.sort((a, b) => (a[orderBy] < b[orderBy] ? 1 : -1)); @@ -92,9 +97,23 @@ export const HouseholdMembersTable = ({ } const totalCount = allIndividuals.length; + + const replacements = { + unicefId: (_beneficiaryGroup) => `${_beneficiaryGroup?.memberLabel} ID`, + fullName: (_beneficiaryGroup) => `${_beneficiaryGroup?.memberLabel}`, + relationship: (_beneficiaryGroup) => + `Relationship to Head of ${_beneficiaryGroup?.groupLabel}`, + }; + + const adjustedHeadCells = adjustHeadCells( + headCells, + beneficiaryGroup, + replacements, + ); + return ( - title="Household Members" + title={`${beneficiaryGroup?.groupLabel} Members`} data={allIndividuals.slice( page * rowsPerPage, page * rowsPerPage + rowsPerPage, @@ -148,7 +167,7 @@ export const HouseholdMembersTable = ({ ); }} - headCells={headCells} + headCells={adjustedHeadCells} rowsPerPageOptions={totalCount < 5 ? [totalCount] : [5, 10, 15]} rowsPerPage={totalCount > 5 ? rowsPerPage : totalCount} page={page} diff --git a/src/frontend/src/containers/tables/population/HouseholdTable/HouseholdTable.tsx b/src/frontend/src/containers/tables/population/HouseholdTable/HouseholdTable.tsx index 8ab502c0bd..b5c3536151 100644 --- a/src/frontend/src/containers/tables/population/HouseholdTable/HouseholdTable.tsx +++ b/src/frontend/src/containers/tables/population/HouseholdTable/HouseholdTable.tsx @@ -8,8 +8,9 @@ import { useAllHouseholdsForPopulationTableQuery, } from '@generated/graphql'; import { useBaseUrl } from '@hooks/useBaseUrl'; +import { adjustHeadCells } from '@utils/utils'; import { ReactElement } from 'react'; -import { useTranslation } from 'react-i18next'; +import { useProgramContext } from 'src/programContext'; import { UniversalTable } from '../../UniversalTable'; import { headCells } from './HouseholdTableHeadCells'; import { HouseholdTableRow } from './HouseholdTableRow'; @@ -27,7 +28,8 @@ export function HouseholdTable({ choicesData, canViewDetails, }: HouseholdTableProps): ReactElement { - const { t } = useTranslation(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const { programId } = useBaseUrl(); const matchWithdrawnValue = (): boolean | undefined => { if (filter.withdrawn === 'true') { @@ -56,11 +58,24 @@ export function HouseholdTable({ program: programId, rdiMergeStatus: HouseholdRdiMergeStatus.Merged, }; + const replacements = { + unicefId: (_beneficiaryGroup) => `${_beneficiaryGroup?.groupLabel} ID`, + head_of_household__full_name: (_beneficiaryGroup) => + `Head of ${_beneficiaryGroup?.groupLabel}`, + size: (_beneficiaryGroup) => `${_beneficiaryGroup?.groupLabel} Size`, + }; + + const adjustedHeadCells = adjustHeadCells( + headCells, + beneficiaryGroup, + replacements, + ); + return ( - title={t('Households')} - headCells={headCells} + title={`${beneficiaryGroup?.groupLabelPlural}`} + headCells={adjustedHeadCells} rowsPerPageOptions={[10, 15, 20]} query={useAllHouseholdsForPopulationTableQuery} queriedObjectName="allHouseholds" diff --git a/src/frontend/src/containers/tables/population/IndividualsListTable/IndividualsListTable.tsx b/src/frontend/src/containers/tables/population/IndividualsListTable/IndividualsListTable.tsx index 93b371360e..5375101d66 100644 --- a/src/frontend/src/containers/tables/population/IndividualsListTable/IndividualsListTable.tsx +++ b/src/frontend/src/containers/tables/population/IndividualsListTable/IndividualsListTable.tsx @@ -1,4 +1,4 @@ -import { useTranslation } from 'react-i18next'; +import { TableWrapper } from '@components/core/TableWrapper'; import { AllIndividualsForPopulationTableQueryVariables, AllIndividualsQueryVariables, @@ -7,13 +7,13 @@ import { IndividualRdiMergeStatus, useAllIndividualsForPopulationTableQuery, } from '@generated/graphql'; -import { TableWrapper } from '@components/core/TableWrapper'; -import { dateToIsoString } from '@utils/utils'; -import { UniversalTable } from '../../UniversalTable'; import { useBaseUrl } from '@hooks/useBaseUrl'; +import { adjustHeadCells, dateToIsoString } from '@utils/utils'; +import { ReactElement } from 'react'; +import { useProgramContext } from 'src/programContext'; +import { UniversalTable } from '../../UniversalTable'; import { headCells } from './IndividualsListTableHeadCells'; import { IndividualsListTableRow } from './IndividualsListTableRow'; -import { ReactElement } from 'react'; interface IndividualsListTableProps { filter; @@ -28,8 +28,9 @@ export function IndividualsListTable({ canViewDetails, choicesData, }: IndividualsListTableProps): ReactElement { - const { t } = useTranslation(); const { programId } = useBaseUrl(); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const initialVariables: AllIndividualsForPopulationTableQueryVariables = { age: JSON.stringify({ min: filter.ageMin, max: filter.ageMax }), businessArea, @@ -48,11 +49,26 @@ export function IndividualsListTable({ rdiMergeStatus: IndividualRdiMergeStatus.Merged, }; + const replacements = { + unicefId: (_beneficiaryGroup) => `${_beneficiaryGroup?.memberLabel} ID`, + fullName: (_beneficiaryGroup) => _beneficiaryGroup?.memberLabel, + household__unicef_id: (_beneficiaryGroup) => + `${_beneficiaryGroup?.groupLabel} ID`, + relationship: (_beneficiaryGroup) => + `Relationship to Head of ${_beneficiaryGroup?.groupLabel}`, + }; + + const adjustedHeadCells = adjustHeadCells( + headCells, + beneficiaryGroup, + replacements, + ); + return ( - title={t('Individuals')} - headCells={headCells} + title={beneficiaryGroup?.memberLabelPlural} + headCells={adjustedHeadCells} rowsPerPageOptions={[10, 15, 20]} query={useAllIndividualsForPopulationTableQuery} queriedObjectName="allIndividuals" diff --git a/src/frontend/src/containers/tables/population/IndividualsListTable/__snapshots__/IndividualsListTable.test.tsx.snap b/src/frontend/src/containers/tables/population/IndividualsListTable/__snapshots__/IndividualsListTable.test.tsx.snap index 08f88afd61..3c9345eb3d 100644 --- a/src/frontend/src/containers/tables/population/IndividualsListTable/__snapshots__/IndividualsListTable.test.tsx.snap +++ b/src/frontend/src/containers/tables/population/IndividualsListTable/__snapshots__/IndividualsListTable.test.tsx.snap @@ -95,7 +95,7 @@ exports[`containers/tables/population/IndividualsListTable should render loading class="sc-kLhKbu dUAYNZ" data-cy="table-label" > - Relationship to HoH + Relationship to Head of Household
[] = [ { @@ -63,6 +65,9 @@ export function HouseholdImportedIndividualsTable({ const [rowsPerPage, setRowsPerPage] = useState(5); const [orderBy, setOrderBy] = useState(null); const [orderDirection, setOrderDirection] = useState('asc'); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + const allIndividuals = household.individuals.edges.map((edge) => edge.node); if (orderBy) { if (orderDirection === 'asc') { @@ -72,6 +77,21 @@ export function HouseholdImportedIndividualsTable({ } } + const replacements = { + unicefId: (_beneficiaryGroup) => `${_beneficiaryGroup?.memberLabel} ID`, + fullName: (_beneficiaryGroup) => _beneficiaryGroup?.memberLabel, + household__unicef_id: (_beneficiaryGroup) => + `${_beneficiaryGroup?.groupLabel} ID`, + relationship: (_beneficiaryGroup) => + `Relationship to Head of ${_beneficiaryGroup?.groupLabel}`, + }; + + const adjustedHeadCells = adjustHeadCells( + headCells, + beneficiaryGroup, + replacements, + ); + const totalCount = allIndividuals.length; return ( @@ -90,19 +110,19 @@ export function HouseholdImportedIndividualsTable({ isMerged={household.rdiMergeStatus} /> )} - headCells={headCells} + headCells={adjustedHeadCells} rowsPerPageOptions={totalCount < 5 ? [totalCount] : [5, 10, 15]} rowsPerPage={totalCount > 5 ? rowsPerPage : totalCount} page={page} itemsCount={totalCount} - handleChangePage={(event, newPage) => { + handleChangePage={(_event, newPage) => { setPage(newPage); }} handleChangeRowsPerPage={(event) => { setRowsPerPage(Number(event.target.value)); setPage(0); }} - handleRequestSort={(event, property) => { + handleRequestSort={(_event, property) => { let direction = 'asc'; if (property === orderBy) { direction = orderDirection === 'asc' ? 'desc' : 'asc'; diff --git a/src/frontend/src/containers/tables/rdi/ImportedHouseholdsTable/ImportedHouseholdTable.tsx b/src/frontend/src/containers/tables/rdi/ImportedHouseholdsTable/ImportedHouseholdTable.tsx index afd826087f..64363c14f8 100644 --- a/src/frontend/src/containers/tables/rdi/ImportedHouseholdsTable/ImportedHouseholdTable.tsx +++ b/src/frontend/src/containers/tables/rdi/ImportedHouseholdsTable/ImportedHouseholdTable.tsx @@ -9,6 +9,8 @@ import { UniversalTable } from '../../UniversalTable'; import { headCells as importedHeadCells } from './ImportedHouseholdTableHeadCells'; import { ImportedHouseholdTableRow } from './ImportedHouseholdTableRow'; import { headCells as mergedHeadCells } from './MergedHouseholdTableHeadCells'; +import { useProgramContext } from 'src/programContext'; +import { adjustHeadCells } from '@utils/utils'; export function ImportedHouseholdTable({ rdi, @@ -23,10 +25,38 @@ export function ImportedHouseholdTable({ : HouseholdRdiMergeStatus.Pending, }; + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; + + const mergedReplacements = { + id: (_beneficiaryGroup) => `${_beneficiaryGroup?.memberLabel} ID`, + head_of_household__full_name: (_beneficiaryGroup) => + `Head of ${_beneficiaryGroup?.groupLabel}`, + size: (_beneficiaryGroup) => `${_beneficiaryGroup?.groupLabel} Size`, + }; + + const adjustedMergedHeadCells = adjustHeadCells( + mergedHeadCells, + beneficiaryGroup, + mergedReplacements, + ); + + const importedReplacements = { + id: (_beneficiaryGroup) => `${_beneficiaryGroup?.groupLabel} ID`, + head_of_household__full_name: (_beneficiaryGroup) => + `Head of ${_beneficiaryGroup?.groupLabel}`, + size: (_beneficiaryGroup) => `${_beneficiaryGroup?.groupLabel} Size`, + }; + + const adjustedImportedHeadCells = adjustHeadCells( + importedHeadCells, + beneficiaryGroup, + importedReplacements, + ); if (isMerged) { return ( - headCells={mergedHeadCells} + headCells={adjustedMergedHeadCells} query={useAllHouseholdsQuery} queriedObjectName="allHouseholds" rowsPerPageOptions={[10, 15, 20]} @@ -45,7 +75,7 @@ export function ImportedHouseholdTable({ } return ( - headCells={importedHeadCells} + headCells={adjustedImportedHeadCells} query={useAllHouseholdsQuery} queriedObjectName="allHouseholds" rowsPerPageOptions={[10, 15, 20]} diff --git a/src/frontend/src/containers/tables/rdi/ImportedIndividualsTable/ImportedIndividualsTable.tsx b/src/frontend/src/containers/tables/rdi/ImportedIndividualsTable/ImportedIndividualsTable.tsx index 4ceb651e4d..a776e28aa2 100644 --- a/src/frontend/src/containers/tables/rdi/ImportedIndividualsTable/ImportedIndividualsTable.tsx +++ b/src/frontend/src/containers/tables/rdi/ImportedIndividualsTable/ImportedIndividualsTable.tsx @@ -10,6 +10,8 @@ import { ReactElement, useState } from 'react'; import { UniversalTable } from '../../UniversalTable'; import { headCells as importedIndividualHeadCells } from './ImportedIndividualsTableHeadCells'; import { ImportedIndividualsTableRow } from './ImportedIndividualsTableRow'; +import { useProgramContext } from 'src/programContext'; +import { adjustHeadCells } from '@utils/utils'; import { headCells as mergedIndividualHeadCells } from './MergedIndividualsTableHeadCells'; interface ImportedIndividualsTableProps { @@ -38,6 +40,8 @@ export function ImportedIndividualsTable({ isMerged, }: ImportedIndividualsTableProps): ReactElement { const [showDuplicates, setShowDuplicates] = useState(false); + const { selectedProgram } = useProgramContext(); + const beneficiaryGroup = selectedProgram?.beneficiaryGroup; const initialVariables = { rdiId, @@ -49,6 +53,23 @@ export function ImportedIndividualsTable({ : IndividualRdiMergeStatus.Pending, }; + const replacements = { + id: (_beneficiaryGroup) => `${_beneficiaryGroup?.memberLabel} ID`, + full_name: (_beneficiaryGroup) => _beneficiaryGroup?.memberLabel, + relationship: (_beneficiaryGroup) => + `Relationship to Head of ${_beneficiaryGroup?.groupLabel}`, + }; + + const adjustedMergedIndividualsHeadCells = adjustHeadCells( + mergedIndividualHeadCells, + beneficiaryGroup, + replacements, + ); + const adjustedImportedIndividualsHeadCells = adjustHeadCells( + importedIndividualHeadCells, + beneficiaryGroup, + replacements, + ); return (
{showCheckbox && ( @@ -72,7 +93,7 @@ export function ImportedIndividualsTable({ {isMerged ? ( title={title} - headCells={mergedIndividualHeadCells} + headCells={adjustedMergedIndividualsHeadCells} query={useAllIndividualsQuery} queriedObjectName="allIndividuals" rowsPerPageOptions={rowsPerPageOptions} @@ -91,7 +112,7 @@ export function ImportedIndividualsTable({ ) : ( title={title} - headCells={importedIndividualHeadCells} + headCells={adjustedImportedIndividualsHeadCells} query={useAllIndividualsQuery} queriedObjectName="allIndividuals" rowsPerPageOptions={rowsPerPageOptions} diff --git a/src/frontend/src/containers/tables/rdi/ImportedIndividualsTable/__snapshots__/ImportedIndividualsTable.test.tsx.snap b/src/frontend/src/containers/tables/rdi/ImportedIndividualsTable/__snapshots__/ImportedIndividualsTable.test.tsx.snap index b60c63f69e..bdaf66cbb3 100644 --- a/src/frontend/src/containers/tables/rdi/ImportedIndividualsTable/__snapshots__/ImportedIndividualsTable.test.tsx.snap +++ b/src/frontend/src/containers/tables/rdi/ImportedIndividualsTable/__snapshots__/ImportedIndividualsTable.test.tsx.snap @@ -109,7 +109,7 @@ exports[`containers/tables/rdi/ImportedIndividualsTable should render loading 1` role="button" tabindex="0" > - Relationship to HoH + Relationship to Head of Household