summaryrefslogtreecommitdiff
path: root/src/services/transforms.ts
blob: 2eea46fe35fc4dbede39efc6702d7497cd361b02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import _ from 'lodash';
import { Field } from '../components/ListTable';

type Transformer = Field['transform'];

const transformer = (hash: Record<string, string | JSX.Element>): Transformer => {
  return value => _.get(hash, value, value);
};


export const transformOperation = transformer({
  in: 'Приход',
  out: 'Расход',
});

export const transformStatus = transformer({
  waiting: 'Ожидание',
  executed: 'Проведена',
  cancelled: 'Отменена',
});