from app.extensions import db

class RawTransaction(db.Model):
    __tablename__ = 'analytics_raw_transactions'

    id = db.Column(db.Integer, primary_key=True)
    cust_id = db.Column(db.String(10))
    accountid = db.Column(db.String(10))
    tran_id = db.Column(db.String(12))
    entry_date = db.Column(db.TIMESTAMP, nullable=True)
    value_date = db.Column(db.TIMESTAMP, nullable=True)
    pstd_date = db.Column(db.TIMESTAMP, nullable=True)
    tran_date = db.Column(db.TIMESTAMP, nullable=True)
    tran_sub_ty = db.Column(db.String(4))
    part_tran_ty = db.Column(db.String(4))
    channel = db.Column(db.String(32))
    tran_amt = db.Column(db.Numeric(20, 2))
    balance = db.Column(db.Numeric(20, 2))
    isreverse = db.Column(db.String(4))
    reverse = db.Column(db.String(4))
    tran_particular = db.Column(db.String(100))

    def __repr__(self):
        return f'<RawTransaction {self.tran_id}>' 