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

add POST account functionality #15

Merged
merged 4 commits into from
May 28, 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
54 changes: 54 additions & 0 deletions strr-api/migrations/versions/20240522_dbdabde037cc_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
"""empty message

Revision ID: dbdabde037cc
Revises: 7026f9b26d3f
Create Date: 2024-05-22 23:25:46.897711

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'dbdabde037cc'
down_revision = '7026f9b26d3f'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.add_column(sa.Column('preferredname', sa.VARCHAR(), autoincrement=False, nullable=True))
batch_op.add_column(sa.Column('phone_extension', sa.VARCHAR(), autoincrement=False, nullable=True))
batch_op.add_column(sa.Column('fax_number', sa.VARCHAR(), autoincrement=False, nullable=True))
batch_op.add_column(sa.Column('phone_number', sa.VARCHAR(), autoincrement=False, nullable=True))
batch_op.add_column(sa.Column('date_of_birth', sa.DATE(), autoincrement=False, nullable=True))

with op.batch_alter_table('property_managers', schema=None) as batch_op:
batch_op.add_column(sa.Column('secondary_contact_user_id', sa.INTEGER(), autoincrement=False, nullable=True))
batch_op.create_foreign_key('property_managers_secondary_contact_user_id_fkey', 'users', ['secondary_contact_user_id'], ['id'])

with op.batch_alter_table('addresses', schema=None) as batch_op:
batch_op.add_column(sa.Column('street_address_additional', sa.VARCHAR(), autoincrement=False, nullable=True))

# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('addresses', schema=None) as batch_op:
batch_op.drop_column('street_address_additional')

with op.batch_alter_table('property_managers', schema=None) as batch_op:
batch_op.drop_constraint('property_managers_secondary_contact_user_id_fkey', type_='foreignkey')
batch_op.drop_column('secondary_contact_user_id')

with op.batch_alter_table('users', schema=None) as batch_op:
batch_op.drop_column('date_of_birth')
batch_op.drop_column('phone_number')
batch_op.drop_column('fax_number')
batch_op.drop_column('phone_extension')
batch_op.drop_column('preferredname')

# ### end Alembic commands ###
34 changes: 34 additions & 0 deletions strr-api/migrations/versions/20240523_3d7b4953b1ee_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
"""empty message

Revision ID: 3d7b4953b1ee
Revises: dbdabde037cc
Create Date: 2024-05-23 22:32:30.579174

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '3d7b4953b1ee'
down_revision = 'dbdabde037cc'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('rental_platforms', schema=None) as batch_op:
batch_op.alter_column('name',
existing_nullable=False,
nullable=True)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('rental_platforms', schema=None) as batch_op:
batch_op.alter_column('name',
existing_nullable=True,
nullable=False)
# ### end Alembic commands ###
30 changes: 30 additions & 0 deletions strr-api/migrations/versions/20240524_894fe4847de6_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""empty message

Revision ID: 894fe4847de6
Revises: 3d7b4953b1ee
Create Date: 2024-05-24 09:34:10.209903

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '894fe4847de6'
down_revision = '3d7b4953b1ee'
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('registrations', schema=None) as batch_op:
batch_op.add_column(sa.Column('sbc_account_id', sa.INTEGER(), autoincrement=False, nullable=True))
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('registrations', schema=None) as batch_op:
batch_op.drop_column('sbc_account_id')
# ### end Alembic commands ###
123 changes: 122 additions & 1 deletion strr-api/poetry.lock

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

1 change: 1 addition & 0 deletions strr-api/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ pytest-env = "^1.1.3"
coloredlogs = "^15.0.1"
flask-httpauth = "^4.8.0"
flasgger = "^0.9.7.1"
pydantic = "^2.7.1"

[tool.poetry.group.test.dependencies]
freezegun = "^1.2.2"
Expand Down
27 changes: 27 additions & 0 deletions strr-api/src/strr_api/enums/enum.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,30 @@ class Role(Enum):
STAFF_CREATE_ACCOUNTS = "create_accounts"
STAFF_MANAGE_BUSINESS = "manage_business"
STAFF_SUSPEND_ACCOUNTS = "suspend_accounts"


class RegistrationStatus(Enum):
"""STRR Registration Status."""

PENDING = "pending"
APPROVED = "approved"
MORE_INFO_NEEDED = "more info needed"
DENIED = "denied"


class PropertyType(Enum):
"""STRR Property Type."""

PRIMARY = "All or part of primary dwelling"
SECONDARY = "Secondary suite"
ACCESSORY = "Accessory dwelling unit"
FLOAT_HOME = "Float home"
OTHER = "Other"


class OwnershipType(Enum):
"""STRR Ownership Type."""

OWN = "own"
RENT = "rent"
CO_OWN = "co-own"
1 change: 1 addition & 0 deletions strr-api/src/strr_api/exceptions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@
"""Application Specific Exceptions/Responses, to manage handled errors."""
from .exceptions import AuthException # noqa: F401
from .exceptions import ExternalServiceException # noqa: F401
from .exceptions import ValidationException # noqa: F401
from .responses import error_response, exception_response # noqa: F401
Loading