@felloh-org/lambda-wrapper 1.1.58 → 1.1.61
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,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, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11;
|
|
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.
|
|
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
|
-
}),
|
|
37
|
+
}), _dec6 = (0, _typeorm.ManyToOne)(() => _paymentProvider.default), _dec7 = (0, _typeorm.JoinColumn)({
|
|
35
38
|
name: 'payment_provider_id',
|
|
36
39
|
referencedColumnName: 'id'
|
|
37
|
-
}),
|
|
40
|
+
}), _dec8 = (0, _typeorm.ManyToMany)(() => _transactionMethod.default, {
|
|
38
41
|
cascade: true
|
|
39
|
-
}),
|
|
42
|
+
}), _dec9 = (0, _typeorm.JoinTable)({
|
|
40
43
|
name: "organisation_payment_provider_method",
|
|
41
44
|
schema: "payment",
|
|
42
45
|
joinColumn: {
|
|
@@ -47,46 +50,52 @@ let OrganisationPaymentProvider = (_dec = (0, _typeorm.Entity)({
|
|
|
47
50
|
name: "transaction_method_id",
|
|
48
51
|
referencedColumnName: "id"
|
|
49
52
|
}
|
|
50
|
-
}),
|
|
53
|
+
}), _dec10 = (0, _typeorm.Column)({
|
|
51
54
|
type: "varchar",
|
|
52
55
|
length: "150"
|
|
53
|
-
}),
|
|
56
|
+
}), _dec11 = (0, _typeorm.Column)({
|
|
54
57
|
type: "json",
|
|
55
58
|
nullable: true
|
|
56
|
-
}),
|
|
59
|
+
}), _dec12 = (0, _typeorm.Column)({
|
|
57
60
|
type: "varchar",
|
|
58
61
|
length: "512"
|
|
59
|
-
}),
|
|
62
|
+
}), _dec13 = (0, _typeorm.Column)({
|
|
60
63
|
type: "varchar",
|
|
61
64
|
length: "4"
|
|
62
|
-
}),
|
|
65
|
+
}), _dec14 = (0, _typeorm.Column)({
|
|
63
66
|
type: "boolean",
|
|
64
67
|
default: false
|
|
65
|
-
}),
|
|
68
|
+
}), _dec15 = (0, _typeorm.Column)({
|
|
66
69
|
type: "int"
|
|
67
|
-
}),
|
|
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, "
|
|
74
|
+
_initializerDefineProperty(this, "name", _descriptor2, this);
|
|
75
|
+
|
|
76
|
+
_initializerDefineProperty(this, "organisation", _descriptor3, this);
|
|
77
|
+
|
|
78
|
+
_initializerDefineProperty(this, "payment_provider", _descriptor4, this);
|
|
79
|
+
|
|
80
|
+
_initializerDefineProperty(this, "transaction_methods", _descriptor5, this);
|
|
72
81
|
|
|
73
|
-
_initializerDefineProperty(this, "
|
|
82
|
+
_initializerDefineProperty(this, "public_key", _descriptor6, this);
|
|
74
83
|
|
|
75
|
-
_initializerDefineProperty(this, "
|
|
84
|
+
_initializerDefineProperty(this, "public_creds", _descriptor7, this);
|
|
76
85
|
|
|
77
|
-
_initializerDefineProperty(this, "
|
|
86
|
+
_initializerDefineProperty(this, "secret_key", _descriptor8, this);
|
|
78
87
|
|
|
79
|
-
_initializerDefineProperty(this, "
|
|
88
|
+
_initializerDefineProperty(this, "secret_key_last_four", _descriptor9, this);
|
|
80
89
|
|
|
81
|
-
_initializerDefineProperty(this, "
|
|
90
|
+
_initializerDefineProperty(this, "is_active", _descriptor10, this);
|
|
82
91
|
|
|
83
|
-
_initializerDefineProperty(this, "
|
|
92
|
+
_initializerDefineProperty(this, "weight", _descriptor11, this);
|
|
84
93
|
|
|
85
|
-
_initializerDefineProperty(this, "
|
|
94
|
+
_initializerDefineProperty(this, "created_at", _descriptor12, this);
|
|
86
95
|
|
|
87
|
-
_initializerDefineProperty(this, "
|
|
96
|
+
_initializerDefineProperty(this, "updated_at", _descriptor13, this);
|
|
88
97
|
|
|
89
|
-
_initializerDefineProperty(this, "
|
|
98
|
+
_initializerDefineProperty(this, "deleted_at", _descriptor14, this);
|
|
90
99
|
}
|
|
91
100
|
|
|
92
101
|
}, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
|
|
@@ -96,64 +105,81 @@ let OrganisationPaymentProvider = (_dec = (0, _typeorm.Entity)({
|
|
|
96
105
|
initializer: function () {
|
|
97
106
|
return (0, _uuid.v4)();
|
|
98
107
|
}
|
|
99
|
-
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "
|
|
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], {
|
|
100
116
|
configurable: true,
|
|
101
117
|
enumerable: true,
|
|
102
118
|
writable: true,
|
|
103
119
|
initializer: function () {
|
|
104
120
|
return _organisation.default;
|
|
105
121
|
}
|
|
106
|
-
}),
|
|
122
|
+
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "payment_provider", [_dec6, _dec7], {
|
|
107
123
|
configurable: true,
|
|
108
124
|
enumerable: true,
|
|
109
125
|
writable: true,
|
|
110
126
|
initializer: function () {
|
|
111
127
|
return _paymentProvider.default;
|
|
112
128
|
}
|
|
113
|
-
}),
|
|
129
|
+
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "transaction_methods", [_dec8, _dec9], {
|
|
114
130
|
configurable: true,
|
|
115
131
|
enumerable: true,
|
|
116
132
|
writable: true,
|
|
117
133
|
initializer: null
|
|
118
|
-
}),
|
|
134
|
+
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "public_key", [_dec10], {
|
|
119
135
|
configurable: true,
|
|
120
136
|
enumerable: true,
|
|
121
137
|
writable: true,
|
|
122
138
|
initializer: function () {
|
|
123
139
|
return "";
|
|
124
140
|
}
|
|
125
|
-
}),
|
|
141
|
+
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "public_creds", [_dec11], {
|
|
126
142
|
configurable: true,
|
|
127
143
|
enumerable: true,
|
|
128
144
|
writable: true,
|
|
129
145
|
initializer: null
|
|
130
|
-
}),
|
|
146
|
+
}), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "secret_key", [_dec12], {
|
|
131
147
|
configurable: true,
|
|
132
148
|
enumerable: true,
|
|
133
149
|
writable: true,
|
|
134
150
|
initializer: function () {
|
|
135
151
|
return "";
|
|
136
152
|
}
|
|
137
|
-
}),
|
|
153
|
+
}), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "secret_key_last_four", [_dec13], {
|
|
138
154
|
configurable: true,
|
|
139
155
|
enumerable: true,
|
|
140
156
|
writable: true,
|
|
141
157
|
initializer: function () {
|
|
142
158
|
return "";
|
|
143
159
|
}
|
|
144
|
-
}),
|
|
160
|
+
}), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "is_active", [_dec14], {
|
|
145
161
|
configurable: true,
|
|
146
162
|
enumerable: true,
|
|
147
163
|
writable: true,
|
|
148
164
|
initializer: function () {
|
|
149
165
|
return false;
|
|
150
166
|
}
|
|
151
|
-
}),
|
|
167
|
+
}), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "weight", [_dec15], {
|
|
168
|
+
configurable: true,
|
|
169
|
+
enumerable: true,
|
|
170
|
+
writable: true,
|
|
171
|
+
initializer: null
|
|
172
|
+
}), _descriptor12 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec16], {
|
|
173
|
+
configurable: true,
|
|
174
|
+
enumerable: true,
|
|
175
|
+
writable: true,
|
|
176
|
+
initializer: null
|
|
177
|
+
}), _descriptor13 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec17], {
|
|
152
178
|
configurable: true,
|
|
153
179
|
enumerable: true,
|
|
154
180
|
writable: true,
|
|
155
181
|
initializer: null
|
|
156
|
-
}),
|
|
182
|
+
}), _descriptor14 = _applyDecoratedDescriptor(_class2.prototype, "deleted_at", [_dec18], {
|
|
157
183
|
configurable: true,
|
|
158
184
|
enumerable: true,
|
|
159
185
|
writable: true,
|
package/dist/migration/payment/1659431411240-organisation-payment-provider-enable-soft-delete.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const { MigrationInterface, QueryRunner } = require("typeorm");
|
|
2
|
+
|
|
3
|
+
module.exports = class organisationPaymentProviderEnableSoftDelete1659431411240 {
|
|
4
|
+
name = 'organisationPaymentProviderEnableSoftDelete1659431411240'
|
|
5
|
+
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE "payment"."organisation_payment_provider" ADD "updated_at" TIMESTAMP NOT NULL DEFAULT now()`);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE "payment"."organisation_payment_provider" ADD "deleted_at" TIMESTAMP`);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async down(queryRunner) {
|
|
12
|
+
await queryRunner.query(`ALTER TABLE "payment"."organisation_payment_provider" DROP COLUMN "deleted_at"`);
|
|
13
|
+
await queryRunner.query(`ALTER TABLE "payment"."organisation_payment_provider" DROP COLUMN "updated_at"`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -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
|
+
}
|