diff --git a/source/backend/api/Models/Concepts/CompensationRequisition/CompensationRequisitionMap.cs b/source/backend/api/Models/Concepts/CompensationRequisition/CompensationRequisitionMap.cs index be1732464c..b3d2b9bda7 100644 --- a/source/backend/api/Models/Concepts/CompensationRequisition/CompensationRequisitionMap.cs +++ b/source/backend/api/Models/Concepts/CompensationRequisition/CompensationRequisitionMap.cs @@ -35,6 +35,7 @@ public void Register(TypeAdapterConfig config) .Map(dest => dest.IsPaymentInTrust, src => src.IsPaymentInTrust) .Map(dest => dest.GstNumber, src => src.GstNumber) .Map(dest => dest.FinalizedDate, src => src.FinalizedDate) + .Map(dest => dest.AdvancedPaymentServedDate, src => src.AdvPmtServedDt) .Map(dest => dest.SpecialInstruction, src => src.SpecialInstruction) .Map(dest => dest.DetailedRemarks, src => src.DetailedRemarks) .Map(dest => dest.IsDisabled, src => src.IsDisabled) @@ -54,6 +55,7 @@ public void Register(TypeAdapterConfig config) .Map(dest => dest.AgreementDt, src => src.AgreementDate) .Map(dest => dest.ExpropNoticeServedDt, src => src.ExpropriationNoticeServedDate) .Map(dest => dest.ExpropVestingDt, src => src.ExpropriationVestingDate) + .Map(dest => dest.AdvPmtServedDt, src => src.AdvancedPaymentServedDate) .Map(dest => dest.GenerationDt, src => src.GenerationDate) .Map(dest => dest.PimsCompReqFinancials, src => src.Financials) .Map(dest => dest.AcquisitionOwnerId, src => src.AcquisitionOwnerId) diff --git a/source/backend/api/Models/Concepts/CompensationRequisition/CompensationRequisitionModel.cs b/source/backend/api/Models/Concepts/CompensationRequisition/CompensationRequisitionModel.cs index 9bb73dee55..9162a77888 100644 --- a/source/backend/api/Models/Concepts/CompensationRequisition/CompensationRequisitionModel.cs +++ b/source/backend/api/Models/Concepts/CompensationRequisition/CompensationRequisitionModel.cs @@ -35,6 +35,8 @@ public class CompensationRequisitionModel : BaseAppModel public DateTime? ExpropriationVestingDate { get; set; } + public DateTime? AdvancedPaymentServedDate { get; set; } + public DateTime? GenerationDate { get; set; } public List Financials { get; set; } diff --git a/source/frontend/src/features/mapSideBar/acquisition/models/PayeeOptionModel.ts b/source/frontend/src/features/mapSideBar/acquisition/models/PayeeOptionModel.ts index 6d6b9644cc..a275a28aca 100644 --- a/source/frontend/src/features/mapSideBar/acquisition/models/PayeeOptionModel.ts +++ b/source/frontend/src/features/mapSideBar/acquisition/models/PayeeOptionModel.ts @@ -85,6 +85,7 @@ export class PayeeOption { agreementDate: null, expropriationNoticeServedDate: null, expropriationVestingDate: null, + advancedPaymentServedDate: null, generationDate: null, financials: [], legacyPayee: null, diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/detail/CompensationRequisitionDetailView.test.tsx b/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/detail/CompensationRequisitionDetailView.test.tsx index 6d7fc4badb..ac0bfe0ead 100644 --- a/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/detail/CompensationRequisitionDetailView.test.tsx +++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/detail/CompensationRequisitionDetailView.test.tsx @@ -7,7 +7,7 @@ import { getMockApiDefaultCompensation, } from '@/mocks/compensations.mock'; import { Api_CompensationRequisition } from '@/models/api/CompensationRequisition'; -import { act, render, RenderOptions, userEvent, waitFor } from '@/utils/test-utils'; +import { act, getByTestId, render, RenderOptions, userEvent, waitFor } from '@/utils/test-utils'; import CompensationRequisitionDetailView, { CompensationRequisitionDetailViewProps, @@ -170,11 +170,29 @@ describe('Compensation Detail View Component', () => { isDraft: false, finalizedDate: '2024-06-12T18:00:00', }; - const { getByText } = await setup({ + const { getByTestId } = await setup({ roles: [Roles.SYSTEM_ADMINISTRATOR], props: { compensation: mockFinalCompensation }, }); - expect(getByText('Jun 12, 2024')).toBeVisible(); + const compensationFinalizedDate = getByTestId('compensation-finalized-date'); + expect(compensationFinalizedDate).toHaveTextContent('Jun 12, 2024'); + }); + + it('Displays the Advanced Payment Served Date', async () => { + const mockCompensation = getMockApiDefaultCompensation(); + const { queryByTestId } = await setup({ + claims: [Claims.COMPENSATION_REQUISITION_VIEW], + props: { + compensation: { + ...mockCompensation, + isDraft: true, + advancedPaymentServedDate: '2023-09-18T00:00:00', + }, + }, + }); + + const advancedPaymntServedDate = queryByTestId('advanced-payment-served-date'); + expect(advancedPaymntServedDate).toHaveTextContent('Sep 18, 2023'); }); }); diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/detail/CompensationRequisitionDetailView.tsx b/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/detail/CompensationRequisitionDetailView.tsx index ed34362287..30b8a08956 100644 --- a/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/detail/CompensationRequisitionDetailView.tsx +++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/detail/CompensationRequisitionDetailView.tsx @@ -206,13 +206,13 @@ export const CompensationRequisitionDetailView: React.FunctionComponent< } > - + {compensation.isDraft ? 'Draft' : 'Final'} {projectName} - + {prettyFormatDate(compensation.finalizedDate)} @@ -224,6 +224,13 @@ export const CompensationRequisitionDetailView: React.FunctionComponent< {prettyFormatDate(compensation.expropriationVestingDate)} + + {prettyFormatDate(compensation.advancedPaymentServedDate)} + {compensation.specialInstruction} diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/detail/__snapshots__/CompensationRequisitionDetailView.test.tsx.snap b/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/detail/__snapshots__/CompensationRequisitionDetailView.test.tsx.snap index 5af364c8fe..e6d942ef47 100644 --- a/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/detail/__snapshots__/CompensationRequisitionDetailView.test.tsx.snap +++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/detail/__snapshots__/CompensationRequisitionDetailView.test.tsx.snap @@ -427,6 +427,7 @@ exports[`Compensation Detail View Component renders as expected 1`] = `
Final
@@ -463,6 +464,7 @@ exports[`Compensation Detail View Component renders as expected 1`] = `
+
+
+ +
+
+
diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/list/CompensationListContainer.tsx b/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/list/CompensationListContainer.tsx index 8e21969b76..8ea554919d 100644 --- a/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/list/CompensationListContainer.tsx +++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/list/CompensationListContainer.tsx @@ -92,6 +92,7 @@ export const CompensationListContainer: React.FunctionComponent< agreementDate: null, expropriationNoticeServedDate: null, expropriationVestingDate: null, + advancedPaymentServedDate: null, generationDate: null, specialInstruction: null, detailedRemarks: null, diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/update/UpdateCompensationRequisitionForm.test.tsx b/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/update/UpdateCompensationRequisitionForm.test.tsx index 67d2aefff4..af23b76f44 100644 --- a/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/update/UpdateCompensationRequisitionForm.test.tsx +++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/update/UpdateCompensationRequisitionForm.test.tsx @@ -107,6 +107,11 @@ describe('Compensation Requisition UpdateForm component', () => { `#typeahead-alternateProject-item-${index}`, ) as HTMLElement; }, + getAdvancedPaymentServedDate: () => { + return utils.container.querySelector( + `input[name="advancedPaymentServedDate"]`, + ) as HTMLInputElement; + }, getPayeeOptionsDropDown: () => utils.container.querySelector(`select[name="payee.payeeKey"]`) as HTMLInputElement, getPayeeGSTNumber: () => @@ -298,13 +303,14 @@ describe('Compensation Requisition UpdateForm component', () => { const mockCompensation = CompensationRequisitionFormModel.fromApi({ ...getMockApiDefaultCompensation(), isDraft: false, - finalizedDate: '2024-06-12T18:00:00', + finalizedDate: '2024-06-12T00:00:00', }); - const { getByText } = await setup({ + const { getByTestId } = await setup({ props: { initialValues: mockCompensation }, }); - expect(getByText('Jun 12, 2024')).toBeVisible(); + const compensationFinalizedDate = getByTestId('compensation-finalized-date'); + expect(compensationFinalizedDate).toHaveTextContent('Jun 12, 2024'); }); it('should display the LEGACY payee information', async () => { @@ -378,4 +384,18 @@ describe('Compensation Requisition UpdateForm component', () => { expect(setShowAltProjectError).toHaveBeenCalledWith(true); }); + + it('displays the compensation advanced payment served date', async () => { + const mockCompensation = CompensationRequisitionFormModel.fromApi({ + ...getMockApiDefaultCompensation(), + isDraft: false, + advancedPaymentServedDate: '2024-09-16T00:00:00', + }); + const { getAdvancedPaymentServedDate } = await setup({ + props: { initialValues: mockCompensation }, + }); + + const inputServedDate = getAdvancedPaymentServedDate(); + expect(inputServedDate).toHaveValue('Sep 16, 2024'); + }); }); diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/update/UpdateCompensationRequisitionForm.tsx b/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/update/UpdateCompensationRequisitionForm.tsx index 4d6c9727d2..d378120728 100644 --- a/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/update/UpdateCompensationRequisitionForm.tsx +++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/update/UpdateCompensationRequisitionForm.tsx @@ -175,7 +175,7 @@ const UpdateCompensationRequisitionForm: React.FC {prettyFormatDate(initialValues.finalizedDate)} @@ -195,6 +195,9 @@ const UpdateCompensationRequisitionForm: React.FC + + + diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/update/__snapshots__/UpdateCompensationRequisitionForm.test.tsx.snap b/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/update/__snapshots__/UpdateCompensationRequisitionForm.test.tsx.snap index a840667811..66b76a26da 100644 --- a/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/update/__snapshots__/UpdateCompensationRequisitionForm.test.tsx.snap +++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/update/__snapshots__/UpdateCompensationRequisitionForm.test.tsx.snap @@ -393,6 +393,7 @@ exports[`Compensation Requisition UpdateForm component renders as expected 1`] =
+
+
+ +
+
+
+
+
+ + + + +
+
+
+
+
diff --git a/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/update/models.ts b/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/update/models.ts index bd2dcc8ea7..a1c45ea34e 100644 --- a/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/update/models.ts +++ b/source/frontend/src/features/mapSideBar/acquisition/tabs/compensation/update/models.ts @@ -20,6 +20,7 @@ export class CompensationRequisitionFormModel { agreementDateTime: string = ''; expropriationNoticeServedDateTime: string = ''; expropriationVestingDateTime: string = ''; + advancedPaymentServedDate: string = ''; generationDatetTime: string = ''; specialInstruction: string = ''; detailedRemarks: string = ''; @@ -59,6 +60,7 @@ export class CompensationRequisitionFormModel { finalizedDate: stringToUndefined(this.finalizedDate), expropriationNoticeServedDate: stringToUndefined(this.expropriationNoticeServedDateTime), expropriationVestingDate: stringToUndefined(this.expropriationVestingDateTime), + advancedPaymentServedDate: stringToUndefined(this.advancedPaymentServedDate), generationDate: stringToUndefined(this.generationDatetTime), specialInstruction: stringToUndefined(this.specialInstruction), detailedRemarks: stringToUndefined(this.detailedRemarks), @@ -96,6 +98,7 @@ export class CompensationRequisitionFormModel { compensation.agreementDateTime = apiModel.agreementDate || ''; compensation.expropriationNoticeServedDateTime = apiModel.expropriationNoticeServedDate || ''; compensation.expropriationVestingDateTime = apiModel.expropriationVestingDate || ''; + compensation.advancedPaymentServedDate = apiModel.advancedPaymentServedDate || ''; compensation.generationDatetTime = apiModel.generationDate || ''; compensation.specialInstruction = apiModel.specialInstruction || ''; compensation.detailedRemarks = apiModel.detailedRemarks || ''; diff --git a/source/frontend/src/mocks/compensations.mock.ts b/source/frontend/src/mocks/compensations.mock.ts index d381990783..637e295ff2 100644 --- a/source/frontend/src/mocks/compensations.mock.ts +++ b/source/frontend/src/mocks/compensations.mock.ts @@ -19,6 +19,7 @@ export const emptyCompensationRequisition: Api_CompensationRequisition = { agreementDate: null, expropriationNoticeServedDate: null, expropriationVestingDate: null, + advancedPaymentServedDate: null, generationDate: null, financials: [], acquisitionOwnerId: null, diff --git a/source/frontend/src/models/api/CompensationRequisition.ts b/source/frontend/src/models/api/CompensationRequisition.ts index 1c23eff84f..5a645de647 100644 --- a/source/frontend/src/models/api/CompensationRequisition.ts +++ b/source/frontend/src/models/api/CompensationRequisition.ts @@ -28,6 +28,7 @@ export interface Api_CompensationRequisition extends Api_ConcurrentVersion, Api_ agreementDate: string | null; expropriationNoticeServedDate: string | null; expropriationVestingDate: string | null; + advancedPaymentServedDate: string | null; generationDate: string | null; financials: Api_CompensationFinancial[]; acquisitionOwnerId: number | null;