Skip to content

Commit

Permalink
#1438 pallet_delivery_status (fixes)
Browse files Browse the repository at this point in the history
  • Loading branch information
inikoo committed Feb 13, 2025
1 parent 4f00542 commit 0d9f9aa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
use App\Actions\OrgAction;
use App\Http\Resources\Fulfilment\PalletDeliveryStatusResource;
use App\Models\Fulfilment\PalletDelivery;
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
use Illuminate\Http\Resources\Json\AnonymousResourceCollection;
use Lorisleiva\Actions\ActionRequest;

class ShowPalletDeliveryStatus extends OrgAction
Expand All @@ -36,8 +34,8 @@ public function asController(PalletDelivery $palletDelivery, ActionRequest $requ



public function jsonResponse(LengthAwarePaginator $physicalGoods): AnonymousResourceCollection
public function jsonResponse(PalletDelivery $palletDelivery): PalletDeliveryStatusResource
{
return PalletDeliveryStatusResource::collection($physicalGoods);
return PalletDeliveryStatusResource::make($palletDelivery);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function toArray($request): array
'state' => $palletDelivery->state->value,
'number_pallets_received' => $numberPalletsStateBookingIn,
'number_pallets_rental_not_set' => $numberPalletsRentalNotSet,
'can_finalise' => $palletDelivery->state == PalletDeliveryStateEnum::BOOKED_IN && $numberPalletsStateBookingIn == 0 and $numberPalletsRentalNotSet == 0
'can_finish_booking_in' => $palletDelivery->state == PalletDeliveryStateEnum::BOOKING_IN && $numberPalletsStateBookingIn == 0 and $numberPalletsRentalNotSet == 0

];
}
Expand Down
32 changes: 2 additions & 30 deletions routes/maya/json.php
Original file line number Diff line number Diff line change
@@ -1,40 +1,12 @@
<?php

/*
* Author: Raul Perusquia <[email protected]>
* Created: Thu, 13 Feb 2025 12:34:56 Central Indonesia Time,Sanur, Bali, Indonesia
* Copyright (c) 2025, Raul A Perusquia Flores
*/

use App\Actions\Dispatching\Picking\UpdatePickingStateToDone;
use App\Actions\Dispatching\Picking\UpdatePickingStateToPacking;
use App\Actions\Dispatching\Picking\UpdatePickingStateToPicked;
use App\Actions\Dispatching\Picking\UpdatePickingStateToPicking;
use App\Actions\Dispatching\Picking\UpdatePickingStateToQueried;
use App\Actions\Dispatching\Picking\UpdatePickingStateToWaiting;
use App\Actions\Fulfilment\Pallet\BookInPallet;
use App\Actions\Fulfilment\Pallet\ReturnPalletToCustomer;
use App\Actions\Fulfilment\Pallet\SetPalletAsDamaged;
use App\Actions\Fulfilment\Pallet\SetPalletAsLost;
use App\Actions\Fulfilment\Pallet\SetPalletAsNotReceived;
use App\Actions\Fulfilment\Pallet\SetPalletInReturnAsPicked;
use App\Actions\Fulfilment\Pallet\SetPalletRental;
use App\Actions\Fulfilment\Pallet\UndoBookedInPallet;
use App\Actions\Fulfilment\Pallet\UpdatePallet;
use App\Actions\Fulfilment\Pallet\UpdatePalletLocation;
use App\Actions\Fulfilment\PalletDelivery\Json\ShowPalletDeliveryStatus;
use App\Actions\Fulfilment\PalletDelivery\ReceivePalletDelivery;
use App\Actions\Fulfilment\PalletDelivery\SetPalletDeliveryAsBookedIn;
use App\Actions\Fulfilment\PalletDelivery\StartBookingPalletDelivery;
use App\Actions\Fulfilment\PalletReturn\ConfirmPalletReturn;
use App\Actions\Fulfilment\PalletReturn\DispatchPalletReturn;
use App\Actions\Fulfilment\PalletReturn\PickedPalletReturn;
use App\Actions\Fulfilment\PalletReturn\PickingPalletReturn;
use App\Actions\Fulfilment\PalletReturnItem\NotPickedPalletFromReturn;
use App\Actions\Fulfilment\PalletReturnItem\UndoPickingPalletFromReturn;
use App\Actions\Fulfilment\StoredItem\UpdateQuantityStoredItemPalletApp;
use App\Actions\UI\Notification\MarkNotificationAsRead;
use App\Actions\UI\Profile\UpdateProfile;
use Illuminate\Support\Facades\Route;


Route::get('{palletDelivery:id}/status', ShowPalletDeliveryStatus::class)->name('pallet_delivery.status');
Route::get('pallet-delivery/{palletDelivery:id}/status', ShowPalletDeliveryStatus::class)->name('pallet_delivery.status');

0 comments on commit 0d9f9aa

Please sign in to comment.