feat: Add event association to purchases; implement event relationship in models, update migration, and enhance tests

This commit is contained in:
2026-08-04 11:45:03 -03:00
parent 1de08c1ca4
commit 8aa3a26ee7
7 changed files with 83 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
<?php
namespace Tests\Unit\Forms;
use App\Domains\Forms\Services\SaleFormService;
use App\Domains\Purchase\Models\Purchase;
use PHPUnit\Framework\TestCase;
class SaleFormServiceTest extends TestCase
{
public function test_it_returns_every_purchase_status_as_a_form_option(): void
{
$form = (new SaleFormService)->get();
$this->assertSame(Purchase::statuses(), array_column($form['statuses'], 'code'));
$this->assertSame([
'Creada',
'Esperando pago',
'Confirmada',
'Cancelada',
'Rechazada',
'Vencida',
], array_column($form['statuses'], 'name'));
}
}