feat(api): add ItemRarity enum to item system

- Add ItemRarity enum with 5 tiers (common, uncommon, rare, epic, legendary)
- Add rarity field to Item dataclass with COMMON default
- Update Item serialization (to_dict/from_dict) for rarity
- Export ItemRarity from models package
- Add 24 comprehensive unit tests for Item and ItemRarity

Part of Phase 4 Week 2: Inventory & Equipment System (Task 2.1)
This commit is contained in:
2025-11-26 16:14:29 -06:00
parent 03ab783eeb
commit f3ac0c8647
4 changed files with 407 additions and 3 deletions

View File

@@ -40,6 +40,16 @@ class ItemType(Enum):
QUEST_ITEM = "quest_item" # Story-related, non-tradeable
class ItemRarity(Enum):
"""Item rarity tiers affecting drop rates, value, and visual styling."""
COMMON = "common" # White/gray - basic items
UNCOMMON = "uncommon" # Green - slightly better
RARE = "rare" # Blue - noticeably better
EPIC = "epic" # Purple - powerful items
LEGENDARY = "legendary" # Orange/gold - best items
class StatType(Enum):
"""Character attribute types."""