feat(purchase): implement purchase limit enforcement and custom exception handling

This commit is contained in:
2026-08-19 16:43:59 -03:00
parent 8537d2ed0a
commit 5c0b3503b7
15 changed files with 124 additions and 41 deletions

View File

@@ -340,7 +340,11 @@ class StorePurchaseTest extends TestCase
],
])
->assertUnprocessable()
->assertJsonValidationErrors('direct_items');
->assertJsonValidationErrors('direct_items')
->assertJsonPath('code', 'purchase.limit_exceeded')
->assertJsonPath('catalog_item_id', $variant->catalog_item_id)
->assertJsonPath('catalog_item_name', $variant->catalogItem->nombre)
->assertJsonPath('maximum_addable_quantity', 1);
$this->actingAs($otherUser, 'sanctum')
->postJson('/api/tenants/sonder/compras/start-checkout', [