-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
34 changed files
with
624 additions
and
251 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
app/Actions/Inventory/OrgStock/Hydrators/OrgStockHydrateMovements.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<?php | ||
/* | ||
* Author: Raul Perusquia <raul@inikoo.com> | ||
* Created: Sat, 31 Aug 2024 10:58:58 Malaysia Time, Kuala Lumpur, Malaysia | ||
* Copyright (c) 2024, Raul A Perusquia Flores | ||
*/ | ||
|
||
namespace App\Actions\Inventory\OrgStock\Hydrators; | ||
|
||
use App\Models\Inventory\OrgStock; | ||
use Illuminate\Queue\Middleware\WithoutOverlapping; | ||
use Lorisleiva\Actions\Concerns\AsAction; | ||
|
||
class OrgStockHydrateMovements | ||
{ | ||
use AsAction; | ||
|
||
private OrgStock $orgStock; | ||
|
||
public function __construct(OrgStock $orgStock) | ||
{ | ||
$this->orgStock = $orgStock; | ||
} | ||
|
||
public function getJobMiddleware(): array | ||
{ | ||
return [(new WithoutOverlapping($this->orgStock->id))->dontRelease()]; | ||
} | ||
|
||
|
||
public function handle(OrgStock $orgStock): void | ||
{ | ||
|
||
$orgStock->stats->update( | ||
[ | ||
'number_movements' => $orgStock->orgStockMovements()->count() | ||
] | ||
); | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.