при запросе Ставки привлечения (GetRate и GetRates) добавить фильтр что используются только записи evo_rate, у которых Тип ставки evo_type = Банк 100 000 000

This commit is contained in:
vchikalkin 2024-03-26 12:40:09 +03:00
parent 61c6f41635
commit d3fef51059
3 changed files with 7 additions and 3 deletions

View File

@ -307,6 +307,7 @@ query GetTarif($tarifId: Uuid!) {
evo_rates {
evo_datefrom
evo_rateid
evo_type
}
evo_irr_plan
evo_margin_min

File diff suppressed because one or more lines are too long

View File

@ -105,9 +105,12 @@ export default function helper({ apolloClient }: Pick<ProcessContext, 'apolloCli
variables: { tarifId },
});
const filtered_evo_tarif_evo_rates =
evo_tarif?.evo_rates?.filter((x) => x?.evo_type === 100_000_000) || [];
const evo_tarif_evo_rate =
evo_tarif?.evo_rates &&
first(sort(evo_tarif?.evo_rates, (x) => dayjs(x?.evo_datefrom).date()));
first(sort(filtered_evo_tarif_evo_rates, (x) => dayjs(x?.evo_datefrom).date()));
if (evo_tarif_evo_rate) {
return {