commit5
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-10-30 10:55:18 +02:00
parent 0235c7609e
commit 48347e2d3a
161 changed files with 11814 additions and 265 deletions
+41
View File
@@ -0,0 +1,41 @@
<?php
namespace App\Models;
use App\Models\Concerns\BelongsToTenant;
use Illuminate\Database\Eloquent\Model;
/**
* @property int $id
* @property int $tenant_id
* @property int $supplier_evaluation_id
* @property int $created_by
* @property int $version
* @property string $status
* @property array<string,mixed> $payload
* @property list<int> $contributors
* @property array<string,mixed>|null $decision
*/
class SupplierResponse extends Model
{
use BelongsToTenant;
protected $guarded = ['id'];
protected $attributes = ['status' => 'draft', 'version' => 1];
protected function casts(): array
{
return ['payload' => 'array', 'contributors' => 'array', 'decision' => 'array', 'reviewed_at' => 'datetime'];
}
protected static function booted(): void
{
static::updating(function (self $record) {
if ($record->getRawOriginal('status') === 'decided') {
throw new \LogicException('A conclusão registada conserva-se no histórico.');
}
});
static::deleting(fn () => throw new \LogicException('Preservar o contraditório do fornecedor.'));
}
}