qbo_auth: realmId шифруется, /callback отвечает 302, no-cache; требования Intuit: раздел E по оригиналу, ручные тесты через /tests
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -36,8 +36,9 @@ const notify = async (text: string): Promise<void> => {
|
||||
|
||||
/** Компания QuickBooks берётся из подключения qbo_auth. */
|
||||
async function realmId(): Promise<string> {
|
||||
const { rows } = await pool.query("select realm_id from qbo_connection order by refreshed_at desc limit 1");
|
||||
if (!rows[0]) throw new Error("QuickBooks не подключён (нет строки в qbo_connection)");
|
||||
// realm_id в qbo_connection зашифрован (требование Intuit); компания берётся из последней успешной загрузки зеркала
|
||||
const { rows } = await pool.query("select realm_id from qbo_sync_run where status = 'ok' and realm_id is not null order by started_at desc limit 1");
|
||||
if (!rows[0]) throw new Error("QuickBooks не подключён или зеркало ещё не загружено (нет успешной загрузки в qbo_sync_run)");
|
||||
return rows[0].realm_id as string;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user