summaryrefslogtreecommitdiff
path: root/src/services/waybills/index.ts
blob: b623da6d27f5fbdf5ea1399bb907ee01e1653463 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
import Form from './WaybillForm';
import Panel from './WaybillPanel';
import { transformOperation, transformStatus } from '../transforms';
import { ServiceParams } from '../../lib/ServiceContext';
import { Waybill } from '../types';

const service: ServiceParams<Waybill> = {
  route: 'waybills',
  name: 'Накладные',
  nameSingular: 'Накладная',
  tableFields: [
    { key: 'status', label: 'Статус', transform: transformStatus },
    { key: 'date', label: 'Дата' },
    { key: 'operation', label: 'Операция', transform: transformOperation },
    { key: 'total', label: 'Сумма' },
    { key: 'contractor.name', label: 'Контрагент' },
  ],
  filters: [
    { key: 'date', label: 'Дата', date: true },
    { key: 'status', label: 'Статус', transform: transformStatus },
    { key: 'operation', label: 'Операция', transform: transformOperation },
    { key: 'contractorId', label: 'Контрагент', as: 'contractor.name' },
  ],
  default: {
    operation: 'in',
    records: [],
  },
  Form,
  Panel,
};

export default service;