Skip to content

Commit

Permalink
feat: remove COMPLIANCE_REPORT document type
Browse files Browse the repository at this point in the history
  • Loading branch information
yolile committed Nov 28, 2023
1 parent ee81931 commit 6fdfbe9
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 2 deletions.
1 change: 0 additions & 1 deletion app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ class BorrowerDocumentType(Enum):
BANK_CERTIFICATION_DOCUMENT = "BANK_CERTIFICATION_DOCUMENT"
FINANCIAL_STATEMENT = "FINANCIAL_STATEMENT"
SIGNED_CONTRACT = "SIGNED_CONTRACT"
COMPLIANCE_REPORT = "COMPLIANCE_REPORT"
SHAREHOLDER_COMPOSITION = "SHAREHOLDER_COMPOSITION"
CHAMBER_OF_COMMERCE = "CHAMBER_OF_COMMERCE"
THREE_LAST_BANK_STATEMENT = "THREE_LAST_BANK_STATEMENT"
Expand Down
37 changes: 37 additions & 0 deletions migrations/versions/c919c4501192_remove_compliance_doc_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
"""remove compliance doc type
Revision ID: c919c4501192
Revises: f9f53b0fd892
Create Date: 2023-11-28 16:31:35.726353
"""
from alembic import op


# revision identifiers, used by Alembic.
revision = "c919c4501192"
down_revision = "f9f53b0fd892"
branch_labels = None
depends_on = None


def upgrade() -> None:
op.execute(
"""create type borrower_document_type_tmp as enum ('INCORPORATION_DOCUMENT', 'SUPPLIER_REGISTRATION_DOCUMENT',
'BANK_NAME', 'BANK_CERTIFICATION_DOCUMENT', 'FINANCIAL_STATEMENT', 'SIGNED_CONTRACT',
'SHAREHOLDER_COMPOSITION', 'CHAMBER_OF_COMMERCE', 'THREE_LAST_BANK_STATEMENT');"""
)
op.execute("""DELETE from borrower_document where type = 'COMPLIANCE_REPORT'""")

op.execute(
"""ALTER TABLE borrower_document ALTER COLUMN type TYPE borrower_document_type_tmp
USING (type::text::borrower_document_type_tmp);"""
)

op.execute("""DROP TYPE borrower_document_type""")

op.execute("""ALTER TYPE borrower_document_type_tmp RENAME TO borrower_document_type;""")


def downgrade() -> None:
pass
1 change: 0 additions & 1 deletion reportlab_mods.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
BorrowerDocumentType.BANK_CERTIFICATION_DOCUMENT: "Bank Certification Document",
BorrowerDocumentType.FINANCIAL_STATEMENT: "Financial Statement",
BorrowerDocumentType.SIGNED_CONTRACT: "Signed Contract",
BorrowerDocumentType.COMPLIANCE_REPORT: "Compliance Report",
BorrowerDocumentType.SHAREHOLDER_COMPOSITION: "Shareholder composition",
BorrowerDocumentType.CHAMBER_OF_COMMERCE: "Chamber of Commerce",
BorrowerDocumentType.THREE_LAST_BANK_STATEMENT: "Three last bank statement",
Expand Down

0 comments on commit 6fdfbe9

Please sign in to comment.