export class SyncClient { static async getSyncStatus(contractId: number, targetSystem: string = 'SHI') { const response = await fetch(`/api/sync/status?contractId=${contractId}&targetSystem=${targetSystem}`) if (!response.ok) throw new Error('Failed to fetch sync status') return response.json() } static async triggerSync(contractId: number, targetSystem: string = 'SHI') { const response = await fetch('/api/sync/trigger', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ contractId, targetSystem }) }) if (!response.ok) { const error = await response.json() throw new Error(error.message || 'Sync failed') } return response.json() } static async getSyncBatches(contractId: number, targetSystem: string = 'SHI', limit: number = 10) { const response = await fetch(`/api/sync/batches?contractId=${contractId}&targetSystem=${targetSystem}&limit=${limit}`) if (!response.ok) throw new Error('Failed to fetch sync batches') return response.json() } }