<?php

namespace App\Controller;

use App\Request\InquiryRequest;
use App\Services\InquiryService;
use Extend\Wechat\WechatPay;
use Hyperf\Snowflake\IdGeneratorInterface;
use Psr\Container\ContainerExceptionInterface;
use Psr\Container\NotFoundExceptionInterface;
use Psr\Http\Message\ResponseInterface;

/**
 * 问诊
 */
class InquiryController extends AbstractController
{
    /**
     * 创建问诊订单
     * @return ResponseInterface
     * @throws ContainerExceptionInterface
     * @throws NotFoundExceptionInterface
     */
    public function addInquiryOrder(): ResponseInterface
    {
        $request = $this->container->get(InquiryRequest::class);
        $request->scene('addInquiryOrder')->validateResolved();

        $InquiryService = new InquiryService();
        $data = $InquiryService->addInquiryOrder();
        return $this->response->json($data);
    }

    /**
     * 获取患者问诊病例
     * @return ResponseInterface
     * @throws ContainerExceptionInterface
     * @throws NotFoundExceptionInterface
     */
    public function getPatientInquiryCase(): ResponseInterface
    {
        $request = $this->container->get(InquiryRequest::class);
        $request->scene('getPatientInquiryCase')->validateResolved();

        $InquiryService = new InquiryService();
        $data = $InquiryService->getPatientInquiryCase();
        return $this->response->json($data);
    }

    /**
     * 检测快速、购药订单分配医生状态
     * @return ResponseInterface
     */
    public function getInquiryAssign(): ResponseInterface
    {
        $InquiryService = new InquiryService();
        $data = $InquiryService->getInquiryAssign();
        return $this->response->json($data);
    }

    /**
     * 新增问诊评价
     * @return ResponseInterface
     * @throws ContainerExceptionInterface
     * @throws NotFoundExceptionInterface
     */
    public function addInquiryEvaluation(): ResponseInterface
    {
        $request = $this->container->get(InquiryRequest::class);
        $request->scene('addInquiryEvaluation')->validateResolved();

        $InquiryService = new InquiryService();
        $data = $InquiryService->addInquiryEvaluation();
        return $this->response->json($data);
    }

    /**
     * 获取问诊最低价格
     * @return ResponseInterface
     */
    public function getInquiryLowestPrice(): ResponseInterface
    {
        $InquiryService = new InquiryService();
        $data = $InquiryService->getInquiryLowestPrice();
        return $this->response->json($data);
    }

    /**
     * 获取问诊订单消息内页基础数据
     * @return ResponseInterface
     */
    public function getInquiryMessageBasic(): ResponseInterface
    {
        $InquiryService = new InquiryService();
        $data = $InquiryService->getInquiryMessageBasic();
        return $this->response->json($data);
    }

}