| 26 | |
| 27 | @dataclass |
| 28 | class Category: |
| 29 | name: str |
| 30 | subcategory: Optional[str] = None |
| 31 | |
| 32 | def __str__(self): |
| 33 | if self.subcategory is None: |
| 34 | return f"{self.name}-NoSubcategory" |
| 35 | else: |
| 36 | return f"{self.name}-{self.subcategory}" |
| 37 | |
| 38 | def __eq__(self, other): |
| 39 | return self.name == other.name and self.subcategory == other.subcategory |
| 40 | |
| 41 | def is_same_category_name(self, other): |
| 42 | return self.name == other.name |
| 43 | |
| 44 | |
| 45 | @dataclass |
no outgoing calls