26 lines
916 B
Python
26 lines
916 B
Python
"""Financial statement model (재무제표)."""
|
|
from sqlalchemy import Column, String, Numeric, Date
|
|
from sqlalchemy.dialects.postgresql import UUID
|
|
import uuid
|
|
|
|
try:
|
|
from app.database import Base
|
|
except ModuleNotFoundError:
|
|
from backend.app.database import Base
|
|
|
|
|
|
class FinancialStatement(Base):
|
|
"""Financial statement model (kor_fs → financial_statements)."""
|
|
|
|
__tablename__ = "financial_statements"
|
|
|
|
id = Column(UUID(as_uuid=True), primary_key=True, default=uuid.uuid4)
|
|
ticker = Column(String(20), nullable=False, index=True)
|
|
account = Column(String(100), nullable=False) # 계정 과목
|
|
base_date = Column(Date, nullable=False, index=True)
|
|
value = Column(Numeric(20, 2))
|
|
disclosure_type = Column(String(1)) # Y(연간), Q(분기)
|
|
|
|
def __repr__(self):
|
|
return f"<FinancialStatement(ticker={self.ticker}, account={self.account}, base_date={self.base_date})>"
|