# ManageListings V1 — Cleanup Plan

Recorded 2026-08-17. V2 is the active listing page. Once V2 is confirmed stable, do this in one pass.

---

## Files to delete

| File | Reason |
|---|---|
| `plugins/webkul/channels/src/Filament/Pages/ManageListings.php` | V1 page (1,363 lines) — entirely superseded by ManageListingsV2 |
| `plugins/webkul/channels/resources/views/filament/pages/manage-listings.blade.php` | Paired V1 blade |
| `plugins/webkul/channels/src/Jobs/BulkSyncProductsJob.php` | Never dispatched anywhere — completely unreachable dead code |
| `plugins/webkul/channels/src/Jobs/CreateProductInShopify.php` | Only called from the V1 page — dead once V1 nav is removed |

---

## Code to remove

**`plugins/webkul/channels/src/ChannelPlugin.php` — lines 61–68**

Remove the V1 nav item block (the one that creates `NavigationItem::make('channels-listings')` pointing to `ManageListings::getUrl()`). Also remove the `use Webkul\Channel\Filament\Pages\ManageListings;` import. This is the only thing keeping V1 reachable in the sidebar.

---

## TODOs to fix in ManageListingsV2

**1. `pushNow()` — row "Sync Now" button**

Currently dispatches `SyncProductToChannels::dispatchSync($productId, $channelId)` (V1 per-product REST path). Replace with:

```php
ShopifyBatchSyncJob::dispatch([$productId], $this->channelId)->onQueue('high');
```

There are existing `// TODO(V1-cleanup)` comments marking this at lines ~982–994.

**2. `cancelPendingSync()`**

Currently only cancels queue entries matching `SyncProductToChannels` and only marks those activity logs as cancelled. After the `pushNow()` fix above, the cancel button also needs to handle `ShopifyBatchSyncJob` and `ShopifyBatchCreateJob` queue entries. Two `// TODO` comments already exist in that method.

---

## What NOT to remove

- `SyncProductToChannels` job — stays. It is the backbone of all observer-driven auto-sync (product price/stock changes, order processing, pricing recalculation). Removing it would break automated sync entirely.
- All per-product REST methods on `ShopifyClient` — stays. Called by `SyncProductToChannels` which is still active.
