feat: add DomainEvent base class and 5 domain event types
This commit is contained in:
36
domain/marketplace/domain_event.py
Normal file
36
domain/marketplace/domain_event.py
Normal file
@@ -0,0 +1,36 @@
|
||||
from dataclasses import dataclass
|
||||
from decimal import Decimal
|
||||
from uuid import UUID
|
||||
|
||||
|
||||
class DomainEvent:
|
||||
pass
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ClassifiedAdCreated(DomainEvent):
|
||||
id: UUID
|
||||
owner_id: UUID
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ClassifiedAdTitleChanged(DomainEvent):
|
||||
id: UUID
|
||||
title: str
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ClassifiedAdTextUpdated(DomainEvent):
|
||||
id: UUID
|
||||
ad_text: str
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ClassifiedAdPriceUpdated(DomainEvent):
|
||||
id: UUID
|
||||
price: Decimal
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class ClassifiedAdSentForReview(DomainEvent):
|
||||
id: UUID
|
||||
Reference in New Issue
Block a user