@felloh-org/lambda-wrapper 1.11.13 → 1.11.15

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.
@@ -0,0 +1,129 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _typeorm = require("typeorm");
9
+
10
+ var _transaction = _interopRequireDefault(require("../../payment/transaction"));
11
+
12
+ var _paymentProvider = _interopRequireDefault(require("../../payment/payment-provider"));
13
+
14
+ var _batch = _interopRequireDefault(require("../batch"));
15
+
16
+ var _organisation = _interopRequireDefault(require("../../user/organisation"));
17
+
18
+ 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;
19
+
20
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
+
22
+ function _initializerDefineProperty(target, property, descriptor, context) { if (!descriptor) return; Object.defineProperty(target, property, { enumerable: descriptor.enumerable, configurable: descriptor.configurable, writable: descriptor.writable, value: descriptor.initializer ? descriptor.initializer.call(context) : void 0 }); }
23
+
24
+ function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
25
+
26
+ function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }
27
+
28
+ let Adjustment = (_dec = (0, _typeorm.Entity)({
29
+ name: 'adjustment',
30
+ schema: 'acquirer'
31
+ }), _dec2 = (0, _typeorm.PrimaryColumn)("varchar"), _dec3 = (0, _typeorm.ManyToOne)(() => _batch.default), _dec4 = (0, _typeorm.JoinColumn)({
32
+ name: 'batch_id',
33
+ referencedColumnName: 'id'
34
+ }), _dec5 = (0, _typeorm.Column)({
35
+ type: "int",
36
+ nullable: true
37
+ }), _dec6 = (0, _typeorm.Column)({
38
+ type: "varchar",
39
+ length: "5",
40
+ nullable: true
41
+ }), _dec7 = (0, _typeorm.Column)({
42
+ type: "varchar",
43
+ length: "250"
44
+ }), _dec8 = (0, _typeorm.ManyToOne)(() => _paymentProvider.default), _dec9 = (0, _typeorm.JoinColumn)({
45
+ name: 'payment_provider_id',
46
+ referencedColumnName: 'id'
47
+ }), _dec10 = (0, _typeorm.ManyToOne)(() => _organisation.default), _dec11 = (0, _typeorm.JoinColumn)({
48
+ name: 'organisation_id',
49
+ referencedColumnName: 'id'
50
+ }), _dec12 = (0, _typeorm.CreateDateColumn)({
51
+ type: 'timestamp with time zone'
52
+ }), _dec13 = (0, _typeorm.UpdateDateColumn)({
53
+ type: 'timestamp with time zone'
54
+ }), _dec(_class = (_class2 = class Adjustment {
55
+ constructor() {
56
+ _initializerDefineProperty(this, "id", _descriptor, this);
57
+
58
+ _initializerDefineProperty(this, "batch", _descriptor2, this);
59
+
60
+ _initializerDefineProperty(this, "amount", _descriptor3, this);
61
+
62
+ _initializerDefineProperty(this, "currency", _descriptor4, this);
63
+
64
+ _initializerDefineProperty(this, "description", _descriptor5, this);
65
+
66
+ _initializerDefineProperty(this, "payment_provider", _descriptor6, this);
67
+
68
+ _initializerDefineProperty(this, "organisation", _descriptor7, this);
69
+
70
+ _initializerDefineProperty(this, "created_at", _descriptor8, this);
71
+
72
+ _initializerDefineProperty(this, "updated_at", _descriptor9, this);
73
+ }
74
+
75
+ }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
76
+ configurable: true,
77
+ enumerable: true,
78
+ writable: true,
79
+ initializer: function () {
80
+ return undefined;
81
+ }
82
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "batch", [_dec3, _dec4], {
83
+ configurable: true,
84
+ enumerable: true,
85
+ writable: true,
86
+ initializer: function () {
87
+ return _batch.default;
88
+ }
89
+ }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "amount", [_dec5], {
90
+ configurable: true,
91
+ enumerable: true,
92
+ writable: true,
93
+ initializer: null
94
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "currency", [_dec6], {
95
+ configurable: true,
96
+ enumerable: true,
97
+ writable: true,
98
+ initializer: null
99
+ }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "description", [_dec7], {
100
+ configurable: true,
101
+ enumerable: true,
102
+ writable: true,
103
+ initializer: null
104
+ }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "payment_provider", [_dec8, _dec9], {
105
+ configurable: true,
106
+ enumerable: true,
107
+ writable: true,
108
+ initializer: function () {
109
+ return _paymentProvider.default;
110
+ }
111
+ }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "organisation", [_dec10, _dec11], {
112
+ configurable: true,
113
+ enumerable: true,
114
+ writable: true,
115
+ initializer: function () {
116
+ return _organisation.default;
117
+ }
118
+ }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec12], {
119
+ configurable: true,
120
+ enumerable: true,
121
+ writable: true,
122
+ initializer: null
123
+ }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec13], {
124
+ configurable: true,
125
+ enumerable: true,
126
+ writable: true,
127
+ initializer: null
128
+ })), _class2)) || _class);
129
+ exports.default = Adjustment;
@@ -11,7 +11,11 @@ var _paymentProvider = _interopRequireDefault(require("../../payment/payment-pro
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, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9;
14
+ var _transactionSettlement = _interopRequireDefault(require("../transaction-settlement"));
15
+
16
+ var _adjustment = _interopRequireDefault(require("../adjustment"));
17
+
18
+ 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, _descriptor11;
15
19
 
16
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
21
 
@@ -39,12 +43,12 @@ let Batch = (_dec = (0, _typeorm.Entity)({
39
43
  }), _dec7 = (0, _typeorm.ManyToOne)(() => _paymentProvider.default), _dec8 = (0, _typeorm.JoinColumn)({
40
44
  name: 'payment_provider_id',
41
45
  referencedColumnName: 'id'
42
- }), _dec9 = (0, _typeorm.Column)({
46
+ }), _dec9 = (0, _typeorm.OneToMany)(() => _adjustment.default, adjustment => adjustment.batch), _dec10 = (0, _typeorm.OneToMany)(() => _transactionSettlement.default, transactionSettlement => transactionSettlement.batch), _dec11 = (0, _typeorm.Column)({
43
47
  type: "boolean",
44
48
  default: false
45
- }), _dec10 = (0, _typeorm.CreateDateColumn)({
49
+ }), _dec12 = (0, _typeorm.CreateDateColumn)({
46
50
  type: 'timestamp with time zone'
47
- }), _dec11 = (0, _typeorm.UpdateDateColumn)({
51
+ }), _dec13 = (0, _typeorm.UpdateDateColumn)({
48
52
  type: 'timestamp with time zone'
49
53
  }), _dec(_class = (_class2 = class Batch {
50
54
  constructor() {
@@ -60,11 +64,31 @@ let Batch = (_dec = (0, _typeorm.Entity)({
60
64
 
61
65
  _initializerDefineProperty(this, "payment_provider", _descriptor6, this);
62
66
 
63
- _initializerDefineProperty(this, "found_in_felloh_managed_trust", _descriptor7, this);
67
+ _initializerDefineProperty(this, "adjustments", _descriptor7, this);
68
+
69
+ _initializerDefineProperty(this, "transaction_settlements", _descriptor8, this);
70
+
71
+ _initializerDefineProperty(this, "found_in_felloh_managed_trust", _descriptor9, this);
64
72
 
65
- _initializerDefineProperty(this, "created_at", _descriptor8, this);
73
+ _initializerDefineProperty(this, "created_at", _descriptor10, this);
66
74
 
67
- _initializerDefineProperty(this, "updated_at", _descriptor9, this);
75
+ _initializerDefineProperty(this, "updated_at", _descriptor11, this);
76
+ }
77
+
78
+ getPublicData() {
79
+ var _this$payment_provide, _this$payment_provide2;
80
+
81
+ return {
82
+ id: this.id,
83
+ bank_reference: this.bank_reference,
84
+ amount: this.amount,
85
+ posting_date: this.posting_date,
86
+ currency: this.currency,
87
+ payment_provider: {
88
+ id: (_this$payment_provide = this.payment_provider) === null || _this$payment_provide === void 0 ? void 0 : _this$payment_provide.id,
89
+ name: (_this$payment_provide2 = this.payment_provider) === null || _this$payment_provide2 === void 0 ? void 0 : _this$payment_provide2.name
90
+ }
91
+ };
68
92
  }
69
93
 
70
94
  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
@@ -101,19 +125,29 @@ let Batch = (_dec = (0, _typeorm.Entity)({
101
125
  initializer: function () {
102
126
  return _paymentProvider.default;
103
127
  }
104
- }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "found_in_felloh_managed_trust", [_dec9], {
128
+ }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "adjustments", [_dec9], {
129
+ configurable: true,
130
+ enumerable: true,
131
+ writable: true,
132
+ initializer: null
133
+ }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "transaction_settlements", [_dec10], {
134
+ configurable: true,
135
+ enumerable: true,
136
+ writable: true,
137
+ initializer: null
138
+ }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "found_in_felloh_managed_trust", [_dec11], {
105
139
  configurable: true,
106
140
  enumerable: true,
107
141
  writable: true,
108
142
  initializer: function () {
109
143
  return false;
110
144
  }
111
- }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec10], {
145
+ }), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec12], {
112
146
  configurable: true,
113
147
  enumerable: true,
114
148
  writable: true,
115
149
  initializer: null
116
- }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec11], {
150
+ }), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec13], {
117
151
  configurable: true,
118
152
  enumerable: true,
119
153
  writable: true,
@@ -9,8 +9,10 @@ var _batch = _interopRequireDefault(require("./batch"));
9
9
 
10
10
  var _transactionSettlement = _interopRequireDefault(require("./transaction-settlement"));
11
11
 
12
+ var _adjustment = _interopRequireDefault(require("./adjustment"));
13
+
12
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
15
 
14
- const ENTITIES = [_batch.default, _transactionSettlement.default];
16
+ const ENTITIES = [_adjustment.default, _batch.default, _transactionSettlement.default];
15
17
  var _default = ENTITIES;
16
18
  exports.default = _default;
@@ -47,6 +47,13 @@ let PaymentProvider = (_dec = (0, _typeorm.Entity)({
47
47
  _initializerDefineProperty(this, "created_at", _descriptor5, this);
48
48
  }
49
49
 
50
+ getPublicData() {
51
+ return {
52
+ id: this.id,
53
+ name: this.name
54
+ };
55
+ }
56
+
50
57
  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
51
58
  configurable: true,
52
59
  enumerable: true,
package/dist/index.js CHANGED
@@ -15,6 +15,12 @@ Object.defineProperty(exports, "AccountEntity", {
15
15
  return _account.default;
16
16
  }
17
17
  });
18
+ Object.defineProperty(exports, "AcquirerAdjustment", {
19
+ enumerable: true,
20
+ get: function () {
21
+ return _adjustment.default;
22
+ }
23
+ });
18
24
  Object.defineProperty(exports, "AcquirerBatch", {
19
25
  enumerable: true,
20
26
  get: function () {
@@ -30,7 +36,7 @@ Object.defineProperty(exports, "AcquirerTransactionSettlement", {
30
36
  Object.defineProperty(exports, "AdjustmentEntity", {
31
37
  enumerable: true,
32
38
  get: function () {
33
- return _adjustment.default;
39
+ return _adjustment2.default;
34
40
  }
35
41
  });
36
42
  Object.defineProperty(exports, "AmendmentEntity", {
@@ -432,7 +438,7 @@ Object.defineProperty(exports, "TPAccountFees", {
432
438
  Object.defineProperty(exports, "TPAdjustment", {
433
439
  enumerable: true,
434
440
  get: function () {
435
- return _adjustment2.default;
441
+ return _adjustment3.default;
436
442
  }
437
443
  });
438
444
  Object.defineProperty(exports, "TPBatchEntity", {
@@ -640,6 +646,8 @@ var _entity = _interopRequireDefault(require("./entity"));
640
646
 
641
647
  var _abtaMembers = _interopRequireDefault(require("./entity/scratch/abta-members"));
642
648
 
649
+ var _adjustment = _interopRequireDefault(require("./entity/acquirer/adjustment"));
650
+
643
651
  var _batch = _interopRequireDefault(require("./entity/acquirer/batch"));
644
652
 
645
653
  var _transactionSettlement = _interopRequireDefault(require("./entity/acquirer/transaction-settlement"));
@@ -660,7 +668,7 @@ var _bookingBankTransaction = _interopRequireDefault(require("./entity/agent-dat
660
668
 
661
669
  var _account = _interopRequireDefault(require("./entity/bank/account"));
662
670
 
663
- var _adjustment = _interopRequireDefault(require("./entity/bank/adjustment"));
671
+ var _adjustment2 = _interopRequireDefault(require("./entity/bank/adjustment"));
664
672
 
665
673
  var _amendment = _interopRequireDefault(require("./entity/bank/amendment"));
666
674
 
@@ -742,7 +750,7 @@ var _transactionCharges = _interopRequireDefault(require("./entity/trust-payment
742
750
 
743
751
  var _accountFees = _interopRequireDefault(require("./entity/trust-payments/account-fees"));
744
752
 
745
- var _adjustment2 = _interopRequireDefault(require("./entity/trust-payments/adjustment"));
753
+ var _adjustment3 = _interopRequireDefault(require("./entity/trust-payments/adjustment"));
746
754
 
747
755
  var _organisation = _interopRequireDefault(require("./entity/user/organisation"));
748
756
 
@@ -0,0 +1,19 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class acquirerAdjustment1692102029462 {
4
+ name = 'acquirerAdjustment1692102029462'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`CREATE TABLE "acquirer"."adjustment" ("id" character varying NOT NULL, "amount" integer, "currency" character varying(5), "description" character varying(250) NOT NULL, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "batch_id" character varying, "payment_provider_id" character varying, "organisation_id" character varying(150), CONSTRAINT "PK_f84d8d269b59850fb017ee1630b" PRIMARY KEY ("id"))`);
8
+ await queryRunner.query(`ALTER TABLE "acquirer"."adjustment" ADD CONSTRAINT "FK_b5bd6a240c5b121448713251f5d" FOREIGN KEY ("batch_id") REFERENCES "acquirer"."batch"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
9
+ await queryRunner.query(`ALTER TABLE "acquirer"."adjustment" ADD CONSTRAINT "FK_ec01a590fe84f04a5e6d15dce1f" FOREIGN KEY ("payment_provider_id") REFERENCES "payment"."payment_provider"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
10
+ await queryRunner.query(`ALTER TABLE "acquirer"."adjustment" ADD CONSTRAINT "FK_d684ed3fd01c94b5fa2a010ab27" FOREIGN KEY ("organisation_id") REFERENCES "user"."organisation"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
11
+ }
12
+
13
+ async down(queryRunner) {
14
+ await queryRunner.query(`ALTER TABLE "acquirer"."adjustment" DROP CONSTRAINT "FK_d684ed3fd01c94b5fa2a010ab27"`);
15
+ await queryRunner.query(`ALTER TABLE "acquirer"."adjustment" DROP CONSTRAINT "FK_ec01a590fe84f04a5e6d15dce1f"`);
16
+ await queryRunner.query(`ALTER TABLE "acquirer"."adjustment" DROP CONSTRAINT "FK_b5bd6a240c5b121448713251f5d"`);
17
+ await queryRunner.query(`DROP TABLE "acquirer"."adjustment"`);
18
+ }
19
+ }
@@ -11,7 +11,7 @@ class TransactionWebhook {
11
11
  }
12
12
 
13
13
  get() {
14
- var _this$transaction, _this$transaction2, _this$transaction3, _this$transaction3$bo, _this$transaction4, _this$transaction4$bo, _this$transaction5, _this$transaction5$pa, _this$transaction6, _this$transaction6$or, _this$transaction7, _this$transaction8, _this$transaction8$st, _this$transaction9, _this$transaction10;
14
+ var _this$transaction, _this$transaction2, _this$transaction3, _this$transaction3$bo, _this$transaction4, _this$transaction4$bo, _this$transaction5, _this$transaction5$ec, _this$transaction6, _this$transaction6$pa, _this$transaction7, _this$transaction7$or, _this$transaction8, _this$transaction9, _this$transaction9$st, _this$transaction10, _this$transaction11;
15
15
 
16
16
  return {
17
17
  transaction: {
@@ -22,16 +22,19 @@ class TransactionWebhook {
22
22
  id: (_this$transaction3 = this.transaction) === null || _this$transaction3 === void 0 ? void 0 : (_this$transaction3$bo = _this$transaction3.booking) === null || _this$transaction3$bo === void 0 ? void 0 : _this$transaction3$bo.id,
23
23
  booking_reference: (_this$transaction4 = this.transaction) === null || _this$transaction4 === void 0 ? void 0 : (_this$transaction4$bo = _this$transaction4.booking) === null || _this$transaction4$bo === void 0 ? void 0 : _this$transaction4$bo.booking_reference
24
24
  },
25
+ ecommerce: {
26
+ id: (_this$transaction5 = this.transaction) === null || _this$transaction5 === void 0 ? void 0 : (_this$transaction5$ec = _this$transaction5.ecommerce) === null || _this$transaction5$ec === void 0 ? void 0 : _this$transaction5$ec.id
27
+ },
25
28
  payment_link: {
26
- id: (_this$transaction5 = this.transaction) === null || _this$transaction5 === void 0 ? void 0 : (_this$transaction5$pa = _this$transaction5.payment_link) === null || _this$transaction5$pa === void 0 ? void 0 : _this$transaction5$pa.id
29
+ id: (_this$transaction6 = this.transaction) === null || _this$transaction6 === void 0 ? void 0 : (_this$transaction6$pa = _this$transaction6.payment_link) === null || _this$transaction6$pa === void 0 ? void 0 : _this$transaction6$pa.id
27
30
  },
28
31
  provider: {
29
- name: (_this$transaction6 = this.transaction) === null || _this$transaction6 === void 0 ? void 0 : (_this$transaction6$or = _this$transaction6.organisation_payment_provider) === null || _this$transaction6$or === void 0 ? void 0 : _this$transaction6$or.name,
30
- reference: (_this$transaction7 = this.transaction) === null || _this$transaction7 === void 0 ? void 0 : _this$transaction7.provider_reference
32
+ name: (_this$transaction7 = this.transaction) === null || _this$transaction7 === void 0 ? void 0 : (_this$transaction7$or = _this$transaction7.organisation_payment_provider) === null || _this$transaction7$or === void 0 ? void 0 : _this$transaction7$or.name,
33
+ reference: (_this$transaction8 = this.transaction) === null || _this$transaction8 === void 0 ? void 0 : _this$transaction8.provider_reference
31
34
  },
32
- status: (_this$transaction8 = this.transaction) === null || _this$transaction8 === void 0 ? void 0 : (_this$transaction8$st = _this$transaction8.status) === null || _this$transaction8$st === void 0 ? void 0 : _this$transaction8$st.id,
33
- completed_at: (_this$transaction9 = this.transaction) === null || _this$transaction9 === void 0 ? void 0 : _this$transaction9.completed_at,
34
- currency: (_this$transaction10 = this.transaction) === null || _this$transaction10 === void 0 ? void 0 : _this$transaction10.currency
35
+ status: (_this$transaction9 = this.transaction) === null || _this$transaction9 === void 0 ? void 0 : (_this$transaction9$st = _this$transaction9.status) === null || _this$transaction9$st === void 0 ? void 0 : _this$transaction9$st.id,
36
+ completed_at: (_this$transaction10 = this.transaction) === null || _this$transaction10 === void 0 ? void 0 : _this$transaction10.completed_at,
37
+ currency: (_this$transaction11 = this.transaction) === null || _this$transaction11 === void 0 ? void 0 : _this$transaction11.currency
35
38
  };
36
39
  }
37
40
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@felloh-org/lambda-wrapper",
3
- "version": "1.11.13",
3
+ "version": "1.11.15",
4
4
  "description": "Lambda wrapper for all Felloh Serverless Projects",
5
5
  "main": "dist/index.js",
6
6
  "engines": {