summaryrefslogtreecommitdiff
path: root/src/services/waybills/index.ts
blob: f8a4be6e78201be02ceb388ec1f5ea70131fe0e5 (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
import Form from './WaybillForm';
import Panel from './WaybillPanel';
import { waybillStatusNames, operationNames } from '../constants';

const service = {
  route: 'waybills',
  name: 'Накладные',
  nameSingular: 'Накладная',
  tableFields: [
    {
      key: 'status',
      label: 'Статус',
      transform: (status: 'waiting' | 'executed' | 'cancelled') => waybillStatusNames[status],
    },
    { key: 'operation', label: 'Операция', transform: (op: 'in' | 'out') => operationNames[op] },
    { key: 'total', label: 'Сумма' },
    { key: 'contractor.name', label: 'Контрагент' },
  ],
  default: {
    operation: 'in',
    records: [],
  },
  Form,
  Panel,
};

export default service;