Make Clientify CRM sync daily and reliable via incremental upsert.

Webhooks alone miss WooCommerce deals; replace wipe+cap sync with lookback upsert and a dedicated Dokploy cron.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
4Ventures
2026-10-08 11:02:51 +02:00
parent b4e843762e
commit 4baf256750
8 changed files with 419 additions and 100 deletions

View File

@@ -92,10 +92,10 @@ export async function GET(req: NextRequest) {
};
}
// 4) Clientify CRM → leads/deals
// 4) Clientify CRM → leads/deals (prefer dedicated /api/cron/clientify-sync)
try {
const [clientify, gohighlevel] = await Promise.all([
syncAllClientifyTenants(),
syncAllClientifyTenants({ lookbackDays: Math.max(days * 2, 30) }),
syncAllGhlTenants(),
]);
const results = [...clientify.results, ...gohighlevel.results];