feat: Remove 'in_review' status from purchase workflow; implement logging for status changes and update related tests

This commit is contained in:
2026-08-03 17:04:39 -03:00
parent c4b317d5fc
commit 96f26e2e9d
8 changed files with 92 additions and 27 deletions

View File

@@ -57,13 +57,9 @@ class TelepagosWebhookService
->whereIn('status', [
Purchase::STATUS_CREATED,
Purchase::STATUS_PENDING_PAYMENT,
Purchase::STATUS_IN_REVIEW,
])
->where('payment_method', 'transfer')
->where('total', $amount)
->orderByRaw('CASE WHEN status = ? THEN 0 ELSE 1 END', [
Purchase::STATUS_IN_REVIEW,
])
->latest()
->first();
@@ -97,7 +93,6 @@ class TelepagosWebhookService
if (! in_array($compra->status, [
Purchase::STATUS_PENDING_PAYMENT,
Purchase::STATUS_IN_REVIEW,
], true)) {
Log::warning("Telepagos webhook: Purchase {$compra->id} is not awaiting payment confirmation");