Compare commits
156 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eda60066b1 | ||
|
|
276be44fa4 | ||
|
|
3a1b34602c | ||
|
|
d016a66601 | ||
|
|
df885e3805 | ||
|
|
178f2e0bda | ||
|
|
b6c5660d5e | ||
|
|
f7ce006c58 | ||
|
|
aaf7d442b3 | ||
|
|
083357f746 | ||
|
|
552d220b69 | ||
|
|
87136fcc42 | ||
|
|
b2989b4967 | ||
|
|
454695928b | ||
|
|
74ab9b3041 | ||
|
|
7a2004637d | ||
|
|
2dacdbabd6 | ||
|
|
d0efb0f527 | ||
|
|
9d2c5323ae | ||
|
|
bd8e90b5e4 | ||
|
|
ef674986c2 | ||
|
|
d5ed718874 | ||
|
|
0d527654ae | ||
|
|
64d418dcc9 | ||
|
|
946342d975 | ||
|
|
081c7a3599 | ||
|
|
e9454f9dbb | ||
|
|
78466ec482 | ||
|
|
eca7a9adbf | ||
|
|
192e72f554 | ||
|
|
327defbee0 | ||
|
|
dd4f4ce253 | ||
|
|
fab265cd68 | ||
|
|
24c151cc99 | ||
|
|
e8a6ab07de | ||
|
|
cd7d5f5fe9 | ||
|
|
0e05779f89 | ||
|
|
28d6200136 | ||
|
|
c8f895c759 | ||
|
|
c40016bba1 | ||
|
|
71e0d65f31 | ||
|
|
da0c3afc14 | ||
|
|
e857a58d00 | ||
|
|
cfac370e2e | ||
|
|
08354b44b6 | ||
|
|
ed593c25b0 | ||
|
|
c52b13cc51 | ||
|
|
7b910c5af6 | ||
|
|
961829a0c7 | ||
|
|
36faed679e | ||
|
|
cef7a4e4b0 | ||
|
|
a87f5756b2 | ||
|
|
f174aa74cf | ||
|
|
0874259eba | ||
|
|
dfaa74be01 | ||
|
|
3ac3cbc7ff | ||
|
|
62363253ce | ||
|
|
16dfc32f73 | ||
|
|
65df9aa04e | ||
|
|
584fee7e69 | ||
|
|
5d36639705 | ||
|
|
8e42639134 | ||
|
|
a94d8a4b49 | ||
|
|
b9999caf8d | ||
|
|
4d6ff9b726 | ||
|
|
82697ed416 | ||
|
|
0d5958aae6 | ||
|
|
e66f3ce17d | ||
|
|
0edef37e50 | ||
|
|
eb72abb9d2 | ||
|
|
0ea946a2f6 | ||
|
|
8be89194e3 | ||
|
|
f882b431b7 | ||
|
|
889cc66c07 | ||
|
|
9d28162ec4 | ||
|
|
5ca0f4ddde | ||
|
|
db684cf35f | ||
|
|
7a5c91e55e | ||
|
|
e2263911f3 | ||
|
|
aef658645b | ||
|
|
1e1172b757 | ||
|
|
a15cc29a61 | ||
|
|
b31602b040 | ||
|
|
8d43d71370 | ||
|
|
020e2f8526 | ||
|
|
35306547c9 | ||
|
|
c5fe5987da | ||
|
|
4b0775b5ea | ||
|
|
7a6c154e5f | ||
|
|
769949b3c3 | ||
|
|
5a0cc6c519 | ||
|
|
99586179d7 | ||
|
|
87e66c1d13 | ||
|
|
b3dc0ff3c4 | ||
|
|
14ceb300cf | ||
|
|
44ffc4d34e | ||
|
|
b166fa01e1 | ||
|
|
f9ded6d01c | ||
|
|
4ff3daecab | ||
|
|
6388c2a085 | ||
|
|
46e9a873ab | ||
|
|
644b3f6c16 | ||
|
|
87bd150f6b | ||
|
|
283038e5f4 | ||
|
|
46a3ae4dc3 | ||
|
|
99822b5a51 | ||
|
|
0ca572537c | ||
|
|
c4e1bfa80a | ||
|
|
b67ea17584 | ||
|
|
055ce2eb5d | ||
|
|
53f86fce63 | ||
|
|
75646a5f49 | ||
|
|
81dc370134 | ||
|
|
ce28473860 | ||
|
|
534e14f2e8 | ||
|
|
38de1011ee | ||
|
|
f29ef10a43 | ||
|
|
53e5f47bcf | ||
|
|
c9b64d4fe5 | ||
|
|
7125bf8ead | ||
|
|
e5f3ea4d04 | ||
|
|
772cd92f85 | ||
|
|
f8537635bc | ||
|
|
a3c7193e05 | ||
|
|
2740798612 | ||
|
|
f07fae78a2 | ||
|
|
eb91d4d17f | ||
|
|
5cad93d548 | ||
|
|
152bc58474 | ||
|
|
5d2d58cd7a | ||
|
|
6ff2257144 | ||
|
|
f352408c40 | ||
|
|
c7c2175625 | ||
|
|
2c63b95f86 | ||
|
|
d74badf9b8 | ||
|
|
43a33daa01 | ||
|
|
4f5be11730 | ||
|
|
ed77e6aef9 | ||
|
|
2cf1a2761a | ||
|
|
3c2f785441 | ||
|
|
7661bba6ca | ||
|
|
8db9c7dc4c | ||
|
|
9a8d7b400a | ||
|
|
60497326fe | ||
|
|
2c0961dcc3 | ||
|
|
1f32078053 | ||
|
|
38771721ea | ||
|
|
7ccd63db5f | ||
|
|
5758a1d40c | ||
|
|
28448a34a7 | ||
|
|
f984799a02 | ||
|
|
a94589fb13 | ||
|
|
24cfb976f6 | ||
|
|
931a79444b | ||
|
|
c287334426 | ||
|
|
7547491e46 |
524 changed files with 6431 additions and 2411 deletions
|
|
@ -35,6 +35,13 @@ class OrderLineProductCast implements CastsAttributes
|
||||||
|
|
||||||
$data = Arr::wrap(json_decode($value, true));
|
$data = Arr::wrap(json_decode($value, true));
|
||||||
|
|
||||||
|
$taxRate = Arr::get($data, 'tax_rate');
|
||||||
|
$taxRate = is_numeric($taxRate) ? (float) $taxRate : null;
|
||||||
|
|
||||||
|
if (is_null($taxRate)) {
|
||||||
|
throw new \InvalidArgumentException('The tax rate cannot be null.');
|
||||||
|
}
|
||||||
|
|
||||||
return new OrderLineProduct(
|
return new OrderLineProduct(
|
||||||
incoId: new IncoId(Arr::integer($data, 'inco_id')),
|
incoId: new IncoId(Arr::integer($data, 'inco_id')),
|
||||||
originalId: new ProductId(Uuid::fromString(
|
originalId: new ProductId(Uuid::fromString(
|
||||||
|
|
@ -50,14 +57,8 @@ class OrderLineProductCast implements CastsAttributes
|
||||||
price: new MoneyCast()->get($model, 'price', Arr::get($data, 'price'), []),
|
price: new MoneyCast()->get($model, 'price', Arr::get($data, 'price'), []),
|
||||||
discountedPrice: new MoneyCast()->get($model, 'discounted_price', Arr::get($data, 'discounted_price'), []),
|
discountedPrice: new MoneyCast()->get($model, 'discounted_price', Arr::get($data, 'discounted_price'), []),
|
||||||
priceKgTtc: new MoneyCast()->get($model, 'price_kg_ttc', Arr::get($data, 'price_kg_ttc'), []),
|
priceKgTtc: new MoneyCast()->get($model, 'price_kg_ttc', Arr::get($data, 'price_kg_ttc'), []),
|
||||||
taxRate: match ((float) Arr::float($data, 'tax_rate')) {
|
taxRate: TaxRate::fromPercent($taxRate),
|
||||||
TaxRate::TVA_20->percent() => TaxRate::TVA_20,
|
picture: is_string($picture = Arr::get($data, 'picture')) ? $picture : null,
|
||||||
TaxRate::TVA_5_5->percent() => TaxRate::TVA_5_5,
|
|
||||||
default => throw new \UnexpectedValueException(
|
|
||||||
'Unhandled tax'
|
|
||||||
)
|
|
||||||
},
|
|
||||||
picture: Arr::string($data, 'picture', null),
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,9 @@ declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Console\Commands;
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
use App\Actions\ProductIncos\SynchronizeProductIncosWithArcadiaApi;
|
|
||||||
use App\Contracts\ActionInputEmpty;
|
use App\Contracts\ActionInputEmpty;
|
||||||
use App\Contracts\Executor;
|
use App\Contracts\Executor;
|
||||||
|
use App\Cqs\Actions\ProductIncos\SynchronizeProductIncosWithArcadiaApi;
|
||||||
use App\Jobs\FetchAndUpsertArcadiaProductIncos;
|
use App\Jobs\FetchAndUpsertArcadiaProductIncos;
|
||||||
use Illuminate\Console\Attributes\Description;
|
use Illuminate\Console\Attributes\Description;
|
||||||
use Illuminate\Console\Attributes\Signature;
|
use Illuminate\Console\Attributes\Signature;
|
||||||
|
|
|
||||||
56
app/Console/Commands/UpsertEmployeesFormFile.php
Normal file
56
app/Console/Commands/UpsertEmployeesFormFile.php
Normal file
|
|
@ -0,0 +1,56 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use App\Contracts\Executor;
|
||||||
|
use App\Cqs\Actions\Employee\ImportEmployees;
|
||||||
|
use App\Cqs\Actions\Employee\ImportEmployeesInput;
|
||||||
|
use Illuminate\Console\Attributes\Description;
|
||||||
|
use Illuminate\Console\Attributes\Signature;
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
|
||||||
|
#[Description('Synchronize all employees from a CSV file with Arcadia API')]
|
||||||
|
#[Signature('uwil:employees:upsert {file : The CSV file to import}')]
|
||||||
|
class UpsertEmployeesFormFile extends Command
|
||||||
|
{
|
||||||
|
public function handle(
|
||||||
|
Executor $executor,
|
||||||
|
ImportEmployees $action
|
||||||
|
): int {
|
||||||
|
$file = $this->argument('file');
|
||||||
|
|
||||||
|
if (! file_exists($file)) {
|
||||||
|
$this->error("File not found: {$file}");
|
||||||
|
|
||||||
|
return self::FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->info('Starting synchronous employee import from CSV...');
|
||||||
|
|
||||||
|
$stream = new \SplFileObject($file, 'r');
|
||||||
|
|
||||||
|
if (! $stream->isReadable()) {
|
||||||
|
$this->error("Failed to open file: {$file}");
|
||||||
|
|
||||||
|
return self::FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
$importResult = $executor->execute($action, new ImportEmployeesInput($stream));
|
||||||
|
|
||||||
|
$this->info("Successfully inserted {$importResult->insertedCount} employees.");
|
||||||
|
$this->info("Successfully updated {$importResult->updatedCount} employees.");
|
||||||
|
|
||||||
|
if (! empty($importResult->errors)) {
|
||||||
|
$this->error('Errors occurred during import:');
|
||||||
|
foreach ($importResult->errors as $error) {
|
||||||
|
$this->error($error);
|
||||||
|
}
|
||||||
|
|
||||||
|
return self::FAILURE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return self::SUCCESS;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Basket;
|
namespace App\Cqs\Actions\Basket;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -10,7 +10,7 @@ use Domain\Services\BasketService;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Basket\AddToBasketInput, void>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Basket\AddToBasketInput, void>
|
||||||
*/
|
*/
|
||||||
final class AddToBasket implements Action
|
final class AddToBasket implements Action
|
||||||
{
|
{
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Basket;
|
namespace App\Cqs\Actions\Basket;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Domain\Models\ValueObjects\Entities\ProductId;
|
use Domain\Models\ValueObjects\Entities\ProductId;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Basket;
|
namespace App\Cqs\Actions\Basket;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Basket;
|
namespace App\Cqs\Actions\Basket;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -10,7 +10,7 @@ use Domain\Services\BasketService;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Basket\RemoveQuantityFromBasketInput|\App\Actions\Basket\RemoveProductFromBasketInput, void>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Basket\RemoveQuantityFromBasketInput|\App\Cqs\Actions\Basket\RemoveProductFromBasketInput, void>
|
||||||
*/
|
*/
|
||||||
final class RemoveFromBasket implements Action
|
final class RemoveFromBasket implements Action
|
||||||
{
|
{
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Basket;
|
namespace App\Cqs\Actions\Basket;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Domain\Models\ValueObjects\Entities\ProductId;
|
use Domain\Models\ValueObjects\Entities\ProductId;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Basket;
|
namespace App\Cqs\Actions\Basket;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Domain\Models\ValueObjects\Entities\ProductId;
|
use Domain\Models\ValueObjects\Entities\ProductId;
|
||||||
|
|
@ -2,24 +2,26 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Common;
|
namespace App\Cqs\Actions\Common;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Interfaces\ModelWithOrder;
|
use App\Interfaces\ModelWithOrder;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
use SortDirection;
|
use SortDirection;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Common\ChangeModelOrderInput, bool>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Common\ChangeModelOrderInput, bool>
|
||||||
*/
|
*/
|
||||||
final class ChangeModelOrder implements Action
|
final class ChangeModelOrder implements Action
|
||||||
{
|
{
|
||||||
private const int MAX_ORDER_VALUE = 4294967295;
|
private const int MAX_ORDER_VALUE = 4294967295;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Common\ChangeModelOrderInput $input
|
* @param \App\Cqs\Actions\Common\ChangeModelOrderInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): bool
|
public function __invoke(ActionInput $input): bool
|
||||||
|
|
@ -30,8 +32,17 @@ final class ChangeModelOrder implements Action
|
||||||
$goUp = $input->direction === SortDirection::Ascending;
|
$goUp = $input->direction === SortDirection::Ascending;
|
||||||
$currentOrder = $model->getOrder();
|
$currentOrder = $model->getOrder();
|
||||||
|
|
||||||
|
$usesSoftDeletes = in_array(SoftDeletes::class, class_uses_recursive($model), true)
|
||||||
|
|| method_exists($model, 'trashed');
|
||||||
|
|
||||||
|
/** @var Builder<Model&ModelWithOrder> $baseQuery */
|
||||||
|
$baseQuery = $usesSoftDeletes
|
||||||
|
// @phpstan-ignore method.notFound (withTrashed)
|
||||||
|
? $model::query()->withTrashed()
|
||||||
|
: $model::query();
|
||||||
|
|
||||||
/** @var (Model&ModelWithOrder)|null $adjacentModel */
|
/** @var (Model&ModelWithOrder)|null $adjacentModel */
|
||||||
$adjacentModel = $model::query()
|
$adjacentModel = $baseQuery
|
||||||
->where('order', $goUp ? '<' : '>', $currentOrder)
|
->where('order', $goUp ? '<' : '>', $currentOrder)
|
||||||
->orderBy('order', $goUp ? SortDirection::Descending : SortDirection::Ascending)
|
->orderBy('order', $goUp ? SortDirection::Descending : SortDirection::Ascending)
|
||||||
->first();
|
->first();
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Common;
|
namespace App\Cqs\Actions\Common;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Interfaces\ModelWithOrder;
|
use App\Interfaces\ModelWithOrder;
|
||||||
102
app/Cqs/Actions/Common/ChangeModelOrderPosition.php
Normal file
102
app/Cqs/Actions/Common/ChangeModelOrderPosition.php
Normal file
|
|
@ -0,0 +1,102 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Cqs\Actions\Common;
|
||||||
|
|
||||||
|
use App\Contracts\Action;
|
||||||
|
use App\Contracts\ActionInput;
|
||||||
|
use App\Interfaces\ModelWithOrder;
|
||||||
|
use Illuminate\Database\Eloquent\Builder;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Common\ChangeModelOrderPositionInput, bool>
|
||||||
|
*/
|
||||||
|
final class ChangeModelOrderPosition implements Action
|
||||||
|
{
|
||||||
|
private const int MAX_ORDER_VALUE = 4294967295;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param \App\Cqs\Actions\Common\ChangeModelOrderPositionInput $input
|
||||||
|
*/
|
||||||
|
#[\Override]
|
||||||
|
public function __invoke(ActionInput $input): bool
|
||||||
|
{
|
||||||
|
Assert::isInstanceOf($input, ChangeModelOrderPositionInput::class);
|
||||||
|
|
||||||
|
$model = $input->model;
|
||||||
|
$currentOrder = $model->getOrder();
|
||||||
|
$targetOrder = $input->targetOrder;
|
||||||
|
|
||||||
|
if ($currentOrder === $targetOrder) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
$usesSoftDeletes = in_array(SoftDeletes::class, class_uses_recursive($model), true)
|
||||||
|
|| method_exists($model, 'trashed');
|
||||||
|
|
||||||
|
/** @var Builder<Model&ModelWithOrder> $baseQuery */
|
||||||
|
$baseQuery = $usesSoftDeletes
|
||||||
|
// @phpstan-ignore method.notFound (withTrashed)
|
||||||
|
? $model::query()->withTrashed()
|
||||||
|
: $model::query();
|
||||||
|
|
||||||
|
/** @var int|null $maxOrder */
|
||||||
|
$maxOrder = (clone $baseQuery)->max('order');
|
||||||
|
if ($maxOrder !== null && $targetOrder > $maxOrder) {
|
||||||
|
$targetOrder = (int) $maxOrder;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($currentOrder === $targetOrder) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deactivate timestamps
|
||||||
|
$model->timestamps = false;
|
||||||
|
|
||||||
|
// Step 1: Temporarily park the moving model at MAX_ORDER_VALUE
|
||||||
|
$model->setOrder(self::MAX_ORDER_VALUE);
|
||||||
|
$model->saveQuietly();
|
||||||
|
|
||||||
|
if ($targetOrder < $currentOrder) {
|
||||||
|
// Moving UP
|
||||||
|
/** @var \Illuminate\Database\Eloquent\Collection<int, Model&ModelWithOrder> $itemsToShift */
|
||||||
|
$itemsToShift = (clone $baseQuery)
|
||||||
|
->where('order', '>=', $targetOrder)
|
||||||
|
->where('order', '<', $currentOrder)
|
||||||
|
->whereKeyNot($model->getKey())
|
||||||
|
->orderBy('order', 'desc')
|
||||||
|
->get();
|
||||||
|
|
||||||
|
foreach ($itemsToShift as $item) {
|
||||||
|
$item->timestamps = false;
|
||||||
|
$item->setOrder($item->getOrder() + 1);
|
||||||
|
$item->saveQuietly();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// Moving DOWN
|
||||||
|
/** @var \Illuminate\Database\Eloquent\Collection<int, Model&ModelWithOrder> $itemsToShift */
|
||||||
|
$itemsToShift = (clone $baseQuery)
|
||||||
|
->where('order', '>', $currentOrder)
|
||||||
|
->where('order', '<=', $targetOrder)
|
||||||
|
->whereKeyNot($model->getKey())
|
||||||
|
->orderBy('order', 'asc')
|
||||||
|
->get();
|
||||||
|
|
||||||
|
foreach ($itemsToShift as $item) {
|
||||||
|
$item->timestamps = false;
|
||||||
|
$item->setOrder($item->getOrder() - 1);
|
||||||
|
$item->saveQuietly();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Step 2: Set the moving model to the target order
|
||||||
|
$model->setOrder($targetOrder);
|
||||||
|
$model->saveQuietly();
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
22
app/Cqs/Actions/Common/ChangeModelOrderPositionInput.php
Normal file
22
app/Cqs/Actions/Common/ChangeModelOrderPositionInput.php
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Cqs\Actions\Common;
|
||||||
|
|
||||||
|
use App\Contracts\ActionInput;
|
||||||
|
use App\Interfaces\ModelWithOrder;
|
||||||
|
use Illuminate\Database\Eloquent\Model;
|
||||||
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
|
final readonly class ChangeModelOrderPositionInput implements ActionInput
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
public Model & ModelWithOrder $model,
|
||||||
|
public int $targetOrder,
|
||||||
|
) {
|
||||||
|
Assert::isInstanceOf($this->model, Model::class);
|
||||||
|
Assert::isInstanceOf($this->model, ModelWithOrder::class);
|
||||||
|
Assert::greaterThanEq($this->targetOrder, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Common;
|
namespace App\Cqs\Actions\Common;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -13,12 +13,12 @@ use Illuminate\Database\Eloquent\Model;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Common\ExecuteMassActionInput, int>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Common\ExecuteMassActionInput, int>
|
||||||
*/
|
*/
|
||||||
final class ExecuteMassAction implements Action
|
final class ExecuteMassAction implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Common\ExecuteMassActionInput $input
|
* @param \App\Cqs\Actions\Common\ExecuteMassActionInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): int
|
public function __invoke(ActionInput $input): int
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Common;
|
namespace App\Cqs\Actions\Common;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Enums\MassActionType;
|
use App\Enums\MassActionType;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Common;
|
namespace App\Cqs\Actions\Common;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -11,12 +11,12 @@ use Illuminate\Database\Eloquent\Model;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Common\ToggleModelStarInput, \Illuminate\Database\Eloquent\Model&\App\Interfaces\ModelWithStar>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Common\ToggleModelStarInput, \Illuminate\Database\Eloquent\Model&\App\Interfaces\ModelWithStar>
|
||||||
*/
|
*/
|
||||||
final class ToggleModelStar implements Action
|
final class ToggleModelStar implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Common\ToggleModelStarInput $input
|
* @param \App\Cqs\Actions\Common\ToggleModelStarInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): Model & ModelWithStar
|
public function __invoke(ActionInput $input): Model & ModelWithStar
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Common;
|
namespace App\Cqs\Actions\Common;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Interfaces\ModelWithStar;
|
use App\Interfaces\ModelWithStar;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Common;
|
namespace App\Cqs\Actions\Common;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -11,12 +11,15 @@ use Illuminate\Database\Eloquent\Model;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Common\ToggleModelStatusInput, \Illuminate\Database\Eloquent\Model&\App\Interfaces\ModelWithStatus>
|
* @implements \App\Contracts\Action<
|
||||||
|
* \App\Cqs\Actions\Common\ToggleModelStatusInput,
|
||||||
|
* \Illuminate\Database\Eloquent\Model&\App\Interfaces\ModelWithStatus
|
||||||
|
* >
|
||||||
*/
|
*/
|
||||||
final class ToggleModelStatus implements Action
|
final class ToggleModelStatus implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Common\ToggleModelStatusInput $input
|
* @param \App\Cqs\Actions\Common\ToggleModelStatusInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): Model & ModelWithStatus
|
public function __invoke(ActionInput $input): Model & ModelWithStatus
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Common;
|
namespace App\Cqs\Actions\Common;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Interfaces\ModelWithStatus;
|
use App\Interfaces\ModelWithStatus;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Crm;
|
namespace App\Cqs\Actions\Crm;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -10,7 +10,7 @@ use App\Services\CrmService;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Crm\UnsubscribeFromNewsletterInput, \App\Actions\Crm\UnsubscribeFromNewsletterOutput>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Crm\UnsubscribeFromNewsletterInput, \App\Cqs\Actions\Crm\UnsubscribeFromNewsletterOutput>
|
||||||
*/
|
*/
|
||||||
final class UnsubscribeFromNewsletter implements Action
|
final class UnsubscribeFromNewsletter implements Action
|
||||||
{
|
{
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Crm;
|
namespace App\Cqs\Actions\Crm;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Shared\ValueObjects\CrmHashcode;
|
use Shared\ValueObjects\CrmHashcode;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Crm;
|
namespace App\Cqs\Actions\Crm;
|
||||||
|
|
||||||
enum UnsubscribeFromNewsletterOutput
|
enum UnsubscribeFromNewsletterOutput
|
||||||
{
|
{
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Crm;
|
namespace App\Cqs\Actions\Crm;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -11,7 +11,7 @@ use Infrastructure\Adapters\Services\AppCustomerAuthService;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Crm\UpdateCustomerInput, \App\Actions\Crm\UpdateCustomerOutput>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Crm\UpdateCustomerInput, \App\Cqs\Actions\Crm\UpdateCustomerOutput>
|
||||||
*/
|
*/
|
||||||
final class UpdateCustomer implements Action
|
final class UpdateCustomer implements Action
|
||||||
{
|
{
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Crm;
|
namespace App\Cqs\Actions\Crm;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Crm;
|
namespace App\Cqs\Actions\Crm;
|
||||||
|
|
||||||
use Domain\Models\ValueObjects\CrmCustomer;
|
use Domain\Models\ValueObjects\CrmCustomer;
|
||||||
use Illuminate\Validation\ValidationException;
|
use Illuminate\Validation\ValidationException;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Crm;
|
namespace App\Cqs\Actions\Crm;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -12,7 +12,7 @@ use Infrastructure\Adapters\Services\AppCustomerAuthService;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Crm\UpdateCustomerPasswordInput, \App\Actions\Crm\UpdateCustomerPasswordOutput>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Crm\UpdateCustomerPasswordInput, \App\Cqs\Actions\Crm\UpdateCustomerPasswordOutput>
|
||||||
*/
|
*/
|
||||||
final class UpdateCustomerPassword implements Action
|
final class UpdateCustomerPassword implements Action
|
||||||
{
|
{
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Crm;
|
namespace App\Cqs\Actions\Crm;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Crm;
|
namespace App\Cqs\Actions\Crm;
|
||||||
|
|
||||||
use Domain\Models\ValueObjects\CrmCustomer;
|
use Domain\Models\ValueObjects\CrmCustomer;
|
||||||
use Illuminate\Validation\ValidationException;
|
use Illuminate\Validation\ValidationException;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Customers;
|
namespace App\Cqs\Actions\Customers;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -21,7 +21,7 @@ use Shared\ValueObjects\CrmHashcode;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Customers\RegisterCustomerInput, \App\Models\Customer>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Customers\RegisterCustomerInput, \App\Models\Customer>
|
||||||
*/
|
*/
|
||||||
final class RegisterCustomer implements Action
|
final class RegisterCustomer implements Action
|
||||||
{
|
{
|
||||||
|
|
@ -33,7 +33,7 @@ final class RegisterCustomer implements Action
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Customers\RegisterCustomerInput $input
|
* @param \App\Cqs\Actions\Customers\RegisterCustomerInput $input
|
||||||
*
|
*
|
||||||
* @throws ValidationException
|
* @throws ValidationException
|
||||||
* @throws \UnexpectedValueException
|
* @throws \UnexpectedValueException
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Customers;
|
namespace App\Cqs\Actions\Customers;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Domain\Models\ValueObjects\Code;
|
use Domain\Models\ValueObjects\Code;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Discounts;
|
namespace App\Cqs\Actions\Discounts;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -12,12 +12,12 @@ use Illuminate\Support\Carbon;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Discounts\CreateDiscountInput, \App\Models\Discount>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Discounts\CreateDiscountInput, \App\Models\Discount>
|
||||||
*/
|
*/
|
||||||
final class CreateDiscount implements Action
|
final class CreateDiscount implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Discounts\CreateDiscountInput $input
|
* @param \App\Cqs\Actions\Discounts\CreateDiscountInput $input
|
||||||
*/
|
*/
|
||||||
public function __invoke(ActionInput $input): Discount
|
public function __invoke(ActionInput $input): Discount
|
||||||
{
|
{
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Discounts;
|
namespace App\Cqs\Actions\Discounts;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Domain\Enums\DiscountType;
|
use Domain\Enums\DiscountType;
|
||||||
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Discounts;
|
namespace App\Cqs\Actions\Discounts;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Discounts\DeleteDiscountInput, bool>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Discounts\DeleteDiscountInput, bool>
|
||||||
*/
|
*/
|
||||||
final class DeleteDiscount implements Action
|
final class DeleteDiscount implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Discounts\DeleteDiscountInput $input
|
* @param \App\Cqs\Actions\Discounts\DeleteDiscountInput $input
|
||||||
*/
|
*/
|
||||||
public function __invoke(ActionInput $input): bool
|
public function __invoke(ActionInput $input): bool
|
||||||
{
|
{
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Discounts;
|
namespace App\Cqs\Actions\Discounts;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Models\Discount;
|
use App\Models\Discount;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Discounts;
|
namespace App\Cqs\Actions\Discounts;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -12,12 +12,12 @@ use Illuminate\Support\Carbon;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Discounts\UpdateDiscountInput, \App\Models\Discount>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Discounts\UpdateDiscountInput, \App\Models\Discount>
|
||||||
*/
|
*/
|
||||||
final class UpdateDiscount implements Action
|
final class UpdateDiscount implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Discounts\UpdateDiscountInput $input
|
* @param \App\Cqs\Actions\Discounts\UpdateDiscountInput $input
|
||||||
*/
|
*/
|
||||||
public function __invoke(ActionInput $input): Discount
|
public function __invoke(ActionInput $input): Discount
|
||||||
{
|
{
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Discounts;
|
namespace App\Cqs\Actions\Discounts;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Models\Discount;
|
use App\Models\Discount;
|
||||||
106
app/Cqs/Actions/Employee/ImportEmployees.php
Normal file
106
app/Cqs/Actions/Employee/ImportEmployees.php
Normal file
|
|
@ -0,0 +1,106 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Cqs\Actions\Employee;
|
||||||
|
|
||||||
|
use App\Contracts\Action;
|
||||||
|
use App\Contracts\ActionInput;
|
||||||
|
use App\Services\ArcadiaEmployee;
|
||||||
|
use App\Services\EmployeeCsvImportLineService as ServicesEmployeeCsvImportLine;
|
||||||
|
use App\Services\EmployeeCsvReaderService;
|
||||||
|
use App\Services\EmployeeUpsertService;
|
||||||
|
use Domain\Models\ValueObjects\Matricule;
|
||||||
|
use Domain\Models\ValueObjects\ShopperEstablishmentCode;
|
||||||
|
use Domain\Models\ValueObjects\ShopperServiceCode;
|
||||||
|
use Domain\Models\ValueObjects\ShopperSiteCode;
|
||||||
|
use Psr\Log\LoggerInterface;
|
||||||
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Employee\ImportEmployeesInput, \App\Cqs\Actions\Employee\ImportEmployeesOutput>
|
||||||
|
*/
|
||||||
|
final class ImportEmployees implements Action
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
private readonly LoggerInterface $logger,
|
||||||
|
private readonly EmployeeCsvReaderService $employeeCsvReaderService,
|
||||||
|
private readonly EmployeeUpsertService $employeeUpsertService,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @param \App\Cqs\Actions\Employee\ImportEmployeesInput $input */
|
||||||
|
public function __invoke(ActionInput $input): ImportEmployeesOutput
|
||||||
|
{
|
||||||
|
Assert::isAOf($input, ImportEmployeesInput::class);
|
||||||
|
|
||||||
|
$csvLines = $this->employeeCsvReaderService->importEmployeesFromCsv($input->inputStream);
|
||||||
|
|
||||||
|
$this->logger->debug('Retrieved employees from CSV.', [
|
||||||
|
'count' => count([...$csvLines]),
|
||||||
|
]);
|
||||||
|
|
||||||
|
$csvErrors = array_filter(
|
||||||
|
$csvLines,
|
||||||
|
fn ($employee) => is_string($employee)
|
||||||
|
);
|
||||||
|
|
||||||
|
$importedEmployees = array_map(
|
||||||
|
fn (ServicesEmployeeCsvImportLine $csvLine) => $this->mapToArcadiaEmployee($csvLine),
|
||||||
|
array_filter(
|
||||||
|
$csvLines,
|
||||||
|
fn ($employee) => $employee instanceof ServicesEmployeeCsvImportLine
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
$employees = array_filter(
|
||||||
|
$importedEmployees,
|
||||||
|
fn ($employee) => $employee instanceof ArcadiaEmployee
|
||||||
|
);
|
||||||
|
|
||||||
|
$mappingErrors = array_filter(
|
||||||
|
$importedEmployees,
|
||||||
|
fn ($employee) => is_string($employee)
|
||||||
|
);
|
||||||
|
|
||||||
|
$result = $this->employeeUpsertService->upsertEmployees($employees);
|
||||||
|
|
||||||
|
$totalInserted = $result->insertedCount;
|
||||||
|
$totalUpdated = $result->updatedCount;
|
||||||
|
$errors = array_values([
|
||||||
|
...$csvErrors,
|
||||||
|
...$mappingErrors,
|
||||||
|
...$result->errors,
|
||||||
|
]);
|
||||||
|
|
||||||
|
$this->logger->info('Employee synchronization completed successfully.', [
|
||||||
|
'total_inserted' => $totalInserted,
|
||||||
|
'total_updated' => $totalUpdated,
|
||||||
|
'errors_count' => count($errors),
|
||||||
|
]);
|
||||||
|
|
||||||
|
return new ImportEmployeesOutput(
|
||||||
|
insertedCount: $totalInserted,
|
||||||
|
updatedCount: $totalUpdated,
|
||||||
|
errors: $errors,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function mapToArcadiaEmployee(ServicesEmployeeCsvImportLine $csvLine): ArcadiaEmployee | string
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
return new ArcadiaEmployee(
|
||||||
|
matricule: new Matricule($csvLine->matricule),
|
||||||
|
lastname: $csvLine->lastName,
|
||||||
|
firstname: $csvLine->firstName,
|
||||||
|
startDate: $csvLine->startDate,
|
||||||
|
endDate: $csvLine->endDate ?? $csvLine->expectedEndDate,
|
||||||
|
etablissement: new ShopperEstablishmentCode($csvLine->establishment),
|
||||||
|
site: new ShopperSiteCode($csvLine->site),
|
||||||
|
service: new ShopperServiceCode($csvLine->service),
|
||||||
|
);
|
||||||
|
} catch (\Throwable $e) {
|
||||||
|
return "Matricule {$csvLine->matricule}: {$e->getMessage()}";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
18
app/Cqs/Actions/Employee/ImportEmployeesInput.php
Normal file
18
app/Cqs/Actions/Employee/ImportEmployeesInput.php
Normal file
|
|
@ -0,0 +1,18 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Cqs\Actions\Employee;
|
||||||
|
|
||||||
|
use App\Contracts\ActionInput;
|
||||||
|
|
||||||
|
final readonly class ImportEmployeesInput implements ActionInput
|
||||||
|
{
|
||||||
|
public function __construct(
|
||||||
|
public \SplFileObject $inputStream
|
||||||
|
) {
|
||||||
|
if (! $inputStream->isReadable()) {
|
||||||
|
throw new \InvalidArgumentException('Input stream must be readable.');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
23
app/Cqs/Actions/Employee/ImportEmployeesOutput.php
Normal file
23
app/Cqs/Actions/Employee/ImportEmployeesOutput.php
Normal file
|
|
@ -0,0 +1,23 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Cqs\Actions\Employee;
|
||||||
|
|
||||||
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
|
final readonly class ImportEmployeesOutput
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* @param array<int, string> $errors
|
||||||
|
*/
|
||||||
|
public function __construct(
|
||||||
|
public int $insertedCount,
|
||||||
|
public int $updatedCount,
|
||||||
|
public array $errors
|
||||||
|
) {
|
||||||
|
Assert::greaterThanEq($insertedCount, 0);
|
||||||
|
Assert::greaterThanEq($updatedCount, 0);
|
||||||
|
Assert::allString($errors);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Employee;
|
namespace App\Cqs\Actions\Employee;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Faqs;
|
namespace App\Cqs\Actions\Faqs;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -10,12 +10,12 @@ use App\Models\Faq;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Faqs\CreateFaqInput, \App\Models\Faq>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Faqs\CreateFaqInput, \App\Models\Faq>
|
||||||
*/
|
*/
|
||||||
final class CreateFaq implements Action
|
final class CreateFaq implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Faqs\CreateFaqInput $input
|
* @param \App\Cqs\Actions\Faqs\CreateFaqInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): Faq
|
public function __invoke(ActionInput $input): Faq
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Faqs;
|
namespace App\Cqs\Actions\Faqs;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Faqs;
|
namespace App\Cqs\Actions\Faqs;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Faqs\DeleteFaqInput, void>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Faqs\DeleteFaqInput, void>
|
||||||
*/
|
*/
|
||||||
final class DeleteFaq implements Action
|
final class DeleteFaq implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Faqs\DeleteFaqInput $input
|
* @param \App\Cqs\Actions\Faqs\DeleteFaqInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): void
|
public function __invoke(ActionInput $input): void
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Faqs;
|
namespace App\Cqs\Actions\Faqs;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Models\Faq;
|
use App\Models\Faq;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Faqs;
|
namespace App\Cqs\Actions\Faqs;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -10,12 +10,12 @@ use App\Models\Faq;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Faqs\UpdateFaqInput, \App\Models\Faq>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Faqs\UpdateFaqInput, \App\Models\Faq>
|
||||||
*/
|
*/
|
||||||
final class UpdateFaq implements Action
|
final class UpdateFaq implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Faqs\UpdateFaqInput $input
|
* @param \App\Cqs\Actions\Faqs\UpdateFaqInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): Faq
|
public function __invoke(ActionInput $input): Faq
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Faqs;
|
namespace App\Cqs\Actions\Faqs;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Models\Faq;
|
use App\Models\Faq;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Orders;
|
namespace App\Cqs\Actions\Orders;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -11,7 +11,7 @@ use Domain\Services\OrderTunnelService;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Orders\ApplyPickTimeSlotInput, ?\Domain\Models\ValueObjects\PickupTimeSlot>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Orders\ApplyPickTimeSlotInput, ?\Domain\Models\ValueObjects\PickupTimeSlot>
|
||||||
*/
|
*/
|
||||||
final class ApplyPickTimeSlot implements Action
|
final class ApplyPickTimeSlot implements Action
|
||||||
{
|
{
|
||||||
|
|
@ -21,7 +21,7 @@ final class ApplyPickTimeSlot implements Action
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Orders\ApplyPickTimeSlotInput $input
|
* @param \App\Cqs\Actions\Orders\ApplyPickTimeSlotInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): ?PickupTimeSlot
|
public function __invoke(ActionInput $input): ?PickupTimeSlot
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Orders;
|
namespace App\Cqs\Actions\Orders;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Carbon\CarbonInterface;
|
use Carbon\CarbonInterface;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Orders;
|
namespace App\Cqs\Actions\Orders;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -10,7 +10,7 @@ use Domain\Services\OrderService as DomainOrderService;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Orders\CancelOrderInput, void>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Orders\CancelOrderInput, void>
|
||||||
*/
|
*/
|
||||||
final class CancelOrder implements Action
|
final class CancelOrder implements Action
|
||||||
{
|
{
|
||||||
|
|
@ -20,7 +20,7 @@ final class CancelOrder implements Action
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Orders\CancelOrderInput $input
|
* @param \App\Cqs\Actions\Orders\CancelOrderInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): void
|
public function __invoke(ActionInput $input): void
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Orders;
|
namespace App\Cqs\Actions\Orders;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Models\Order;
|
use App\Models\Order;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Orders;
|
namespace App\Cqs\Actions\Orders;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -11,7 +11,7 @@ use Domain\Services\OrderTunnelService;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Orders\FinalizeOrderInput, \Domain\Models\ValueObjects\OrderReference>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Orders\FinalizeOrderInput, \Domain\Models\ValueObjects\OrderReference>
|
||||||
*/
|
*/
|
||||||
final class FinalizeOrder implements Action
|
final class FinalizeOrder implements Action
|
||||||
{
|
{
|
||||||
|
|
@ -21,7 +21,7 @@ final class FinalizeOrder implements Action
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Orders\FinalizeOrderInput $input
|
* @param \App\Cqs\Actions\Orders\FinalizeOrderInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): OrderReference
|
public function __invoke(ActionInput $input): OrderReference
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Orders;
|
namespace App\Cqs\Actions\Orders;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Domain\Models\ValueObjects\Entities\ShopperId;
|
use Domain\Models\ValueObjects\Entities\ShopperId;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Orders;
|
namespace App\Cqs\Actions\Orders;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -10,7 +10,7 @@ use Domain\Services\OrderTunnelService;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Orders\InitializeOrderTunnelInput, void>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Orders\InitializeOrderTunnelInput, void>
|
||||||
*/
|
*/
|
||||||
final class InitializeOrderTunnel implements Action
|
final class InitializeOrderTunnel implements Action
|
||||||
{
|
{
|
||||||
|
|
@ -20,7 +20,7 @@ final class InitializeOrderTunnel implements Action
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Orders\InitializeOrderTunnelInput $input
|
* @param \App\Cqs\Actions\Orders\InitializeOrderTunnelInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): void
|
public function __invoke(ActionInput $input): void
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Orders;
|
namespace App\Cqs\Actions\Orders;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Domain\Models\Entities\Basket;
|
use Domain\Models\Entities\Basket;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Pages;
|
namespace App\Cqs\Actions\Pages;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -10,12 +10,12 @@ use App\Models\Page;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Pages\UpdatePageInput, \App\Models\Page>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Pages\UpdatePageInput, \App\Models\Page>
|
||||||
*/
|
*/
|
||||||
final class UpdatePage implements Action
|
final class UpdatePage implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Pages\UpdatePageInput $input
|
* @param \App\Cqs\Actions\Pages\UpdatePageInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): Page
|
public function __invoke(ActionInput $input): Page
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Pages;
|
namespace App\Cqs\Actions\Pages;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Models\Page;
|
use App\Models\Page;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\PickupExceptions;
|
namespace App\Cqs\Actions\PickupExceptions;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -10,12 +10,12 @@ use App\Models\PickupException;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\PickupExceptions\CreatePickupExceptionInput, \App\Models\PickupException>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\PickupExceptions\CreatePickupExceptionInput, \App\Models\PickupException>
|
||||||
*/
|
*/
|
||||||
final class CreatePickupException implements Action
|
final class CreatePickupException implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\PickupExceptions\CreatePickupExceptionInput $input
|
* @param \App\Cqs\Actions\PickupExceptions\CreatePickupExceptionInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): PickupException
|
public function __invoke(ActionInput $input): PickupException
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\PickupExceptions;
|
namespace App\Cqs\Actions\PickupExceptions;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Domain\Enums\RepeatFrequency;
|
use Domain\Enums\RepeatFrequency;
|
||||||
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\PickupExceptions;
|
namespace App\Cqs\Actions\PickupExceptions;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\PickupExceptions\DeletePickupExceptionInput, bool>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\PickupExceptions\DeletePickupExceptionInput, bool>
|
||||||
*/
|
*/
|
||||||
final class DeletePickupException implements Action
|
final class DeletePickupException implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\PickupExceptions\DeletePickupExceptionInput $input
|
* @param \App\Cqs\Actions\PickupExceptions\DeletePickupExceptionInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): bool
|
public function __invoke(ActionInput $input): bool
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\PickupExceptions;
|
namespace App\Cqs\Actions\PickupExceptions;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Models\PickupException;
|
use App\Models\PickupException;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\PickupExceptions;
|
namespace App\Cqs\Actions\PickupExceptions;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -10,12 +10,12 @@ use App\Models\PickupException;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\PickupExceptions\UpdatePickupExceptionInput, \App\Models\PickupException>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\PickupExceptions\UpdatePickupExceptionInput, \App\Models\PickupException>
|
||||||
*/
|
*/
|
||||||
final class UpdatePickupException implements Action
|
final class UpdatePickupException implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\PickupExceptions\UpdatePickupExceptionInput $input
|
* @param \App\Cqs\Actions\PickupExceptions\UpdatePickupExceptionInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): PickupException
|
public function __invoke(ActionInput $input): PickupException
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\PickupExceptions;
|
namespace App\Cqs\Actions\PickupExceptions;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Models\PickupException;
|
use App\Models\PickupException;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\ProductIncos;
|
namespace App\Cqs\Actions\ProductIncos;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -11,7 +11,7 @@ use App\Services\ArcadiaIncoService;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\ProductIncos\AssociateProductIncoInput, \App\Models\ProductInco>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\ProductIncos\AssociateProductIncoInput, \App\Models\ProductInco>
|
||||||
*/
|
*/
|
||||||
final class AssociateProductInco implements Action
|
final class AssociateProductInco implements Action
|
||||||
{
|
{
|
||||||
|
|
@ -21,7 +21,7 @@ final class AssociateProductInco implements Action
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\ProductIncos\AssociateProductIncoInput $input
|
* @param \App\Cqs\Actions\ProductIncos\AssociateProductIncoInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): ProductInco
|
public function __invoke(ActionInput $input): ProductInco
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\ProductIncos;
|
namespace App\Cqs\Actions\ProductIncos;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Models\Product;
|
use App\Models\Product;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\ProductIncos;
|
namespace App\Cqs\Actions\ProductIncos;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -11,7 +11,7 @@ use App\Services\ArcadiaIncoService;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\ProductIncos\SyncProductIncoInput, \App\Models\ProductInco>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\ProductIncos\SyncProductIncoInput, \App\Models\ProductInco>
|
||||||
*/
|
*/
|
||||||
final class SyncProductInco implements Action
|
final class SyncProductInco implements Action
|
||||||
{
|
{
|
||||||
|
|
@ -21,7 +21,7 @@ final class SyncProductInco implements Action
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\ProductIncos\SyncProductIncoInput $input
|
* @param \App\Cqs\Actions\ProductIncos\SyncProductIncoInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): ProductInco
|
public function __invoke(ActionInput $input): ProductInco
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\ProductIncos;
|
namespace App\Cqs\Actions\ProductIncos;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Models\Product;
|
use App\Models\Product;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\ProductIncos;
|
namespace App\Cqs\Actions\ProductIncos;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Products;
|
namespace App\Cqs\Actions\Products;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -13,12 +13,12 @@ use Illuminate\Support\Str;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Products\CreateProductInput, \App\Models\Product>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Products\CreateProductInput, \App\Models\Product>
|
||||||
*/
|
*/
|
||||||
final class CreateProduct implements Action
|
final class CreateProduct implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Products\CreateProductInput $input
|
* @param \App\Cqs\Actions\Products\CreateProductInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): Product
|
public function __invoke(ActionInput $input): Product
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Products;
|
namespace App\Cqs\Actions\Products;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Carbon\CarbonInterface;
|
use Carbon\CarbonInterface;
|
||||||
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Products;
|
namespace App\Cqs\Actions\Products;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Products\DeleteProductInput, bool>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Products\DeleteProductInput, bool>
|
||||||
*/
|
*/
|
||||||
final class DeleteProduct implements Action
|
final class DeleteProduct implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Products\DeleteProductInput $input
|
* @param \App\Cqs\Actions\Products\DeleteProductInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): bool
|
public function __invoke(ActionInput $input): bool
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Products;
|
namespace App\Cqs\Actions\Products;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Models\Product;
|
use App\Models\Product;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Products;
|
namespace App\Cqs\Actions\Products;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -13,12 +13,12 @@ use Illuminate\Support\Str;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Products\UpdateProductInput, \App\Models\Product>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Products\UpdateProductInput, \App\Models\Product>
|
||||||
*/
|
*/
|
||||||
final class UpdateProduct implements Action
|
final class UpdateProduct implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Products\UpdateProductInput $input
|
* @param \App\Cqs\Actions\Products\UpdateProductInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): Product
|
public function __invoke(ActionInput $input): Product
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Products;
|
namespace App\Cqs\Actions\Products;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Models\Product;
|
use App\Models\Product;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Ranges;
|
namespace App\Cqs\Actions\Ranges;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -10,12 +10,12 @@ use App\Models\Range;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Ranges\CreateRangeInput, \App\Models\Range>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Ranges\CreateRangeInput, \App\Models\Range>
|
||||||
*/
|
*/
|
||||||
final class CreateRange implements Action
|
final class CreateRange implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Ranges\CreateRangeInput $input
|
* @param \App\Cqs\Actions\Ranges\CreateRangeInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): Range
|
public function __invoke(ActionInput $input): Range
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Ranges;
|
namespace App\Cqs\Actions\Ranges;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Domain\Models\ValueObjects\PictureMetadata;
|
use Domain\Models\ValueObjects\PictureMetadata;
|
||||||
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Ranges;
|
namespace App\Cqs\Actions\Ranges;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Ranges\DeleteRangeInput, bool>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Ranges\DeleteRangeInput, bool>
|
||||||
*/
|
*/
|
||||||
final class DeleteRange implements Action
|
final class DeleteRange implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Ranges\DeleteRangeInput $input
|
* @param \App\Cqs\Actions\Ranges\DeleteRangeInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): bool
|
public function __invoke(ActionInput $input): bool
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Ranges;
|
namespace App\Cqs\Actions\Ranges;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Models\Range;
|
use App\Models\Range;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Ranges;
|
namespace App\Cqs\Actions\Ranges;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -10,12 +10,12 @@ use App\Models\Range;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Ranges\UpdateRangeInput, \App\Models\Range>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Ranges\UpdateRangeInput, \App\Models\Range>
|
||||||
*/
|
*/
|
||||||
final class UpdateRange implements Action
|
final class UpdateRange implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Ranges\UpdateRangeInput $input
|
* @param \App\Cqs\Actions\Ranges\UpdateRangeInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): Range
|
public function __invoke(ActionInput $input): Range
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Ranges;
|
namespace App\Cqs\Actions\Ranges;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Models\Range;
|
use App\Models\Range;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Settings;
|
namespace App\Cqs\Actions\Settings;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -11,12 +11,12 @@ use Domain\Models\ValueObjects\ShopperSiteCode;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Settings\UpdateSettingsInput, \App\Models\Setting>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Settings\UpdateSettingsInput, \App\Models\Setting>
|
||||||
*/
|
*/
|
||||||
final class UpdateSettings implements Action
|
final class UpdateSettings implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Settings\UpdateSettingsInput $input
|
* @param \App\Cqs\Actions\Settings\UpdateSettingsInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): Setting
|
public function __invoke(ActionInput $input): Setting
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Settings;
|
namespace App\Cqs\Actions\Settings;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Domain\Models\ValueObjects\ShopperSiteCode;
|
use Domain\Models\ValueObjects\ShopperSiteCode;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Shops;
|
namespace App\Cqs\Actions\Shops;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -10,12 +10,12 @@ use App\Models\Shop;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Shops\CreateShopInput, \App\Models\Shop>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Shops\CreateShopInput, \App\Models\Shop>
|
||||||
*/
|
*/
|
||||||
final class CreateShop implements Action
|
final class CreateShop implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Shops\CreateShopInput $input
|
* @param \App\Cqs\Actions\Shops\CreateShopInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): Shop
|
public function __invoke(ActionInput $input): Shop
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Shops;
|
namespace App\Cqs\Actions\Shops;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Domain\Models\ValueObjects\Coordinates;
|
use Domain\Models\ValueObjects\Coordinates;
|
||||||
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Shops;
|
namespace App\Cqs\Actions\Shops;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Shops\DeleteShopInput, bool>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Shops\DeleteShopInput, bool>
|
||||||
*/
|
*/
|
||||||
final class DeleteShop implements Action
|
final class DeleteShop implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Shops\DeleteShopInput $input
|
* @param \App\Cqs\Actions\Shops\DeleteShopInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): bool
|
public function __invoke(ActionInput $input): bool
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Shops;
|
namespace App\Cqs\Actions\Shops;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Models\Shop;
|
use App\Models\Shop;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Shops;
|
namespace App\Cqs\Actions\Shops;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -10,12 +10,12 @@ use App\Models\Shop;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Shops\UpdateShopInput, \App\Models\Shop>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Shops\UpdateShopInput, \App\Models\Shop>
|
||||||
*/
|
*/
|
||||||
final class UpdateShop implements Action
|
final class UpdateShop implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Shops\UpdateShopInput $input
|
* @param \App\Cqs\Actions\Shops\UpdateShopInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): Shop
|
public function __invoke(ActionInput $input): Shop
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Shops;
|
namespace App\Cqs\Actions\Shops;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Models\Shop;
|
use App\Models\Shop;
|
||||||
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Shops;
|
namespace App\Cqs\Actions\Shops;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Shops\UpdateShopPickupExceptionsInput, bool>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Shops\UpdateShopPickupExceptionsInput, bool>
|
||||||
*/
|
*/
|
||||||
final class UpdateShopPickupExceptions implements Action
|
final class UpdateShopPickupExceptions implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Shops\UpdateShopPickupExceptionsInput $input
|
* @param \App\Cqs\Actions\Shops\UpdateShopPickupExceptionsInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): bool
|
public function __invoke(ActionInput $input): bool
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Shops;
|
namespace App\Cqs\Actions\Shops;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Models\Shop;
|
use App\Models\Shop;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Slides;
|
namespace App\Cqs\Actions\Slides;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -11,12 +11,12 @@ use Illuminate\Support\Carbon;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Slides\CreateSlideInput, \App\Models\Slide>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Slides\CreateSlideInput, \App\Models\Slide>
|
||||||
*/
|
*/
|
||||||
final class CreateSlide implements Action
|
final class CreateSlide implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Slides\CreateSlideInput $input
|
* @param \App\Cqs\Actions\Slides\CreateSlideInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): Slide
|
public function __invoke(ActionInput $input): Slide
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Slides;
|
namespace App\Cqs\Actions\Slides;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Domain\Models\ValueObjects\DatePeriod;
|
use Domain\Models\ValueObjects\DatePeriod;
|
||||||
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Slides;
|
namespace App\Cqs\Actions\Slides;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Slides\DeleteSlideInput, bool>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Slides\DeleteSlideInput, bool>
|
||||||
*/
|
*/
|
||||||
final class DeleteSlide implements Action
|
final class DeleteSlide implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Slides\DeleteSlideInput $input
|
* @param \App\Cqs\Actions\Slides\DeleteSlideInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): bool
|
public function __invoke(ActionInput $input): bool
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Slides;
|
namespace App\Cqs\Actions\Slides;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Models\Slide;
|
use App\Models\Slide;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Slides;
|
namespace App\Cqs\Actions\Slides;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -11,12 +11,12 @@ use Illuminate\Support\Carbon;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Slides\UpdateSlideInput, \App\Models\Slide>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Slides\UpdateSlideInput, \App\Models\Slide>
|
||||||
*/
|
*/
|
||||||
final class UpdateSlide implements Action
|
final class UpdateSlide implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Slides\UpdateSlideInput $input
|
* @param \App\Cqs\Actions\Slides\UpdateSlideInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): Slide
|
public function __invoke(ActionInput $input): Slide
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Slides;
|
namespace App\Cqs\Actions\Slides;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Models\Slide;
|
use App\Models\Slide;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Tags;
|
namespace App\Cqs\Actions\Tags;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -10,12 +10,12 @@ use App\Models\Tag;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Tags\CreateTagInput, \App\Models\Tag>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Tags\CreateTagInput, \App\Models\Tag>
|
||||||
*/
|
*/
|
||||||
final class CreateTag implements Action
|
final class CreateTag implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Tags\CreateTagInput $input
|
* @param \App\Cqs\Actions\Tags\CreateTagInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): Tag
|
public function __invoke(ActionInput $input): Tag
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Tags;
|
namespace App\Cqs\Actions\Tags;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
@ -2,19 +2,19 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Tags;
|
namespace App\Cqs\Actions\Tags;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Tags\DeleteTagInput, void>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Tags\DeleteTagInput, void>
|
||||||
*/
|
*/
|
||||||
final class DeleteTag implements Action
|
final class DeleteTag implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Tags\DeleteTagInput $input
|
* @param \App\Cqs\Actions\Tags\DeleteTagInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): void
|
public function __invoke(ActionInput $input): void
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Tags;
|
namespace App\Cqs\Actions\Tags;
|
||||||
|
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
use App\Models\Tag;
|
use App\Models\Tag;
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
namespace App\Actions\Tags;
|
namespace App\Cqs\Actions\Tags;
|
||||||
|
|
||||||
use App\Contracts\Action;
|
use App\Contracts\Action;
|
||||||
use App\Contracts\ActionInput;
|
use App\Contracts\ActionInput;
|
||||||
|
|
@ -10,12 +10,12 @@ use App\Models\Tag;
|
||||||
use Webmozart\Assert\Assert;
|
use Webmozart\Assert\Assert;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @implements \App\Contracts\Action<\App\Actions\Tags\UpdateTagInput, \App\Models\Tag>
|
* @implements \App\Contracts\Action<\App\Cqs\Actions\Tags\UpdateTagInput, \App\Models\Tag>
|
||||||
*/
|
*/
|
||||||
final class UpdateTag implements Action
|
final class UpdateTag implements Action
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @param \App\Actions\Tags\UpdateTagInput $input
|
* @param \App\Cqs\Actions\Tags\UpdateTagInput $input
|
||||||
*/
|
*/
|
||||||
#[\Override]
|
#[\Override]
|
||||||
public function __invoke(ActionInput $input): Tag
|
public function __invoke(ActionInput $input): Tag
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue