[fix]: Missing Transaction ID
This commit was merged in pull request #11.
This commit is contained in:
@@ -53,14 +53,14 @@ class LoanCharge(db.Model):
|
||||
amount = (percent / 100.0) * referenced_amount
|
||||
|
||||
charge_obj = cls(
|
||||
loan_id=loan_id,
|
||||
transaction_id=charge.get("transaction_id"),
|
||||
code=charge.get("code"),
|
||||
amount=amount,
|
||||
percent=percent,
|
||||
description=charge.get("description", ""),
|
||||
due=due_days,
|
||||
due_date=now + timedelta(days=due_days)
|
||||
loan_id = loan_id,
|
||||
transaction_id = transaction_id,
|
||||
code = charge.get("code"),
|
||||
amount = amount,
|
||||
percent = percent,
|
||||
description = charge.get("description", ""),
|
||||
due = due_days,
|
||||
due_date = now + timedelta(days=due_days)
|
||||
)
|
||||
|
||||
db.session.add(charge_obj)
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
"""Migration on Thu Apr 17 10:40:05 UTC 2025
|
||||
|
||||
Revision ID: ec8d97f9b584
|
||||
Revises: 287ecb02d3d7
|
||||
Create Date: 2025-04-17 10:40:34.751272
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = 'ec8d97f9b584'
|
||||
down_revision = '287ecb02d3d7'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('loan_charges', schema=None) as batch_op:
|
||||
batch_op.add_column(sa.Column('transaction_id', sa.String(length=50), nullable=True))
|
||||
batch_op.add_column(sa.Column('due_date', sa.DateTime(), nullable=True))
|
||||
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
with op.batch_alter_table('loan_charges', schema=None) as batch_op:
|
||||
batch_op.drop_column('due_date')
|
||||
batch_op.drop_column('transaction_id')
|
||||
|
||||
# ### end Alembic commands ###
|
||||
Reference in New Issue
Block a user