feat: Category Feature - Models & Storage (#85) #89

Closed
shoko wants to merge 0 commits from feature/category-models-storage into main
Owner

Summary

Add Category dataclass and update storage layer for category support.

Changes

Models (core/models.py)

  • Added dataclass with fields: uid=1000(shoko) gid=1000(shoko) groups=1000(shoko),10(wheel), , ,
  • Added field to dataclass
  • Added field to dataclass

Storage (adapters/storage/json_file.py)

  • Updated to deserialize categories and bounty.category_ids
  • Updated to serialize categories and bounty.category_ids

Backward Compatibility

Existing data without categories works fine - new fields have default empty values.

Testing

All 96 existing tests pass.

Closes #85

## Summary Add Category dataclass and update storage layer for category support. ## Changes ### Models (core/models.py) - Added dataclass with fields: uid=1000(shoko) gid=1000(shoko) groups=1000(shoko),10(wheel), , , - Added field to dataclass - Added field to dataclass ### Storage (adapters/storage/json_file.py) - Updated to deserialize categories and bounty.category_ids - Updated to serialize categories and bounty.category_ids ## Backward Compatibility Existing data without categories works fine - new fields have default empty values. ## Testing All 96 existing tests pass. ## Related Issues Closes #85
shoko added 1 commit 2026-04-09 12:23:46 +02:00
Models & Storage layer for category feature (Issue #85):

- Add Category dataclass to core/models.py
  - id (slug): lowercase alphabetic only
  - name: display name
  - created_at: Unix timestamp
  - deleted_at: soft delete timestamp (None if active)

- Add category_ids field to Bounty dataclass
  - list[str] for multiple categories per bounty
  - Default empty list for backward compatibility

- Add categories field to RoomData dataclass
  - list[Category] for room-level categories
  - Default empty list

- Update JsonFileRoomStorage to serialize/deserialize:
  - Category fields (id, name, created_at, deleted_at)
  - Bounty.category_ids
  - RoomData.categories

Backward compatible: existing data without categories works fine.
shoko closed this pull request 2026-04-09 12:30:11 +02:00

Pull request closed

Sign in to join this conversation.