26 lines
681 B
Python
26 lines
681 B
Python
"""Shared base classes for the Meeting Assistant domain model."""
|
|
|
|
from datetime import UTC, datetime
|
|
from uuid import UUID, uuid4
|
|
|
|
from pydantic import BaseModel, ConfigDict, Field
|
|
|
|
|
|
def utc_now() -> datetime:
|
|
"""Return the current time as a timezone-aware UTC datetime."""
|
|
return datetime.now(UTC)
|
|
|
|
|
|
class DomainModel(BaseModel):
|
|
"""Base class for persistent domain entities."""
|
|
|
|
model_config = ConfigDict(
|
|
extra="forbid",
|
|
validate_assignment=True,
|
|
use_enum_values=False,
|
|
)
|
|
|
|
id: UUID = Field(default_factory=uuid4)
|
|
created_at: datetime = Field(default_factory=utc_now)
|
|
updated_at: datetime = Field(default_factory=utc_now)
|