Skip to content
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
8 changes: 4 additions & 4 deletions python/common/business-registry-model/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions python/common/business-registry-model/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "business-model"
version = "3.4.8"
version = "3.4.9"
description = ""
authors = [
{name = "thor",email = "1042854+thorwolpert@users.noreply.github.com"}
Expand All @@ -9,7 +9,7 @@ readme = "README.md"
requires-python = ">=3.13,<3.14"
dependencies = [
"sql-versioning @ git+https://github.com/bcgov/lear.git@main#subdirectory=python/common/sql-versioning-alt",
"registry-schemas @ git+https://github.com/bcgov/business-schemas.git@2.18.79",
"registry-schemas @ git+https://github.com/bcgov/business-schemas.git@2.18.80",
"flask-migrate (>=4.1.0,<5.0.0)",
"pg8000 (>=1.31.2,<2.0.0)",
"pydantic (>=2.10.6,<3.0.0)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,17 @@ class CourtOrder(db.Model, Versioned):

@property
def json(self) -> dict:
return {
data = {
"id": self.id,
"filingId": self.filing_id,
"fileNumber": self.file_number,
"orderDate": self.order_date,
"effectOfOrder": self.effect_of_order,
"orderDetails": self.order_details
}
if self.order_date:
data["orderDate"] = self.order_date.isoformat()

return data

def save(self):
db.session.add(self)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ class DocumentType(Enum):
COOP_MEMORANDUM = 'coop_memorandum'
COURT_ORDER = 'court_order'
DIRECTOR_AFFIDAVIT = 'director_affidavit'
SUPPORTING_DOCUMENT = 'supporting_document'


class Document(db.Model, Versioned):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ def test_court_order_json(session):
"""Assert that court order json property works."""
business = factory_business('CP1234567')
filing = factory_filing(business, data_dict={'filing': {'header': {'name': 'courtOrder'}}})
from datetime import timezone
order_date = datetime.now(UTC)

court_order = CourtOrder(
Expand All @@ -61,7 +60,7 @@ def test_court_order_json(session):
assert co_json['id'] == court_order.id
assert co_json['filingId'] == filing.id
assert co_json['fileNumber'] == '12345'
assert co_json['orderDate'] == order_date
assert co_json['orderDate'] == order_date.isoformat()
assert co_json['effectOfOrder'] == 'planOfArrangement'
assert co_json['orderDetails'] == 'Some details'

Expand Down