Compare commits
No commits in common. "ebf856252c12829614df25dc6e15e99b8afa193e" and "267aaa17761bee09e70e70a6b663f78d003028c7" have entirely different histories.
ebf856252c
...
267aaa1776
|
@ -2,14 +2,12 @@
|
||||||
|
|
||||||
namespace App\Invoice\Actions;
|
namespace App\Invoice\Actions;
|
||||||
|
|
||||||
use App\Invoice\Events\InvoicesMassStored;
|
|
||||||
use App\Invoice\Models\Invoice;
|
use App\Invoice\Models\Invoice;
|
||||||
use App\Lib\JobMiddleware\JobChannels;
|
use App\Lib\JobMiddleware\JobChannels;
|
||||||
use App\Lib\JobMiddleware\WithJobState;
|
use App\Lib\JobMiddleware\WithJobState;
|
||||||
use App\Lib\Queue\TracksJob;
|
use App\Lib\Queue\TracksJob;
|
||||||
use App\Member\Member;
|
use App\Member\Member;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use Illuminate\Support\Collection;
|
|
||||||
use Lorisleiva\Actions\ActionRequest;
|
use Lorisleiva\Actions\ActionRequest;
|
||||||
use Lorisleiva\Actions\Concerns\AsAction;
|
use Lorisleiva\Actions\Concerns\AsAction;
|
||||||
|
|
||||||
|
@ -30,9 +28,6 @@ class MassStoreAction
|
||||||
|
|
||||||
public function handle(int $year): void
|
public function handle(int $year): void
|
||||||
{
|
{
|
||||||
/** @var Collection<int, Invoice> */
|
|
||||||
$invoices = collect([]);
|
|
||||||
|
|
||||||
$memberGroup = Member::payable()->get()
|
$memberGroup = Member::payable()->get()
|
||||||
->groupBy(fn ($member) => "{$member->bill_kind->value}{$member->lastname}{$member->address}{$member->zip}{$member->location}");
|
->groupBy(fn ($member) => "{$member->bill_kind->value}{$member->lastname}{$member->address}{$member->zip}{$member->location}");
|
||||||
foreach ($memberGroup as $members) {
|
foreach ($memberGroup as $members) {
|
||||||
|
@ -47,11 +42,7 @@ class MassStoreAction
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$invoices->push($invoice);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
event(new InvoicesMassStored($year, $invoices));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function asController(ActionRequest $request): JsonResponse
|
public function asController(ActionRequest $request): JsonResponse
|
||||||
|
|
|
@ -1,36 +0,0 @@
|
||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Invoice\Events;
|
|
||||||
|
|
||||||
use App\Invoice\Models\Invoice;
|
|
||||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
|
||||||
use Illuminate\Broadcasting\PrivateChannel;
|
|
||||||
use Illuminate\Foundation\Events\Dispatchable;
|
|
||||||
use Illuminate\Queue\SerializesModels;
|
|
||||||
use Illuminate\Support\Collection;
|
|
||||||
|
|
||||||
class InvoicesMassStored
|
|
||||||
{
|
|
||||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Create a new event instance.
|
|
||||||
*
|
|
||||||
* @param Collection<int, Invoice> $invoices
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
public function __construct(public int $year, public Collection $invoices)
|
|
||||||
{
|
|
||||||
//
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the channels the event should broadcast on.
|
|
||||||
*
|
|
||||||
* @return \Illuminate\Broadcasting\Channel|array
|
|
||||||
*/
|
|
||||||
public function broadcastOn()
|
|
||||||
{
|
|
||||||
return new PrivateChannel('channel-name');
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -30,7 +30,6 @@ services:
|
||||||
REDIS_HOST: redis
|
REDIS_HOST: redis
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/storage:/app/storage/app
|
- ./data/storage:/app/storage/app
|
||||||
- ./data/plugins:/app/plugins
|
|
||||||
- ./data/cookies:/app/packages/laravel-nami/.cookies
|
- ./data/cookies:/app/packages/laravel-nami/.cookies
|
||||||
|
|
||||||
horizon:
|
horizon:
|
||||||
|
@ -51,7 +50,6 @@ services:
|
||||||
REDIS_HOST: redis
|
REDIS_HOST: redis
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/storage:/app/storage/app
|
- ./data/storage:/app/storage/app
|
||||||
- ./data/plugins:/app/plugins
|
|
||||||
- ./data/cookies:/app/packages/laravel-nami/.cookies
|
- ./data/cookies:/app/packages/laravel-nami/.cookies
|
||||||
|
|
||||||
schedule:
|
schedule:
|
||||||
|
@ -72,7 +70,6 @@ services:
|
||||||
REDIS_HOST: redis
|
REDIS_HOST: redis
|
||||||
volumes:
|
volumes:
|
||||||
- ./data/storage:/app/storage/app
|
- ./data/storage:/app/storage/app
|
||||||
- ./data/plugins:/app/plugins
|
|
||||||
- ./data/cookies:/app/packages/laravel-nami/.cookies
|
- ./data/cookies:/app/packages/laravel-nami/.cookies
|
||||||
|
|
||||||
db:
|
db:
|
||||||
|
|
Loading…
Reference in New Issue