<?php

namespace App\Services;

use App\Forms\InquiryForm;
use App\Models\InquiryModel;
use App\Entities\CommonEntity;
use App\Helpers\InquiryHelper;
use App\Entities\InquiryEntity;

class InquiryService extends CommonService
{
    protected string $formClass = InquiryForm::class;
    protected string $helperClass = InquiryHelper::class;

    public function __construct(InquiryModel $model)
    {
        parent::__construct($model);
        $this->addClassPaths('Inquiry');
    }
    public function getEntityClass(): string
    {
        return InquiryEntity::class;
    }
    //기본 기능부분
    protected function getEntity_process(mixed $entity): InquiryEntity
    {
        return $entity;
    }
    //List 검색용
    //FormFilter 조건절 처리
    //검색어조건절처리

    //추가기능부분
    protected function create_process(array $formDatas): CommonEntity
    {
        if (!isset($formDatas['status']) || $formDatas['status'] === '' || $formDatas['status'] === null) {
            $formDatas['status'] = STATUS['AVAILABLE']; // 'available'
        }
        return parent::create_process($formDatas);
    }
}
