From ff599b13fd7dfb53e45c76aabfc6edf1beb8fc17 Mon Sep 17 00:00:00 2001 From: Vladimir Voronkov Date: Wed, 14 Sep 2022 13:27:12 +0300 Subject: [PATCH] Fix symbol filter --- workers/loc.api/sync/total.fees.report/index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/workers/loc.api/sync/total.fees.report/index.js b/workers/loc.api/sync/total.fees.report/index.js index 9a2137a69..4ce7fde96 100644 --- a/workers/loc.api/sync/total.fees.report/index.js +++ b/workers/loc.api/sync/total.fees.report/index.js @@ -1,5 +1,7 @@ 'use strict' +const { merge } = require('lodash') + const { TotalFeesParamsFlagError } = require('../../errors') @@ -112,16 +114,16 @@ class TotalFeesReport { const filterToSkipNotRecalcedBalance = user.isSubAccount ? { _isBalanceRecalced: 1 } : {} + const _filter = merge(filter, symbFilter) return this.dao.getElemsInCollBy( this.ALLOWED_COLLS.LEDGERS, { filter: { - ...filter, + ..._filter, user_id: user._id, $lte: { mts: end }, $gte: { mts: start }, - ...symbFilter, ...filterToSkipNotRecalcedBalance }, sort: [['mts', -1]],