From 9f266904c62e47db9e8741044eba69292ffaeb16 Mon Sep 17 00:00:00 2001 From: Hongjing <60866283+chenhongjing@users.noreply.github.com> Date: Tue, 25 Jun 2024 07:20:33 -0700 Subject: [PATCH] 21475-filer-fix target dissolution date calculation (#2788) Signed-off-by: Hongjing Chen --- .../src/entity_filer/filing_processors/change_of_address.py | 3 ++- .../tests/unit/filing_processors/test_change_of_address.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/queue_services/entity-filer/src/entity_filer/filing_processors/change_of_address.py b/queue_services/entity-filer/src/entity_filer/filing_processors/change_of_address.py index bc0efce80b..107f18e5a1 100644 --- a/queue_services/entity-filer/src/entity_filer/filing_processors/change_of_address.py +++ b/queue_services/entity-filer/src/entity_filer/filing_processors/change_of_address.py @@ -50,12 +50,13 @@ def process(business: Business, filing: Dict, filing_meta: FilingMeta, flag_on: BatchProcessing.BatchProcessingStatus.COMPLETED, BatchProcessing.BatchProcessingStatus.WITHDRAWN ] and datetime.utcnow() + datedelta(days=60) > batch_processing.trigger_date: + old_trigger_date = batch_processing.trigger_date batch_processing.trigger_date = datetime.utcnow() + datedelta(days=62) batch_processing.meta_data = { **batch_processing.meta_data, 'changeOfAddressDelay': True } target_dissolution_date = date.fromisoformat(batch_processing.meta_data['targetDissolutionDate']) - target_dissolution_date += datedelta(days=62) + target_dissolution_date += batch_processing.trigger_date - old_trigger_date batch_processing.meta_data['targetDissolutionDate'] = target_dissolution_date.isoformat() batch_processing.last_modified = datetime.utcnow() diff --git a/queue_services/entity-filer/tests/unit/filing_processors/test_change_of_address.py b/queue_services/entity-filer/tests/unit/filing_processors/test_change_of_address.py index 4f70375f9d..98ec421d33 100644 --- a/queue_services/entity-filer/tests/unit/filing_processors/test_change_of_address.py +++ b/queue_services/entity-filer/tests/unit/filing_processors/test_change_of_address.py @@ -118,7 +118,7 @@ def test_change_of_address_delay_dissolution(app, session, test_name, status, st utc_now = datetime.utcnow() dissolution_date = utc_now + datedelta(days=72) trigger_date = batch_processing.trigger_date - delay_dissolution_date = utc_now + datedelta(days=134) + delay_dissolution_date = utc_now + datedelta(days=92) delay_trigger_date = utc_now + datedelta(days=62) filing_meta = FilingMeta()