@felloh-org/lambda-wrapper 1.0.4 → 1.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -10,13 +10,13 @@ const run = async () => {
10
10
  const connection = await warehouse.connect();
11
11
 
12
12
  const queryRunner = await connection.createQueryRunner();
13
- await queryRunner.createDatabase("felloh", true);
13
+ await queryRunner.createDatabase('felloh', true);
14
14
 
15
- await queryRunner.createSchema("nuapay", true);
16
- await queryRunner.createSchema("agent_data", true);
17
- await queryRunner.createSchema("payment", true);
18
- await queryRunner.createSchema("bank", true);
19
- await queryRunner.createSchema("user", true);
15
+ await queryRunner.createSchema('nuapay', true);
16
+ await queryRunner.createSchema('agent_data', true);
17
+ await queryRunner.createSchema('payment', true);
18
+ await queryRunner.createSchema('bank', true);
19
+ await queryRunner.createSchema('user', true);
20
20
  };
21
21
 
22
22
  run();
@@ -11,7 +11,9 @@ var _user = _interopRequireDefault(require("../../user/user"));
11
11
 
12
12
  var _organisation = _interopRequireDefault(require("../../user/organisation"));
13
13
 
14
- var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9;
14
+ var _transaction = _interopRequireDefault(require("../../payment/transaction"));
15
+
16
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10;
15
17
 
16
18
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
19
 
