from tortoise import fields

from .base import BaseModel, TimestampMixin
from .enums import  ESGType

# ESG关联价值对应表
class ESG(BaseModel, TimestampMixin):
    code = fields.CharField(max_length=20, unique=True, description="行业代码", index=True)
    name = fields.CharField(max_length=20, description="行业名称")
    level = fields.CharEnumField(ESGType, description="ESG价值等级", index=True)
    number = fields.IntField(default=0, description="ESG基准分")
    remark = fields.TextField(default="简要说明（ESG视角）")

    class Meta:
        table = "esg"