Skip to content

Lost & found deck state machine #260

@jbourdin

Description

@jbourdin

Feature ID: F4.17

Summary

Add a secondary state machine for deck loss/recovery tracking, with three transitions:

  1. Mark as lost — owner (or staff for delegated decks) declares a deck missing
  2. Mark as found — anyone reports the deck has been located (extends F4.16)
  3. Mark as recovered — owner confirms physical recovery, returning to normal state

Behavior

  • New lostStatus field on Deck (or Borrow): nulllostfoundrecovered (or back to null)
  • When a deck is marked as lost:
    • Visual indicator on the deck card and detail page
    • Active borrows are flagged (the deck may have been lost while lent)
    • Notification to relevant parties depending on borrow state
  • When found: notification routed to the right person:
    • No active borrow → notify owner
    • Active borrow → notify borrower + owner
    • Delegated to staff → notify staff + owner
  • When recovered: state resets, normal workflow resumes

Notification routing matrix

Deck state Lost by Found notification to Recovered notification to
Available (no borrow) Owner Owner Owner
Lent (active borrow) Borrower Borrower + Owner Owner
Delegated to staff Staff Staff + Owner Owner

Acceptance Criteria

  • Lost/found/recovered state transitions with Symfony Workflow
  • "Mark as lost" action for owner and staff
  • "Mark as found" integrates with existing F4.16 found report flow
  • "Mark as recovered" action for owner
  • Notifications routed to the correct person(s) based on borrow state
  • Visual indicators on deck cards and detail pages
  • State history tracked (who, when, optional message)
  • Translations for both en and fr

Notes

Builds on top of F4.16 (found deck notification). The current F4.16 implementation is notification-only with no state change — this feature adds the state machine layer.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions