@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
/** @property int $id
|
||||
* @property int $tenant_id
|
||||
* @property string $email
|
||||
* @property string $password
|
||||
* @property Carbon|null $email_verified_at
|
||||
* @property int $session_version
|
||||
*/
|
||||
class CandidateAccount extends Authenticatable
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
|
||||
protected $attributes = ['session_version' => 1];
|
||||
|
||||
protected $hidden = ['password'];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['password' => 'hashed', 'email_verified_at' => 'datetime', 'session_version' => 'integer'];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\Concerns\BelongsToTenant;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
* @property int $tenant_id
|
||||
* @property int $created_by
|
||||
* @property string $kind
|
||||
* @property string $status
|
||||
* @property int $version
|
||||
* @property string $closes_on
|
||||
* @property string $creation_hash
|
||||
* @property int|null $selected_application_id
|
||||
* @property array<string,mixed> $rules
|
||||
* @property array<string,mixed>|null $selection
|
||||
* @property array<string,mixed>|null $contract
|
||||
*/
|
||||
class PeopleProcess extends Model
|
||||
{
|
||||
use BelongsToTenant;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
|
||||
protected $attributes = ['status' => 'draft', 'version' => 1];
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['rules' => 'array', 'selection' => 'array', 'contract' => 'array'];
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,10 @@ use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
/** @property array<string, mixed> $weights */
|
||||
/**
|
||||
* @property array<string, mixed> $weights
|
||||
* @property array<string, mixed>|null $commercial_terms Stored JSON is validated against the pricing contract before comparison.
|
||||
*/
|
||||
class Quotation extends Model
|
||||
{
|
||||
use BelongsToTenant;
|
||||
@@ -16,7 +19,7 @@ class Quotation extends Model
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['weights' => 'array', 'valid_until' => 'date:Y-m-d'];
|
||||
return ['weights' => 'array', 'commercial_terms' => 'array', 'valid_until' => 'date:Y-m-d'];
|
||||
}
|
||||
|
||||
/** @return BelongsTo<Supplier, $this> */
|
||||
|
||||
@@ -10,6 +10,7 @@ use Illuminate\Database\Eloquent\Collection;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Support\Carbon;
|
||||
|
||||
/**
|
||||
* @property int $id
|
||||
@@ -21,6 +22,9 @@ use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
* @property int $subtotal_minor
|
||||
* @property int $tax_minor
|
||||
* @property int $total_minor
|
||||
* @property Carbon|null $submitted_at
|
||||
* @property Carbon|null $needed_by
|
||||
* @property array<string,mixed>|null $comparison_policy
|
||||
* @property Collection<int, ApprovalStep> $steps
|
||||
* @property Collection<int, RequisitionItem> $items
|
||||
*/
|
||||
@@ -32,7 +36,7 @@ class Requisition extends Model
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['approval_snapshot' => 'array', 'submitted_at' => 'datetime', 'needed_by' => 'date:Y-m-d'];
|
||||
return ['approval_snapshot' => 'array', 'comparison_policy' => 'array', 'submitted_at' => 'datetime', 'needed_by' => 'date:Y-m-d'];
|
||||
}
|
||||
|
||||
/** @return HasMany<RequisitionItem, $this> */
|
||||
|
||||
@@ -12,6 +12,8 @@ use Illuminate\Database\Eloquent\Model;
|
||||
* @property string $tax_rate
|
||||
* @property int|null $equipment_id
|
||||
* @property int|null $spare_part_id
|
||||
* @property int|null $catalogue_entry_id
|
||||
* @property array<string,mixed>|null $catalogue_snapshot
|
||||
*/
|
||||
class RequisitionItem extends Model
|
||||
{
|
||||
@@ -23,6 +25,6 @@ class RequisitionItem extends Model
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['quantity' => 'decimal:3', 'tax_rate' => 'decimal:2'];
|
||||
return ['quantity' => 'decimal:3', 'tax_rate' => 'decimal:2', 'catalogue_entry_id' => 'integer', 'catalogue_snapshot' => 'array'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,8 @@ use Illuminate\Database\Eloquent\Model;
|
||||
* @property int $second_limit_minor
|
||||
* @property bool $approval_includes_tax
|
||||
* @property bool $rules_provisional
|
||||
* @property array<string,mixed>|null $comparison_policy
|
||||
* @property array{revision:int,configured:bool,procurement_brief:bool,people_brief:bool,ai_plan?:array<string,mixed>}|null $intelligence_policy
|
||||
*/
|
||||
class Tenant extends Model
|
||||
{
|
||||
@@ -18,6 +20,6 @@ class Tenant extends Model
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['approval_includes_tax' => 'boolean', 'rules_provisional' => 'boolean'];
|
||||
return ['approval_includes_tax' => 'boolean', 'rules_provisional' => 'boolean', 'default_tax_rate' => 'decimal:2', 'comparison_policy' => 'array', 'intelligence_policy' => 'array'];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user