from datetime import datetime, timezone

from tortoise import fields
from tortoise.models import Model


class BaseModel(Model):
    id = fields.BigIntField(pk=True)
    created_at = fields.DatetimeField(default=lambda: datetime.now(timezone.utc))
    updated_at = fields.DatetimeField(auto_now=True)

    class Meta:
        abstract = True
