from dataclasses import dataclass, field from typing import List, Optional @dataclass class MerchantCategoryMail: """Domain entity representing a mail entry linked to one or more merchant categories. category_ids is the parsed form of the DB's comma-separated merchant_category_list column (e.g. "1,3,7" → [1, 3, 7]). """ id: int email: str category_ids: List[int] = field(default_factory=list) created_by: Optional[int] = None updated_by: Optional[int] = None @dataclass class MerchantCategoryMailSummary: """Slim view used when listing all entries (id + email only).""" id: int email: str