<?php

namespace App\Services\Equipment;

use App\Helpers\Equipment\CSHelper;
use App\Models\Equipment\CSModel;

class CSService extends EquipmentService
{
    public function __construct()
    {
        parent::__construct(new CSModel(), new CSHelper());
        $this->addClassName('CS');
    }
    public function getFormFields(): array
    {
        return  [
            "serverinfo_uid",
            "type",
            "ip",
            "accountid",
            "domain",
            "price",
            "status",
        ];
    }
    public function getFormFilters(): array
    {
        return [
            "clientinfo_uid",
            'serverinfo_uid',
            'type',
            'status'
        ];
    }
    public function getIndexFields(): array
    {
        return [
            "clientinfo_uid",
            'serverinfo_uid',
            'type',
            'ip',
            'accountid',
            'domain',
            'price',
            'status',
        ];
    }
    public function getBatchjobFields(): array
    {
        return ['type', 'status'];
    }
    //기본 기능부분
    //List 검색용
    //OrderBy 처리
    public function setOrderBy(mixed $field = null, mixed $value = null): void
    {
        $this->getModel()->orderBy('INET_ATON(ip)', 'ASC');
        parent::setOrderBy($field, $value);
    }
}
