2026-06-14 21:32:07 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
|
|
|
|
|
use App\Models\Page;
|
|
|
|
|
use App\Models\Product;
|
feat(employees): automated sync with Arcadia API, BO settings, Shopper value objects, and pagination migration
- 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
2026-10-01 17:26:30 +02:00
|
|
|
use App\Services\EmployeeSyncService;
|
2026-06-14 21:32:07 +02:00
|
|
|
use Illuminate\Pagination\Paginator;
|
|
|
|
|
use Illuminate\Support\Facades\Blade;
|
|
|
|
|
use Illuminate\Support\Facades\View;
|
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
|
use Infrastructure\Adapters\Repositories\EloquentProductRepository;
|
|
|
|
|
|
|
|
|
|
class ViewServiceProvider extends ServiceProvider
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Bootstrap any application services.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function boot(EloquentProductRepository $productRepository)
|
|
|
|
|
{
|
2026-10-29 20:13:15 +01:00
|
|
|
$this->setUpBladeMacros($productRepository);
|
|
|
|
|
|
2026-06-14 21:32:07 +02:00
|
|
|
if ($this->app->runningInConsole() && ! $this->app->runningUnitTests()) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$this->setupPaginator();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function setupPaginator(): void
|
|
|
|
|
{
|
|
|
|
|
// * PAGINATOR
|
|
|
|
|
if (collect(explode('/', \request()->getPathInfo()))->get(1) === 'bo') {
|
|
|
|
|
Paginator::defaultView('bo.modules.pagination');
|
|
|
|
|
} else {
|
|
|
|
|
Paginator::defaultView('fo.modules.pagination');
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// * PAGE LIST
|
|
|
|
|
View::composer('*', function ($view) {
|
|
|
|
|
$view->with('PageList', Page::getCached()
|
|
|
|
|
->mapWithKeys(fn ($page) => [
|
|
|
|
|
$page->slug->value() => $page,
|
|
|
|
|
]));
|
feat(employees): automated sync with Arcadia API, BO settings, Shopper value objects, and pagination migration
- 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
2026-10-01 17:26:30 +02:00
|
|
|
$view->with('EmployeeSyncService', resolve(EmployeeSyncService::class));
|
2026-06-14 21:32:07 +02:00
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function setUpBladeMacros(EloquentProductRepository $productRepository): void
|
|
|
|
|
{
|
|
|
|
|
Blade::if(
|
|
|
|
|
'orderable',
|
2026-10-29 19:48:38 +01:00
|
|
|
fn (Product $product) => $productRepository->toEntity($product)->isOrderable()
|
2026-06-14 21:32:07 +02:00
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|