@felloh-org/lambda-wrapper 1.1.24 → 1.1.27

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.
@@ -15,7 +15,9 @@ var _transaction = _interopRequireDefault(require("../../payment/transaction"));
15
15
 
16
16
  var _uuid = require("uuid");
17
17
 
18
- 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;
18
+ var _bookingComponent = _interopRequireDefault(require("../booking-component"));
19
+
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;
19
21
 
20
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
23
 
@@ -29,53 +31,63 @@ let Booking = (_dec = (0, _typeorm.Entity)({
29
31
  name: 'booking',
30
32
  schema: 'agent_data'
31
33
  }), _dec2 = (0, _typeorm.PrimaryColumn)("varchar"), _dec3 = (0, _typeorm.Column)({
34
+ type: "int",
35
+ nullable: true
36
+ }), _dec4 = (0, _typeorm.Column)({
32
37
  type: "varchar",
33
- length: "250"
34
- }), _dec4 = (0, _typeorm.ManyToOne)(() => _user.default), _dec5 = (0, _typeorm.JoinColumn)({
38
+ length: "250",
39
+ nullable: true
40
+ }), _dec5 = (0, _typeorm.ManyToOne)(() => _user.default, {
41
+ nullable: true
42
+ }), _dec6 = (0, _typeorm.JoinColumn)({
35
43
  name: 'user_id',
36
44
  referencedColumnName: 'id'
37
- }), _dec6 = (0, _typeorm.OneToMany)(() => _transaction.default, transaction => transaction.booking), _dec7 = (0, _typeorm.ManyToOne)(() => _organisation.default), _dec8 = (0, _typeorm.JoinColumn)({
45
+ }), _dec7 = (0, _typeorm.OneToMany)(() => _transaction.default, transaction => transaction.booking), _dec8 = (0, _typeorm.OneToMany)(() => _bookingComponent.default, bookingComponent => bookingComponent.booking), _dec9 = (0, _typeorm.ManyToOne)(() => _organisation.default), _dec10 = (0, _typeorm.JoinColumn)({
38
46
  name: 'organisation_id',
39
47
  referencedColumnName: 'id'
40
- }), _dec9 = (0, _typeorm.Column)({
48
+ }), _dec11 = (0, _typeorm.Column)({
41
49
  type: "varchar",
42
50
  length: "150"
43
- }), _dec10 = (0, _typeorm.Column)({
51
+ }), _dec12 = (0, _typeorm.Column)({
44
52
  type: "varchar",
45
53
  length: "150"
46
- }), _dec11 = (0, _typeorm.Column)({
54
+ }), _dec13 = (0, _typeorm.Column)({
47
55
  type: "date",
48
56
  nullable: true
49
- }), _dec12 = (0, _typeorm.Column)({
57
+ }), _dec14 = (0, _typeorm.Column)({
50
58
  type: "date",
51
59
  nullable: true
52
- }), _dec13 = (0, _typeorm.CreateDateColumn)({
60
+ }), _dec15 = (0, _typeorm.CreateDateColumn)({
53
61
  type: 'timestamp with time zone'
54
- }), _dec14 = (0, _typeorm.UpdateDateColumn)({
62
+ }), _dec16 = (0, _typeorm.UpdateDateColumn)({
55
63
  type: 'timestamp with time zone'
56
64
  }), _dec(_class = (_class2 = class Booking {
57
65
  constructor() {
58
66
  _initializerDefineProperty(this, "id", _descriptor, this);
59
67
 
60
- _initializerDefineProperty(this, "email", _descriptor2, this);
68
+ _initializerDefineProperty(this, "gross_amount", _descriptor2, this);
69
+
70
+ _initializerDefineProperty(this, "email", _descriptor3, this);
71
+
72
+ _initializerDefineProperty(this, "user", _descriptor4, this);
61
73
 
62
- _initializerDefineProperty(this, "user", _descriptor3, this);
74
+ _initializerDefineProperty(this, "transactions", _descriptor5, this);
63
75
 
64
- _initializerDefineProperty(this, "transactions", _descriptor4, this);
76
+ _initializerDefineProperty(this, "components", _descriptor6, this);
65
77
 
66
- _initializerDefineProperty(this, "organisation", _descriptor5, this);
78
+ _initializerDefineProperty(this, "organisation", _descriptor7, this);
67
79
 
68
- _initializerDefineProperty(this, "customer_name", _descriptor6, this);
80
+ _initializerDefineProperty(this, "customer_name", _descriptor8, this);
69
81
 
70
- _initializerDefineProperty(this, "booking_reference", _descriptor7, this);
82
+ _initializerDefineProperty(this, "booking_reference", _descriptor9, this);
71
83
 
72
- _initializerDefineProperty(this, "departure_date", _descriptor8, this);
84
+ _initializerDefineProperty(this, "departure_date", _descriptor10, this);
73
85
 
74
- _initializerDefineProperty(this, "return_date", _descriptor9, this);
86
+ _initializerDefineProperty(this, "return_date", _descriptor11, this);
75
87
 
76
- _initializerDefineProperty(this, "created_at", _descriptor10, this);
88
+ _initializerDefineProperty(this, "created_at", _descriptor12, this);
77
89
 
78
- _initializerDefineProperty(this, "updated_at", _descriptor11, this);
90
+ _initializerDefineProperty(this, "updated_at", _descriptor13, this);
79
91
  }
80
92
 
81
93
  /**
@@ -90,13 +102,18 @@ let Booking = (_dec = (0, _typeorm.Entity)({
90
102
  customer_name: this.customer_name,
91
103
  departure_date: this.departure_date,
92
104
  return_date: this.return_date,
93
- email: this.email
105
+ email: this.email,
106
+ gross_amount: this.gross_amount
94
107
  };
95
108
 
96
109
  if (typeof this.transactions !== 'undefined') {
97
110
  response.transactions = this.transactions.map(transaction => transaction.getPublicCompactData());
98
111
  }
99
112
 
113
+ if (typeof this.components !== 'undefined') {
114
+ response.components = this.components.map(component => component.getPublicCompactData());
115
+ }
116
+
100
117
  if (this.user !== null && typeof this.user.id !== 'undefined') {
101
118
  response.user = this.user.getPublicCompactData();
102
119
  }
@@ -115,62 +132,72 @@ let Booking = (_dec = (0, _typeorm.Entity)({
115
132
  initializer: function () {
116
133
  return (0, _uuid.v4)();
117
134
  }
118
- }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "email", [_dec3], {
135
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "gross_amount", [_dec3], {
136
+ configurable: true,
137
+ enumerable: true,
138
+ writable: true,
139
+ initializer: null
140
+ }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "email", [_dec4], {
119
141
  configurable: true,
120
142
  enumerable: true,
121
143
  writable: true,
122
144
  initializer: function () {
123
145
  return "";
124
146
  }
125
- }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "user", [_dec4, _dec5], {
147
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "user", [_dec5, _dec6], {
126
148
  configurable: true,
127
149
  enumerable: true,
128
150
  writable: true,
129
151
  initializer: function () {
130
152
  return _user.default;
131
153
  }
132
- }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "transactions", [_dec6], {
154
+ }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "transactions", [_dec7], {
155
+ configurable: true,
156
+ enumerable: true,
157
+ writable: true,
158
+ initializer: null
159
+ }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "components", [_dec8], {
133
160
  configurable: true,
134
161
  enumerable: true,
135
162
  writable: true,
136
163
  initializer: null
137
- }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "organisation", [_dec7, _dec8], {
164
+ }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "organisation", [_dec9, _dec10], {
138
165
  configurable: true,
139
166
  enumerable: true,
140
167
  writable: true,
141
168
  initializer: function () {
142
169
  return _organisation.default;
143
170
  }
144
- }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "customer_name", [_dec9], {
171
+ }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "customer_name", [_dec11], {
145
172
  configurable: true,
146
173
  enumerable: true,
147
174
  writable: true,
148
175
  initializer: function () {
149
176
  return "";
150
177
  }
151
- }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "booking_reference", [_dec10], {
178
+ }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "booking_reference", [_dec12], {
152
179
  configurable: true,
153
180
  enumerable: true,
154
181
  writable: true,
155
182
  initializer: function () {
156
183
  return "";
157
184
  }
158
- }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "departure_date", [_dec11], {
185
+ }), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "departure_date", [_dec13], {
159
186
  configurable: true,
160
187
  enumerable: true,
161
188
  writable: true,
162
189
  initializer: null
163
- }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "return_date", [_dec12], {
190
+ }), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "return_date", [_dec14], {
164
191
  configurable: true,
165
192
  enumerable: true,
166
193
  writable: true,
167
194
  initializer: null
168
- }), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec13], {
195
+ }), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec15], {
169
196
  configurable: true,
170
197
  enumerable: true,
171
198
  writable: true,
172
199
  initializer: null
173
- }), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec14], {
200
+ }), _descriptor13 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec16], {
174
201
  configurable: true,
175
202
  enumerable: true,
176
203
  writable: true,
@@ -9,7 +9,13 @@ var _typeorm = require("typeorm");
9
9
 
10
10
  var _uuid = require("uuid");
11
11
 
12
- var _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2;
12
+ var _supplier = _interopRequireDefault(require("../supplier"));
13
+
14
+ var _booking = _interopRequireDefault(require("../booking"));
15
+
16
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8;
17
+
18
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
13
19
 
14
20
  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 }); }
15
21
 
@@ -20,11 +26,55 @@ function _initializerWarningHelper(descriptor, context) { throw new Error('Decor
20
26
  let BookingComponent = (_dec = (0, _typeorm.Entity)({
21
27
  name: 'booking_component',
22
28
  schema: 'agent_data'
23
- }), _dec2 = (0, _typeorm.PrimaryColumn)("varchar"), _dec3 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class BookingComponent {
29
+ }), _dec2 = (0, _typeorm.PrimaryColumn)("varchar"), _dec3 = (0, _typeorm.ManyToOne)(() => _booking.default), _dec4 = (0, _typeorm.JoinColumn)({
30
+ name: 'booking_id',
31
+ referencedColumnName: 'id'
32
+ }), _dec5 = (0, _typeorm.ManyToOne)(() => _supplier.default, {
33
+ nullable: true
34
+ }), _dec6 = (0, _typeorm.JoinColumn)({
35
+ name: 'supplier_id',
36
+ referencedColumnName: 'id'
37
+ }), _dec7 = (0, _typeorm.Column)({
38
+ type: "int",
39
+ nullable: true
40
+ }), _dec8 = (0, _typeorm.Column)({
41
+ type: "varchar",
42
+ length: "150",
43
+ nullable: true
44
+ }), _dec9 = (0, _typeorm.Column)({
45
+ type: "varchar",
46
+ length: "10",
47
+ nullable: true
48
+ }), _dec10 = (0, _typeorm.Column)({
49
+ type: "varchar",
50
+ length: "40"
51
+ }), _dec11 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class BookingComponent {
24
52
  constructor() {
25
53
  _initializerDefineProperty(this, "id", _descriptor, this);
26
54
 
27
- _initializerDefineProperty(this, "created_at", _descriptor2, this);
55
+ _initializerDefineProperty(this, "booking", _descriptor2, this);
56
+
57
+ _initializerDefineProperty(this, "supplier", _descriptor3, this);
58
+
59
+ _initializerDefineProperty(this, "amount", _descriptor4, this);
60
+
61
+ _initializerDefineProperty(this, "booking_reference", _descriptor5, this);
62
+
63
+ _initializerDefineProperty(this, "destination_air", _descriptor6, this);
64
+
65
+ _initializerDefineProperty(this, "type", _descriptor7, this);
66
+
67
+ _initializerDefineProperty(this, "created_at", _descriptor8, this);
68
+ }
69
+
70
+ getPublicCompactData() {
71
+ return {
72
+ id: this.id,
73
+ supplier: this.supplier,
74
+ amount: this.amount,
75
+ booking_reference: this.booking_reference,
76
+ destination_air: this.destination_air
77
+ };
28
78
  }
29
79
 
30
80
  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
@@ -34,7 +84,47 @@ let BookingComponent = (_dec = (0, _typeorm.Entity)({
34
84
  initializer: function () {
35
85
  return (0, _uuid.v4)();
36
86
  }
37
- }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec3], {
87
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "booking", [_dec3, _dec4], {
88
+ configurable: true,
89
+ enumerable: true,
90
+ writable: true,
91
+ initializer: function () {
92
+ return _booking.default;
93
+ }
94
+ }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "supplier", [_dec5, _dec6], {
95
+ configurable: true,
96
+ enumerable: true,
97
+ writable: true,
98
+ initializer: function () {
99
+ return _supplier.default;
100
+ }
101
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "amount", [_dec7], {
102
+ configurable: true,
103
+ enumerable: true,
104
+ writable: true,
105
+ initializer: null
106
+ }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "booking_reference", [_dec8], {
107
+ configurable: true,
108
+ enumerable: true,
109
+ writable: true,
110
+ initializer: function () {
111
+ return null;
112
+ }
113
+ }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "destination_air", [_dec9], {
114
+ configurable: true,
115
+ enumerable: true,
116
+ writable: true,
117
+ initializer: function () {
118
+ return null;
119
+ }
120
+ }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "type", [_dec10], {
121
+ configurable: true,
122
+ enumerable: true,
123
+ writable: true,
124
+ initializer: function () {
125
+ return null;
126
+ }
127
+ }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec11], {
38
128
  configurable: true,
39
129
  enumerable: true,
40
130
  writable: true,
@@ -0,0 +1,13 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class bookingGross1656410109048 {
4
+ name = 'bookingGross1656410109048'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking" ADD "gross_amount" integer`);
8
+ }
9
+
10
+ async down(queryRunner) {
11
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking" DROP COLUMN "gross_amount"`);
12
+ }
13
+ }
@@ -0,0 +1,13 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class bookingNullables1656411834978 {
4
+ name = 'bookingNullables1656411834978'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking" ALTER COLUMN "email" DROP NOT NULL`);
8
+ }
9
+
10
+ async down(queryRunner) {
11
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking" ALTER COLUMN "email" SET NOT NULL`);
12
+ }
13
+ }
@@ -0,0 +1,27 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class bookingComponents1656421768668 {
4
+ name = 'bookingComponents1656421768668'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" ADD "amount" integer`);
8
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" ADD "booking_reference" character varying(150)`);
9
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" ADD "destination_air" character varying(10)`);
10
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" ADD "type" character varying(40) NOT NULL`);
11
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" ADD "booking_id" character varying`);
12
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" ADD "supplier_id" character varying`);
13
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" ADD CONSTRAINT "FK_d243dfda8e27a088dc2661981d7" FOREIGN KEY ("booking_id") REFERENCES "agent_data"."booking"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
14
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" ADD CONSTRAINT "FK_f9577f42fa4c57747cefb8927b1" FOREIGN KEY ("supplier_id") REFERENCES "agent_data"."supplier"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
15
+ }
16
+
17
+ async down(queryRunner) {
18
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" DROP CONSTRAINT "FK_f9577f42fa4c57747cefb8927b1"`);
19
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" DROP CONSTRAINT "FK_d243dfda8e27a088dc2661981d7"`);
20
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" DROP COLUMN "supplier_id"`);
21
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" DROP COLUMN "booking_id"`);
22
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" DROP COLUMN "type"`);
23
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" DROP COLUMN "destination_air"`);
24
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" DROP COLUMN "booking_reference"`);
25
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking_component" DROP COLUMN "amount"`);
26
+ }
27
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@felloh-org/lambda-wrapper",
3
- "version": "1.1.24",
3
+ "version": "1.1.27",
4
4
  "description": "Lambda wrapper for all Felloh Serverless Projects",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {