feat: enhance sale detail retrieval by including trashed cart items and update related tests

This commit is contained in:
2026-08-21 08:58:18 -03:00
parent 8c09ca1204
commit dd81e3b3f7
2 changed files with 8 additions and 0 deletions

View File

@@ -317,6 +317,11 @@ class AdminAppSaleControllerTest extends TestCase
$this->assertSame(Purchase::STATUS_CANCELLED, $purchase->fresh()->status);
$this->assertSoftDeleted('carritos', ['id' => $cart->id]);
$this->assertSame('converted', Cart::withTrashed()->findOrFail($cart->id)->status);
$this->getJson("/api/v1/adminapp/tenant/sales/{$purchase->id}")
->assertOk()
->assertJsonPath('data.items.0.product', 'Entrada general')
->assertJsonPath('data.items.0.quantity', 2);
}
public function test_an_adminapp_user_cannot_change_a_sale_from_another_tenant(): void