feat: add list_bounties and list_all_bounties methods to storage adapter #57

Merged
shoko merged 1 commits from fix/issue-42 into main 2026-04-04 07:17:08 +02:00
Owner

Summary

Add filtering methods to JsonFileRoomStorage for Phase 2 soft delete support:

  • list_bounties(room_id): returns only non-deleted bounties for normal queries
  • list_all_bounties(room_id, include_deleted=True): returns all bounties for /recover functionality

Changes

JsonFileRoomStorage

  • Add list_bounties(room_id) method - filters out soft-deleted bounties (where deleted_at is not None)
  • Add list_all_bounties(room_id, include_deleted=True) method - returns all bounties or only non-deleted based on flag

core/ports.py

  • Update RoomStorage protocol to include the new list_bounties and list_all_bounties methods

tests/test_ports.py

  • Update SimpleRoomStorage and MockRoomStorage mock classes to implement the new methods

Dependencies

  • Requires #43 (service layer) to use these new methods for filtering

Fixes #42

## Summary Add filtering methods to `JsonFileRoomStorage` for Phase 2 soft delete support: - `list_bounties(room_id)`: returns only non-deleted bounties for normal queries - `list_all_bounties(room_id, include_deleted=True)`: returns all bounties for /recover functionality ## Changes ### JsonFileRoomStorage - Add `list_bounties(room_id)` method - filters out soft-deleted bounties (where `deleted_at` is not None) - Add `list_all_bounties(room_id, include_deleted=True)` method - returns all bounties or only non-deleted based on flag ### core/ports.py - Update `RoomStorage` protocol to include the new `list_bounties` and `list_all_bounties` methods ### tests/test_ports.py - Update `SimpleRoomStorage` and `MockRoomStorage` mock classes to implement the new methods ## Dependencies - Requires #43 (service layer) to use these new methods for filtering Fixes #42
shoko added 1 commit 2026-04-04 07:12:35 +02:00
Add filtering methods to JsonFileRoomStorage for Phase 2 soft delete support:
- list_bounties(room_id): returns only non-deleted bounties for normal queries
- list_all_bounties(room_id, include_deleted=True): returns all bounties for /recover

Update RoomStorage protocol to include the new methods.
Update mock classes in tests to pass isinstance checks.

Fixes #42
han approved these changes 2026-04-04 07:16:36 +02:00
han left a comment
Collaborator

lgtm

lgtm
shoko merged commit 0a64b4f310 into main 2026-04-04 07:17:08 +02:00
Sign in to join this conversation.
No Reviewers
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: shoko/jigaido#57