06/05 Optimize app
This commit is contained in:
@@ -52,3 +52,25 @@ class TellerAccount(db.Model):
|
||||
|
||||
def __repr__(self):
|
||||
return f'<TellerAccount {self.account_name} → PFM #{self.pfm_account_id}>'
|
||||
|
||||
|
||||
class TellerSyncPreview(db.Model):
|
||||
"""
|
||||
Temporary server-side storage for sync preview data.
|
||||
Replaces cookie-based session storage which has a 4 KB limit —
|
||||
large accounts (100+ transactions) exceeded that limit and caused
|
||||
silent data loss on the confirm step.
|
||||
One row per teller_account_id; overwritten on each new sync preview.
|
||||
"""
|
||||
__tablename__ = 'teller_sync_previews'
|
||||
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
teller_account_id = db.Column(
|
||||
db.Integer, db.ForeignKey('teller_accounts.id'),
|
||||
nullable=False, unique=True, index=True,
|
||||
)
|
||||
data_json = db.Column(db.Text, nullable=False)
|
||||
created_at = db.Column(db.DateTime, default=datetime.utcnow)
|
||||
|
||||
def __repr__(self):
|
||||
return f'<TellerSyncPreview account_id={self.teller_account_id}>'
|
||||
|
||||
Reference in New Issue
Block a user