38 lines
1.0 KiB
PHP
38 lines
1.0 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\Concerns\BelongsToTenant;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
|
|
|
/**
|
|
* @property int $id
|
|
* @property int $tenant_id
|
|
* @property int $requisition_id
|
|
* @property int $quotation_id
|
|
* @property int $created_by
|
|
* @property string $status
|
|
* @property string $comparison_hash
|
|
* @property array<string, mixed> $approval_snapshot
|
|
* @property list<array<string, mixed>> $decision_matrix
|
|
* @property array<string,mixed>|null $investment_snapshot
|
|
*/
|
|
class PurchaseAward extends Model
|
|
{
|
|
use BelongsToTenant;
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
protected function casts(): array
|
|
{
|
|
return ['approval_snapshot' => 'array', 'decision_matrix' => 'array', 'investment_snapshot' => 'array', 'delivery_date' => 'date:Y-m-d'];
|
|
}
|
|
|
|
/** @return HasMany<PurchaseAwardApproval, $this> */
|
|
public function approvals(): HasMany
|
|
{
|
|
return $this->hasMany(PurchaseAwardApproval::class)->orderBy('position');
|
|
}
|
|
}
|