Skip to content

Commit

Permalink
remove validation for intended agm date
Browse files Browse the repository at this point in the history
Signed-off-by: Hongjing Chen <[email protected]>
  • Loading branch information
chenhongjing committed Nov 15, 2023
1 parent eb36800 commit 71a1025
Showing 1 changed file with 0 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ def validate(business: Business, filing: Dict) -> Optional[Error]:
msg.extend(first_agm_validation(business, filing))
else:
msg.extend(subsequent_agm_validation(filing))
msg.extend(intended_agm_date_validation(filing))

if msg:
return Error(HTTPStatus.BAD_REQUEST, msg)
Expand Down Expand Up @@ -154,24 +153,6 @@ def subsequent_agm_validation(filing: Dict) -> list:
return msg


def intended_agm_date_validation(filing: Dict) -> list:
"""Validate intended AGM date."""
msg = []
intended_agm_date_str = get_str(filing, f'{AGM_EXTENSION_PATH}/intendedAgmDate')
curr_ext_expire_date_str = get_str(filing, f'{AGM_EXTENSION_PATH}/expireDateCurrExt')
if intended_agm_date_str and curr_ext_expire_date_str:
intended_agm_date =\
LegislationDatetime.as_legislation_timezone_from_date_str(intended_agm_date_str).date()
curr_ext_expire_date =\
LegislationDatetime.as_legislation_timezone_from_date_str(curr_ext_expire_date_str).date()

if intended_agm_date > curr_ext_expire_date:
msg.append({'error': 'Intended AGM date should not be greater than current extension expiry date.',
'path': f'{AGM_EXTENSION_PATH}/intendedAgmDate'})

return msg


def _calculate_granted_ext(curr_ext_expire_date, baseline_date) -> tuple:
"""Calculate expected total approved extension and extension duration."""
total_approved_ext = relativedelta(curr_ext_expire_date, baseline_date).months
Expand Down

0 comments on commit 71a1025

Please sign in to comment.