This folder contains architecture documentation for AI assistants working on this codebase.
| File | Description |
|---|---|
| architecture/ARCHITECTURE.md | System architecture overview |
| architecture/DDD_PATTERNS.md | DDD patterns with code examples |
| architecture/FOLDER_STRUCTURE.md | Project folder structure guide |
| architecture/CODING_STANDARDS.md | Naming conventions and standards |
- Identify the Bounded Context - Does it belong to
client_bcorreservation_bc? - Create Value Objects - Use
@dataclass(frozen=True)with validation in__post_init__ - Create Entity - Use
@dataclasswithcreate()andreconstitute()factory methods - Create Domain Events - Use
@dataclass(frozen=True)withfrom_entity()method - Create Repository Interface - ABC in
domain/interfaces/ - Create Command/Query - Dataclass + Handler in
application/ - Create DTO - Dataclass with
from_entity()inapplication/dtos/ - Create SQLAlchemy Model - In
infrastructure/models/ - Create Repository Implementation - In
infrastructure/repositories/ - Create HTTP Layer - Schema, Controller, Router in
adapters/http/api/
# Value Object
@dataclass(frozen=True)
class BookingId:
value: str
def __post_init__(self): ...
@classmethod
def generate(cls): ...
# Entity
@dataclass
class Booking(BaseEntity):
@classmethod
def create(cls, ...): ... # Records events
@classmethod
def reconstitute(cls, ...): ... # No events
# Repository Interface
class BookingRepositoryInterface(ABC):
@abstractmethod
def save(self, booking: Booking) -> None: ...
# Command + Handler
@dataclass(frozen=True)
class CreateBookingCommand:
id: str
...
class CreateBookingHandler:
def handle(self, command: CreateBookingCommand) -> BookingDto: ...