05/31 Phase 1: initial codes

This commit is contained in:
2026-05-31 10:03:28 -04:00
parent b0a5ce5399
commit b0c0bd363b
35 changed files with 2871 additions and 164 deletions
+15
View File
@@ -0,0 +1,15 @@
from app.extensions import db
from datetime import datetime
class FxRate(db.Model):
__tablename__ = 'fx_rates'
id = db.Column(db.Integer, primary_key=True)
date = db.Column(db.Date, nullable=False, unique=True, index=True)
usd_to_vnd = db.Column(db.Numeric(12, 2), nullable=False)
source = db.Column(db.String(50), nullable=True) # 'exchangerate-api' | 'vcb' | 'manual'
fetched_at = db.Column(db.DateTime, default=datetime.utcnow)
def __repr__(self):
return f'<FxRate {self.date} 1USD={self.usd_to_vnd}VND>'