Initial commit: AutonetSellCar platform with deployment system
- Frontend: Next.js 14 with TypeScript - Backend: FastAPI with SQLAlchemy - Agent: Carmodoo sync agent - Deployment: Docker Compose based staging/production setup - Scripts: Automated deployment with rollback support 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
46
backend/app/models/exchange_rate.py
Normal file
46
backend/app/models/exchange_rate.py
Normal file
@@ -0,0 +1,46 @@
|
||||
"""
|
||||
Exchange Rate Model - 환율 정보 저장
|
||||
"""
|
||||
from sqlalchemy import Column, Integer, String, Float, DateTime, Boolean
|
||||
from sqlalchemy.sql import func
|
||||
from ..database import Base
|
||||
|
||||
|
||||
class ExchangeRate(Base):
|
||||
"""환율 정보 테이블"""
|
||||
__tablename__ = "exchange_rates"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
|
||||
# 통화 정보
|
||||
currency_code = Column(String(10), unique=True, index=True) # USD, MNT, RUB, CNY
|
||||
currency_name = Column(String(100)) # 미국 달러, 몽골 투그릭 등
|
||||
|
||||
# 환율 정보 (한국수출입은행 기준)
|
||||
deal_base_rate = Column(Float) # 매매기준율 (1 USD = X KRW)
|
||||
ttb_rate = Column(Float) # 전신환(송금) 받을때
|
||||
tts_rate = Column(Float) # 전신환(송금) 보낼때
|
||||
|
||||
# 가중치 적용 환율
|
||||
weight_percent = Column(Float, default=0.0) # 관리자 설정 가중치 (%)
|
||||
adjusted_rate = Column(Float) # 가중치 적용된 환율
|
||||
|
||||
# 메타 정보
|
||||
source_date = Column(String(20)) # 수출입은행 기준일 (예: 20241223)
|
||||
is_active = Column(Boolean, default=True)
|
||||
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
updated_at = Column(DateTime(timezone=True), server_default=func.now(), onupdate=func.now())
|
||||
|
||||
|
||||
class ExchangeRateHistory(Base):
|
||||
"""환율 변동 이력 테이블"""
|
||||
__tablename__ = "exchange_rate_history"
|
||||
|
||||
id = Column(Integer, primary_key=True, index=True)
|
||||
|
||||
currency_code = Column(String(10), index=True)
|
||||
deal_base_rate = Column(Float)
|
||||
source_date = Column(String(20))
|
||||
|
||||
created_at = Column(DateTime(timezone=True), server_default=func.now())
|
||||
Reference in New Issue
Block a user