-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
49 lines (47 loc) · 1.33 KB
/
test.js
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
"use strict";
const vcmcemtex = require('./app.js');
vcmcemtex({
header: {
record: { type: 'lps', length: 1, value: '1' },
branch: { type: 'lpz', value: '1234' },
name: { type: 'rps', value: 'HEADER NAME' },
date: { type: 'lpz', value: '20190211' },
test1: { type: 'rps', value: 'test1' },
test2: { type: 'rps', value: 'test2' }
},
detail: {
keys: {
name: { type: 'rps', length: 10, default: '' },
username: { type: 'rps', length: 10, default: '' },
email: { type: 'rps', length: 20, default: '' },
accountNumber: { type: 'lpz', length: 10, default: '' },
testAmount: { type: 'lpz', length: 10, default: '' }
},
data: [
{
name: 'John Doe',
username: 'johndoe',
email: 'johndoe@email.com',
accountNumber: '123456789',
testAmount: '12500'
},
{
name: 'John Smith',
username: 'johnsmith',
email: 'johnsmith@email.com',
accountNumber: '123456789',
testAmount: '12500'
},
{
name: 'John Adam',
}
]
},
footer: {
record: { type: 'lpz', length: 1, value: '3' },
totalData: { type: 'lpz', length: 11, countAllData: true },
totalAmount: { type: 'lpz', length: 11, countFromDetail: 'testAmount' }
}
}).then(cemtex => {
console.log("'" + cemtex + "'");
});