Use all-time client purchase patterns
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m25s
All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 2m25s
This commit is contained in:
@@ -805,7 +805,7 @@ test('getClientDetailsAnalytics resolves legacy name tokens to the canonical pho
|
||||
try {
|
||||
const details = await getClientDetailsAnalytics(clientToken, { start: '2026-06-01', end: '2026-06-15' });
|
||||
|
||||
assert.equal(calls.length, 4);
|
||||
assert.equal(calls.length, 5);
|
||||
assert.match(calls[0].sql, /FROM client_identity_tokens/);
|
||||
assert.deepEqual(calls[0].params, [clientToken]);
|
||||
assert.match(calls[1].sql, /SELECT customer_key/);
|
||||
@@ -816,6 +816,10 @@ test('getClientDetailsAnalytics resolves legacy name tokens to the canonical pho
|
||||
assert.match(calls[3].sql, /data_pedido_date >= \$2::date/);
|
||||
assert.match(calls[3].sql, /data_pedido_date <= \$3::date/);
|
||||
assert.deepEqual(calls[3].params, ['(16) 99999-9999', '2026-06-01', '2026-06-15']);
|
||||
assert.match(calls[4].sql, /created_at/);
|
||||
assert.doesNotMatch(calls[4].sql, /data_pedido_date >=/);
|
||||
assert.doesNotMatch(calls[4].sql, /data_pedido_date <=/);
|
||||
assert.deepEqual(calls[4].params, ['(16) 99999-9999']);
|
||||
assert.equal(details.clientName, 'Cliente Sem Fone');
|
||||
assert.equal(details.clientPhone, '(16) 99999-9999');
|
||||
assert.equal(details.allTimeOrderCount, 3);
|
||||
|
||||
Reference in New Issue
Block a user