-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Create Platform Registration (#177)
* Platform Registration * no message * no message * no message * no message * Test fixes * Updated version
- Loading branch information
1 parent
5f7a160
commit 58f3edb
Showing
22 changed files
with
1,037 additions
and
95 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
602 changes: 602 additions & 0 deletions
602
strr-api/migrations/versions/20241010_2151_a6abe20bd998_.py
Large diffs are not rendered by default.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "strr-api" | ||
version = "0.0.13" | ||
version = "0.0.14" | ||
description = "" | ||
authors = ["thorwolpert <[email protected]>"] | ||
license = "BSD 3-Clause" | ||
|
@@ -14,7 +14,6 @@ launchdarkly-server-sdk = "^9.0.1" | |
python-dotenv = "^1.0.0" | ||
flask-sqlalchemy = "^3.1.1" | ||
flask-migrate = "^4.0.4" | ||
sql-versioning = { git = "https://github.com/bcgov/lear.git", subdirectory = "python/common/sql-versioning", branch = "feature-legal-name" } | ||
sentry-sdk = "^1.24.0" | ||
flask-babel = "^4.0.0" | ||
flask-cors = "^4.0.0" | ||
|
@@ -33,6 +32,7 @@ google-cloud-storage = "2.14.0" | |
geoalchemy2 = "^0.15.1" | ||
weasyprint = "^62.3" | ||
sqlalchemy-utils = "^0.41.2" | ||
sql-versioning = { git = "https://github.com/bcgov/sbc-connect-common.git", subdirectory = "python/sql-versioning", branch = "main" } | ||
|
||
[tool.poetry.group.test.dependencies] | ||
freezegun = "^1.2.2" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
"""Registration model. | ||
""" | ||
|
||
from __future__ import annotations | ||
|
||
from sql_versioning import Versioned | ||
from sqlalchemy.orm import relationship | ||
|
||
from strr_api.models.base_model import BaseModel | ||
|
||
from .db import db | ||
|
||
|
||
class Address(Versioned, BaseModel): | ||
"""Address""" | ||
|
||
__tablename__ = "addresses" | ||
|
||
id = db.Column(db.Integer, primary_key=True, autoincrement=True) | ||
country = db.Column(db.String, nullable=False) | ||
street_address = db.Column(db.String, nullable=False) | ||
street_address_additional = db.Column(db.String, nullable=True) | ||
city = db.Column(db.String, nullable=False) | ||
province = db.Column(db.String, nullable=False) | ||
postal_code = db.Column(db.String, nullable=False) | ||
|
||
contact = relationship("Contact", back_populates="address", foreign_keys="Contact.address_id") | ||
rental_properties_address = relationship( | ||
"RentalProperty", back_populates="address", foreign_keys="RentalProperty.address_id" | ||
) | ||
|
||
def to_oneline_address(self): | ||
"""Convert object to one line address.""" | ||
unit = "" | ||
if self.street_address_additional: | ||
unit = f"{self.street_address_additional} " | ||
return f"{unit}{self.street_address}, {self.city}, {self.province}, {self.country}, {self.postal_code}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.