

class BaseModelCore(BaseModel):

    """
    BaseModelCore
    model_dump override for alias support Users.name -> Table[Users] Field(alias="name")
    """
    __abstract__ = True
    
    class Config:
        validate_by_name = True
        use_enum_values = True
    
    def model_dump(self, *args, **kwargs):
        data = super().model_dump(*args, **kwargs)
        return {self.__class__.model_fields[field].alias: value for field, value in data.items()}
