<?php

namespace App\Services\Equipment;

use App\Entities\Equipment\ServerEntity;
use App\Models\Equipment\ServerModel;
use App\Services\Equipment\EquipmentService;

class ServerService extends EquipmentService
{
    public function __construct()
    {
        parent::__construct(new ServerModel());
        $this->addClassName('Server');
    }
    public function getFormFields(): array
    {
        return [
            "serviceinfo_uid",
            "code",
            "type",
            "title",
            "price",
            "manufactur_at",
            "format_at",
            "status",
        ];
    }
    public function getFilterFields(): array
    {
        return ['clientinfo_uid', 'serviceinfo_uid', 'type', 'status'];
    }
    public function getBatchJobFields(): array
    {
        return ['clientinfo_uid', 'type', 'status'];
    }
    public function getIndexFields(): array
    {
        return ['clientinfo_uid', 'serviceinfo_uid', "type", 'title', 'price', 'total_price', 'manufactur_at', "format_at", 'status'];
    }
    //기본 기능부분
    //FieldForm관련용
    //List 검색용
    //OrderBy 처리
    public function setOrderBy(mixed $field = null, mixed $value = null): void
    {
        $this->getModel()->orderBy("code ASC,title ASC");
        parent::setOrderBy($field, $value);
    }
}
