Bug 37803 - Add patron notification when a new booking has been created successfully
Summary: Add patron notification when a new booking has been created successfully
Status: Needs documenting
Alias: None
Product: Koha
Classification: Unclassified
Component: Circulation (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Paul Derscheid
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords: additional_work_needed
Depends on: 37204
Blocks: 36666 38175 38490
  Show dependency treegraph
 
Reported: 2024-09-02 09:54 UTC by Paul Derscheid
Modified: 2024-11-20 10:42 UTC (History)
6 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement adds a patron notification for successful booking creation, aligning it with existing notices for booking modifications and deletions.
Version(s) released in:
24.11.00
Circulation function: bookings


Attachments
Bug 37803: Add patron notification when a new booking has been created successfully (8.41 KB, patch)
2024-09-02 10:43 UTC, Paul Derscheid
Details | Diff | Splinter Review
Bug 37803: Add patron notification when a new booking has been created successfully (8.63 KB, patch)
2024-09-02 10:46 UTC, Paul Derscheid
Details | Diff | Splinter Review
Bug 37803: Add patron notification when a new booking has been created successfully (8.63 KB, patch)
2024-09-02 10:46 UTC, Paul Derscheid
Details | Diff | Splinter Review
Bug 37803: Add patron notification when a new booking has been created successfully (8.68 KB, patch)
2024-09-05 12:41 UTC, Paul Derscheid
Details | Diff | Splinter Review
Bug 37803: Add patron notification when a new booking has been created successfully (8.73 KB, patch)
2024-10-16 16:03 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 37803: Add patron notification when a new booking has been created successfully (8.89 KB, patch)
2024-10-24 15:18 UTC, Paul Derscheid
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Derscheid 2024-09-02 09:54:50 UTC
Similarly to notices when a booking has been modified or deleted we should have a notice for a successful creation of a booking for patrons.
Comment 1 Katrin Fischer 2024-09-02 09:58:15 UTC
I stumbled on the bug description a little - hope this is OK?
Comment 2 Paul Derscheid 2024-09-02 09:59:16 UTC
Sure, you are right. Copied it from Bug 37204 and doctored it a bit too much.
Comment 3 Paul Derscheid 2024-09-02 10:43:27 UTC
Created attachment 170933 [details] [review]
Bug 37803: Add patron notification when a new booking has been created successfully
Comment 4 Paul Derscheid 2024-09-02 10:46:20 UTC
Created attachment 170934 [details] [review]
Bug 37803: Add patron notification when a new booking has been created successfully

To test:
1) Apply the patch
2) Include the sample notice, e.g. run 'reset_all' on ktd
3) Create a booking
4) Look into the borrower notifications
5) Confirm the notice has been generated
6) Run t/db_dependent/Koha/Booking.t
Comment 5 Paul Derscheid 2024-09-02 10:46:58 UTC
Created attachment 170935 [details] [review]
Bug 37803: Add patron notification when a new booking has been created successfully

To test:
1) Apply the patch
2) Include the sample notice, e.g. run 'reset_all' on ktd
3) Create a booking
4) Look into the borrower notifications
5) Confirm the notice has been generated
6) Run t/db_dependent/Koha/Booking.t
Comment 6 Paul Derscheid 2024-09-02 10:47:25 UTC
Commented the 'Obsoletes' for some reason the first time. Please ignore :D
Comment 7 Paul Derscheid 2024-09-05 12:41:18 UTC
Created attachment 171066 [details] [review]
Bug 37803: Add patron notification when a new booking has been created successfully

To test:
1) Apply the patch
2) Include the sample notice, e.g. run 'reset_all' on ktd
3) Create a booking
4) Look into the borrower notifications
5) Confirm the notice has been generated
6) Run t/db_dependent/Koha/Booking.t

Signed-off-by: LEBSimonsen <simonsen@bz-sh.de>
Comment 8 Paul Derscheid 2024-09-05 12:42:12 UTC
I just inserted the signed-off line because the sandbox failed at that step.
Just for reference.
Comment 9 Martin Renvoize (ashimema) 2024-10-16 16:03:19 UTC
Created attachment 172829 [details] [review]
Bug 37803: Add patron notification when a new booking has been created successfully

To test:
1) Apply the patch
2) Include the sample notice, e.g. run 'reset_all' on ktd
3) Create a booking
4) Look into the borrower notifications
5) Confirm the notice has been generated
6) Run t/db_dependent/Koha/Booking.t

Signed-off-by: LEBSimonsen <simonsen@bz-sh.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 10 Martin Renvoize (ashimema) 2024-10-16 16:03:37 UTC
More great work, thanks.
Comment 11 Paul Derscheid 2024-10-24 15:18:57 UTC
Created attachment 173286 [details] [review]
Bug 37803: Add patron notification when a new booking has been created successfully

