dstpabuaran.com/app/OldDataMigrations/OrdersMigration.php
Yoga Pangestu 49841a662c Refactor marketplace settings: remove MarketplaceFeeRule, update related database and UI components
- Deleted MarketplaceFeeRule class and its usage in settings migration.
- Removed 'is_affiliate' field from orders and related factories.
- Updated notifications table to use longText for body.
- Adjusted role permissions by removing marketplace-related permissions.
- Cleaned up admin settings page by removing marketplace settings section and related components.
- Updated tests to reflect the removal of marketplace settings and ensure other settings remain unaffected.
2026-08-14 03:20:18 +07:00

41 lines
1.0 KiB
PHP

<?php
namespace App\OldDataMigrations;
class OrdersMigration extends BaseOldDataMigration
{
public function priority(): int
{
return 9;
}
public function migrate(): array
{
$results = [];
$results['orders'] = $this->migrateTableWithoutColumns('orders', ['marketplace_settings_snapshot', 'is_affiliate'], function ($row) {
$row['cogs'] = $row['cogs'] ?? 0;
$row['price_type'] = match ($row['price_type']) {
'grosir' => 'wholesale',
'harga_modal' => 'capital',
default => $row['price_type'],
};
return $row;
});
$results['order_items'] = $this->migrateTable('order_items', function ($row) {
$row['stock_quality'] = match ($row['stock_quality']) {
'retail' => 'good',
default => $row['stock_quality'],
};
return $row;
});
$results['activity_log'] = $this->migrateTable('activity_log');
return $results;
}
}