<?php

declare(strict_types=1);

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Upload extends Model
{
    protected $table = 'uploads';

    public $incrementing = false;

    protected $keyType = 'string';

    protected $fillable = [
        'id',
        'user_id',
        'type',
        'status',
        'processing_state',
        'title',
        'slug',
        'category_id',
        'description',
        'tags',
        'license',
        'nsfw',
        'is_scanned',
        'has_tags',
        'preview_path',
        'published_at',
        'final_path',
        'expires_at',
        'moderation_status',
        'moderated_at',
        'moderated_by',
        'moderation_note',
    ];

    protected $casts = [
        'tags' => 'array',
        'nsfw' => 'boolean',
        'is_scanned' => 'boolean',
        'has_tags' => 'boolean',
        'published_at' => 'datetime',
        'expires_at' => 'datetime',
        'moderated_at' => 'datetime',
    ];
}
