@felloh-org/lambda-wrapper 1.11.92 → 1.11.94

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.
@@ -9,8 +9,6 @@ var _typeorm = require("typeorm");
9
9
 
10
10
  var _paymentProvider = _interopRequireDefault(require("../../payment/payment-provider"));
11
11
 
12
- var _organisation = _interopRequireDefault(require("../../user/organisation"));
13
-
14
12
  var _transactionSettlement = _interopRequireDefault(require("../transaction-settlement"));
15
13
 
16
14
  var _adjustment = _interopRequireDefault(require("../adjustment"));
@@ -0,0 +1,83 @@
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 _adjustment = _interopRequireDefault(require("../adjustment"));
11
+
12
+ var _disbursal = _interopRequireDefault(require("../disbursal"));
13
+
14
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5;
15
+
16
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
17
+
18
+ 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 }); }
19
+
20
+ 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; }
21
+
22
+ 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.'); }
23
+
24
+ let AdjustmentBatch = exports.default = (_dec = (0, _typeorm.Entity)({
25
+ name: 'adjustment_batch',
26
+ schema: 'bank'
27
+ }), _dec2 = (0, _typeorm.ManyToOne)(() => _adjustment.default, {
28
+ primary: true
29
+ }), _dec3 = (0, _typeorm.JoinColumn)({
30
+ name: 'transaction_id',
31
+ referencedColumnName: 'id'
32
+ }), _dec4 = (0, _typeorm.ManyToOne)(() => _disbursal.default), _dec5 = (0, _typeorm.JoinColumn)({
33
+ name: 'disbursal_id',
34
+ referencedColumnName: 'id'
35
+ }), _dec6 = (0, _typeorm.CreateDateColumn)({
36
+ type: 'timestamp with time zone'
37
+ }), _dec7 = (0, _typeorm.UpdateDateColumn)({
38
+ type: 'timestamp with time zone'
39
+ }), _dec8 = (0, _typeorm.DeleteDateColumn)({
40
+ type: 'timestamp with time zone'
41
+ }), _dec(_class = (_class2 = class AdjustmentBatch {
42
+ constructor() {
43
+ _initializerDefineProperty(this, "adjustment", _descriptor, this);
44
+
45
+ _initializerDefineProperty(this, "disbursal", _descriptor2, this);
46
+
47
+ _initializerDefineProperty(this, "created_at", _descriptor3, this);
48
+
49
+ _initializerDefineProperty(this, "updated_at", _descriptor4, this);
50
+
51
+ _initializerDefineProperty(this, "deleted_at", _descriptor5, this);
52
+ }
53
+
54
+ }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "adjustment", [_dec2, _dec3], {
55
+ configurable: true,
56
+ enumerable: true,
57
+ writable: true,
58
+ initializer: function () {
59
+ return _adjustment.default;
60
+ }
61
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "disbursal", [_dec4, _dec5], {
62
+ configurable: true,
63
+ enumerable: true,
64
+ writable: true,
65
+ initializer: function () {
66
+ return _disbursal.default;
67
+ }
68
+ }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec6], {
69
+ configurable: true,
70
+ enumerable: true,
71
+ writable: true,
72
+ initializer: null
73
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec7], {
74
+ configurable: true,
75
+ enumerable: true,
76
+ writable: true,
77
+ initializer: null
78
+ }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "deleted_at", [_dec8], {
79
+ configurable: true,
80
+ enumerable: true,
81
+ writable: true,
82
+ initializer: null
83
+ })), _class2)) || _class);
@@ -305,6 +305,10 @@ let Transaction = exports.default = (_dec = (0, _typeorm.Entity)({
305
305
  assigned_at: this.assigned_at
306
306
  };
307
307
 
308
+ if (this.customer !== null && typeof this.customer.id !== 'undefined') {
309
+ response.customer = this.customer.getPublicData();
310
+ }
311
+
308
312
  if (this.settlement !== null && typeof this.settlement !== 'undefined') {
309
313
  response.settlement = this.settlement;
310
314
  }
@@ -9,7 +9,7 @@ var _typeorm = require("typeorm");
9
9
 
10
10
  var _organisation = _interopRequireDefault(require("../organisation"));
11
11
 
12
- var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5;
12
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6;
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
 
@@ -33,9 +33,12 @@ let OrganisationPayoutConfig = exports.default = (_dec = (0, _typeorm.Entity)({
33
33
  }), _dec5 = (0, _typeorm.Column)({
34
34
  type: "boolean",
35
35
  default: false
36
- }), _dec6 = (0, _typeorm.CreateDateColumn)({
36
+ }), _dec6 = (0, _typeorm.Column)({
37
+ type: "boolean",
38
+ default: false
39
+ }), _dec7 = (0, _typeorm.CreateDateColumn)({
37
40
  type: 'timestamp with time zone'
38
- }), _dec7 = (0, _typeorm.UpdateDateColumn)({
41
+ }), _dec8 = (0, _typeorm.UpdateDateColumn)({
39
42
  type: 'timestamp with time zone'
40
43
  }), _dec(_class = (_class2 = class OrganisationPayoutConfig {
41
44
  constructor() {
@@ -45,9 +48,11 @@ let OrganisationPayoutConfig = exports.default = (_dec = (0, _typeorm.Entity)({
45
48
 
46
49
  _initializerDefineProperty(this, "ledgering", _descriptor3, this);
47
50
 
48
- _initializerDefineProperty(this, "created_at", _descriptor4, this);
51
+ _initializerDefineProperty(this, "balancing", _descriptor4, this);
52
+
53
+ _initializerDefineProperty(this, "created_at", _descriptor5, this);
49
54
 
50
- _initializerDefineProperty(this, "updated_at", _descriptor5, this);
55
+ _initializerDefineProperty(this, "updated_at", _descriptor6, this);
51
56
  }
52
57
 
53
58
  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "organisation", [_dec2, _dec3], {
@@ -71,12 +76,19 @@ let OrganisationPayoutConfig = exports.default = (_dec = (0, _typeorm.Entity)({
71
76
  initializer: function () {
72
77
  return false;
73
78
  }
74
- }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec6], {
79
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "balancing", [_dec6], {
80
+ configurable: true,
81
+ enumerable: true,
82
+ writable: true,
83
+ initializer: function () {
84
+ return false;
85
+ }
86
+ }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec7], {
75
87
  configurable: true,
76
88
  enumerable: true,
77
89
  writable: true,
78
90
  initializer: null
79
- }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec7], {
91
+ }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec8], {
80
92
  configurable: true,
81
93
  enumerable: true,
82
94
  writable: true,
@@ -0,0 +1,19 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class adjustmentBatch1714140033660 {
4
+ name = 'adjustmentBatch1714140033660'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`CREATE TABLE "bank"."adjustment_batch" ("created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP WITH TIME ZONE, "transaction_id" character varying NOT NULL, "disbursal_id" character varying, CONSTRAINT "PK_4c004d62a3ec4b15021c35942b1" PRIMARY KEY ("transaction_id"))`);
8
+ await queryRunner.query(`ALTER TABLE "user"."organisation_payout_config" ADD "balancing" boolean NOT NULL DEFAULT false`);
9
+ await queryRunner.query(`ALTER TABLE "bank"."adjustment_batch" ADD CONSTRAINT "FK_4c004d62a3ec4b15021c35942b1" FOREIGN KEY ("transaction_id") REFERENCES "bank"."adjustment"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
10
+ await queryRunner.query(`ALTER TABLE "bank"."adjustment_batch" ADD CONSTRAINT "FK_297be5c1088c0670aa1a541a3f0" FOREIGN KEY ("disbursal_id") REFERENCES "bank"."disbursal"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
11
+ }
12
+
13
+ async down(queryRunner) {
14
+ await queryRunner.query(`ALTER TABLE "bank"."adjustment_batch" DROP CONSTRAINT "FK_297be5c1088c0670aa1a541a3f0"`);
15
+ await queryRunner.query(`ALTER TABLE "bank"."adjustment_batch" DROP CONSTRAINT "FK_4c004d62a3ec4b15021c35942b1"`);
16
+ await queryRunner.query(`ALTER TABLE "user"."organisation_payout_config" DROP COLUMN "balancing"`);
17
+ await queryRunner.query(`DROP TABLE "bank"."adjustment_batch"`);
18
+ }
19
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@felloh-org/lambda-wrapper",
3
- "version": "1.11.92",
3
+ "version": "1.11.94",
4
4
  "description": "Lambda wrapper for all Felloh Serverless Projects",
5
5
  "main": "dist/index.js",
6
6
  "engines": {