fix getRevenue case-insensitivity bug
Some checks failed
Create docker images (cloud) / Build, push, and deploy (push) Has been cancelled
Node.js CI / build (postgresql, 18.18, 10) (push) Has been cancelled

This commit is contained in:
Francis Cao 2025-12-04 12:27:44 -08:00
parent 60271779de
commit 83b03d682c

View file

@ -62,7 +62,7 @@ async function relationalQuery(
${joinSessionQuery} ${joinSessionQuery}
where revenue.website_id = {{websiteId::uuid}} where revenue.website_id = {{websiteId::uuid}}
and revenue.created_at between {{startDate}} and {{endDate}} and revenue.created_at between {{startDate}} and {{endDate}}
and revenue.currency = upper({{currency}}) and upper(revenue.currency) = {{currency}}
${filterQuery} ${filterQuery}
group by x, t group by x, t
order by t order by t
@ -83,7 +83,7 @@ async function relationalQuery(
${cohortQuery} ${cohortQuery}
where revenue.website_id = {{websiteId::uuid}} where revenue.website_id = {{websiteId::uuid}}
and revenue.created_at between {{startDate}} and {{endDate}} and revenue.created_at between {{startDate}} and {{endDate}}
and revenue.currency = upper({{currency}}) and upper(revenue.currency) = {{currency}}
${filterQuery} ${filterQuery}
group by session.country group by session.country
`, `,
@ -102,7 +102,7 @@ async function relationalQuery(
${joinSessionQuery} ${joinSessionQuery}
where revenue.website_id = {{websiteId::uuid}} where revenue.website_id = {{websiteId::uuid}}
and revenue.created_at between {{startDate}} and {{endDate}} and revenue.created_at between {{startDate}} and {{endDate}}
and revenue.currency = upper({{currency}}) and upper(revenue.currency) = {{currency}}
${filterQuery} ${filterQuery}
`, `,
queryParams, queryParams,
@ -154,7 +154,7 @@ async function clickhouseQuery(
${cohortQuery} ${cohortQuery}
where website_revenue.website_id = {websiteId:UUID} where website_revenue.website_id = {websiteId:UUID}
and website_revenue.created_at between {startDate:DateTime64} and {endDate:DateTime64} and website_revenue.created_at between {startDate:DateTime64} and {endDate:DateTime64}
and website_revenue.currency = upper({currency:String}) and upper(website_revenue.currency) = {currency:String}
${filterQuery} ${filterQuery}
group by x, t group by x, t
order by t order by t
@ -182,7 +182,7 @@ async function clickhouseQuery(
${cohortQuery} ${cohortQuery}
where website_revenue.website_id = {websiteId:UUID} where website_revenue.website_id = {websiteId:UUID}
and website_revenue.created_at between {startDate:DateTime64} and {endDate:DateTime64} and website_revenue.created_at between {startDate:DateTime64} and {endDate:DateTime64}
and website_revenue.currency = upper({currency:String}) and upper(website_revenue.currency) = {currency:String}
${filterQuery} ${filterQuery}
group by website_event.country group by website_event.country
order by value desc order by value desc
@ -205,7 +205,7 @@ async function clickhouseQuery(
${cohortQuery} ${cohortQuery}
where website_revenue.website_id = {websiteId:UUID} where website_revenue.website_id = {websiteId:UUID}
and website_revenue.created_at between {startDate:DateTime64} and {endDate:DateTime64} and website_revenue.created_at between {startDate:DateTime64} and {endDate:DateTime64}
and website_revenue.currency = upper({currency:String}) aand upper(website_revenue.currency) = {currency:String}
${filterQuery} ${filterQuery}
`, `,
queryParams, queryParams,