diff --git a/app/Filament/Exports/TempStopCharacteristicResourceExporter.php b/app/Filament/Exports/TempStopCharacteristicResourceExporter.php deleted file mode 100644 index d8a8ea4..0000000 --- a/app/Filament/Exports/TempStopCharacteristicResourceExporter.php +++ /dev/null @@ -1,79 +0,0 @@ -label('ID'), - ExportColumn::make('no') - ->label('NO') - ->state(function ($record) use (&$rowNumber) { - // Increment and return the row number - return ++$rowNumber; - }), - ExportColumn::make('plant.code') - ->label('PLANT CODE'), - ExportColumn::make('machine.work_center') - ->label('WORK CENTER'), - ExportColumn::make('machine_name') - ->label('MACHINE NAME'), - ExportColumn::make('has_stop_flow_id') - ->label('HAS STOP FLOW ID'), - ExportColumn::make('item.code') - ->label('ITEM CODE'), - ExportColumn::make('aufnr') - ->label('JOB NUMBER'), - ExportColumn::make('gernr') - ->label('SERIAL NUMBER'), - ExportColumn::make('zmm_heading') - ->label('ZMM HEADING'), - ExportColumn::make('winded_serial_number') - ->label('WINDED SERIAL NUMBER'), - ExportColumn::make('model_type') - ->label('MODEL TYPE'), - ExportColumn::make('characteristic_field') - ->label('MASTER CHARACTERISTIC FIELD'), - ExportColumn::make('samlight_logged_name') - ->label('SAMLIGHT LOGGED NAME'), - ExportColumn::make('stopped_at') - ->label('STOPPED AT'), - ExportColumn::make('stopped_by') - ->label('STOPPED BY'), - ExportColumn::make('has_stop_flow_id') - ->label('HAS STOP FLOW ID'), - ExportColumn::make('created_at') - ->label('CREATED AT'), - ExportColumn::make('created_by') - ->label('CREATED BY'), - ExportColumn::make('updated_at') - ->label('UPDATED AT'), - ExportColumn::make('updated_by') - ->label('UPDATED BY'), - ExportColumn::make('deleted_at') - ->enabledByDefault(false) - ->label('DELETED AT'), - ]; - } - - public static function getCompletedNotificationBody(Export $export): string - { - $body = 'Your temp stop characteristic resource export has completed and '.number_format($export->successful_rows).' '.str('row')->plural($export->successful_rows).' exported.'; - - if ($failedRowsCount = $export->getFailedRowsCount()) { - $body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to export.'; - } - - return $body; - } -} diff --git a/app/Filament/Imports/TempStopCharacteristicResourceImporter.php b/app/Filament/Imports/TempStopCharacteristicResourceImporter.php deleted file mode 100644 index 0c15612..0000000 --- a/app/Filament/Imports/TempStopCharacteristicResourceImporter.php +++ /dev/null @@ -1,115 +0,0 @@ -requiredMapping() - ->label('PLANT CODE') - ->exampleHeader('PLANT CODE') - ->example('1000') - ->relationship(resolveUsing: 'code') - ->rules(['required']), - ImportColumn::make('machine') - ->requiredMapping() - ->label('WORK CENTER') - ->exampleHeader('WORK CENTER') - ->example('RMGLAS01') - ->relationship(resolveUsing: 'work_center') - ->rules(['required']), - ImportColumn::make('machine_name') - ->label('MACHINE NAME') - ->exampleHeader('MACHINE NAME') - ->example('RMGLAS01') - ->rules(['required']), - ImportColumn::make('item') - ->requiredMapping() - ->exampleHeader('ITEM CODE') - ->example('630214') - ->label('ITEM CODE') - ->relationship(resolveUsing: 'code') - ->rules(['required']), - ImportColumn::make('aufnr') - ->label('JOB NUMBER') - ->exampleHeader('JOB NUMBER') - ->example('1234567'), - ImportColumn::make('gernr') - ->label('SERIAL NUMBER') - ->exampleHeader('SERIAL NUMBER') - ->example('1234567890123'), - ImportColumn::make('zmm_heading') - ->exampleHeader('ZMM HEADING') - ->example('ZMM001') - ->label('ZMM HEADING'), - ImportColumn::make('winded_serial_number') - ->exampleHeader('WINDED SERIAL NUMBER') - ->example('WSN001') - ->label('WINDED SERIAL NUMBER'), - ImportColumn::make('model_type') - ->label('MODEL TYPE') - ->exampleHeader('MODEL TYPE') - ->example('PUMP'), - ImportColumn::make('characteristic_field') - ->label('MASTER CHARACTERISTIC FIELD') - ->exampleHeader('MASTER CHARACTERISTIC FIELD') - ->example('NIL'), - ImportColumn::make('samlight_logged_name') - ->label('SAMLIGHT LOGGED NAME') - ->exampleHeader('SAMLIGHT LOGGED NAME') - ->example('User'), - ImportColumn::make('stopped_at') - ->label('STOPPED AT') - ->exampleHeader('STOPPED AT') - ->example('01-09-2026 12:00:00') - ->rules(['datetime']), - ImportColumn::make('stopped_by') - ->label('STOPPED BY') - ->exampleHeader('STOPPED BY') - ->example('RAW01234'), - ImportColumn::make('has_stop_flow_id') - ->label('HAS STOP FLOW ID') - ->exampleHeader('HAS STOP FLOW ID') - ->example('2'), - ImportColumn::make('created_by') - ->label('CREATED BY') - ->exampleHeader('CREATED BY') - ->example('RAW01234'), - ImportColumn::make('updated_by') - ->label('UPDATED BY') - ->exampleHeader('UPDATED BY') - ->example('RAW01234'), - ]; - } - - public function resolveRecord(): ?TempStopCharacteristicResource - { - // return TempStopCharacteristicResource::firstOrNew([ - // // Update existing records, matching them by `$this->data['column_name']` - // 'email' => $this->data['email'], - // ]); - - return new TempStopCharacteristicResource; - } - - public static function getCompletedNotificationBody(Import $import): string - { - $body = 'Your temp stop characteristic resource import has completed and '.number_format($import->successful_rows).' '.str('row')->plural($import->successful_rows).' imported.'; - - if ($failedRowsCount = $import->getFailedRowsCount()) { - $body .= ' '.number_format($failedRowsCount).' '.str('row')->plural($failedRowsCount).' failed to import.'; - } - - return $body; - } -}