Fills the gaps between the admin panel screens and the backend: a full free-text + slide-count + language -> AI-generated presentation flow with new slide-cloning logic in TemplateFillService, a "my presentations" list endpoint, a swappable payment-gateway structure for wallet top-ups (fake driver for now), and avatar upload / public-profile toggle / account deletion / password change / notification preference endpoints. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
56 lines
1.1 KiB
PHP
56 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Enums\TemplateGenerationSource;
|
|
use App\Enums\TemplateGenerationStatus;
|
|
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
|
|
|
#[Fillable([
|
|
'template_id',
|
|
'uuid',
|
|
'source',
|
|
'title',
|
|
'language',
|
|
'slide_count',
|
|
'source_text',
|
|
'status',
|
|
'values',
|
|
'output_path',
|
|
'error_message',
|
|
'requested_by',
|
|
])]
|
|
class TemplateGeneration extends Model
|
|
{
|
|
/**
|
|
* @return BelongsTo<Template, $this>
|
|
*/
|
|
public function template(): BelongsTo
|
|
{
|
|
return $this->belongsTo(Template::class);
|
|
}
|
|
|
|
/**
|
|
* @return BelongsTo<User, $this>
|
|
*/
|
|
public function requester(): BelongsTo
|
|
{
|
|
return $this->belongsTo(User::class, 'requested_by');
|
|
}
|
|
|
|
/**
|
|
* @return array<string, string>
|
|
*/
|
|
protected function casts(): array
|
|
{
|
|
return [
|
|
'source' => TemplateGenerationSource::class,
|
|
'status' => TemplateGenerationStatus::class,
|
|
'values' => 'array',
|
|
'slide_count' => 'integer',
|
|
];
|
|
}
|
|
}
|