- Implement automated synchronization of employees via Arcadia API (EmployeeSyncService, SynchronizeEmployeesWithArcadiaApi, FetchAndUpsertArcadiaEmployees) - Add Back-Office application settings for employee sites (Setting singleton, GetSettingsQuery, UpdateSettings, SettingsController, EmployeeSitesInputComponent.vue) - Strongly type Employee attributes using Domain Value Objects (ShopperEstablishmentCode, ShopperSiteCode, ShopperServiceCode) and Eloquent Casts - Migrate pagination from Domain to Shared\Pagination namespace across queries and inputs - Remove legacy and dead CSV employee import/export code - Restore Domain\Ports\Services\CsvGenerator interface for Regate order generation - Add comprehensive Pest unit, integration, and feature test coverage
66 lines
1.9 KiB
PHP
66 lines
1.9 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Http\Controllers\Fo\Pages;
|
|
|
|
use App\Contracts\Executor;
|
|
use App\Http\Controllers\Controller;
|
|
use App\Queries\Products\GetPaginatedProductsQuery;
|
|
use App\Queries\Products\GetPaginatedProductsQueryInput;
|
|
use App\Queries\Ranges\GetPaginatedRangesQuery;
|
|
use App\Queries\Ranges\GetPaginatedRangesQueryInput;
|
|
use App\Queries\Slides\GetPaginatedSlidesQuery;
|
|
use App\Queries\Slides\GetPaginatedSlidesQueryInput;
|
|
use Illuminate\Contracts\View\View;
|
|
use Infrastructure\Adapters\Services\AppCustomerAuthService;
|
|
use Shared\Pagination\Pagination;
|
|
|
|
class HomeController extends Controller
|
|
{
|
|
public function __construct(
|
|
private readonly AppCustomerAuthService $authService,
|
|
private readonly Executor $executor,
|
|
) {
|
|
}
|
|
|
|
public function index(
|
|
GetPaginatedProductsQuery $productsAction,
|
|
GetPaginatedSlidesQuery $slidesAction,
|
|
GetPaginatedRangesQuery $rangesAction
|
|
): View {
|
|
|
|
$starProductList = $this->executor->execute(
|
|
$productsAction,
|
|
new GetPaginatedProductsQueryInput(
|
|
Pagination::firstPage(),
|
|
starOnly: true,
|
|
publishedOnly: true,
|
|
withPricing: true,
|
|
)
|
|
)->items();
|
|
|
|
$slideList = $this->executor->execute(
|
|
$slidesAction,
|
|
new GetPaginatedSlidesQueryInput(
|
|
Pagination::firstPage(),
|
|
publishedOnly: true,
|
|
forConnectedCustomers: $this->authService->check()
|
|
)
|
|
)->items();
|
|
|
|
$rangeList = $this->executor->execute(
|
|
$rangesAction,
|
|
new GetPaginatedRangesQueryInput(
|
|
Pagination::firstPage(),
|
|
publishedOnly: true
|
|
)
|
|
)->items();
|
|
|
|
return view('fo.pages.home', compact(
|
|
'starProductList',
|
|
'slideList',
|
|
'rangeList'
|
|
));
|
|
}
|
|
}
|