63 lines
1.4 KiB
PHP
63 lines
1.4 KiB
PHP
<?php
|
|||
|
|
|
||
|
|
namespace App\Models;
|
||
|
|
|
||
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||
|
|
use Illuminate\Database\Eloquent\Model;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||
|
|
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||
|
|
|
||
|
|
class WorkflowStep extends Model
|
||
|
|
{
|
||
|
|
use HasFactory;
|
||
|
|
|
||
|
|
// Mirrors the content-generation modules in the YouTube Content
|
||
|
|
// Creation System project (script through publish).
|
||
|
|
public const TYPES = [
|
||
|
|
'script_generation',
|
||
|
|
'tts_voiceover',
|
||
|
|
'storyboard',
|
||
|
|
'video_generation',
|
||
|
|
'video_editing',
|
||
|
|
'thumbnail_generation',
|
||
|
|
'metadata_generation',
|
||
|
|
'youtube_publish',
|
||
|
|
];
|
||
|
|
|
||
|
|
public const STATUSES = [
|
||
|
|
'pending', 'in_progress', 'awaiting_approval',
|
||
|
|
'completed', 'rejected', 'failed', 'skipped',
|
||
|
|
];
|
||
|
|
|
||
|
|
protected $fillable = [
|
||
|
|
'video_project_id',
|
||
|
|
'type',
|
||
|
|
'order',
|
||
|
|
'status',
|
||
|
|
'requires_approval',
|
||
|
|
'input',
|
||
|
|
'output',
|
||
|
|
'error',
|
||
|
|
'started_at',
|
||
|
|
'completed_at',
|
||
|
|
];
|
||
|
|
|
||
|
|
protected $casts = [
|
||
|
|
'requires_approval' => 'boolean',
|
||
|
|
'input' => 'array',
|
||
|
|
'output' => 'array',
|
||
|
|
'started_at' => 'datetime',
|
||
|
|
'completed_at' => 'datetime',
|
||
|
|
];
|
||
|
|
|
||
|
|
public function videoProject(): BelongsTo
|
||
|
|
{
|
||
|
|
return $this->belongsTo(VideoProject::class);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function assets(): HasMany
|
||
|
|
{
|
||
|
|
return $this->hasMany(Asset::class);
|
||
|
|
}
|
||
|
|
}
|