@felloh-org/lambda-wrapper 1.1.11 → 1.1.14

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.
@@ -97,10 +97,14 @@ let Booking = (_dec = (0, _typeorm.Entity)({
97
97
  response.transactions = this.transactions.map(transaction => transaction.getPublicCompactData());
98
98
  }
99
99
 
100
- if (typeof this.user.id !== 'undefined') {
100
+ if (this.user !== null && typeof this.user.id !== 'undefined') {
101
101
  response.user = this.user.getPublicCompactData();
102
102
  }
103
103
 
104
+ if (this.organisation !== null && typeof this.organisation.id !== 'undefined') {
105
+ response.organisation = this.organisation.getPublicCompactData();
106
+ }
107
+
104
108
  return response;
105
109
  }
106
110
 
@@ -172,4 +176,5 @@ let Booking = (_dec = (0, _typeorm.Entity)({
172
176
  writable: true,
173
177
  initializer: null
174
178
  })), _class2)) || _class);
175
- exports.default = Booking;
179
+ exports.default = Booking;
180
+ ``;
@@ -150,6 +150,10 @@ let PaymentLink = (_dec = (0, _typeorm.Entity)({
150
150
  response.user = this.user.getPublicCompactData();
151
151
  }
152
152
 
153
+ if (this.organisation !== null && typeof this.organisation.id !== 'undefined') {
154
+ response.organisation = this.organisation.getPublicCompactData();
155
+ }
156
+
153
157
  return response;
154
158
  }
155
159
 
@@ -138,11 +138,15 @@ let Transaction = (_dec = (0, _typeorm.Entity)({
138
138
  response.booking = this.booking.getPublicData();
139
139
  }
140
140
 
141
+ if (this.organisation !== null && typeof this.organisation.id !== 'undefined') {
142
+ response.organisation = this.organisation.getPublicCompactData();
143
+ }
144
+
141
145
  return response;
142
146
  }
143
147
 
144
148
  getPublicCompactData() {
145
- return {
149
+ const response = {
146
150
  id: this.id,
147
151
  amount: this.amount,
148
152
  status: this.status.id,
@@ -151,6 +155,12 @@ let Transaction = (_dec = (0, _typeorm.Entity)({
151
155
  created_at: this.created_at,
152
156
  completed_at: this.completed_at
153
157
  };
158
+
159
+ if (this.organisation !== null && typeof this.organisation.id !== 'undefined') {
160
+ response.organisation = this.organisation.getPublicCompactData();
161
+ }
162
+
163
+ return response;
154
164
  }
155
165
 
156
166
  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
@@ -9,7 +9,7 @@ var _typeorm = require("typeorm");
9
9
 
10
10
  var _transaction = _interopRequireDefault(require("../transaction"));
11
11
 
12
- 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;
12
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12;
13
13
 
14
14
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
15
15
 
@@ -59,9 +59,12 @@ let TransactionMetadata = (_dec = (0, _typeorm.Entity)({
59
59
  type: "varchar",
60
60
  nullable: true,
61
61
  length: 150
62
- }), _dec12 = (0, _typeorm.CreateDateColumn)({
62
+ }), _dec12 = (0, _typeorm.Column)({
63
+ type: "int",
64
+ nullable: true
65
+ }), _dec13 = (0, _typeorm.CreateDateColumn)({
63
66
  type: 'timestamp with time zone'
64
- }), _dec13 = (0, _typeorm.UpdateDateColumn)({
67
+ }), _dec14 = (0, _typeorm.UpdateDateColumn)({
65
68
  type: 'timestamp with time zone'
66
69
  }), _dec(_class = (_class2 = class TransactionMetadata {
67
70
  constructor() {
@@ -83,9 +86,11 @@ let TransactionMetadata = (_dec = (0, _typeorm.Entity)({
83
86
 
84
87
  _initializerDefineProperty(this, "cardholder_name", _descriptor9, this);
85
88
 
86
- _initializerDefineProperty(this, "created_at", _descriptor10, this);
89
+ _initializerDefineProperty(this, "charges", _descriptor10, this);
87
90
 
88
- _initializerDefineProperty(this, "updated_at", _descriptor11, this);
91
+ _initializerDefineProperty(this, "created_at", _descriptor11, this);
92
+
93
+ _initializerDefineProperty(this, "updated_at", _descriptor12, this);
89
94
  }
90
95
 
91
96
  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "transaction", [_dec2, _dec3], {
@@ -135,12 +140,17 @@ let TransactionMetadata = (_dec = (0, _typeorm.Entity)({
135
140
  enumerable: true,
136
141
  writable: true,
137
142
  initializer: null
138
- }), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec12], {
143
+ }), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "charges", [_dec12], {
144
+ configurable: true,
145
+ enumerable: true,
146
+ writable: true,
147
+ initializer: null
148
+ }), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec13], {
139
149
  configurable: true,
140
150
  enumerable: true,
141
151
  writable: true,
142
152
  initializer: null
143
- }), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec13], {
153
+ }), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec14], {
144
154
  configurable: true,
145
155
  enumerable: true,
146
156
  writable: true,
@@ -0,0 +1,13 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class transactionCharges1651747895363 {
4
+ name = 'transactionCharges1651747895363'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`ALTER TABLE "payment"."transaction_metadata" ADD "charges" integer`);
8
+ }
9
+
10
+ async down(queryRunner) {
11
+ await queryRunner.query(`ALTER TABLE "payment"."transaction_metadata" DROP COLUMN "charges"`);
12
+ }
13
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@felloh-org/lambda-wrapper",
3
- "version": "1.1.11",
3
+ "version": "1.1.14",
4
4
  "description": "Lambda wrapper for all Felloh Serverless Projects",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {
@@ -57,7 +57,7 @@
57
57
  "dotenv": "^16.0.0",
58
58
  "epsagon": "^1.121.3",
59
59
  "typeorm": "^0.2.41",
60
- "typeorm-aurora-data-api-driver": "^2.3.5",
60
+ "typeorm-aurora-data-api-driver": "^2.4.2",
61
61
  "useragent": "^2.3.0",
62
62
  "uuid": "^8.3.2",
63
63
  "validate.js": "^0.13.1",