feat: Part product images + seasonal tire-swap reminders
Part (HasMedia): - Spatie media `image` single-file collection + imageUrl() helper - PartResource form: image upload section (image editor, 2 MB max) - Parts list: circular thumbnail column - Shop catalog cards: square thumbnail + 📦 placeholder - Shop part detail: 260px image alongside info, single column when no image Seasonal tire-swap reminders: - NotificationDispatcher::tireSeasonalSwap(TireSet) — Telegram first, email fallback (when set has a vehicle, via ServiceReminderMail with 'tire_swap' type and a size-aware note) - tires:remind-seasonal artisan command, self-gating to Feb 15-Mar 15 (notify winter sets stored) and Sep 15-Oct 15 (notify summer sets stored). 60-day cooldown per client via service_reminders_sent. --force / --dry-run. - Schedule: weekly Mon 09:30 Tests (6 new): - outside window no-ops; spring window notifies winter; spring ignores summer; autumn notifies summer; cooldown blocks doubles; --force overrides window Full suite: 106 passed. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -99,6 +99,18 @@ class PartResource extends Resource
|
||||
->options(fn () => Supplier::pluck('name', 'id'))
|
||||
->searchable(),
|
||||
]),
|
||||
Schemas\Components\Section::make('Imagine')
|
||||
->collapsible()
|
||||
->schema([
|
||||
\Filament\Forms\Components\SpatieMediaLibraryFileUpload::make('image')
|
||||
->label('Foto piesă')
|
||||
->collection('image')
|
||||
->image()
|
||||
->imageEditor()
|
||||
->maxSize(2048)
|
||||
->columnSpanFull()
|
||||
->helperText('Apare în magazinul online (catalog + pagina piesei). Max 2 MB.'),
|
||||
]),
|
||||
Forms\Components\Textarea::make('notes')->label('Observații')->columnSpanFull()->rows(2),
|
||||
]);
|
||||
}
|
||||
@@ -107,6 +119,11 @@ class PartResource extends Resource
|
||||
{
|
||||
return $table
|
||||
->columns([
|
||||
\Filament\Tables\Columns\SpatieMediaLibraryImageColumn::make('image')
|
||||
->label('')
|
||||
->collection('image')
|
||||
->circular()
|
||||
->size(32),
|
||||
Tables\Columns\TextColumn::make('name')->searchable()->sortable()->wrap(),
|
||||
Tables\Columns\TextColumn::make('article')->label('Cod')->searchable()->copyable()->placeholder('—'),
|
||||
Tables\Columns\TextColumn::make('brand')->placeholder('—'),
|
||||
|
||||
Reference in New Issue
Block a user