validated(); $result = $this->refunds->calculateRefund($payload['students'], (int) $payload['parent_id']); return response()->json([ 'ok' => true, 'refund' => new FeeRefundResource($result), ]); } public function tuitionTotal(FeeTuitionTotalRequest $request): JsonResponse { $payload = $request->validated(); $total = $this->tuition->totalTuitionFee($payload['students']); return response()->json([ 'ok' => true, 'tuition' => new FeeTuitionTotalResource([ 'total_tuition' => $total, ]), ]); } }