"""Events emitted by the Example aggregate."""

from datetime import datetime
from typing import Annotated

from pydantic import Field

from {{ package_name }}.domain import {{ domain_name }}


@{{ domain_name }}.event(part_of="Example")
class ExampleCreated:
    """Event emitted when an Example is created."""

    example_id: str
    name: Annotated[str, Field(max_length=100)]
    description: Annotated[str, Field(max_length=500)] | None = None
    created_at: datetime


@{{ domain_name }}.event(part_of="Example")
class ExampleActivated:
    """Event emitted when an Example is activated."""

    example_id: str
    activated_at: datetime = Field(default_factory=datetime.now)


@{{ domain_name }}.event(part_of="Example")
class ExampleArchived:
    """Event emitted when an Example is archived."""

    example_id: str
    archived_at: datetime = Field(default_factory=datetime.now)
