forked from mojaloop/central-ledger
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbulkProcessingState.js
93 lines (89 loc) · 3.39 KB
/
bulkProcessingState.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
/*****
License
--------------
Copyright © 2017 Bill & Melinda Gates Foundation
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Contributors
--------------
This is the official list of the Mojaloop project contributors for this file.
Names of the original copyright holders (individuals or organizations)
should be listed with a '*' in the first column. People who have
contributed from an organization can be listed under the organization
that actually holds the copyright for their contributions (see the
Gates Foundation organization for an example). Those individuals should have
their names indented and be marked with a '-'. Email address can be added
optionally within square brackets <email>.
* Gates Foundation
- Name Surname <name.surname@gatesfoundation.com>
* Georgi Georgiev <georgi.georgiev@modusbox.com>
* Shashikant Hirugade <shashikant.hirugade@modusbox.com>
--------------
******/
'use strict'
const bulkProcessingStates = [
{
bulkProcessingStateId: 1,
name: 'RECEIVED',
description: 'The switch has received the individual transfer ids part of the bulk transfer'
},
{
bulkProcessingStateId: 2,
name: 'RECEIVED_DUPLICATE',
description: 'The switch has matched individual transfer as duplicate'
},
{
bulkProcessingStateId: 3,
name: 'RECEIVED_INVALID',
description: 'The switch has matched individual transfer as invalid within Prepare or Position Handler'
},
{
bulkProcessingStateId: 4,
name: 'ACCEPTED',
description: 'The switch has reserved the funds for the transfers in the bulk'
},
{
bulkProcessingStateId: 5,
name: 'PROCESSING',
description: 'Fulfilment request has been received for the individual transfer'
},
{
bulkProcessingStateId: 6,
name: 'FULFIL_DUPLICATE',
description: 'The switch has matched individual transfer fulfil as duplicate'
},
{
bulkProcessingStateId: 7,
name: 'FULFIL_INVALID',
description: 'The switch has matched individual transfer fulfilment as invalid within Fulfil or Position Handler'
},
{
bulkProcessingStateId: 8,
name: 'COMPLETED',
description: 'The switch has marked the individual transfer as committed'
},
{
bulkProcessingStateId: 9,
name: 'REJECTED',
description: 'The switch has marked the individual transfer as rejected'
},
{
bulkProcessingStateId: 10,
name: 'EXPIRED',
description: 'The switch has marked the individual transfer as timed out'
},
{
bulkProcessingStateId: 11,
name: 'ABORTING',
description: 'The switch has marked the individual transfer as aborting due to failed validation'
}
]
exports.seed = async function (knex) {
try {
return await knex('bulkProcessingState').insert(bulkProcessingStates).onConflict('name').ignore()
} catch (err) {
console.log(`Uploading seeds for bulkProcessingState has failed with the following error: ${err}`)
return -1000
}
}