@felloh-org/lambda-wrapper 1.1.59 → 1.1.62

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.
@@ -17,7 +17,7 @@ var _uuid = require("uuid");
17
17
 
18
18
  var _bookingComponent = _interopRequireDefault(require("../booking-component"));
19
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;
20
+ var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14;
21
21
 
22
22
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
23
23
 
@@ -61,6 +61,9 @@ let Booking = (_dec = (0, _typeorm.Entity)({
61
61
  type: 'timestamp with time zone'
62
62
  }), _dec16 = (0, _typeorm.UpdateDateColumn)({
63
63
  type: 'timestamp with time zone'
64
+ }), _dec17 = (0, _typeorm.DeleteDateColumn)({
65
+ type: 'timestamp with time zone',
66
+ nullable: true
64
67
  }), _dec(_class = (_class2 = class Booking {
65
68
  constructor() {
66
69
  _initializerDefineProperty(this, "id", _descriptor, this);
@@ -88,6 +91,8 @@ let Booking = (_dec = (0, _typeorm.Entity)({
88
91
  _initializerDefineProperty(this, "created_at", _descriptor12, this);
89
92
 
90
93
  _initializerDefineProperty(this, "updated_at", _descriptor13, this);
94
+
95
+ _initializerDefineProperty(this, "deleted_at", _descriptor14, this);
91
96
  }
92
97
 
93
98
  /**
@@ -202,5 +207,10 @@ let Booking = (_dec = (0, _typeorm.Entity)({
202
207
  enumerable: true,
203
208
  writable: true,
204
209
  initializer: null
210
+ }), _descriptor14 = _applyDecoratedDescriptor(_class2.prototype, "deleted_at", [_dec17], {
211
+ configurable: true,
212
+ enumerable: true,
213
+ writable: true,
214
+ initializer: null
205
215
  })), _class2)) || _class);
206
216
  exports.default = Booking;
@@ -15,7 +15,7 @@ var _paymentProvider = _interopRequireDefault(require("../payment-provider"));
15
15
 
16
16
  var _transactionMethod = _interopRequireDefault(require("../transaction-method"));
17
17
 
18
- var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13;
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, _descriptor13, _descriptor14;
19
19
 
20
20
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
21
21
 
@@ -28,15 +28,18 @@ function _initializerWarningHelper(descriptor, context) { throw new Error('Decor
28
28
  let OrganisationPaymentProvider = (_dec = (0, _typeorm.Entity)({
29
29
  name: 'organisation_payment_provider',
30
30
  schema: 'payment'
31
- }), _dec2 = (0, _typeorm.PrimaryColumn)("varchar"), _dec3 = (0, _typeorm.ManyToOne)(() => _organisation.default), _dec4 = (0, _typeorm.JoinColumn)({
31
+ }), _dec2 = (0, _typeorm.PrimaryColumn)("varchar"), _dec3 = (0, _typeorm.Column)({
32
+ type: "varchar",
33
+ length: "150"
34
+ }), _dec4 = (0, _typeorm.ManyToOne)(() => _organisation.default), _dec5 = (0, _typeorm.JoinColumn)({
32
35
  name: 'organisation_id',
33
36
  referencedColumnName: 'id'
34
- }), _dec5 = (0, _typeorm.ManyToOne)(() => _paymentProvider.default), _dec6 = (0, _typeorm.JoinColumn)({
37
+ }), _dec6 = (0, _typeorm.ManyToOne)(() => _paymentProvider.default), _dec7 = (0, _typeorm.JoinColumn)({
35
38
  name: 'payment_provider_id',
36
39
  referencedColumnName: 'id'
37
- }), _dec7 = (0, _typeorm.ManyToMany)(() => _transactionMethod.default, () => {}, {
40
+ }), _dec8 = (0, _typeorm.ManyToMany)(() => _transactionMethod.default, {
38
41
  cascade: true
39
- }), _dec8 = (0, _typeorm.JoinTable)({
42
+ }), _dec9 = (0, _typeorm.JoinTable)({
40
43
  name: "organisation_payment_provider_method",
41
44
  schema: "payment",
42
45
  joinColumn: {
@@ -47,50 +50,52 @@ let OrganisationPaymentProvider = (_dec = (0, _typeorm.Entity)({
47
50
  name: "transaction_method_id",
48
51
  referencedColumnName: "id"
49
52
  }
50
- }), _dec9 = (0, _typeorm.Column)({
53
+ }), _dec10 = (0, _typeorm.Column)({
51
54
  type: "varchar",
52
55
  length: "150"
53
- }), _dec10 = (0, _typeorm.Column)({
56
+ }), _dec11 = (0, _typeorm.Column)({
54
57
  type: "json",
55
58
  nullable: true
56
- }), _dec11 = (0, _typeorm.Column)({
59
+ }), _dec12 = (0, _typeorm.Column)({
57
60
  type: "varchar",
58
61
  length: "512"
59
- }), _dec12 = (0, _typeorm.Column)({
62
+ }), _dec13 = (0, _typeorm.Column)({
60
63
  type: "varchar",
61
64
  length: "4"
62
- }), _dec13 = (0, _typeorm.Column)({
65
+ }), _dec14 = (0, _typeorm.Column)({
63
66
  type: "boolean",
64
67
  default: false
65
- }), _dec14 = (0, _typeorm.Column)({
68
+ }), _dec15 = (0, _typeorm.Column)({
66
69
  type: "int"
67
- }), _dec15 = (0, _typeorm.CreateDateColumn)(), _dec16 = (0, _typeorm.UpdateDateColumn)(), _dec17 = (0, _typeorm.DeleteDateColumn)(), _dec(_class = (_class2 = class OrganisationPaymentProvider {
70
+ }), _dec16 = (0, _typeorm.CreateDateColumn)(), _dec17 = (0, _typeorm.UpdateDateColumn)(), _dec18 = (0, _typeorm.DeleteDateColumn)(), _dec(_class = (_class2 = class OrganisationPaymentProvider {
68
71
  constructor() {
69
72
  _initializerDefineProperty(this, "id", _descriptor, this);
70
73
 
71
- _initializerDefineProperty(this, "organisation", _descriptor2, this);
74
+ _initializerDefineProperty(this, "name", _descriptor2, this);
75
+
76
+ _initializerDefineProperty(this, "organisation", _descriptor3, this);
72
77
 
73
- _initializerDefineProperty(this, "payment_provider", _descriptor3, this);
78
+ _initializerDefineProperty(this, "payment_provider", _descriptor4, this);
74
79
 
75
- _initializerDefineProperty(this, "transaction_methods", _descriptor4, this);
80
+ _initializerDefineProperty(this, "transaction_methods", _descriptor5, this);
76
81
 
77
- _initializerDefineProperty(this, "public_key", _descriptor5, this);
82
+ _initializerDefineProperty(this, "public_key", _descriptor6, this);
78
83
 
79
- _initializerDefineProperty(this, "public_creds", _descriptor6, this);
84
+ _initializerDefineProperty(this, "public_creds", _descriptor7, this);
80
85
 
81
- _initializerDefineProperty(this, "secret_key", _descriptor7, this);
86
+ _initializerDefineProperty(this, "secret_key", _descriptor8, this);
82
87
 
83
- _initializerDefineProperty(this, "secret_key_last_four", _descriptor8, this);
88
+ _initializerDefineProperty(this, "secret_key_last_four", _descriptor9, this);
84
89
 
85
- _initializerDefineProperty(this, "is_active", _descriptor9, this);
90
+ _initializerDefineProperty(this, "is_active", _descriptor10, this);
86
91
 
87
- _initializerDefineProperty(this, "weight", _descriptor10, this);
92
+ _initializerDefineProperty(this, "weight", _descriptor11, this);
88
93
 
89
- _initializerDefineProperty(this, "created_at", _descriptor11, this);
94
+ _initializerDefineProperty(this, "created_at", _descriptor12, this);
90
95
 
91
- _initializerDefineProperty(this, "updated_at", _descriptor12, this);
96
+ _initializerDefineProperty(this, "updated_at", _descriptor13, this);
92
97
 
93
- _initializerDefineProperty(this, "deleted_at", _descriptor13, this);
98
+ _initializerDefineProperty(this, "deleted_at", _descriptor14, this);
94
99
  }
95
100
 
96
101
  }, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
@@ -100,74 +105,81 @@ let OrganisationPaymentProvider = (_dec = (0, _typeorm.Entity)({
100
105
  initializer: function () {
101
106
  return (0, _uuid.v4)();
102
107
  }
103
- }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "organisation", [_dec3, _dec4], {
108
+ }), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "name", [_dec3], {
109
+ configurable: true,
110
+ enumerable: true,
111
+ writable: true,
112
+ initializer: function () {
113
+ return "";
114
+ }
115
+ }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "organisation", [_dec4, _dec5], {
104
116
  configurable: true,
105
117
  enumerable: true,
106
118
  writable: true,
107
119
  initializer: function () {
108
120
  return _organisation.default;
109
121
  }
110
- }), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "payment_provider", [_dec5, _dec6], {
122
+ }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "payment_provider", [_dec6, _dec7], {
111
123
  configurable: true,
112
124
  enumerable: true,
113
125
  writable: true,
114
126
  initializer: function () {
115
127
  return _paymentProvider.default;
116
128
  }
117
- }), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "transaction_methods", [_dec7, _dec8], {
129
+ }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "transaction_methods", [_dec8, _dec9], {
118
130
  configurable: true,
119
131
  enumerable: true,
120
132
  writable: true,
121
133
  initializer: null
122
- }), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "public_key", [_dec9], {
134
+ }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "public_key", [_dec10], {
123
135
  configurable: true,
124
136
  enumerable: true,
125
137
  writable: true,
126
138
  initializer: function () {
127
139
  return "";
128
140
  }
129
- }), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "public_creds", [_dec10], {
141
+ }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "public_creds", [_dec11], {
130
142
  configurable: true,
131
143
  enumerable: true,
132
144
  writable: true,
133
145
  initializer: null
134
- }), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "secret_key", [_dec11], {
146
+ }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "secret_key", [_dec12], {
135
147
  configurable: true,
136
148
  enumerable: true,
137
149
  writable: true,
138
150
  initializer: function () {
139
151
  return "";
140
152
  }
141
- }), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "secret_key_last_four", [_dec12], {
153
+ }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "secret_key_last_four", [_dec13], {
142
154
  configurable: true,
143
155
  enumerable: true,
144
156
  writable: true,
145
157
  initializer: function () {
146
158
  return "";
147
159
  }
148
- }), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "is_active", [_dec13], {
160
+ }), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "is_active", [_dec14], {
149
161
  configurable: true,
150
162
  enumerable: true,
151
163
  writable: true,
152
164
  initializer: function () {
153
165
  return false;
154
166
  }
155
- }), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "weight", [_dec14], {
167
+ }), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "weight", [_dec15], {
156
168
  configurable: true,
157
169
  enumerable: true,
158
170
  writable: true,
159
171
  initializer: null
160
- }), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec15], {
172
+ }), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec16], {
161
173
  configurable: true,
162
174
  enumerable: true,
163
175
  writable: true,
164
176
  initializer: null
165
- }), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec16], {
177
+ }), _descriptor13 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec17], {
166
178
  configurable: true,
167
179
  enumerable: true,
168
180
  writable: true,
169
181
  initializer: null
170
- }), _descriptor13 = _applyDecoratedDescriptor(_class2.prototype, "deleted_at", [_dec17], {
182
+ }), _descriptor14 = _applyDecoratedDescriptor(_class2.prototype, "deleted_at", [_dec18], {
171
183
  configurable: true,
172
184
  enumerable: true,
173
185
  writable: true,
@@ -0,0 +1,13 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class bookingSoftDelete1659707743290 {
4
+ name = 'bookingSoftDelete1659707743290'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking" ADD "deleted_at" TIMESTAMP WITH TIME ZONE`);
8
+ }
9
+
10
+ async down(queryRunner) {
11
+ await queryRunner.query(`ALTER TABLE "agent_data"."booking" DROP COLUMN "deleted_at"`);
12
+ }
13
+ }
@@ -0,0 +1,26 @@
1
+ const { MigrationInterface, QueryRunner } = require("typeorm");
2
+
3
+ module.exports = class organisationPaymentProviderName1659527810407 {
4
+ name = 'organisationPaymentProviderName1659527810407'
5
+
6
+ async up(queryRunner) {
7
+ await queryRunner.query(`ALTER TABLE "payment"."organisation_payment_provider" ADD "name" character varying(150) NOT NULL DEFAULT 'UNTITLED'`);
8
+ // Set default "name" value using format "<PROVIDER-NAME> - <TRANSACTION-METHOD-1>,<TRANSACTION-METHOD-2>"
9
+ await queryRunner.query(`
10
+ UPDATE "payment"."organisation_payment_provider"
11
+ SET "name" = CONCAT_WS(' - ', "provider"."name", "methods"."names")
12
+ FROM "payment"."organisation_payment_provider" AS "organisation"
13
+ JOIN (
14
+ SELECT "organisation_payment_provider_id" AS "organisation_id"
15
+ , STRING_AGG("method"."transaction_method_id", ',') AS "names"
16
+ FROM "payment"."organisation_payment_provider_method" AS "method"
17
+ GROUP BY "organisation_id"
18
+ ) AS "methods" ON "methods"."organisation_id" = "organisation"."id"
19
+ JOIN "payment"."payment_provider" AS "provider" ON "organisation"."payment_provider_id" = "provider"."id"
20
+ `);
21
+ }
22
+
23
+ async down(queryRunner) {
24
+ await queryRunner.query(`ALTER TABLE "payment"."organisation_payment_provider" DROP COLUMN "name"`);
25
+ }
26
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@felloh-org/lambda-wrapper",
3
- "version": "1.1.59",
3
+ "version": "1.1.62",
4
4
  "description": "Lambda wrapper for all Felloh Serverless Projects",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {