39 lines
1.1 KiB
PHP
Executable File
39 lines
1.1 KiB
PHP
Executable File
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Modules\Helpdesk\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
final class WorkflowLog extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'helpdesk_workflow_logs';
|
|
|
|
/** @var list<string> */
|
|
protected $fillable = ['template_id', 'ticket_id', 'event', 'recipient', 'subject', 'status', 'tracking_token', 'first_opened_at', 'last_opened_at', 'opened_count', 'error'];
|
|
|
|
/** @var array<string, string> */
|
|
protected $casts = [
|
|
'first_opened_at' => 'datetime',
|
|
'last_opened_at' => 'datetime',
|
|
'opened_count' => 'integer',
|
|
];
|
|
|
|
/** @return BelongsTo<WorkflowTemplate, WorkflowLog> */
|
|
public function template(): BelongsTo
|
|
{
|
|
return $this->belongsTo(WorkflowTemplate::class, 'template_id');
|
|
}
|
|
|
|
/** @return BelongsTo<Ticket, WorkflowLog> */
|
|
public function ticket(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Ticket::class, 'ticket_id');
|
|
}
|
|
}
|