Skip to content

Commit

Permalink
Merge pull request #59 from vysakh-menon-aot/feature/4392
Browse files Browse the repository at this point in the history
4392 Schema Change for Notations
  • Loading branch information
thorwolpert authored May 14, 2021
2 parents 348e011 + 5a051a2 commit fe650da
Show file tree
Hide file tree
Showing 11 changed files with 381 additions and 9 deletions.
10 changes: 10 additions & 0 deletions src/registry_schemas/example_data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,16 @@
CORRECTION_COMBINED_AR,
CORRECTION_INCORPORATION,
COURT_ORDER,
COURT_ORDER_FILING_TEMPLATE,
FILING_HEADER,
FILING_TEMPLATE,
FILINGS_WITH_TYPES,
INCORPORATION,
INCORPORATION_FILING_TEMPLATE,
REGISTRARS_NOTATION,
REGISTRARS_NOTATION_FILING_TEMPLATE,
REGISTRARS_ORDER,
REGISTRARS_ORDER_FILING_TEMPLATE,
SPECIAL_RESOLUTION,
STUB_FILING,
TRANSITION,
Expand All @@ -66,11 +71,16 @@
'CORRECTION_COMBINED_AR',
'CORRECTION_INCORPORATION',
'COURT_ORDER',
'COURT_ORDER_FILING_TEMPLATE',
'FILING_HEADER',
'FILING_TEMPLATE',
'FILINGS_WITH_TYPES',
'INCORPORATION',
'INCORPORATION_FILING_TEMPLATE',
'REGISTRARS_NOTATION',
'REGISTRARS_NOTATION_FILING_TEMPLATE',
'REGISTRARS_ORDER',
'REGISTRARS_ORDER_FILING_TEMPLATE',
'SPECIAL_RESOLUTION',
'STUB_FILING',
'VOLUNTARY_DISSOLUTION',
Expand Down
81 changes: 78 additions & 3 deletions src/registry_schemas/example_data/schema_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
'header': {
'name': 'annualReport',
'availableOnPaperOnly': False,
'inColinOnly' : False,
'inColinOnly': False,
'date': '2019-04-08',
'certifiedBy': 'full name',
'email': '[email protected]',
Expand Down Expand Up @@ -1123,7 +1123,22 @@
COURT_ORDER = {
'fileNumber': '#1234-5678/90',
'orderDate': '2021-01-30T09:56:01+08:00',
'effectOfOrder': 'planOfArrangement'
'effectOfOrder': 'planOfArrangement',
'orderDetails': 'A note about order'
}

REGISTRARS_NOTATION = {
'fileNumber': '#1234-5678/90',
'orderDate': '2021-01-30T09:56:01+08:00',
'effectOfOrder': 'planOfArrangement',
'orderDetails': 'A note about order'
}

REGISTRARS_ORDER = {
'fileNumber': '#1234-5678/90',
'orderDate': '2021-01-30T09:56:01+08:00',
'effectOfOrder': 'planOfArrangement',
'orderDetails': 'A note about order'
}

ALTERATION = {
Expand Down Expand Up @@ -1577,6 +1592,63 @@
}
}

REGISTRARS_NOTATION_FILING_TEMPLATE = {
'filing': {
'header': {
'name': 'registrarsNotation',
'date': '2021-05-06',
'certifiedBy': 'full name',
'email': '[email protected]',
'filingId': 1
},
'business': {
'foundingDate': '2018-01-01T00:00:00+00:00',
'identifier': 'U1234567',
'legalName': 'legal name - Test',
'legalType': 'BC'
},
'registrarsNotation': REGISTRARS_NOTATION
}
}

REGISTRARS_ORDER_FILING_TEMPLATE = {
'filing': {
'header': {
'name': 'registrarsOrder',
'date': '2021-05-06',
'certifiedBy': 'full name',
'email': '[email protected]',
'filingId': 1
},
'business': {
'foundingDate': '2018-01-01T00:00:00+00:00',
'identifier': 'U1234567',
'legalName': 'legal name - Test',
'legalType': 'BC'
},
'registrarsOrder': REGISTRARS_ORDER
}
}

COURT_ORDER_FILING_TEMPLATE = {
'filing': {
'header': {
'name': 'courtOrder',
'date': '2021-05-06',
'certifiedBy': 'full name',
'email': '[email protected]',
'filingId': 1
},
'business': {
'foundingDate': '2018-01-01T00:00:00+00:00',
'identifier': 'U1234567',
'legalName': 'legal name - Test',
'legalType': 'BC'
},
'courtOrder': COURT_ORDER
}
}

STUB_FILING = {
}

Expand All @@ -1602,7 +1674,10 @@
('changeOfDirectors', CHANGE_OF_DIRECTORS_MAILING), # bcorp-specific version of filing
('alteration', ALTERATION),
('conversion', CONVERSION),
('transition', TRANSITION)
('transition', TRANSITION),
('courtOrder', COURT_ORDER),
('registrarsNotation', REGISTRARS_NOTATION),
('registrarsOrder', REGISTRARS_ORDER)
]


