Smooth analytics page reloads
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 34s

This commit is contained in:
Cauê Faleiros
2026-06-23 14:45:21 -03:00
parent 335d231903
commit 7d60073757
7 changed files with 233 additions and 126 deletions

View File

@@ -601,10 +601,10 @@ test('getClientAnalytics groups phone-less history through the customer identity
assert.equal(clients.length, 1);
assert.equal(clients[0].customerKey, '(16) 99999-9999');
assert.equal(clients[0].phone, '(16) 99999-9999');
assert.match(calls[0].sql, /WITH order_identity AS/);
assert.match(calls[0].sql, /customer_phone_by_name AS/);
assert.match(calls[0].sql, /ARRAY_AGG\(NULLIF\(cliente_fone, ''\) ORDER BY data_pedido_date DESC NULLS LAST, id DESC\)/);
assert.match(calls[0].sql, /NULLIF\(order_identity\.cliente_fone, ''\),\s+customer_phone_by_name\.canonical_phone/s);
assert.match(calls[0].sql, /WHERE NULLIF\(cliente_fone, ''\) IS NOT NULL/);
assert.match(calls[0].sql, /NULLIF\(orders\.cliente_fone, ''\),\s+customer_phone_by_name\.canonical_phone/s);
assert.match(calls[0].sql, /FROM identity_orders/);
assert.match(calls[0].sql, /GROUP BY customer_key/);
} finally {