feat: implement module API routes, controllers, and comprehensive system testing with role-based access control
Some checks failed
Tests / PHP 8.3 (push) Has been cancelled
Tests / PHP 8.4 (push) Has been cancelled
Tests / PHP 8.5 (push) Has been cancelled

This commit is contained in:
Ajjj
2026-08-06 19:38:51 +08:00
parent c13f418517
commit 10eb7be033
49 changed files with 405 additions and 360 deletions

View File

@@ -468,7 +468,7 @@ class PurchaseOrderController extends Controller
];
if ($hasFileInfo) {
$rules['receipt'] .= '|mimes:pdf,jpg,jpeg,png';
$rules['receipt'] .= '|mimes:pdf';
}
$validated = $request->validate($rules);
@@ -477,7 +477,7 @@ class PurchaseOrderController extends Controller
if (!$hasFileInfo) {
$extension = strtolower($file->getClientOriginalExtension() ?: pathinfo($file->getClientOriginalName(), PATHINFO_EXTENSION));
if (!in_array($extension, ['pdf', 'jpg', 'jpeg', 'png'])) {
if ($extension !== 'pdf') {
return back()->withErrors(['receipt' => 'The receipt must be a file of type: pdf, jpg, jpeg, png.']);
}
}