From 062f10a25d43b875d187cf582b2ecf96d075ec26 Mon Sep 17 00:00:00 2001 From: eug-vs Date: Thu, 25 Mar 2021 23:09:49 +0300 Subject: refactor: move services to separate folder --- src/services/waybills/index.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/services/waybills/index.ts (limited to 'src/services/waybills/index.ts') diff --git a/src/services/waybills/index.ts b/src/services/waybills/index.ts new file mode 100644 index 0000000..f8a4be6 --- /dev/null +++ b/src/services/waybills/index.ts @@ -0,0 +1,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; -- cgit v1.2.3