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

23562 (2 step continuation in filing) before and after approval of authorization documents #169

Merged
merged 1 commit into from
Oct 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/registry_schemas/example_data/schema_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -2342,6 +2342,7 @@
}

CONTINUATION_IN = {
'isApproved': False,
'business': {
'identifier': 'A1234567', # Identifier of the registered extra provincial business
'legalName': 'HAULER SERVICES IN BC'
Expand Down
38 changes: 31 additions & 7 deletions src/registry_schemas/schemas/continuation_in.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,38 @@
"properties": {
"continuationIn": {
"type": "object",
"required": [
"foreignJurisdiction",
"authorization",
"nameRequest",
"offices",
"parties"
],
"if": {
"properties": {
"isApproved": {
"const": false
}
}
},
"then": {
"$comment": "if isApproved is false or not defined",
"required": [
"nameRequest",
"authorization",
"foreignJurisdiction",
"contactPoint"
]
},
"else": {
"required": [
"nameRequest",
"authorization",
"foreignJurisdiction",
"contactPoint",
"offices",
"parties",
"shareStructure"
]
},
"properties": {
"isApproved": {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Setting this value to True will be handled from legal-api (before validating filing json)

Copy link
Collaborator

Choose a reason for hiding this comment

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

So the UI will need to read this from a draft and then save it upon filing?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Nope. UI doesn't need to provide this at any stage. Even if UI provides it will be overwritten by legal-api based on the filing status

Copy link
Collaborator

Choose a reason for hiding this comment

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

Would it be better to just have a duplicate of the filing status here?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh, so Legal API will set this before validating the schema?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Does it have to be a declared property in this schema? I thought our schemas allowed additional properties without checks.

Copy link
Collaborator Author

@vysakh-menon-aot vysakh-menon-aot Oct 1, 2024

Choose a reason for hiding this comment

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

As you can see from line no. 13 to 39 we have an "if -> then -> else", which is based on this field. Conditional Required based on isApproved value

Copy link
Collaborator

Choose a reason for hiding this comment

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

OK. Then this is fine by me.

"type": "boolean",
"title": "Continuation In Authorization has been approved."
},
"business": {
"$ref": "https://bcrs.gov.bc.ca/.well_known/schemas/business#/properties/business",
"title": "Provide identifier and/or taxId if already registered as extra provincial business."
Expand Down
2 changes: 1 addition & 1 deletion src/registry_schemas/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,4 @@
"""


__version__ = '2.18.28' # pylint: disable=invalid-name
__version__ = '2.18.29' # pylint: disable=invalid-name
39 changes: 39 additions & 0 deletions tests/unit/test_continuation_in.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ def test_validate_no_offices():
def test_validate_no_parties():
"""Assert not valid if parties are ommited."""
continuation_in_json = copy.deepcopy(CONTINUATION_IN)
continuation_in_json['isApproved'] = True
del continuation_in_json['parties']
legal_filing = {'continuationIn': continuation_in_json}

Expand Down Expand Up @@ -141,3 +142,41 @@ def test_validate_share_classes_no_name():
print(errors)

assert not is_valid


def test_validate_continuation_in_submit_authorization():
"""Assert valid if continuation in can be submitted for approval without these props."""
continuation_in_json = copy.deepcopy(CONTINUATION_IN)
del continuation_in_json['isApproved'] # removing isApproved will trigger 'then' (equivalent to False)
del continuation_in_json['offices']
del continuation_in_json['parties']
del continuation_in_json['shareStructure']
legal_filing = {'continuationIn': continuation_in_json}

is_valid, errors = validate(legal_filing, 'continuation_in')

if errors:
for err in errors:
print(err.message)
print(errors)

assert is_valid


def test_validate_continuation_in_submit_after_approval():
"""Assert not valid if these are ommited."""
continuation_in_json = copy.deepcopy(CONTINUATION_IN)
continuation_in_json['isApproved'] = True
del continuation_in_json['offices']
del continuation_in_json['parties']
del continuation_in_json['shareStructure']
legal_filing = {'continuationIn': continuation_in_json}

is_valid, errors = validate(legal_filing, 'continuation_in')

if errors:
for err in errors:
print(err.message)
print(errors)

assert not is_valid
Loading