Skip to content

Commit

Permalink
24195 updating last_modified with filing completion_date (bcgov#3154)
Browse files Browse the repository at this point in the history
  • Loading branch information
vysakh-menon-aot authored Dec 28, 2024
1 parent a53571e commit c830473
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion legal-api/src/legal_api/models/business.py
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,8 @@ def _slim_json(self):
'inDissolution': self.in_dissolution,
'legalName': self.business_legal_name,
'legalType': self.legal_type,
'state': self.state.name if self.state else Business.State.ACTIVE.name
'state': self.state.name if self.state else Business.State.ACTIVE.name,
'lastModified': self.last_modified.isoformat()
}

if self.tax_id:
Expand Down
3 changes: 2 additions & 1 deletion legal-api/tests/unit/models/test_business.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ def test_good_standing_check_transition_filing(session, test_name, has_no_transi
restoration_filing.save()
elif test_name == 'TRANSITION_COMPLETED':
factory_completed_filing(business, TRANSITION_FILING_TEMPLATE, filing_type='transition')

check_result = business._has_no_transition_filed_after_restoration()
assert check_result == has_no_transition_filed
with patch.object(flags, 'is_on', return_value=True):
Expand Down Expand Up @@ -330,6 +330,7 @@ def test_business_json(session):
'legalName': 'legal_name',
'legalType': Business.LegalTypes.COOP.value,
'state': Business.State.ACTIVE.name,
'lastModified': EPOCH_DATETIME.isoformat(),
'taxId': '123456789'
}

Expand Down
1 change: 1 addition & 0 deletions queue_services/entity-filer/src/entity_filer/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ async def process_filing(filing_msg: Dict, flask_app: Flask): # pylint: disable

business_type = business.legal_type if business else filing_submission['business']['legal_type']
filing_submission.set_processed(business_type)
business.last_modified = filing_submission.completion_date

filing_submission._meta_data = json.loads( # pylint: disable=W0212
json.dumps(filing_meta.asjson, default=json_serial)
Expand Down

0 comments on commit c830473

Please sign in to comment.