summaryrefslogtreecommitdiff
path: root/src/services/waybills/index.ts
diff options
context:
space:
mode:
authoreug-vs <eug-vs@keemail.me>2021-03-26 00:44:51 +0300
committereug-vs <eug-vs@keemail.me>2021-03-26 00:44:51 +0300
commitf1cdf02e9c0dca3354f4eebd38edd2ba12075893 (patch)
treec164c722d879869024a1dcd07fec225eb5f5bf47 /src/services/waybills/index.ts
parent062f10a25d43b875d187cf582b2ecf96d075ec26 (diff)
downloadcommercel-ui-f1cdf02e9c0dca3354f4eebd38edd2ba12075893.tar.gz
fix: improve typings
Diffstat (limited to 'src/services/waybills/index.ts')
-rw-r--r--src/services/waybills/index.ts13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/services/waybills/index.ts b/src/services/waybills/index.ts
index f8a4be6..4e50f54 100644
--- a/src/services/waybills/index.ts
+++ b/src/services/waybills/index.ts
@@ -1,18 +1,15 @@
import Form from './WaybillForm';
import Panel from './WaybillPanel';
-import { waybillStatusNames, operationNames } from '../constants';
+import { transformOperation, transformStatus } from '../transforms';
+import { ServiceParams } from '../../containers/Service/ServiceContext';
-const service = {
+const service: ServiceParams = {
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: 'status', label: 'Статус', transform: transformStatus },
+ { key: 'operation', label: 'Операция', transform: transformOperation },
{ key: 'total', label: 'Сумма' },
{ key: 'contractor.name', label: 'Контрагент' },
],