<?php

namespace App\Services\History\Detector;

use App\Services\History\Converter\CustomFieldSelectConverter;
use App\Services\History\Converter\ModelEnumConverter;
use App\Services\History\Converter\WhitelistConverter;

class ProjectDetector extends DetectorAbstract
{
    public static function fields(): array
    {
        return [
            'name',
            'code',
            'const',
            'status',
            'begin',
            'end',
            'latitude',
            'type',
            'acl',
            'whitelist',
            'description',
        ];
    }

    public static function diffFields(): array
    {
        return [
            'description',
        ];
    }

    public static function converters(): array
    {
        return [
            "whitelist" => new WhitelistConverter(),
            "acl" => new ModelEnumConverter("project.acl"),
            "status" => new ModelEnumConverter("project.status"),
            "type" => new CustomFieldSelectConverter("project", "type"),
        ];
    }
}