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

Dev #5

Open
wants to merge 22 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
ae4d5d3
feat: create project base
gabrielsoaresm94 May 30, 2023
2a4a9e8
refactor: changes code to fit an architecture of modules in intentions
gabrielsoaresm94 May 31, 2023
052771c
feat: adds new architecture in modules
gabrielsoaresm94 Jun 2, 2023
ba576d0
refactor: add own image for bank service
gabrielsoaresm94 Jun 2, 2023
2c09e3e
fix: return to postgres image
gabrielsoaresm94 Jun 2, 2023
611ce4f
feat: add models and migrations
gabrielsoaresm94 Jun 3, 2023
1733778
feat: add new modules
gabrielsoaresm94 Jun 3, 2023
1c69389
refactor: allocate models in their correct modules and change the fir…
gabrielsoaresm94 Jun 3, 2023
be6d09f
feat: add new documentation for intentions service
gabrielsoaresm94 Jun 4, 2023
cefc044
feat: add repositories and services for modules in intentions service
gabrielsoaresm94 Jun 4, 2023
86e3cf3
refactor: change server.ts to app.ts in products service
gabrielsoaresm94 Jun 4, 2023
1bea607
feat(products): add new architecture for service
gabrielsoaresm94 Jun 4, 2023
69aaeda
fix(products): put providers in the correct folders
gabrielsoaresm94 Jun 4, 2023
65ad8ac
feat(products): add proxy provider and product listing
gabrielsoaresm94 Jun 5, 2023
15c996a
feat(products): add endpoint for find product
gabrielsoaresm94 Jun 5, 2023
d18625d
feat(intentions): try to run migrations when build the service
gabrielsoaresm94 Jun 5, 2023
2479220
feat(intentions): finalize client creation
gabrielsoaresm94 Jun 6, 2023
97e7bf6
feat(intentions): save intentions on database
gabrielsoaresm94 Jun 6, 2023
68b23cd
refactor(intentions): remove update controller for address
gabrielsoaresm94 Jun 6, 2023
e1c3155
feat(products): add intentions service
gabrielsoaresm94 Jun 6, 2023
a3e8928
feat(intentions): add last endpints to save products
gabrielsoaresm94 Jun 7, 2023
9f0ca67
feat: finish project
gabrielsoaresm94 Jun 7, 2023
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
Prev Previous commit
Next Next commit
refactor: allocate models in their correct modules and change the fir…
…st migration
gabrielsoaresm94 committed Jun 3, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 1c693890b95955ffb9803c8a0744566466a1c1c6
8 changes: 4 additions & 4 deletions intentions/src/app.py
Original file line number Diff line number Diff line change
@@ -11,10 +11,10 @@
from modules.clients.controllers import ns as clients_ns
from modules.adresses.controllers import ns as adresses_ns

from modules.intentions.infra.sqlalchemy.client import Client
from modules.intentions.infra.sqlalchemy.address import Address
from modules.intentions.infra.sqlalchemy.intention import Intention
from modules.intentions.infra.sqlalchemy.intention_product import IntentionProduct
from modules.clients.infra.sqlalchemy.entities.client import Client
from modules.adresses.infra.sqlalchemy.entities.address import Address
from modules.intentions.infra.sqlalchemy.entities.intention import Intention
from modules.intentions.infra.sqlalchemy.entities.intention_product import IntentionProduct

db_user = os.getenv("CHALLENGE_INTENTION_DB_USER")
db_password = os.getenv("CHALLENGE_INTENTION_DB_PASSWORD")
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
"""initial_migration

Revision ID: 223912e820bb
Revision ID: 3b45062f279c
Revises:
Create Date: 2023-06-03 16:38:19.036914
Create Date: 2023-06-03 23:18:23.924290

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '223912e820bb'
revision = '3b45062f279c'
down_revision = None
branch_labels = None
depends_on = None
@@ -42,6 +42,7 @@ def upgrade():
)
op.create_table('intention',
sa.Column('intention_id', sa.Integer(), nullable=False),
sa.Column('status', sa.Enum('EM_SELECAO', 'SELECIONADO', name='intentionstatusenum'), nullable=False),
sa.Column('client_id', sa.Integer(), nullable=False),
sa.Column('address_id', sa.Integer(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=True),
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import enum
from datetime import datetime
from shared.infra.db.sqlalchemy import sqlalchemy as db

class IntentionStatusEnum(enum.Enum):
EM_SELECAO = 'em_selecao'
SELECIONADO = 'selecionado'

class Intention(db.Model):
intention_id = db.Column(db.Integer, primary_key=True)
status = db.Column(db.Enum(IntentionStatusEnum), default=IntentionStatusEnum.EM_SELECAO, nullable=False)
client_id = db.Column(db.Integer, db.ForeignKey('client.client_id'), nullable=False)
address_id = db.Column(db.Integer, db.ForeignKey('address.address_id'), nullable=False)
created_at = db.Column(db.DateTime, default=datetime.utcnow)