Add source column for MemberEquityPayment

for cases where payments must be reconciled across systems

also wire up version importer for this model, whoops
This commit is contained in:
Lance Edgar 2023-09-07 17:40:15 -05:00
parent fa75b06915
commit 73aa4d4f2c
3 changed files with 38 additions and 0 deletions

View file

@ -0,0 +1,33 @@
# -*- coding: utf-8; -*-
"""add MemberEquityPayment.source
Revision ID: a7c2d5d84743
Revises: 310080aaa346
Create Date: 2023-09-07 17:33:19.223569
"""
# revision identifiers, used by Alembic.
revision = 'a7c2d5d84743'
down_revision = '310080aaa346'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
import rattail.db.types
def upgrade():
# member_equity_payment
op.add_column('member_equity_payment', sa.Column('source', sa.String(length=50), nullable=True))
op.add_column('member_equity_payment_version', sa.Column('source', sa.String(length=50), autoincrement=False, nullable=True))
def downgrade():
# member_equity_payment
op.drop_column('member_equity_payment_version', 'source')
op.drop_column('member_equity_payment', 'source')

View file

@ -300,6 +300,10 @@ class MemberEquityPayment(Base):
Text description for the payment.
""")
source = sa.Column(sa.String(length=50), nullable=True, doc="""
System in which the payment first appeared, if applicable.
""")
transaction_identifier = sa.Column(sa.String(length=100), nullable=True, doc="""
Human-friendly string identifying the POS transaction, if
applicable. This value is mostly for user reference and need not

View file

@ -75,6 +75,7 @@ class FromRattailToRattailVersions(FromRattailHandler, ToRattailHandler):
importers['MemberPhoneNumber'] = MemberPhoneNumberImporter
importers['MemberEmailAddress'] = MemberEmailAddressImporter
importers['MemberMailingAddress'] = MemberMailingAddressImporter
importers['MemberEquityPayment'] = MemberEquityPaymentImporter
importers['Employee'] = EmployeeImporter
importers['EmployeePhoneNumber'] = EmployeePhoneNumberImporter
importers['EmployeeEmailAddress'] = EmployeeEmailAddressImporter