Deploy Ladill Care / deploy (push) Successful in 46s
Give lab_manager catalog/ops admin access and blood_bank_manager a branch-level stock register plus specialty admin surface, while keeping technicians on clinical queues. Co-authored-by: Cursor <cursoragent@cursor.com>
42 lines
891 B
PHP
42 lines
891 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Models\Concerns\BelongsToOwner;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
class BloodBankStock extends Model
|
|
{
|
|
use BelongsToOwner;
|
|
|
|
protected $table = 'care_blood_bank_stock';
|
|
|
|
protected $fillable = [
|
|
'owner_ref',
|
|
'organization_id',
|
|
'branch_id',
|
|
'product_code',
|
|
'product_label',
|
|
'units_on_hand',
|
|
'reorder_level',
|
|
'notes',
|
|
'updated_by',
|
|
];
|
|
|
|
public function organization(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Organization::class, 'organization_id');
|
|
}
|
|
|
|
public function branch(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Branch::class, 'branch_id');
|
|
}
|
|
|
|
public function isLowStock(): bool
|
|
{
|
|
return (int) $this->units_on_hand <= (int) $this->reorder_level;
|
|
}
|
|
}
|