@felloh-org/lambda-wrapper 1.11.26 → 1.11.28

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.
@@ -13,7 +13,9 @@ var _refundStatus = _interopRequireDefault(require("../refund-status"));
13
13
 
14
14
  var _user = _interopRequireDefault(require("../../user/user"));
15
15
 
16
- 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;
16
+ var _organisation = _interopRequireDefault(require("../../user/organisation"));
17
+
18
+ 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, _descriptor12;
17
19
 
18
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
21
 
@@ -51,14 +53,19 @@ let Refund = (_dec = (0, _typeorm.Entity)({
51
53
  }), _dec12 = (0, _typeorm.Column)({
52
54
  type: "timestamp with time zone",
53
55
  nullable: true
54
- }), _dec13 = (0, _typeorm.Column)({
56
+ }), _dec13 = (0, _typeorm.ManyToOne)(() => _organisation.default, {
57
+ nullable: true
58
+ }), _dec14 = (0, _typeorm.JoinColumn)({
59
+ name: 'organisation_id',
60
+ referencedColumnName: 'id'
61
+ }), _dec15 = (0, _typeorm.Column)({
55
62
  type: "timestamp with time zone",
56
63
  nullable: true
57
- }), _dec14 = (0, _typeorm.CreateDateColumn)({
64
+ }), _dec16 = (0, _typeorm.CreateDateColumn)({
58
65
  type: 'timestamp with time zone'
59
- }), _dec15 = (0, _typeorm.UpdateDateColumn)({
66
+ }), _dec17 = (0, _typeorm.UpdateDateColumn)({
60
67
  type: 'timestamp with time zone'
61
- }), _dec16 = (0, _typeorm.DeleteDateColumn)({
68
+ }), _dec18 = (0, _typeorm.DeleteDateColumn)({
62
69
  type: 'timestamp with time zone',
63
70
  nullable: true
64
71
  }), _dec(_class = (_class2 = class Refund {
@@ -77,13 +84,32 @@ let Refund = (_dec = (0, _typeorm.Entity)({
77
84
 
78
85
  _initializerDefineProperty(this, "authorised_at", _descriptor7, this);
79
86
 
80
- _initializerDefineProperty(this, "completed_at", _descriptor8, this);
87
+ _initializerDefineProperty(this, "organisation", _descriptor8, this);
81
88
 
82
- _initializerDefineProperty(this, "created_at", _descriptor9, this);
89
+ _initializerDefineProperty(this, "completed_at", _descriptor9, this);
83
90
 
84
- _initializerDefineProperty(this, "updated_at", _descriptor10, this);
91
+ _initializerDefineProperty(this, "created_at", _descriptor10, this);
92
+
93
+ _initializerDefineProperty(this, "updated_at", _descriptor11, this);
94
+
95
+ _initializerDefineProperty(this, "deleted_at", _descriptor12, this);
96
+ }
85
97
 
86
- _initializerDefineProperty(this, "deleted_at", _descriptor11, this);
98
+ getPublicData() {
99
+ var _this$status, _this$requesting_user, _this$authorised_user, _this$organisation;
100
+
101
+ return {
102
+ id: this.transaction.id,
103
+ amount: this.amount,
104
+ status: this.status && typeof ((_this$status = this.status) === null || _this$status === void 0 ? void 0 : _this$status.getPublicData) === 'function' ? this.status.getPublicData() : null,
105
+ requesting_user: this.requesting_user && typeof ((_this$requesting_user = this.requesting_user) === null || _this$requesting_user === void 0 ? void 0 : _this$requesting_user.getPublicData) === 'function' ? this.requesting_user.getPublicCompactData() : null,
106
+ authorised_user: this.authorised_user && typeof ((_this$authorised_user = this.authorised_user) === null || _this$authorised_user === void 0 ? void 0 : _this$authorised_user.getPublicData) === 'function' ? this.authorised_user.getPublicCompactData() : null,
107
+ authorisation_code: this.authorisation_code,
108
+ authorised_at: this.authorised_at,
109
+ organisation: this.organisation && typeof ((_this$organisation = this.organisation) === null || _this$organisation === void 0 ? void 0 : _this$organisation.getPublicCompactData) === 'function' ? this.organisation.getPublicCompactData() : null,
110
+ completed_at: this.completed_at,
111
+ created_at: this.created_at
112
+ };
87
113
  }
88
114
 
89
115
  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "transaction", [_dec2, _dec3], {
@@ -131,22 +157,29 @@ let Refund = (_dec = (0, _typeorm.Entity)({
131
157
  enumerable: true,
132
158
  writable: true,
133
159
  initializer: null
134
- }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "completed_at", [_dec13], {
160
+ }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "organisation", [_dec13, _dec14], {
161
+ configurable: true,
162
+ enumerable: true,
163
+ writable: true,
164
+ initializer: function () {
165
+ return _organisation.default;
166
+ }
167
+ }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "completed_at", [_dec15], {
135
168
  configurable: true,
136
169
  enumerable: true,
137
170
  writable: true,
138
171
  initializer: null
139
- }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec14], {
172
+ }), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec16], {
140
173
  configurable: true,
141
174
  enumerable: true,
142
175
  writable: true,
143
176
  initializer: null
144
- }), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec15], {
177
+ }), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec17], {
145
178
  configurable: true,
146
179
  enumerable: true,
147
180
  writable: true,
148
181
  initializer: null
149
- }), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "deleted_at", [_dec16], {
182
+ }), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, "deleted_at", [_dec18], {
150
183
  configurable: true,
151
184
  enumerable: true,
152
185
  writable: true,
@@ -25,6 +25,12 @@ let RefundStatus = (_dec = (0, _typeorm.Entity)({
25
25
  _initializerDefineProperty(this, "created_at", _descriptor2, this);
26
26
  }
27
27
 
28
+ getPublicData() {
29
+ return {
30
+ id: this.id
31
+ };
32
+ }
33
+
28
34
  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
29
35
  configurable: true,
30
36
  enumerable: true,
@@ -0,0 +1,15 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class refundOrg1695368446155 {
4
+ name = 'refundOrg1695368446155'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`ALTER TABLE "payment"."refund" ADD "organisation_id" character varying(150)`);
8
+ await queryRunner.query(`ALTER TABLE "payment"."refund" ADD CONSTRAINT "FK_b25e4ce9ccd51110c4ec782552c" FOREIGN KEY ("organisation_id") REFERENCES "user"."organisation"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
9
+ }
10
+
11
+ async down(queryRunner) {
12
+ await queryRunner.query(`ALTER TABLE "payment"."refund" DROP CONSTRAINT "FK_b25e4ce9ccd51110c4ec782552c"`);
13
+ await queryRunner.query(`ALTER TABLE "payment"."refund" DROP COLUMN "organisation_id"`);
14
+ }
15
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@felloh-org/lambda-wrapper",
3
- "version": "1.11.26",
3
+ "version": "1.11.28",
4
4
  "description": "Lambda wrapper for all Felloh Serverless Projects",
5
5
  "main": "dist/index.js",
6
6
  "engines": {