35 lines
807 B
PHP
35 lines
807 B
PHP
<?php
|
|
|
|
namespace Modules\AdvancedPlanning\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class ScheduledOperation extends Model
|
|
{
|
|
protected $table = 'ap_scheduled_operations';
|
|
|
|
protected $guarded = ['id'];
|
|
|
|
protected $casts = [
|
|
'planned_start' => 'datetime',
|
|
'planned_end' => 'datetime',
|
|
'quantity' => 'decimal:4',
|
|
'duration_hours' => 'decimal:2',
|
|
];
|
|
|
|
public function scheduleRun()
|
|
{
|
|
return $this->belongsTo(ScheduleRun::class, 'schedule_run_id');
|
|
}
|
|
|
|
public function resource()
|
|
{
|
|
return $this->belongsTo(CapacityResource::class, 'resource_id');
|
|
}
|
|
|
|
public function workOrder()
|
|
{
|
|
return $this->belongsTo(\Modules\IndustrialEngineering\Models\ManufacturingWorkOrder::class, 'ie_work_order_id');
|
|
}
|
|
}
|