python_cqrs_core.base_command

Base command with tracing and audit fields.

Classes

BaseCommand

Base command with tracing and audit fields.

Module Contents

class python_cqrs_core.base_command.BaseCommand

Bases: pydantic.BaseModel, python_cqrs_core.command.ICommand

Base command with tracing and audit fields.

Provides common fields for observability and audit trail. All commands should extend this class.

Example:
>>> class CreateUserCommand(BaseCommand):
...     name: str
...     email: str
>>>
>>> cmd = CreateUserCommand(
...     name="John",
...     email="john@example.com",
...     requested_by="admin"
... )
request_id: uuid.UUID
correlation_id: uuid.UUID | None
requested_by: str | None
requested_at: datetime.datetime
model_config