@@ -30,22 +32,22 @@ let Booking = (_dec = (0, _typeorm.Entity)({
30
32
  }), _dec4 = (0, _typeorm.ManyToOne)(() => _user.default), _dec5 = (0, _typeorm.JoinColumn)({
31
33
  name: 'user_id',
32
34
  referencedColumnName: 'id'
33
- }), _dec6 = (0, _typeorm.ManyToOne)(() => _organisation.default), _dec7 = (0, _typeorm.JoinColumn)({
35
+ }), _dec6 = (0, _typeorm.OneToMany)(() => _transaction.default, transaction => transaction.booking), _dec7 = (0, _typeorm.ManyToOne)(() => _organisation.default), _dec8 = (0, _typeorm.JoinColumn)({
34
36
  name: 'organisation_id',
35
37
  referencedColumnName: 'id'
36
- }), _dec8 = (0, _typeorm.Column)({
37
- type: "varchar",
38
- length: "150"
39
38
  }), _dec9 = (0, _typeorm.Column)({
40
39
  type: "varchar",
41
40
  length: "150"
42
41
  }), _dec10 = (0, _typeorm.Column)({
42
+ type: "varchar",
43
+ length: "150"
44
+ }), _dec11 = (0, _typeorm.Column)({
43
45
  type: "date",
44
46
  nullable: true
45
- }), _dec11 = (0, _typeorm.Column)({
47
+ }), _dec12 = (0, _typeorm.Column)({
46
48
  type: "date",
47
49
  nullable: true
48
- }), _dec12 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class Booking {
50
+ }), _dec13 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class Booking {
49
51
  constructor() {
50
52
  _initializerDefineProperty(this, "id", _descriptor, this);
51
53
 
@@ -53,17 +55,19 @@ let Booking = (_dec = (0, _typeorm.Entity)({
53
55
 
54
56
  _initializerDefineProperty(this, "user", _descriptor3, this);
55
57
 
56
- _initializerDefineProperty(this, "organisation", _descriptor4, this);
58
+ _initializerDefineProperty(this, "transactions", _descriptor4, this);
59
+
60
+ _initializerDefineProperty(this, "organisation", _descriptor5, this);
57
61
 
58
- _initializerDefineProperty(this, "customer_name", _descriptor5, this);
62
+ _initializerDefineProperty(this, "customer_name", _descriptor6, this);
59
63
 
60
- _initializerDefineProperty(this, "booking_reference", _descriptor6, this);
64
+ _initializerDefineProperty(this, "booking_reference", _descriptor7, this);
61
65
 
62
- _initializerDefineProperty(this, "departure_date", _descriptor7, this);
66
+ _initializerDefineProperty(this, "departure_date", _descriptor8, this);
63
67
 
64
- _initializerDefineProperty(this, "return_date", _descriptor8, this);
68
+ _initializerDefineProperty(this, "return_date", _descriptor9, this);
65
69
 
66
- _initializerDefineProperty(this, "created_at", _descriptor9, this);
70
+ _initializerDefineProperty(this, "created_at", _descriptor10, this);
67
71
  }
68
72
 
69
73
  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
@@ -87,38 +91,43 @@ let Booking = (_dec = (0, _typeorm.Entity)({
87
91
  initializer: function () {
88
92
  return _user.default;
89
93
  }
90
- }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "organisation", [_dec6, _dec7], {
94
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "transactions", [_dec6], {
95
+ configurable: true,
96
+ enumerable: true,
97
+ writable: true,
98
+ initializer: null
99
+ }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "organisation", [_dec7, _dec8], {
91
100
  configurable: true,
92
101
  enumerable: true,
93
102
  writable: true,
94
103
  initializer: function () {
95
104
  return _organisation.default;
96
105
  }
97
- }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "customer_name", [_dec8], {
106
+ }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "customer_name", [_dec9], {
98
107
  configurable: true,
99
108
  enumerable: true,
100
109
  writable: true,
101
110
  initializer: function () {
102
111
  return "";
103
112
  }
104
- }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "booking_reference", [_dec9], {
113
+ }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "booking_reference", [_dec10], {
105
114
  configurable: true,
106
115
  enumerable: true,
107
116
  writable: true,
108
117
  initializer: function () {
109
118
  return "";
110
119
  }
111
- }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "departure_date", [_dec10], {
120
+ }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "departure_date", [_dec11], {
112
121
  configurable: true,
113
122
  enumerable: true,
114
123
  writable: true,
115
124
  initializer: null
116
- }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "return_date", [_dec11], {
125
+ }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "return_date", [_dec12], {
117
126
  configurable: true,
118
127
  enumerable: true,
119
128
  writable: true,
120
129
  initializer: null
121
- }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec12], {
130
+ }), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec13], {
122
131
  configurable: true,
123
132
  enumerable: true,
124
133
  writable: true,
@@ -13,7 +13,9 @@ var _user = _interopRequireDefault(require("../../user/user"));
13
13
 
14
14
  var _booking = _interopRequireDefault(require("../../agent-data/booking"));
15
15
 
16
- var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11;
16
+ var _transaction = _interopRequireDefault(require("../transaction"));
17
+
18
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12;
17
19
 
18
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
21
 
@@ -51,9 +53,9 @@ let PaymentLink = (_dec = (0, _typeorm.Entity)({
51
53
  }), _dec13 = (0, _typeorm.Column)({
52
54
  type: "varchar",
53
55
  length: "200"
54
- }), _dec14 = (0, _typeorm.Column)({
56
+ }), _dec14 = (0, _typeorm.OneToMany)(() => _transaction.default, transaction => transaction.payment_link), _dec15 = (0, _typeorm.Column)({
55
57
  type: "timestamp with time zone"
56
- }), _dec15 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class PaymentLink {
58
+ }), _dec16 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class PaymentLink {
57
59
  constructor() {
58
60
  _initializerDefineProperty(this, "id", _descriptor, this);
59
61
 
@@ -73,9 +75,11 @@ let PaymentLink = (_dec = (0, _typeorm.Entity)({
73
75
 
74
76
  _initializerDefineProperty(this, "cancel_url", _descriptor9, this);
75
77
 
76
- _initializerDefineProperty(this, "expires_at", _descriptor10, this);
78
+ _initializerDefineProperty(this, "transactions", _descriptor10, this);
79
+
80
+ _initializerDefineProperty(this, "expires_at", _descriptor11, this);
77
81
 
78
- _initializerDefineProperty(this, "created_at", _descriptor11, this);
82
+ _initializerDefineProperty(this, "created_at", _descriptor12, this);
79
83
  }
80
84
 
81
85
  generateExpiryDate() {
@@ -145,14 +149,19 @@ let PaymentLink = (_dec = (0, _typeorm.Entity)({
145
149
  initializer: function () {
146
150
  return "";
147
151
  }
148
- }), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "expires_at", [_dec14], {
152
+ }), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "transactions", [_dec14], {
153
+ configurable: true,
154
+ enumerable: true,
155
+ writable: true,
156
+ initializer: null
157
+ }), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "expires_at", [_dec15], {
149
158
  configurable: true,
150
159
  enumerable: true,
151
160
  writable: true,
152
161
  initializer: function () {
153
162
  return this.generateExpiryDate();
154
163
  }
155
- }), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec15], {
164
+ }), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec16], {
156
165
  configurable: true,
157
166
  enumerable: true,
158
167
  writable: true,
@@ -19,7 +19,9 @@ var _transactionStatus = _interopRequireDefault(require("../transaction-status")
19
19
 
20
20
  var _paymentLink = _interopRequireDefault(require("../payment-link"));
21
21
 
22
- var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10;
22
+ var _transactionMetadata = _interopRequireDefault(require("../transaction-metadata"));
23
+
24
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _dec18, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11;
23
25
 
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
27
 
@@ -56,10 +58,10 @@ let Transaction = (_dec = (0, _typeorm.Entity)({
56
58
  }), _dec15 = (0, _typeorm.JoinColumn)({
57
59
  name: 'payment_link_id',
58
60
  referencedColumnName: 'id'
59
- }), _dec16 = (0, _typeorm.Column)({
61
+ }), _dec16 = (0, _typeorm.OneToOne)(() => _transactionMetadata.default, transactionMetadata => transactionMetadata.transaction), _dec17 = (0, _typeorm.Column)({
60
62
  type: "timestamp with time zone",
61
63
  nullable: true
62
- }), _dec17 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class Transaction {
64
+ }), _dec18 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class Transaction {
63
65
  constructor() {
64
66
  _initializerDefineProperty(this, "id", _descriptor, this);
65
67
 
@@ -77,9 +79,11 @@ let Transaction = (_dec = (0, _typeorm.Entity)({
77
79
 
78
80
  _initializerDefineProperty(this, "payment_link", _descriptor8, this);
79
81
 
80
- _initializerDefineProperty(this, "completed_at", _descriptor9, this);
82
+ _initializerDefineProperty(this, "metadata", _descriptor9, this);
83
+
84
+ _initializerDefineProperty(this, "completed_at", _descriptor10, this);
81
85
 
82
- _initializerDefineProperty(this, "created_at", _descriptor10, this);
86
+ _initializerDefineProperty(this, "created_at", _descriptor11, this);
83
87
  }
84
88
 
85
89
  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
@@ -136,12 +140,17 @@ let Transaction = (_dec = (0, _typeorm.Entity)({
136
140
  initializer: function () {
137
141
  return _paymentLink.default;
138
142
  }
139
- }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "completed_at", [_dec16], {
143
+ }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "metadata", [_dec16], {
144
+ configurable: true,
145
+ enumerable: true,
146
+ writable: true,
147
+ initializer: null
148
+ }), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "completed_at", [_dec17], {
140
149
  configurable: true,
141
150
  enumerable: true,
142
151
  writable: true,
143
152
  initializer: null
144
- }), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec17], {
153
+ }), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec18], {
145
154
  configurable: true,
146
155
  enumerable: true,
147
156
  writable: true,
@@ -7,8 +7,6 @@ exports.default = void 0;
7
7
 
8
8
  var _typeorm = require("typeorm");
9
9
 
10
- var _booking = _interopRequireDefault(require("../../agent-data/booking"));
11
-
12
10
  var _transaction = _interopRequireDefault(require("../transaction"));
13
11
 
14
12
  var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10;
@@ -89,7 +87,7 @@ let TransactionMetadata = (_dec = (0, _typeorm.Entity)({
89
87
  enumerable: true,
90
88
  writable: true,
91
89
  initializer: function () {
92
- return _booking.default;
90
+ return _transaction.default;
93
91
  }
94
92
  }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "card_type", [_dec4], {
95
93
  configurable: true,
@@ -32,11 +32,11 @@ let Organisation = (_dec = (0, _typeorm.Entity)({
32
32
  name: "user_organisation",
33
33
  schema: "user",
34
34
  joinColumn: {
35
- name: "user_id",
35
+ name: "organisation_id",
36
36
  referencedColumnName: "id"
37
37
  },
38
38
  inverseJoinColumn: {
39
- name: "organisation_id",
39
+ name: "user_id",
40
40
  referencedColumnName: "id"
41
41
  }
42
42
  }), _dec10 = (0, _typeorm.TreeParent)(), _dec11 = (0, _typeorm.TreeChildren)(), _dec(_class = _dec2(_class = (_class2 = class Organisation {
@@ -47,7 +47,7 @@ class Warehouse extends _dependencyAware.default {
47
47
  resourceArn: process.env.WAREHOUSE_ARN,
48
48
  region: process.env.REGION,
49
49
  entities: _entity.default,
50
- logging: true
50
+ logging: false
51
51
  });
52
52
  }
53
53
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@felloh-org/lambda-wrapper",
3
- "version": "1.0.4",
3
+ "version": "1.0.8",
4
4
  "description": "Lambda wrapper for all Felloh Serverless Projects",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {