qbo_auth: инкрементальная загрузка зеркала через QuickBooks CDC (полная раз в 7 дней, при первом запуске, full=1 и переполнении лимита)
All checks were successful
ci / test (push) Successful in 42s
ci / deploy (push) Successful in 2m45s

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-18 22:56:20 +03:00
parent 28cce78169
commit dc224e375b
3 changed files with 145 additions and 11 deletions

View File

@@ -50,7 +50,7 @@ export function buildApi(auth: QboAuth, token: string, sync?: QboSync): FastifyI
if (!sync) return reply.code(501).send({ error: "sync_not_configured" });
if (sync.isRunning) return reply.code(409).send({ error: "already_running" });
try {
const r = await sync.run();
const r = await sync.run({ full: (req.query as { full?: string } | undefined)?.full === "1" });
return reply.code(r.status === "ok" ? 200 : 502).send(r);
} catch (e) {
if (e instanceof ReauthNeeded) return reply.code(409).send({ error: "reauth_needed", message: e.message });