Conversation
…dfoundation/vine into feature/oct-2025-updates
dacook
left a comment
There was a problem hiding this comment.
Great, indeed it's very comprehensive! Thanks for the detailed notes too.
I thought the @see comments seemed a bit over the top, until I remembered this was to aide navigation in IDE. That must be handy, but could get fiddly.
Glad to see this helped uncover a bug; it just goes to show how important tests are!
|
In order to get this deployed, we need to do the following (I've done this in this case):
Deployments are usually based from the Is this the case still with Vine? That |
|
Thanks Paul.
Yes, I haven't changed anything 👍 Something is wrong with the GH action, I wasn't able to fix it but it can wait. First thing is to enjoy the rest of your trip :) |
Fixes #95.
Summary
Add comprehensive unit tests for
VoucherServiceand fix a production bug discovered during testing.Changes
Tests Added (20 tests, 327 assertions)
Complete test coverage for all public static methods in
VoucherService:findUniqueShortCodeForVoucher()(4 tests)calculateVoucherAmountRedeemed()(4 tests)calculateVoucherAmountRemaining()(5 tests)updateVoucherAmountRemaining()(3 tests)collateVoucherAggregates()(4 tests)Bug Fix
Fixed critical bug in
VoucherService::collateVoucherAggregates()(line 93)last_redemption_atwas being calculated without filtering byvoucher_idVoucherRedemption::where('voucher_id')->max('created_at')VoucherRedemption::where('voucher_id', $voucher->id)->max('created_at')Documentation
@seeannotations linking service methods to their testsTesting Notes
withoutEvents()for over-redemption edge case tests to isolate calculation logic from event-driven validationRefreshDatabasetrait