Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

25188 - court order filing added #3203

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
12 changes: 6 additions & 6 deletions legal-api/src/legal_api/core/filing.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,6 @@ def get_document_list(business, # pylint: disable=too-many-locals disable=too-m
"""Return a list of documents for a particular filing."""
no_output_filings = [
Filing.FilingTypes.CONVERSION.value,
Filing.FilingTypes.COURTORDER.value,
Filing.FilingTypes.PUTBACKOFF.value,
Filing.FilingTypes.PUTBACKON.value,
Filing.FilingTypes.REGISTRARSNOTATION.value,
Expand Down Expand Up @@ -518,20 +517,20 @@ def get_document_list(business, # pylint: disable=too-many-locals disable=too-m
return documents

if filing.storage and filing.storage.filing_type in no_output_filings:
if filing.filing_type == 'courtOrder' and \
(filing.storage.documents.filter(
Document.type == DocumentType.COURT_ORDER.value).one_or_none()):
documents['documents']['uploadedCourtOrder'] = f'{base_url}{doc_url}/uploadedCourtOrder'

return documents

# return a receipt for filings completed in our system
if filing.storage and filing.storage.payment_completion_date:
if filing.filing_type == 'courtOrder' and \
(filing.storage.documents.filter(
Document.type == DocumentType.COURT_ORDER.value).one_or_none()):
documents['documents']['uploadedCourtOrder'] = f'{base_url}{doc_url}/uploadedCourtOrder'
documents['documents']['receipt'] = f'{base_url}{doc_url}/receipt'

no_legal_filings_in_paid_withdrawn_status = [
Filing.FilingTypes.REGISTRATION.value,
Filing.FilingTypes.CONSENTCONTINUATIONOUT.value,
Filing.FilingTypes.COURTORDER.value,
Filing.FilingTypes.CONTINUATIONOUT.value,
Filing.FilingTypes.AGMEXTENSION.value,
Filing.FilingTypes.AGMLOCATIONCHANGE.value,
Expand Down Expand Up @@ -571,6 +570,7 @@ def get_document_list(business, # pylint: disable=too-many-locals disable=too-m
no_legal_filings = [
Filing.FilingTypes.CONSENTCONTINUATIONOUT.value,
Filing.FilingTypes.CONTINUATIONOUT.value,
Filing.FilingTypes.COURTORDER.value,
Filing.FilingTypes.AGMEXTENSION.value,
Filing.FilingTypes.AGMLOCATIONCHANGE.value,
Filing.FilingTypes.TRANSPARENCY_REGISTER.value,
Expand Down
16 changes: 14 additions & 2 deletions legal-api/src/legal_api/core/meta/filing.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,8 +390,20 @@ class FilingTitles(str, Enum):
'name': 'courtOrder',
'title': 'Court Order',
'displayName': 'Court Order',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

displayName should not be removed. Please revert this.

'code': 'NOFEE'
},
'codes': {
'SP': 'COURT',
'GP': 'COURT',
'CP': 'COURT',
'BC': 'COURT',
'BEN': 'COURT',
'CC': 'COURT',
'ULC': 'COURT',
'C': 'COURT',
'CBEN': 'COURT',
'CUL': 'COURT',
'CCC': 'COURT',
}
},
'dissolution': {
'name': 'dissolution',
'additional': [
Expand Down
19 changes: 18 additions & 1 deletion legal-api/src/legal_api/models/filing.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,24 @@ class Source(Enum):
'CCC': 'CRCTN',
}
},
'courtOrder': {
'name': 'courtOrder',
'title': 'Court Order',
'displayName': 'Court Order',
'codes': {
vysakh-menon-aot marked this conversation as resolved.
Show resolved Hide resolved
'SP': 'COURT',
'GP': 'COURT',
'CP': 'COURT',
'BC': 'COURT',
'BEN': 'COURT',
'CC': 'COURT',
'ULC': 'COURT',
'C': 'COURT',
'CBEN': 'COURT',
'CUL': 'COURT',
'CCC': 'COURT',
}
},
'dissolution': {
'name': 'dissolution',
'voluntary': {
Expand Down Expand Up @@ -497,7 +515,6 @@ class Source(Enum):
# changing the structure of fee code in courtOrder/registrarsNotation/registrarsOrder
# for all the business the fee code remain same as NOFEE (Staff)
'adminFreeze': {'name': 'adminFreeze', 'title': 'Admin Freeze', 'code': 'NOFEE'},
'courtOrder': {'name': 'courtOrder', 'title': 'Court Order', 'code': 'NOFEE'},
'putBackOff': {'name': 'putBackOff', 'title': 'Put Back Off', 'code': 'NOFEE'},
'putBackOn': {'name': 'putBackOn', 'title': 'Put Back On', 'code': 'NOFEE'},
'registrarsNotation': {'name': 'registrarsNotation', 'title': 'Registrars Notation', 'code': 'NOFEE'},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ def get_filing_types(business: Business, filing_json: dict): # pylint: disable=
legal_type,
priority_flag,
waive_fees_flag))
elif filing_type in ('adminFreeze', 'courtOrder', 'putBackOff', 'putBackOn',
elif filing_type in ('adminFreeze', 'putBackOff', 'putBackOn',
'registrarsNotation', 'registrarsOrder'):
filing_type_code = Filing.FILINGS.get(filing_type, {}).get('code')
filing_types.append({
Expand Down
4 changes: 2 additions & 2 deletions legal-api/tests/unit/services/test_authorization.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class FilingKey(str, Enum):
FilingKey.CORRCTN: {'displayName': 'Register Correction Application', 'feeCode': 'CRCTN', 'name': 'correction'},
FilingKey.CORRCTN_FIRMS: {'displayName': 'Register Correction Application', 'feeCode': 'FMCORR',
'name': 'correction'},
FilingKey.COURT_ORDER: {'displayName': 'Court Order', 'feeCode': 'NOFEE', 'name': 'courtOrder'},
FilingKey.COURT_ORDER: {'displayName': 'Court Order', 'feeCode': 'COURT', 'name': 'courtOrder'},
FilingKey.VOL_DISS: {'displayName': 'Voluntary Dissolution', 'feeCode': 'DIS_VOL',
'name': 'dissolution', 'type': 'voluntary'},
FilingKey.ADM_DISS: {'displayName': 'Administrative Dissolution', 'feeCode': 'DIS_ADM',
Expand Down Expand Up @@ -256,7 +256,7 @@ class FilingKey(str, Enum):
FilingKey.CORRCTN: {'displayName': 'Register Correction Application', 'feeCode': 'CRCTN', 'name': 'correction'},
FilingKey.CORRCTN_FIRMS: {'displayName': 'Register Correction Application', 'feeCode': 'FMCORR',
'name': 'correction'},
FilingKey.COURT_ORDER: {'displayName': 'Court Order', 'feeCode': 'NOFEE', 'name': 'courtOrder'},
FilingKey.COURT_ORDER: {'displayName': 'Court Order', 'feeCode': 'COURT', 'name': 'courtOrder'},
FilingKey.VOL_DISS: {'displayName': 'Voluntary Dissolution', 'feeCode': 'DIS_VOL',
'name': 'dissolution', 'type': 'voluntary'},
FilingKey.ADM_DISS: {'displayName': 'Administrative Dissolution', 'feeCode': 'DIS_ADM',
Expand Down