Merge branch 'dillon/74-admin-workflow' into vapor/development

This commit is contained in:
Dillon Ngo
2024-12-04 13:55:10 +08:00
+7 -4
View File
@@ -11,9 +11,9 @@ use App\Models\KeyValuePair;
use Carbon\Carbon;
use Illuminate\Support\Facades\Route;
Route::group(['prefix' => 'admin-work-flow', 'as' => 'admin_work_flow.', 'namespace' => 'AdminWorkFlow'], function () {
// Generalized JSON response function
// Generalized JSON response function
if (!function_exists('responseJson')) {
function responseJson($data = null, $message = null, $status = 200)
{
$response = ['message' => $message];
@@ -24,7 +24,9 @@ Route::group(['prefix' => 'admin-work-flow', 'as' => 'admin_work_flow.', 'namesp
return response()->json($response, $status);
}
}
if (!function_exists('markedProcessing')) {
function markedProcessing($booking, $key){
$kvp = $booking->attributesKVP()->where('key', $key)->first();
@@ -33,6 +35,9 @@ Route::group(['prefix' => 'admin-work-flow', 'as' => 'admin_work_flow.', 'namesp
(App()->make(CreatesKeyValuePair::class))->execute($booking, $keyValuePairObject);
}
}
}
Route::group(['prefix' => 'admin-work-flow', 'as' => 'admin_work_flow.', 'namespace' => 'AdminWorkFlow'], function () {
Route::get('/fetch-oldest-order', function () {
@@ -108,7 +113,6 @@ Route::group(['prefix' => 'admin-work-flow', 'as' => 'admin_work_flow.', 'namesp
})->name('fetch_pending_approve_po');
Route::get('/fetch-pending-fill-po', function () {
$excludedBookingIds = KeyValuePair::where('owner_type', 'App\Models\Booking')
->where(function ($query) {
@@ -146,7 +150,6 @@ Route::group(['prefix' => 'admin-work-flow', 'as' => 'admin_work_flow.', 'namesp
})->name('fetch_pending_fill_po');
Route::get('{booking_id}/fetch-model-attributes', function ($bookingId) {
$booking = Booking::find($bookingId);