feat: module Sync Sheets complet — stepper 4 étapes, diff, streaming, historique

- Replace placeholder page.tsx with full implementation:
  - 4-step stepper (Analyser → Diff → Confirmer → Progression)
  - Step 1: Call /api/sync/preview to analyze Sheet vs Shopify
  - Step 2: Display DiffTable with changes summary
  - Step 3: Confirmation with actionable changes count
  - Step 4: Real-time progress streaming from /api/sync/execute
  - History section with loadable entries
- Fix type annotations in preview.test.ts (SyncProduct, ShopifyProductFull)
- All 40 tests passing, TypeScript strict mode clean

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-06-08 22:26:37 +02:00
parent cdbddddaec
commit 97f011a24b
2 changed files with 217 additions and 3 deletions
+3 -2
View File
@@ -1,5 +1,6 @@
import { GET } from '@/app/api/sync/preview/route'
import { NextRequest } from 'next/server'
import type { SyncProduct, ShopifyProductFull } from '@/types/sync'
jest.mock('@/lib/googleSheets', () => ({
readSheetProducts: jest.fn(),
@@ -23,8 +24,8 @@ describe('GET /api/sync/preview', () => {
beforeEach(() => jest.clearAllMocks())
it('retourne le DiffResult complet', async () => {
const fakeSheetProducts = [{ ref: 'REF-1', handle: 'ref-1', title: 'T', description: '', price: '10.00', stock: 1, status: 'active' }]
const fakeShopifyProducts = []
const fakeSheetProducts: SyncProduct[] = [{ ref: 'REF-1', handle: 'ref-1', title: 'T', description: '', price: '10.00', stock: 1, status: 'active' }]
const fakeShopifyProducts: ShopifyProductFull[] = []
const fakeDiff = {
changes: [{ type: 'create', ref: 'REF-1', sheetProduct: fakeSheetProducts[0] }],
summary: { create: 1, update: 0, deactivate: 0, unchanged: 0 },