- 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
105 lines
5.1 KiB
PHP
105 lines
5.1 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
use App\Http\Controllers\Bo\Auth\LoginController;
|
|
use App\Http\Controllers\Bo\DashboardController;
|
|
use App\Http\Controllers\Bo\DiscountsController;
|
|
use App\Http\Controllers\Bo\EmployeesController;
|
|
use App\Http\Controllers\Bo\FaqsController;
|
|
use App\Http\Controllers\Bo\OrdersController;
|
|
use App\Http\Controllers\Bo\PageController;
|
|
use App\Http\Controllers\Bo\PickupExceptionsController;
|
|
use App\Http\Controllers\Bo\ProductIncosController;
|
|
use App\Http\Controllers\Bo\ProductsController;
|
|
use App\Http\Controllers\Bo\RangesController;
|
|
use App\Http\Controllers\Bo\SettingsController;
|
|
use App\Http\Controllers\Bo\ShopsController;
|
|
use App\Http\Controllers\Bo\SlidesController;
|
|
use App\Http\Controllers\Bo\TagsController;
|
|
use App\Providers\RouteServiceProvider;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
Route::name('auth.')->middleware([
|
|
'guest:backend',
|
|
'throttle:' . RouteServiceProvider::ROUTE_GROUP_WEB_CREDENTIALS,
|
|
])->group(function (): void {
|
|
Route::get('/login', [LoginController::class, 'showLoginForm'])->name('login');
|
|
Route::post('/login', [LoginController::class, 'login'])->name('login.post');
|
|
});
|
|
|
|
Route::post('/logout', [LoginController::class, 'logout'])->name('auth.logout.post');
|
|
|
|
Route::middleware(['auth:backend', 'has-role:Admin'])->group(function (): void {
|
|
|
|
// * DASHBOARD
|
|
Route::get('/', [DashboardController::class, 'index'])->name('dashboard');
|
|
|
|
// * STATIC PAGES
|
|
Route::resource('pages', PageController::class)->only(['edit', 'update'])
|
|
->withoutMiddleware('htmlsanitize')
|
|
->middleware('htmlsanitize:content');
|
|
|
|
// * FAQS
|
|
Route::resource('faqs', FaqsController::class)->except(['show'])
|
|
->withoutMiddleware('htmlsanitize')
|
|
->middleware('htmlsanitize:answer');
|
|
Route::patch('/faqs/{faq}/{action}', [FaqsController::class, 'changeOrder'])->name('faqs.change-order');
|
|
|
|
// * SLIDES
|
|
Route::resource('slides', SlidesController::class)->except(['show'])
|
|
->withoutMiddleware('htmlsanitize')
|
|
->middleware('htmlsanitize:text');
|
|
Route::patch('/slides/{slide}/{action}', [SlidesController::class, 'changeOrder'])->name('slides.change-order');
|
|
|
|
// * TAGS
|
|
Route::resource('tags', TagsController::class)->except(['show']);
|
|
Route::patch('/tags/{tag}/toggle-status', [TagsController::class, 'toggleStatus'])->name('tags.toggle-status');
|
|
Route::patch('/tags/{tag}/{action}', [TagsController::class, 'changeOrder'])->name('tags.change-order');
|
|
|
|
// * EMPLOYEES
|
|
Route::post('/settings/employees/sync', [EmployeesController::class, 'launchSyncJob'])->name('settings.employees.sync');
|
|
|
|
// * SETTINGS
|
|
Route::get('/settings', [SettingsController::class, 'edit'])->name('settings.edit');
|
|
Route::put('/settings', [SettingsController::class, 'update'])->name('settings.update');
|
|
|
|
// * RANGES
|
|
Route::resource('ranges', RangesController::class)->except(['show'])
|
|
->withoutMiddleware('htmlsanitize')
|
|
->middleware('htmlsanitize:description');
|
|
Route::patch('/ranges/{range}/toggle-status', [RangesController::class, 'toggleStatus'])->name('ranges.toggle-status');
|
|
Route::patch('/ranges/{range}/{action}', [RangesController::class, 'changeOrder'])->name('ranges.change-order');
|
|
|
|
// * PRODUCTS
|
|
Route::resource('products', ProductsController::class)->except(['show'])
|
|
->withoutMiddleware('htmlsanitize')
|
|
->middleware('htmlsanitize:description');
|
|
Route::post('/products/mass-actions', [ProductsController::class, 'massActions'])->name('products.mass-actions');
|
|
Route::patch('/products/{product}/toggle-status', [ProductsController::class, 'toggleStatus'])->name('products.toggle-status');
|
|
Route::patch('/products/{product}/toggle-star', [ProductsController::class, 'toggleStar'])->name('products.toggle-star');
|
|
Route::patch('/products/{product}/{action}', [ProductsController::class, 'changeOrder'])->name('products.change-order');
|
|
|
|
// * PRODUCTS INCO
|
|
Route::resource('products.incos', ProductIncosController::class)
|
|
->only(['create', 'store', 'edit', 'update'])
|
|
->withoutMiddleware('htmlsanitize')
|
|
->middleware('htmlsanitize:ingredients,preparation,selling_argument');
|
|
|
|
// * MERCHANDISING
|
|
Route::get('/products/starred', [ProductsController::class, 'starred'])->name('merch.starred');
|
|
Route::resource('discounts', DiscountsController::class)->except(['show']);
|
|
|
|
// * SHOPS
|
|
Route::resource('shops', ShopsController::class)->except(['show']);
|
|
Route::get('/shops/{shop}/pickup-exceptions', [ShopsController::class, 'pickupExceptionsEdit'])->name('shops.pickup-exceptions.edit');
|
|
Route::put('/shops/{shop}/pickup-exceptions', [ShopsController::class, 'pickupExceptionsUpdate'])->name('shops.pickup-exceptions.update');
|
|
|
|
// * PICKUP EXCEPTIONS
|
|
Route::resource('pickup-exceptions', PickupExceptionsController::class)->except(['show']);
|
|
|
|
// * ORDERS
|
|
Route::get('orders/today', [OrdersController::class, 'today'])->name('orders.today');
|
|
Route::resource('orders', OrdersController::class)->only(['index', 'show']);
|
|
Route::post('orders/{order}/cancel', [OrdersController::class, 'cancel'])->name('orders.cancel');
|
|
});
|