debug the reports
This commit is contained in:
@@ -336,4 +336,9 @@ class AccidentReceiptController extends Controller
|
||||
|
||||
return $this->successResponse();
|
||||
}
|
||||
|
||||
public function accidentTypes(): JsonResponse
|
||||
{
|
||||
return $this->successResponse(DailyAccidentSettings::query()->where('type', 'accident_type')->get());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ use App\Exports\V3\AccidentReceipt\CityReport;
|
||||
use App\Exports\V3\AccidentReceipt\ProvinceReport;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Http\Traits\ApiResponse;
|
||||
use App\Models\City;
|
||||
use App\Models\Province;
|
||||
use App\Services\Cartables\AccidentReceiptTableService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
@@ -19,13 +21,19 @@ class AccidentReceiptReportController extends Controller
|
||||
public function provinceReport(Request $request, AccidentReceiptTableService $accidentReceiptTableService): JsonResponse
|
||||
{
|
||||
$data = $accidentReceiptTableService->provinceReport($request);
|
||||
return $this->successResponse($data['data']);
|
||||
return $this->successResponse([
|
||||
'data' => $data['data'],
|
||||
'provinces' => Province::all(['id', 'name_fa']),
|
||||
]);
|
||||
}
|
||||
|
||||
public function cityReport(Request $request, AccidentReceiptTableService $accidentReceiptTableService): JsonResponse
|
||||
{
|
||||
$data = $accidentReceiptTableService->cityReport($request);
|
||||
return $this->successResponse($data['data']);
|
||||
return $this->successResponse([
|
||||
'data' => $data['data'],
|
||||
'cities' => City::all(['id', 'name_fa']),
|
||||
]);
|
||||
}
|
||||
|
||||
public function provinceExcelReport(Request $request, AccidentReceiptTableService $accidentReceiptTableService): BinaryFileResponse
|
||||
|
||||
@@ -263,6 +263,7 @@ Route::prefix('receipts')
|
||||
Route::get('/check_payment_status/{accident}', 'checkPaymentStatus')->name('checkPaymentStatus');
|
||||
Route::get('/generate_police_document/{accident}', 'generatePoliceDocument')->name('generatePoliceDocument');
|
||||
Route::get('/send_sms_again/{accident}', 'sendSmsAgain')->name('sendSmsAgain');
|
||||
Route::get('/accident_types', 'accidentTypes')->name('accidentTypes');
|
||||
});
|
||||
|
||||
Route::prefix('receipt_reports')
|
||||
|
||||
Reference in New Issue
Block a user