Added migration, model, resource, importer, and exporter files for add stop_flow_id columns and remove stopped columns
All checks were successful
Scan for leaked secrets using Kingfisher / kingfisher-secrets-scan (push) Successful in 13s

This commit is contained in:
dhanabalan
2026-09-14 12:48:48 +05:30
parent 9cd772ac9e
commit 7ac9de3a86
5 changed files with 282 additions and 71 deletions

View File

@@ -875,7 +875,7 @@ class ClassCharacteristicResource extends Resource
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('zmm_performance_factor')
->label('ZMM PERFORMANCE_FACTOR')
->label('ZMM PERFORMANCE FACTOR')
->reactive()
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
@@ -982,45 +982,37 @@ class ClassCharacteristicResource extends Resource
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\Select::make('is_stopped')
->label('IS STOPPED')
// ->nullable()
->selectablePlaceholder(false)
->options(function () {
return [
'0' => 'No',
'1' => 'Yes',
'2' => 'Yes (Alert Pending)',
];
})
->default('0')
->reactive()
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
})
->required(),
Forms\Components\DateTimePicker::make('stopped_datetime')
->label('STOPPED DATETIME')
->reactive()
->placeholder('Select Stopped DateTime')
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
Forms\Components\TextInput::make('stopped_by')
->label('STOPPED BY')
->reactive()
->readOnly(fn (callable $get) => ! $get('id'))
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
}),
// Forms\Components\TextInput::make('is_stopped')
// Forms\Components\Select::make('is_stopped')
// ->label('IS STOPPED')
// // ->nullable()
// ->selectablePlaceholder(false)
// ->options(function () {
// return [
// '0' => 'No',
// '1' => 'Yes',
// '2' => 'Yes (Alert Pending)',
// ];
// })
// ->default('0')
// ->reactive()
// ->afterStateUpdated(function (callable $set) {
// $set('updated_by', Filament::auth()->user()?->name);
// })
// ->default(0)
// ->required(),
// Forms\Components\DateTimePicker::make('stopped_datetime')
// ->label('STOPPED DATETIME')
// ->reactive()
// ->placeholder('Select Stopped DateTime')
// ->afterStateUpdated(function (callable $set) {
// $set('updated_by', Filament::auth()->user()?->name);
// }),
// Forms\Components\TextInput::make('stopped_by')
// ->label('STOPPED BY')
// ->reactive()
// ->readOnly(fn (callable $get) => ! $get('id'))
// ->afterStateUpdated(function (callable $set) {
// $set('updated_by', Filament::auth()->user()?->name);
// }),
Forms\Components\TextInput::make('mark_status')
->label('MARKED STATUS')
->reactive()
@@ -1318,6 +1310,74 @@ class ClassCharacteristicResource extends Resource
})
->default(0)
->required(),
Forms\Components\Select::make('motor_stop_flow_id')
->label('MOTOR STOP FLOW ID')
// ->nullable()
->selectablePlaceholder(false)
->options(function () {
return [
'5' => 'NIL',
'4' => 'Has Master',
'3' => 'Make Alert',
'2' => 'Alert Pending',
'1' => 'Alert Approved',
];
})
->default('5')
->reactive()
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
})
->required(),
// Forms\Components\TextInput::make('motor_stop_flow_id')
// ->label('MOTOR STOP FLOW ID')
// ->reactive()
// ->minValue(1)
// ->integer()
// ->maxValue(5)
// ->afterStateUpdated(function (callable $set) {
// $set('updated_by', Filament::auth()->user()?->name);
// })
// ->default(5)
// ->required(),
Forms\Components\Select::make('pump_stop_flow_id')
->label('PUMP STOP FLOW ID')
// ->nullable()
->selectablePlaceholder(false)
->options(function () {
return [
'5' => 'NIL',
'4' => 'Has Master',
'3' => 'Make Alert',
'2' => 'Alert Pending',
'1' => 'Alert Approved',
];
})
->default('5')
->reactive()
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
})
->required(),
Forms\Components\Select::make('name_plate_stop_flow_id')
->label('NAME PLATE STOP FLOW ID')
// ->nullable()
->selectablePlaceholder(false)
->options(function () {
return [
'5' => 'NIL',
'4' => 'Has Master',
'3' => 'Make Alert',
'2' => 'Alert Pending',
'1' => 'Alert Approved',
];
})
->default('5')
->reactive()
->afterStateUpdated(function (callable $set) {
$set('updated_by', Filament::auth()->user()?->name);
})
->required(),
Forms\Components\Hidden::make('created_by')
->label('Created By')
->default(Filament::auth()->user()?->name),
@@ -1931,19 +1991,19 @@ class ClassCharacteristicResource extends Resource
->label('ZMM AXIAL FORCE')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('is_stopped')
->label('IS STOPPED')
->alignCenter()
->formatStateUsing(fn ($state) => ($state == '0') ? 'No' : ($state == '1' ? 'Yes' : 'Yes (Alert Pending)'))
->sortable(),
Tables\Columns\TextColumn::make('stopped_datetime')
->label('STOPPED DATETIME')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('stopped_by')
->label('STOPPED BY')
->alignCenter()
->sortable(),
// Tables\Columns\TextColumn::make('is_stopped')
// ->label('IS STOPPED')
// ->alignCenter()
// ->formatStateUsing(fn ($state) => ($state == '0') ? 'No' : ($state == '1' ? 'Yes' : 'Yes (Alert Pending)'))
// ->sortable(),
// Tables\Columns\TextColumn::make('stopped_datetime')
// ->label('STOPPED DATETIME')
// ->alignCenter()
// ->sortable(),
// Tables\Columns\TextColumn::make('stopped_by')
// ->label('STOPPED BY')
// ->alignCenter()
// ->sortable(),
Tables\Columns\TextColumn::make('mark_status')
->label('MARKED STATUS')
->alignCenter()
@@ -2035,6 +2095,13 @@ class ClassCharacteristicResource extends Resource
Tables\Columns\TextColumn::make('motor_pump_pumpset_status')
->label('MOTOR PUMP PUMPSET STATUS')
->alignCenter()
->formatStateUsing(fn ($state): string => match ((string) $state) {
'1' => 'Motor',
'2' => 'Pump',
'3' => 'PumpSet',
'4' => 'Name Plate',
default => 'NIL',
})
->sortable(),
Tables\Columns\TextColumn::make('winded_serial_number')
->label('WINDED SERIAL NUMBER')
@@ -2080,6 +2147,46 @@ class ClassCharacteristicResource extends Resource
->label('HAS WORK FLOW ID')
->alignCenter()
->sortable(),
Tables\Columns\TextColumn::make('motor_stop_flow_id')
->label('MOTOR STOP FLOW ID')
->alignCenter()
// ->formatStateUsing(fn ($state) => ($state == '5') ? 'NIL' : ($state == '4' ? 'Has Master' : ($state == '3' ? 'Make Alert' : ($state == '2' ? 'Alert Pending' : ($state == '1' ? 'Alert Approved' : '-')))))
->formatStateUsing(fn ($state): string => match ((string) $state) {
'5' => 'NIL',
'4' => 'Has Master',
'3' => 'Make Alert',
'2' => 'Alert Pending',
'1' => 'Alert Approved',
default => '-',
})
->badge()
->sortable(),
Tables\Columns\TextColumn::make('pump_stop_flow_id')
->label('PUMP STOP FLOW ID')
->alignCenter()
->formatStateUsing(fn ($state): string => match ((string) $state) {
'5' => 'NIL',
'4' => 'Has Master',
'3' => 'Make Alert',
'2' => 'Alert Pending',
'1' => 'Alert Approved',
default => '-',
})
->badge()
->sortable(),
Tables\Columns\TextColumn::make('name_plate_stop_flow_id')
->label('NAME PLATE STOP FLOW ID')
->alignCenter()
->formatStateUsing(fn ($state): string => match ((string) $state) {
'5' => 'NIL',
'4' => 'Has Master',
'3' => 'Make Alert',
'2' => 'Alert Pending',
'1' => 'Alert Approved',
default => '-',
})
->badge()
->sortable(),
Tables\Columns\TextColumn::make('created_at')
->label('CREATED AT')
->alignCenter()