feat: add multi-ID delete support with per-ID results #63

Merged
shoko merged 1 commits from fix/issue-47 into main 2026-04-04 08:54:56 +02:00
Owner

Summary

Implements multi-ID delete support for issue #47:

  • Multi-ID support: /delete 1 2 3 deletes multiple bounties at once
  • Per-ID results: Shows success/failure for each ID
  • Admin-only: Already enforced via existing service layer
  • Soft delete: Already implemented via deleted_at timestamp

Changes

core/services.py

  • Add delete_bounties() method that returns individual results per ID:
    • "deleted" - successfully soft-deleted
    • "not_found" - bounty does not exist
    • "permission_denied" - user is not admin

apps/telegram-bot/commands.py

  • Update cmd_delete() to accept multiple IDs
  • Show per-ID success/failure messages:
    ✅ Bounty #1 deleted.
    ✅ Bounty #2 deleted.
    ⛔ Bounty #3 not found.
    

tests/test_services.py

  • Add 3 tests for delete_bounties() method

Fixes #47

## Summary Implements multi-ID delete support for issue #47: - **Multi-ID support**: `/delete 1 2 3` deletes multiple bounties at once - **Per-ID results**: Shows success/failure for each ID - **Admin-only**: Already enforced via existing service layer - **Soft delete**: Already implemented via `deleted_at` timestamp ## Changes ### core/services.py - Add `delete_bounties()` method that returns individual results per ID: - `"deleted"` - successfully soft-deleted - `"not_found"` - bounty does not exist - `"permission_denied"` - user is not admin ### apps/telegram-bot/commands.py - Update `cmd_delete()` to accept multiple IDs - Show per-ID success/failure messages: ``` ✅ Bounty #1 deleted. ✅ Bounty #2 deleted. ⛔ Bounty #3 not found. ``` ### tests/test_services.py - Add 3 tests for `delete_bounties()` method Fixes #47
shoko added 1 commit 2026-04-04 08:39:25 +02:00
- Add delete_bounties method to BountyService that returns individual
  results per bounty ID (deleted, not_found, permission_denied)
- Update cmd_delete to accept multiple IDs and show per-ID messages
- Add tests for delete_bounties

Example output:
/delete 1 2 3
 Bounty #1 deleted.
 Bounty #2 deleted.
 Bounty #3 not found.

Fixes #47
shoko merged commit bd2627efe9 into main 2026-04-04 08:54:56 +02:00
Sign in to join this conversation.