Skip to content

Commit

Permalink
21475-filer-fix target dissolution date calculation (bcgov#2788)
Browse files Browse the repository at this point in the history
Signed-off-by: Hongjing Chen <[email protected]>
  • Loading branch information
chenhongjing authored Jun 25, 2024
1 parent 8c125d9 commit 9f26690
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 9f26690

Please sign in to comment.