Add all-debtors mode beside custom ranges for balance claims criteria.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -3,7 +3,7 @@ import {
|
||||
ACCOUNT_BALANCE_CLAIMS_TAG,
|
||||
ACCOUNT_BALANCE_EVALUATE_BATCH_SIZE,
|
||||
ACTIVITY_BOARD_SYSTEM_BALANCE_CLAIMS,
|
||||
accountBalanceInRange,
|
||||
accountBalanceMatchesCriterion,
|
||||
DEFAULT_ACCOUNT_BALANCE_FIRST_STAGE,
|
||||
parseAccountBalanceSettings,
|
||||
parseAccountBalanceWeightFields,
|
||||
@@ -624,15 +624,15 @@ export class BalanceClaimsService {
|
||||
},
|
||||
settings: AccountBalanceSettingsDto,
|
||||
): boolean {
|
||||
if (accountBalanceInRange(assets.rialBalance, settings.rial)) return true;
|
||||
if (accountBalanceMatchesCriterion(assets.rialBalance, settings.rial)) return true;
|
||||
|
||||
const fieldMap = parseAccountBalanceWeightFields(assets.mandehFields);
|
||||
for (const [key, range] of Object.entries(settings.weights)) {
|
||||
for (const [key, criterion] of Object.entries(settings.weights)) {
|
||||
const value =
|
||||
fieldMap[key] ??
|
||||
(key === 'MandeyeVazni' ? assets.goldBalance : null) ??
|
||||
null;
|
||||
if (accountBalanceInRange(value, range)) return true;
|
||||
if (accountBalanceMatchesCriterion(value, criterion)) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user