Expand Down
6 changes: 6 additions & 0 deletions src/registry_schemas/schemas/court_order.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@
"type": "string",
"minLength": 5,
"maxLength": 500,
"description": "planOfArrangement"
},
"orderDetails": {
"type": "string",
"minLength": 0,
"maxLength": 2000,
"description": "A brief note to explain the purpose of the Court Order."
}
},
Expand Down
89 changes: 88 additions & 1 deletion src/registry_schemas/schemas/filing.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,10 @@
"correction",
"alteration",
"conversion",
"transition"
"transition",
"registrarsNotation",
"registrarsOrder",
"courtOrder"
]
},
"availableOnPaperOnly": {
Expand Down Expand Up @@ -194,6 +197,42 @@
}
}
}
},
"court_order_property": {
"$id": "#court_order_property",
"type": "object",
"required": [
"courtOrder"
],
"properties": {
"courtOrder": {
"$ref": "https://bcrs.gov.bc.ca/.well_known/schemas/court_order"
}
}
},
"registrars_notation_property": {
"$id": "#registrars_notation_property",
"type": "object",
"required": [
"registrarsNotation"
],
"properties": {
"registrarsNotation": {
"$ref": "https://bcrs.gov.bc.ca/.well_known/schemas/registrars_notation"
}
}
},
"registrars_order_property": {
"$id": "#registrars_order_property",
"type": "object",
"required": [
"registrarsOrder"
],
"properties": {
"registrarsOrder": {
"$ref": "https://bcrs.gov.bc.ca/.well_known/schemas/registrars_order"
}
}
}
},
"type": "object",
Expand Down Expand Up @@ -222,6 +261,54 @@
"then": {
"$ref": "https://bcrs.gov.bc.ca/.well_known/schemas/business"
}
},
{
"if": {
"properties": {
"header": {
"properties": {
"name": {
"const": "courtOrder"
}
}
}
}
},
"then": {
"$ref": "#/definitions/court_order_property"
}
},
{
"if": {
"properties": {
"header": {
"properties": {
"name": {
"const": "registrarsNotation"
}
}
}
}
},
"then": {
"$ref": "#/definitions/registrars_notation_property"
}
},
{
"if": {
"properties": {
"header": {
"properties": {
"name": {
"const": "registrarsOrder"
}
}
}
}
},
"then": {
"$ref": "#/definitions/registrars_order_property"
}
}
],
"anyOf": [
Expand Down
36 changes: 36 additions & 0 deletions src/registry_schemas/schemas/registrars_notation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://bcrs.gov.bc.ca/.well_known/schemas/registrars_notation",
"type": "object",
"title": "Registrars Notation Information Schema",
"properties": {
"fileNumber": {
"type": "string",
"minLength": 5,
"maxLength": 20,
"description": "The court assigns each court order a unique file number up to 20 characters in length."
},
"orderDate": {
"type": "string",
"description": "The date and time of the order.",
"format": "date-time",
"examples": ["1970-01-01T00:00:00+00:00"]
},
"effectOfOrder": {
"type": "string",
"minLength": 5,
"maxLength": 500,
"description": "planOfArrangement"
},
"orderDetails": {
"type": "string",
"minLength": 0,
"maxLength": 2000,
"description": "A brief note to explain the purpose of the order."
}
},
"required": [
"fileNumber"
]
}
36 changes: 36 additions & 0 deletions src/registry_schemas/schemas/registrars_order.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"definitions": {},
"$schema": "http://json-schema.org/draft-07/schema#",
"$id": "https://bcrs.gov.bc.ca/.well_known/schemas/registrars_order",
"type": "object",
"title": "Registrars Order Information Schema",
"properties": {
"fileNumber": {
"type": "string",
"minLength": 5,
"maxLength": 20,
"description": "The court assigns each court order a unique file number up to 20 characters in length."
},
"orderDate": {
"type": "string",
"description": "The date and time of the order.",
"format": "date-time",
"examples": ["1970-01-01T00:00:00+00:00"]
},
"effectOfOrder": {
"type": "string",
"minLength": 5,
"maxLength": 500,
"description": "planOfArrangement"
},
"orderDetails": {
"type": "string",
"minLength": 0,
"maxLength": 2000,
"description": "A brief note to explain the purpose of the Order."
}
},
"required": [
"fileNumber"
]
}
2 changes: 1 addition & 1 deletion src/registry_schemas/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@
Development release segment: .devN
"""

__version__ = '2.12.0' # pylint: disable=invalid-name
__version__ = '2.12.1' # pylint: disable=invalid-name
4 changes: 3 additions & 1 deletion tests/unit/schema_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,7 @@
('conversion.json'),
('transition.json'),
('diff.json'),
('court_order.json')
('court_order.json'),
('registrars_notation.json'),
('registrars_order.json')
]
9 changes: 7 additions & 2 deletions tests/unit/test_alteration.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,13 @@ def test_validate_invalid_share_structure_alteration():
'fileNumber': '12345',
'orderDate': '2021-01-30T09:56:01+08:00',
'effectOfOrder': invalid_effect_of_order
} for invalid_effect_of_order in ['abcd', ('a' * 501)] # long effectOfOrder
]
} for invalid_effect_of_order in ['abcd', ('a' * 501)]], # long effectOfOrder
*[{
'fileNumber': '12345',
'orderDate': '2021-01-30T09:56:01+08:00',
'effectOfOrder': 'planOfArrangement',
'orderDetails': invalid_order_details
} for invalid_order_details in [('a' * 2001)]], # long orderDetails
])
def test_validate_invalid_court_orders(invalid_court_order):
"""Assert not valid court orders."""
Expand Down
Loading

0 comments on commit fe650da

Please sign in to comment.