Revert "Fix RFV period classification"

This reverts commit 1889c172d0.
This commit is contained in:
Cauê Faleiros
2026-06-17 11:08:59 -03:00
parent 19a29956d2
commit 28af45c315
2 changed files with 9 additions and 7 deletions

View File

@@ -262,9 +262,11 @@ const getClientAnalytics = async (range = {}) => {
const getRfmAnalytics = async (range = {}) => {
const { params, whereClause } = buildDateFilter(range);
const normalizedStart = normalizeDateParam(range.start);
const normalizedEnd = normalizeDateParam(range.end);
const recencyReferenceDate = normalizedEnd ? '$1::date' : 'CURRENT_DATE';
const historyParams = normalizedEnd ? [normalizedEnd] : [];
const tagReference = getPreviousDate(normalizedStart) || normalizedEnd;
const recencyReferenceDate = tagReference ? '$1::date' : 'CURRENT_DATE';
const historyParams = tagReference ? [tagReference] : [];
const [periodResult, historyResult] = await Promise.all([
pool.query(`