Build the Solaire inventory intelligence MVP
Some checks failed
CI / verify (push) Has been cancelled
Some checks failed
CI / verify (push) Has been cancelled
Add the tenant-ready dashboard, freshness and pricing analytics, mock integration adapters, persistence schema, and verification tooling needed for the initial pilot. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
44
src/integrations/mock.ts
Normal file
44
src/integrations/mock.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
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<T>(records: T[]): SyncPage<T> {
|
||||
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 : []);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user