To test:
1) Apply the patch
2) Include the sample notice, e.g. run 'reset_all' on ktd
3) Create a booking
4) Look into the borrower notifications
5) Confirm the notice has been generated
6) Run t/db_dependent/Koha/Booking.t

Signed-off-by: LEBSimonsen <simonsen@bz-sh.de>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Sponsored-by: Büchereizentrale Schleswig-Holstein <https://www.bz-sh.de/>
Comment 12 Katrin Fischer 2024-10-24 16:28:06 UTC
Pushed for 24.11!

Well done everyone, thank you!
Comment 13 Lucas Gass (lukeg) 2024-11-18 23:07:02 UTC
Enhancement, no 24.05.x backport
Comment 14 Jonathan Druart 2024-11-20 10:06:33 UTC
Notice template not created for existing installations, is that expected?
Comment 15 Jonathan Druart 2024-11-20 10:11:24 UTC
(In reply to Jonathan Druart from comment #14)
> Notice template not created for existing installations, is that expected?

Koha_Main_My8 is failing with:
18:55:44 koha_1       | No bookings BOOKING_CONFIRMATION letter transported by email at /kohadevbox/koha/C4/Letters.pm line 610.
18:55:44 koha_1       | 
18:55:44 koha_1       |         #   Failed test 'Koha::Booking->store should have enqueued a BOOKING_CONFIRMATION email for a new booking'
18:55:44 koha_1       |         #   at t/db_dependent/Koha/Booking.t line 413.
18:55:44 koha_1       |         #          got: '0'
18:55:44 koha_1       |         #     expected: '1'
18:55:44 koha_1       |         # Looks like you failed 1 test of 2.
18:55:44 koha_1       | 
18:55:44 koha_1       |     #   Failed test 'confirmation notice trigger'
18:55:44 koha_1       |     #   at t/db_dependent/Koha/Booking.t line 418.
18:55:44 koha_1       | No bookings BOOKING_CONFIRMATION letter transported by email at /kohadevbox/koha/C4/Letters.pm line 610.
18:55:44 koha_1       | No bookings BOOKING_MODIFICATION letter transported by email at /kohadevbox/koha/C4/Letters.pm line 610.
18:55:44 koha_1       | 
18:55:44 koha_1       |         #   Failed test 'Koha::Booking->store should have enqueued a BOOKING_MODIFICATION email for a booking with modified start_date'
18:55:44 koha_1       |         #   at t/db_dependent/Koha/Booking.t line 495.
18:55:44 koha_1       |         #          got: '0'
18:55:44 koha_1       |         #     expected: '1'
18:55:44 koha_1       | No bookings BOOKING_MODIFICATION letter transported by email at /kohadevbox/koha/C4/Letters.pm line 610.
18:55:44 koha_1       | No bookings BOOKING_CANCELLATION letter transported by email at /kohadevbox/koha/C4/Letters.pm line 610.
18:55:44 koha_1       | 
18:55:44 koha_1       |         #   Failed test 'Koha::Booking->store should have enqueued a BOOKING_CANCELLATION email for a booking status change that is a "cancellation"'
18:55:44 koha_1       |         #   at t/db_dependent/Koha/Booking.t line 537.
18:55:44 koha_1       |         #          got: '0'
18:55:44 koha_1       |         #     expected: '1'
18:58:14 koha_1       |         # Looks like you failed 2 tests of 5.
18:58:14 koha_1       | 
18:58:14 koha_1       |     #   Failed test 'modification/cancellation notice triggers'
18:58:14 koha_1       |     #   at t/db_dependent/Koha/Booking.t line 542.
18:58:14 koha_1       | DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::mysql::st execute failed: Data truncated for column 'status' at row 1 at /kohadevbox/koha/Koha/Object.pm line 172
18:58:14 koha_1       |     # Looks like you failed 2 tests of 16.
18:58:14 koha_1       | 
18:58:14 koha_1       | #   Failed test 'store() tests'
18:58:14 koha_1       | #   at t/db_dependent/Koha/Booking.t line 558.
18:58:14 koha_1       | # Looks like you failed 1 test of 2.
18:58:14 koha_1       | [17:52:23] t/db_dependent/Koha/Booking.t


The template is missing because we are running the tests suite after update DB process, not a "normal" installation (using selenium tests, like in Koha_Main)
Jenkins config has `export TEST_DB_UPGRADE=yes`
Comment 16 Katrin Fischer 2024-11-20 10:42:54 UTC
(In reply to Jonathan Druart from comment #14)
> Notice template not created for existing installations, is that expected?

Yes, it was to be expected to keep the behavior consistent for updating installations ("lest surprise") and because libraries will need/want to adapt the notices before starting to send them.

I am quite sure this is not the only notice we handled it that way.