https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42383

--- Comment #25 from Tomás Cohen Arazi (tcohen) <[email protected]> ---
Created attachment 209558
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=209558&action=edit
Bug 42383: Add Koha::Checkin->confirm_recall

This patch adds a confirm_recall() domain method to Koha::Checkin
that resolves the recall associated with the checkin:

- If the recall's pickup library matches the checkin library, sets the
  recall to waiting with a calculated expiration date.
- If the pickup library differs, starts a transfer (sets status to
  in_transit).

The method is idempotent — calling it on an already-resolved recall
is a no-op.

Throws Koha::Exceptions::MissingParameter if the checkin has no
recall_id.

Test plan:
1. Apply patch
2. Run:
   $ ktd --shell
   k$ prove t/db_dependent/Koha/Checkin.t
=> SUCCESS: Tests pass
3. Tests cover:
   - confirm_recall at same library (set to waiting + expiration date)
   - confirm_recall at different library (set to in_transit)
   - Idempotent on already in-transit recall
   - confirm_recall without recall_id (throws MissingParameter)
4. Sign off :-D

Signed-off-by: Tomás Cohen Arazi <[email protected]>
Signed-off-by: Brendan Lawlor <[email protected]>

-- 
You are receiving this mail because:
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/

Reply via email to