const adjustmentResults = (await prisma.$queryRaw`
SELECT
DATE_TRUNC('month', ae.date, ${NA_TIMEZONE}) AS date,
ae.marketplace,
ae.type,
SUM(ae.quantity * uc."cost") AS "adjustment"
FROM "MasterProduct" AS mp
JOIN "MasterProductUnitCost" AS uc ON (mp.id = uc."masterProductId")
JOIN "InventoryItem" ii ON (uc."masterProductId" = ii."masterProductId")
JOIN "AdjustmentEvent" AS ae ON (ii."groupId" = ae."groupId" AND ii.marketplace = ae.marketplace AND ii.sku = ae.sku)
WHERE
mp."userId" = ${userId}
AND ii."userId" = ${userId}
AND ae."userId" = ${userId}
AND ae.date >= uc."fromDate"
AND (uc."toDate" IS NULL OR ae.date < uc."toDate")
GROUP BY 1, 2, 3
`) as MonthlyAdjustmentsData[];
const adjustmentResults = (await prisma.$queryRaw`
SELECT
DATE_TRUNC('month', ae.date, ${NA_TIMEZONE}) AS date,
ae.marketplace,
ae.type,
SUM(ae.quantity * uc."cost") AS "adjustment"
FROM "MasterProduct" AS mp
JOIN "MasterProductUnitCost" AS uc ON (mp.id = uc."masterProductId")
JOIN "InventoryItem" ii ON (uc."masterProductId" = ii."masterProductId")
JOIN "AdjustmentEvent" AS ae ON (ii."groupId" = ae."groupId" AND ii.marketplace = ae.marketplace AND ii.sku = ae.sku)
WHERE
mp."userId" = ${userId}
AND ii."userId" = ${userId}
AND ae."userId" = ${userId}
AND ae.date >= uc."fromDate"
AND (uc."toDate" IS NULL OR ae.date < uc."toDate")
GROUP BY 1, 2, 3
`) as MonthlyAdjustmentsData[];