Skip to content

Commit d089572

Browse files
committed
Adding in extra fields
1 parent 666d77c commit d089572

File tree

3 files changed

+35
-2
lines changed

3 files changed

+35
-2
lines changed

pay-api/migrations/versions/2025_03_12_48f199450139_.py

+17-1
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,25 @@ def upgrade():
2424
with op.batch_alter_table('eft_refunds', schema=None) as batch_op:
2525
batch_op.add_column(sa.Column('refund_method', sa.String(length=25), nullable=True))
2626
batch_op.add_column(sa.Column('cheque_status', sa.String(length=25), nullable=True))
27+
batch_op.add_column(sa.Column('entity_name', sa.String(), nullable=True))
28+
batch_op.add_column(sa.Column('street', sa.String(), nullable=True))
29+
batch_op.add_column(sa.Column('street_additional', sa.String(), nullable=True))
30+
batch_op.add_column(sa.Column('city', sa.String(), nullable=True))
31+
batch_op.add_column(sa.Column('region', sa.String(), nullable=True))
32+
batch_op.add_column(sa.Column('postal_code', sa.String(), nullable=True))
33+
batch_op.add_column(sa.Column('country', sa.String(), nullable=True))
34+
batch_op.add_column(sa.Column('delivery_instructions', sa.String(), nullable=True))
2735

2836

2937
def downgrade():
3038
with op.batch_alter_table('eft_refunds', schema=None) as batch_op:
3139
batch_op.drop_column('refund_method')
32-
batch_op.drop_column('cheque_Status')
40+
batch_op.drop_column('cheque_status')
41+
batch_op.drop_column('delivery_instructions')
42+
batch_op.drop_column('country')
43+
batch_op.drop_column('postal_code')
44+
batch_op.drop_column('region')
45+
batch_op.drop_column('city')
46+
batch_op.drop_column('street_additional')
47+
batch_op.drop_column('street')
48+
batch_op.drop_column('entity_name')

pay-api/src/pay_api/models/eft_refund.py

+9
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ class EFTRefund(Audit):
7878
short_name_id = db.Column(db.Integer, ForeignKey("eft_short_names.id"), nullable=False)
7979
status = db.Column(db.String(25), nullable=True)
8080

81+
entity_name = db.Column(db.String(), nullable=True)
82+
street = db.Column(db.String(), nullable=True)
83+
street_additional = db.Column(db.String(), nullable=True)
84+
city = db.Column(db.String(), nullable=True)
85+
region = db.Column(db.String(), nullable=True)
86+
postal_code = db.Column(db.String(), nullable=True)
87+
country = db.Column(db.String(), nullable=True)
88+
delivery_instructions = db.Column(db.String(), nullable=True)
89+
8190
@classmethod
8291
def find_refunds(cls, statuses: List[str], short_name_id: int = None):
8392
"""Return all refunds by status."""

pay-api/src/pay_api/models/eft_short_names.py

+9-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,15 @@ def from_row(cls, row: EFTShortnames):
119119
statement_id=getattr(row, "latest_statement_id", None),
120120
status_code=getattr(row, "status_code", None),
121121
cfs_account_status=getattr(row, "cfs_account_status", None),
122-
refund_method=getattr(row, "refund_method", None)
122+
refund_method=getattr(row, "refund_method", None),
123+
entity_name=getattr(row, "entity_name", None),
124+
street=getattr(row, "street", None),
125+
street_additional=getattr(row, "street_additional", None),
126+
city=getattr(row, "city", None),
127+
region=getattr(row, "region", None),
128+
postal_code=getattr(row, "postal_code", None),
129+
country=getattr(row, "country", None),
130+
delivery_instructions=getattr(row, "delivery_instructions", None)
123131
)
124132

125133

0 commit comments

Comments
 (0)