import { branches, inventoryBatches, products, sales, salespeople, } from "@/lib/demo-data"; import type { IntegrationProvider } from "@/lib/types"; import type { IntegrationAdapter, SyncPage } from "@/integrations/types"; function page(records: T[]): SyncPage { return { records, nextCursor: null }; } export class MockIntegrationAdapter implements IntegrationAdapter { constructor(readonly provider: IntegrationProvider) {} async testConnection() { return { ok: true, message: `${this.provider === "odoo" ? "Odoo" : "Salesforce"} demo source is ready`, }; } async fetchProducts() { return page(this.provider === "odoo" ? products : []); } async fetchBranches() { return page(branches); } async fetchInventory() { return page(this.provider === "odoo" ? inventoryBatches : []); } async fetchSalespeople() { return page(this.provider === "salesforce" ? salespeople : []); } async fetchSales() { return page(this.provider === "salesforce" ? sales : []); } }