예제 #1
0
class AccountActivity(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    account_id = db.Column(db.Integer,
                           db.ForeignKey('account.id'),
                           nullable=False)
    message = db.Column(db.String(256), nullable=False)
    date_time = db.Column(db.DateTime, default=datetime.datetime.utcnow)
예제 #2
0
class Account(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    customer_id = db.Column(db.Integer,
                            db.ForeignKey('customer.id'),
                            nullable=False)
    account_type = db.Column(db.String(20),
                             default=ACC_TYPE['S'],
                             nullable=False)
    balance = db.Column(db.Float(precision=2), default=0.0)
    status = db.Column(db.String(20), default=ACC_STATUS['A'])
예제 #3
0
class AccountActivity(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    account_id = db.Column(db.Integer, db.ForeignKey(
        'account.id'), nullable=False)
    message = db.Column(db.String(256), nullable=False)
    date_time = db.Column(db.DateTime, default=datetime.datetime.utcnow)

    def serialize(self):
        return {
            'id': self.id,
            'account_id': self.account_id,
            'message': self.message,
            'date_time': self.date_time,
        }
예제 #4
0
class CustomerActivity(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    customer_id = db.Column(db.Integer, db.ForeignKey(
        'customer.id'), nullable=False)
    message = db.Column(db.String(256), nullable=False)
    date_time = db.Column(db.DateTime, default=datetime.datetime.utcnow)

    def serialize(self):
        return {
            'id': self.id,
            'customer_id': self.customer_id,
            'message': self.message,
            'date_time': str(self.date_time),
        }
예제 #5
0
class Account(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    customer_id = db.Column(db.Integer, db.ForeignKey(
        'customer.id'), nullable=False)
    account_type = db.Column(
        db.String(20), default=ACC_TYPE['S'], nullable=False)
    balance = db.Column(db.Float(precision=2), default=0.0)
    status = db.Column(db.String(20), default=ACC_STATUS['A'])

    def serialize(self):
        return {'id': self.id,
                'customer_id': self.customer_id,
                'account_type': self.account_type,
                'balance': self.balance,
                'status': self.status
                }
예제 #6
0
class Transaction(db.Model):
    id = db.Column(db.Integer, primary_key=True)
    account_id = db.Column(db.Integer,
                           db.ForeignKey('account.id'),
                           nullable=False)
    src_account_type = db.Column(db.String(20), nullable=True)
    des_account_type = db.Column(db.String(20), nullable=True)
    amount = db.Column(db.Float(precision=2), default=0.0)
    operation = db.Column(db.String(20), nullable=False)
    balance = db.Column(db.Float(precision=2), default=0.0)

    def serialize(self):
        return {
            'id': self.id,
            'src_account_type': self.src_account_type,
            'des_account_type': self.des_account_type,
            'amount': self.amount,
            'operation': self.operation,
            'balance': self.balance
        }