Implement a new pricing architecture based on a 4-quadrant model (Export/Import x Document/Non-Document) to replace the previous 2-zone model. This includes the ability to handle different zones for parcels and documents per country. - Add `RateEntry` and `CountryZone` models for managing complex rate matrices. - Implement `RateImportService` to parse Excel templates using PhpSpreadsheet. - Add `RateImportResource` in Filament for administrative rate uploads. - Refactor `PriceCalculatorService` to utilize the new 4-quadrant lookup logic. - Add database migrations to extend `rate_entries` and create `country_zones`. - Update `DEPLOYMENT.md` with new architectural details and deployment steps.
30 lines
987 B
PHP
30 lines
987 B
PHP
<?php
|
|
|
|
namespace App\Filament\Resources;
|
|
|
|
use App\Filament\Resources\RateImportResource\Pages;
|
|
use Filament\Resources\Resource;
|
|
use Filament\Resources\Pages\Page;
|
|
|
|
class RateImportResource extends Resource
|
|
{
|
|
protected static ?string $navigationIcon = 'heroicon-o-arrow-up-tray';
|
|
protected static ?string $navigationLabel = 'Rate Import';
|
|
protected static ?string $navigationGroup = 'Pricing';
|
|
protected static ?int $navigationSort = 5;
|
|
protected static ?string $slug = 'rate-import';
|
|
protected static ?string $recordTitleAttribute = 'Rate Import';
|
|
|
|
// No model — this is a single page resource for the upload form
|
|
public static function getPages(): array
|
|
{
|
|
return [
|
|
'index' => Pages\ImportRates::route('/'),
|
|
];
|
|
}
|
|
|
|
public static function canCreate(): bool { return false; }
|
|
public static function canEdit($record): bool { return false; }
|
|
public static function canDelete($record): bool { return false; }
|
|
}
|