@felloh-org/lambda-wrapper 1.11.96 → 1.11.97

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.
@@ -29,6 +29,8 @@ const run = async () => {
29
29
  await queryRunner.createSchema('operations', true);
30
30
  await queryRunner.createSchema('basis_theory', true);
31
31
  await queryRunner.createSchema('aisp', true);
32
+
33
+ process.exit(0);
32
34
  } catch (error) {
33
35
  console.log(error);
34
36
 
@@ -96,6 +96,18 @@ let Adjustment = exports.default = (_dec = (0, _typeorm.Entity)({
96
96
  return response;
97
97
  }
98
98
 
99
+ getPublicCompactData() {
100
+ return {
101
+ id: this.id,
102
+ amount: this.amount,
103
+ vendor_reference: this.vendor_reference,
104
+ description: this.description,
105
+ created_at: this.created_at,
106
+ updated_at: this.updated_at,
107
+ currency: this.currency
108
+ };
109
+ }
110
+
99
111
  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
100
112
  configurable: true,
101
113
  enumerable: true,
@@ -13,11 +13,13 @@ var _account = _interopRequireDefault(require("../account"));
13
13
 
14
14
  var _transactionBatch = _interopRequireDefault(require("../transaction-batch"));
15
15
 
16
+ var _adjustmentBatch = _interopRequireDefault(require("../adjustment-batch"));
17
+
16
18
  var _currency = require("../currency");
17
19
 
18
20
  var _transaction = _interopRequireDefault(require("../../saltedge/transaction"));
19
21
 
20
- 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, _descriptor13;
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, _descriptor11, _descriptor12, _descriptor13, _descriptor14;
21
23
 
22
24
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
25
 
@@ -43,24 +45,24 @@ let Disbursal = exports.default = (_dec = (0, _typeorm.Entity)({
43
45
  }), _dec8 = (0, _typeorm.Column)({
44
46
  type: "varchar",
45
47
  length: "50"
46
- }), _dec9 = (0, _typeorm.CreateDateColumn)(), _dec10 = (0, _typeorm.OneToMany)(() => _transactionBatch.default, transactionBatch => transactionBatch.disbursal), _dec11 = (0, _typeorm.Column)({
48
+ }), _dec9 = (0, _typeorm.CreateDateColumn)(), _dec10 = (0, _typeorm.OneToMany)(() => _transactionBatch.default, transactionBatch => transactionBatch.disbursal), _dec11 = (0, _typeorm.OneToMany)(() => _adjustmentBatch.default, adjustmentBatch => adjustmentBatch.disbursal), _dec12 = (0, _typeorm.Column)({
47
49
  type: "varchar",
48
50
  length: "3",
49
51
  default: _currency.DEFAULT_CURRENCY
50
- }), _dec12 = (0, _typeorm.Column)({
52
+ }), _dec13 = (0, _typeorm.Column)({
51
53
  type: "varchar",
52
54
  length: "250",
53
55
  nullable: true
54
- }), _dec13 = (0, _typeorm.Column)({
56
+ }), _dec14 = (0, _typeorm.Column)({
55
57
  type: "boolean",
56
58
  default: true
57
- }), _dec14 = (0, _typeorm.Column)({
59
+ }), _dec15 = (0, _typeorm.Column)({
58
60
  type: "boolean",
59
61
  default: false
60
- }), _dec15 = (0, _typeorm.Column)({
62
+ }), _dec16 = (0, _typeorm.Column)({
61
63
  type: "boolean",
62
64
  default: false
63
- }), _dec16 = (0, _typeorm.OneToOne)(() => _transaction.default, transaction => transaction.disbursal), _dec(_class = (_class2 = class Disbursal {
65
+ }), _dec17 = (0, _typeorm.OneToOne)(() => _transaction.default, transaction => transaction.disbursal), _dec(_class = (_class2 = class Disbursal {
64
66
  constructor() {
65
67
  _initializerDefineProperty(this, "id", _descriptor, this);
66
68
 
@@ -76,17 +78,19 @@ let Disbursal = exports.default = (_dec = (0, _typeorm.Entity)({
76
78
 
77
79
  _initializerDefineProperty(this, "batch", _descriptor7, this);
78
80
 
79
- _initializerDefineProperty(this, "currency", _descriptor8, this);
81
+ _initializerDefineProperty(this, "adjustment_batch", _descriptor8, this);
80
82
 
81
- _initializerDefineProperty(this, "provider_reference", _descriptor9, this);
83
+ _initializerDefineProperty(this, "currency", _descriptor9, this);
82
84
 
83
- _initializerDefineProperty(this, "is_ledgered", _descriptor10, this);
85
+ _initializerDefineProperty(this, "provider_reference", _descriptor10, this);
84
86
 
85
- _initializerDefineProperty(this, "is_manual_review", _descriptor11, this);
87
+ _initializerDefineProperty(this, "is_ledgered", _descriptor11, this);
86
88
 
87
- _initializerDefineProperty(this, "updated_legacy_system", _descriptor12, this);
89
+ _initializerDefineProperty(this, "is_manual_review", _descriptor12, this);
88
90
 
89
- _initializerDefineProperty(this, "bank_transaction", _descriptor13, this);
91
+ _initializerDefineProperty(this, "updated_legacy_system", _descriptor13, this);
92
+
93
+ _initializerDefineProperty(this, "bank_transaction", _descriptor14, this);
90
94
  }
91
95
 
92
96
  getPublicData() {
@@ -108,6 +112,10 @@ let Disbursal = exports.default = (_dec = (0, _typeorm.Entity)({
108
112
  data.transactions = this.batch.map(batch => batch.transaction.getPublicCompactData());
109
113
  }
110
114
 
115
+ if (this.adjustment && this.adjustment.length >= 1) {
116
+ data.adjustments = this.adjustment.map(batch => batch.adjustment.getPublicCompactData());
117
+ }
118
+
111
119
  return data;
112
120
  }
113
121
 
@@ -152,42 +160,47 @@ let Disbursal = exports.default = (_dec = (0, _typeorm.Entity)({
152
160
  enumerable: true,
153
161
  writable: true,
154
162
  initializer: null
155
- }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "currency", [_dec11], {
163
+ }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "adjustment_batch", [_dec11], {
164
+ configurable: true,
165
+ enumerable: true,
166
+ writable: true,
167
+ initializer: null
168
+ }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "currency", [_dec12], {
156
169
  configurable: true,
157
170
  enumerable: true,
158
171
  writable: true,
159
172
  initializer: function () {
160
173
  return _currency.DEFAULT_CURRENCY;
161
174
  }
162
- }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "provider_reference", [_dec12], {
175
+ }), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "provider_reference", [_dec13], {
163
176
  configurable: true,
164
177
  enumerable: true,
165
178
  writable: true,
166
179
  initializer: function () {
167
180
  return "";
168
181
  }
169
- }), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "is_ledgered", [_dec13], {
182
+ }), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "is_ledgered", [_dec14], {
170
183
  configurable: true,
171
184
  enumerable: true,
172
185
  writable: true,
173
186
  initializer: function () {
174
187
  return true;
175
188
  }
176
- }), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "is_manual_review", [_dec14], {
189
+ }), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, "is_manual_review", [_dec15], {
177
190
  configurable: true,
178
191
  enumerable: true,
179
192
  writable: true,
180
193
  initializer: function () {
181
194
  return false;
182
195
  }
183
- }), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, "updated_legacy_system", [_dec15], {
196
+ }), _descriptor13 = _applyDecoratedDescriptor(_class2.prototype, "updated_legacy_system", [_dec16], {
184
197
  configurable: true,
185
198
  enumerable: true,
186
199
  writable: true,
187
200
  initializer: function () {
188
201
  return false;
189
202
  }
190
- }), _descriptor13 = _applyDecoratedDescriptor(_class2.prototype, "bank_transaction", [_dec16], {
203
+ }), _descriptor14 = _applyDecoratedDescriptor(_class2.prototype, "bank_transaction", [_dec17], {
191
204
  configurable: true,
192
205
  enumerable: true,
193
206
  writable: true,
@@ -41,6 +41,12 @@ class AuthenticationService extends _dependencyAware.default {
41
41
  }
42
42
  };
43
43
  }
44
+
45
+ async init() {
46
+ await this.initialise();
47
+ this.initialised = true;
48
+ return this;
49
+ }
44
50
  /**
45
51
  * Fetch a users organisations
46
52
  * @param user
package/ormconfig.js CHANGED
@@ -3,7 +3,7 @@ const DotEnv = require('dotenv');
3
3
  DotEnv.config();
4
4
 
5
5
  const connectionParams = {
6
- database: 'felloh',
6
+ database: process.env.WAREHOUSE_DATABASE,
7
7
  entities: [
8
8
  `${__dirname}/dist/entity/**/*.ts`,
9
9
  `${__dirname}/dist/entity/**/*.js`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@felloh-org/lambda-wrapper",
3
- "version": "1.11.96",
3
+ "version": "1.11.97",
4
4
  "description": "Lambda wrapper for all Felloh Serverless Projects",
5
5
  "main": "dist/index.js",
6
6
  "engines": {
@@ -61,6 +61,7 @@
61
61
  "axios": "^0.26.1",
62
62
  "dotenv": "^16.0.0",
63
63
  "epsagon": "^1.121.3",
64
+ "execution-time": "^1.4.1",
64
65
  "geojson": "^0.5.0",
65
66
  "moment": "^2.29.3",
66
67
  "pg": "^8.11.3",
@@ -1,60 +0,0 @@
1
- const { MigrationInterface, QueryRunner } = require("typeorm");
2
-
3
- module.exports = class initial1641774481300 {
4
- name = 'plecom1693832604328'
5
-
6
- async up(queryRunner) {
7
- await queryRunner.query(`
8
- CREATE OR REPLACE VIEW plecom_union AS
9
- select
10
- amount,
11
- description,
12
- expires_at,
13
- user_id,
14
- organisation_id,
15
- id,
16
- booking_id,
17
- customer_name,
18
- open_banking_enabled,
19
- card_enabled,
20
- moto,
21
- status,
22
- created_at,
23
- updated_at,
24
- email,
25
- currency,
26
- deleted_at,
27
- pre_authorized,
28
- customer_id
29
- from "payment"."payment_Link"
30
- union
31
- select
32
- amount,
33
- '' as description,
34
- expires_at,
35
- user_id,
36
- organisation_id,
37
- id,
38
- booking_id,
39
- customer_name,
40
- open_banking_enabled,
41
- card_enabled,
42
- moto,
43
- status,
44
- created_at,
45
- updated_at,
46
- email,
47
- currency,
48
- deleted_at,
49
- pre_authorized,
50
- customer_id
51
- from "payment".ecommerce
52
- `);
53
- }
54
-
55
- async down(queryRunner) {
56
- await queryRunner.query(`
57
- DROP VIEW IF EXISTS plecom_union;
58
- `);
59
- }
60
- }
@@ -1,105 +0,0 @@
1
- const { MigrationInterface, QueryRunner } = require("typeorm");
2
-
3
- module.exports = class initial1641774481300 {
4
- name = 'plecom1693832604329'
5
-
6
- async up(queryRunner) {
7
- await queryRunner.query(`
8
- CREATE OR REPLACE VIEW plecom_union AS
9
- select
10
- amount,
11
- description,
12
- expires_at,
13
- user_id,
14
- organisation_id,
15
- id,
16
- booking_id,
17
- customer_name,
18
- open_banking_enabled,
19
- card_enabled,
20
- moto,
21
- status,
22
- created_at,
23
- updated_at,
24
- email,
25
- currency,
26
- deleted_at,
27
- pre_authorized,
28
- customer_id,
29
- cast(coalesce(metadata, '{}') as jsonb) as metadata
30
- from "payment"."payment_Link"
31
- union
32
- select
33
- amount,
34
- '' as description,
35
- expires_at,
36
- user_id,
37
- organisation_id,
38
- id,
39
- booking_id,
40
- customer_name,
41
- open_banking_enabled,
42
- card_enabled,
43
- moto,
44
- status,
45
- created_at,
46
- updated_at,
47
- email,
48
- currency,
49
- deleted_at,
50
- pre_authorized,
51
- customer_id,
52
- cast('{}' as jsonb) as metadata
53
- from "payment".ecommerce
54
- `);
55
- }
56
-
57
- async down(queryRunner) {
58
- await queryRunner.query(`
59
- CREATE OR REPLACE VIEW plecom_union AS
60
- select
61
- amount,
62
- description,
63
- expires_at,
64
- user_id,
65
- organisation_id,
66
- id,
67
- booking_id,
68
- customer_name,
69
- open_banking_enabled,
70
- card_enabled,
71
- moto,
72
- status,
73
- created_at,
74
- updated_at,
75
- email,
76
- currency,
77
- deleted_at,
78
- pre_authorized,
79
- customer_id
80
- from "payment"."payment_Link"
81
- union
82
- select
83
- amount,
84
- '' as description,
85
- expires_at,
86
- user_id,
87
- organisation_id,
88
- id,
89
- booking_id,
90
- customer_name,
91
- open_banking_enabled,
92
- card_enabled,
93
- moto,
94
- status,
95
- created_at,
96
- updated_at,
97
- email,
98
- currency,
99
- deleted_at,
100
- pre_authorized,
101
- customer_id
102
- from "payment".ecommerce
103
- `);
104
- }
105
- }