1 | /*
|
2 |
|
3 | ----------------------------------------------------------------------------
|
4 | | qewd-ripple: QEWD-based Middle Tier for Ripple OSI |
|
5 | | |
|
6 | | Copyright (c) 2016-17 Ripple Foundation Community Interest Company |
|
7 | | All rights reserved. |
|
8 | | |
|
9 | | http://rippleosi.org |
|
10 | | Email: code.custodian@rippleosi.org |
|
11 | | |
|
12 | | Author: Rob Tweed, M/Gateway Developments Ltd |
|
13 | | |
|
14 | | Licensed under the Apache License, Version 2.0 (the "License"); |
|
15 | | you may not use this file except in compliance with the License. |
|
16 | | You may obtain a copy of the License at |
|
17 | | |
|
18 | | http://www.apache.org/licenses/LICENSE-2.0 |
|
19 | | |
|
20 | | Unless required by applicable law or agreed to in writing, software |
|
21 | | distributed under the License is distributed on an "AS IS" BASIS, |
|
22 | | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
23 | | See the License for the specific language governing permissions and |
|
24 | | limitations under the License. |
|
25 | ----------------------------------------------------------------------------
|
26 |
|
27 | 17 May 2017
|
28 |
|
29 | */
|
30 |
|
31 | var setTransferOfCare = require('./setTransferOfCare');
|
32 | var getTransferOfCareSummary = require('./getTransferOfCareSummary');
|
33 | var getTransferOfCareDetail = require('./getTransferOfCareDetail');
|
34 |
|
35 | function postEvent(args, callback) {
|
36 | if (args.eventType === 'toc') {
|
37 | return setTransferOfCare.call(this, args, callback);
|
38 | }
|
39 |
|
40 | callback({error: args.eventType + ' is not a valid event type'});
|
41 | }
|
42 |
|
43 | function getAll(args, callback) {
|
44 | if (args.eventType === 'toc') {
|
45 | return getTransferOfCareSummary.call(this, args, callback);
|
46 | }
|
47 |
|
48 | callback({error: args.eventType + ' is not a valid event type'});
|
49 | }
|
50 |
|
51 | function getOne(args, callback) {
|
52 | if (args.eventType === 'toc') {
|
53 | return getTransferOfCareDetail.call(this, args, callback);
|
54 | }
|
55 |
|
56 | callback({error: args.eventType + ' is not a valid event type'});
|
57 | }
|
58 |
|
59 | module.exports = {
|
60 | post: postEvent,
|
61 | getAll: getAll,
|
62 | getOne: getOne
|
63 | };
|