diff options
Diffstat (limited to 'src/services/transfers/index.ts')
-rw-r--r-- | src/services/transfers/index.ts | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/services/transfers/index.ts b/src/services/transfers/index.ts new file mode 100644 index 0000000..09f6e04 --- /dev/null +++ b/src/services/transfers/index.ts @@ -0,0 +1,35 @@ +import Form from './TransferForm'; +import UploadPage from './TransfersUpload'; + +import { operationNames } from '../constants'; + +const service = { + route: 'transfers', + name: 'Переводы', + nameSingular: 'Перевод', + tableFields: [ + { key: 'date', label: 'Дата', transform: (date: string) => new Date(date).toLocaleDateString() }, + { key: 'contractor.name', label: 'Контрагент' }, + { key: 'operation', label: 'Операция', transform: (op: 'in' | 'out') => operationNames[op] }, + { key: 'amount', label: 'Сумма' }, + ], + actions: [ + { + name: 'Загрузить выписку', + route: '/transfers/upload', + variant: 'outlined', + }, + { + name: 'Добавить', + route: '/transfers/add', + }, + ], + default: { + operation: 'in', + records: [], + }, + routes: { upload: UploadPage }, + Form, +}; + +export default service; |