Files
ladill-care/app/Models/DentalPlanItem.php
T
isaaccladandCursor 0edd653187
Deploy Ladill Care / deploy (push) Failing after 36s
Ship commercial Dentistry suite with odontogram and treatment plans.
Replace placeholder clinical forms with patient-level FDI charting, multi-visit plans, procedure-to-bill linking, imaging, reports, and demo seed data.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-18 16:33:34 +00:00

55 lines
1.3 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
use Illuminate\Support\Str;
class DentalPlanItem extends Model
{
public const STATUS_PROPOSED = 'proposed';
public const STATUS_ACCEPTED = 'accepted';
public const STATUS_DONE = 'done';
public const STATUS_CANCELLED = 'cancelled';
protected $table = 'care_dental_plan_items';
protected $fillable = [
'uuid', 'treatment_plan_id', 'tooth_code', 'surfaces', 'procedure_code',
'label', 'priority', 'status', 'estimate_minor', 'bill_line_item_id', 'notes',
];
protected function casts(): array
{
return ['surfaces' => 'array'];
}
protected static function booted(): void
{
static::creating(function (DentalPlanItem $item) {
if (! $item->uuid) {
$item->uuid = (string) Str::uuid();
}
});
}
public function getRouteKeyName(): string
{
return 'uuid';
}
public function plan(): BelongsTo
{
return $this->belongsTo(DentalTreatmentPlan::class, 'treatment_plan_id');
}
public function billLineItem(): BelongsTo
{
return $this->belongsTo(BillLineItem::class, 'bill_line_item_id');
}
}