850 B
850 B
Plan: ClassifiedAd Domain Entity
Status: COMPLETED
Objective
Create the first Domain Entity representing a ClassifiedAd with the specified attributes.
Decisions Made
- Location:
domain/marketplace/classified_ad.py - Class style:
@dataclass(frozen=True)for immutability - Validation: No validation, just hold data
- Tests: Yes, create unit tests
Entity Structure
@dataclass(frozen=True)
class ClassifiedAd:
id: UUID
_ownerId: UUID
title: str
text: str
_price: Decimal
Files Created
domain/__init__.pydomain/marketplace/__init__.pydomain/marketplace/classified_ad.pytests/test_classified_ad.pypyproject.toml
Test Results
test_classified_ad_creation- PASSEDtest_classified_ad_is_immutable- PASSEDtest_classified_ad_equality- PASSED