feat(labors): trilingual name — add name_en column + Labor::label() helper
- Migration: add nullable `labors.name_en` alongside existing name_ro/
name_ru.
- Labor model: label(?locale) accessor returns name_{locale} with
name_ro fallback.
- LaborResource form: expose 3rd 'Nume (EN)' field.
- Table + Select displays now go through label() so options show the
locale-appropriate name:
/app/labors table column,
WorkOrderResource works Select ('[category] name (Nh)'),
ServiceTemplate items Select,
ServiceComposer WorkOrderWork snapshot on create.
- Snapshot name saved on wo_works.name at creation reflects the
current locale; existing rows keep their stored snapshot untouched.
All 306 tests pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -59,6 +59,7 @@ class LaborResource extends Resource
|
||||
Forms\Components\TextInput::make('code')->label(__('Cod'))->maxLength(32),
|
||||
Forms\Components\TextInput::make('name_ro')->label(__('Nume (RO)'))->required()->maxLength(160),
|
||||
Forms\Components\TextInput::make('name_ru')->label(__('Nume (RU)'))->maxLength(160),
|
||||
Forms\Components\TextInput::make('name_en')->label(__('Nume (EN)'))->maxLength(160),
|
||||
Forms\Components\Select::make('pricing_mode')
|
||||
->label(__('Mod tarifare'))
|
||||
->options(\App\Support\I18n::opts(Labor::PRICING_MODES))
|
||||
@@ -81,7 +82,11 @@ class LaborResource extends Resource
|
||||
return $table
|
||||
->columns([
|
||||
Tables\Columns\TextColumn::make('category')->label(__('Categorie'))->badge()->sortable(),
|
||||
Tables\Columns\TextColumn::make('name_ro')->label(__('Manoperă'))->searchable()->sortable(),
|
||||
Tables\Columns\TextColumn::make('name_ro')
|
||||
->label(__('Manoperă'))
|
||||
->searchable()
|
||||
->sortable()
|
||||
->getStateUsing(fn ($record) => $record->label()),
|
||||
Tables\Columns\TextColumn::make('pricing_mode')
|
||||
->label(__('Tarifare'))
|
||||
->formatStateUsing(fn ($s) => $s === 'fixed' ? __('Fix') : __('Pe oră'))
|
||||
|
||||
Reference in New Issue
Block a user