You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
44 lines
1.1 KiB
44 lines
1.1 KiB
<?php
|
|
declare(strict_types = 1);
|
|
|
|
namespace App\Http\Controllers\Outpatient;
|
|
|
|
use App\Exceptions\GeneralException;
|
|
use App\Http\Logics\Outpatient\PaymentLogic;
|
|
use App\Http\Resources\Outpatient\Pending\PendingListsResource;
|
|
use Illuminate\Http\JsonResponse;
|
|
use Illuminate\Http\Request;
|
|
use Symfony\Component\HttpFoundation\Response;
|
|
|
|
class PaymentController
|
|
{
|
|
protected PaymentLogic $payment_logic;
|
|
|
|
/**
|
|
* PaymentController Construct.
|
|
*/
|
|
public function __construct()
|
|
{
|
|
$this->payment_logic = new PaymentLogic();
|
|
}
|
|
|
|
/**
|
|
* 缴费
|
|
* @param Request $request
|
|
* @param string $patient_id
|
|
* @return JsonResponse
|
|
* @throws GeneralException
|
|
*/
|
|
public function payment(Request $request, string $patient_id): JsonResponse
|
|
{
|
|
$validated = $request->validate([
|
|
'prescription_ids' => 'required',
|
|
], [
|
|
'prescription_ids.required' => '请选择要缴纳的处方',
|
|
]);
|
|
|
|
$response = $this->payment_logic->payment($patient_id, $validated['prescription_ids']);
|
|
|
|
return jsonResponse(Response::HTTP_OK, 'success', $response);
|
|
}
|
|
}
|
|
|