feat: add FastAPI, Entity base class, and health check endpoint

This commit is contained in:
2026-07-29 10:38:16 -04:00
parent 2cb5045836
commit 5bb6cedd03
7 changed files with 123 additions and 23 deletions

View File

@@ -0,0 +1,18 @@
from abc import ABC
from dataclasses import replace
from typing import Self
from domain.marketplace.domain_event import DomainEvent
class Entity(ABC):
_events: tuple[DomainEvent, ...] = ()
def raise_event(self, event: DomainEvent) -> Self:
return replace(self, _events=(*self._events, event))
def get_changes(self) -> tuple[DomainEvent, ...]:
return self._events
def clear_changes(self) -> Self:
return replace(self, _events=())