@felloh-org/lambda-wrapper 1.11.24 → 1.11.26
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.
- package/dist/entity/payment/index.js +5 -1
- package/dist/entity/payment/refund/index.js +155 -0
- package/dist/entity/payment/refund-status/index.js +39 -0
- package/dist/entity/payment/transaction/index.js +41 -30
- package/dist/entity/user/role/index.js +22 -4
- package/dist/index.js +16 -0
- package/dist/migration/1695209857606-refund.js +23 -0
- package/dist/migration/user/1695127749722-dependent_feature.js +13 -0
- package/dist/service/authentication.js +3 -3
- package/package.json +1 -1
|
@@ -43,8 +43,12 @@ var _paymentLinkType = _interopRequireDefault(require("./payment-link-type"));
|
|
|
43
43
|
|
|
44
44
|
var _tokenisationProvider = _interopRequireDefault(require("./tokenisation-provider"));
|
|
45
45
|
|
|
46
|
+
var _refund = _interopRequireDefault(require("./refund"));
|
|
47
|
+
|
|
48
|
+
var _refundStatus = _interopRequireDefault(require("./refund-status"));
|
|
49
|
+
|
|
46
50
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
47
51
|
|
|
48
|
-
const ENTITIES = [_chargeback.default, _customer.default, _organisationPaymentProvider.default, _organisationPaymentProviderMethod.default, _paymentLink.default,
|
|
52
|
+
const ENTITIES = [_chargeback.default, _creditNote.default, _customer.default, _ecommerce.default, _organisationPaymentProvider.default, _organisationPaymentProviderMethod.default, _paymentLink.default, _paymentLinkType.default, _paymentProvider.default, _refund.default, _refundStatus.default, _tokenisationProvider.default, _transaction.default, _transactionEvent.default, _transactionEventType.default, _transactionMethod.default, _transactionStatus.default, _transactionSource.default, _transactionType.default, _transactionMetadata.default, _transactionReason.default];
|
|
49
53
|
var _default = ENTITIES;
|
|
50
54
|
exports.default = _default;
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _typeorm = require("typeorm");
|
|
9
|
+
|
|
10
|
+
var _transaction = _interopRequireDefault(require("../transaction"));
|
|
11
|
+
|
|
12
|
+
var _refundStatus = _interopRequireDefault(require("../refund-status"));
|
|
13
|
+
|
|
14
|
+
var _user = _interopRequireDefault(require("../../user/user"));
|
|
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;
|
|
17
|
+
|
|
18
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
|
+
|
|
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 }); }
|
|
21
|
+
|
|
22
|
+
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
23
|
+
|
|
24
|
+
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }
|
|
25
|
+
|
|
26
|
+
let Refund = (_dec = (0, _typeorm.Entity)({
|
|
27
|
+
name: 'refund',
|
|
28
|
+
schema: 'payment'
|
|
29
|
+
}), _dec2 = (0, _typeorm.ManyToOne)(() => _transaction.default, {
|
|
30
|
+
primary: true
|
|
31
|
+
}), _dec3 = (0, _typeorm.JoinColumn)({
|
|
32
|
+
name: 'transaction_id',
|
|
33
|
+
referencedColumnName: 'id'
|
|
34
|
+
}), _dec4 = (0, _typeorm.ManyToOne)(() => _refundStatus.default), _dec5 = (0, _typeorm.JoinColumn)({
|
|
35
|
+
name: 'status_id',
|
|
36
|
+
referencedColumnName: 'id'
|
|
37
|
+
}), _dec6 = (0, _typeorm.Column)({
|
|
38
|
+
type: "int"
|
|
39
|
+
}), _dec7 = (0, _typeorm.ManyToOne)(() => _user.default), _dec8 = (0, _typeorm.JoinColumn)({
|
|
40
|
+
name: 'requesting_user_id',
|
|
41
|
+
referencedColumnName: 'id'
|
|
42
|
+
}), _dec9 = (0, _typeorm.ManyToOne)(() => _user.default, {
|
|
43
|
+
nullable: true
|
|
44
|
+
}), _dec10 = (0, _typeorm.JoinColumn)({
|
|
45
|
+
name: 'authorised_user_id',
|
|
46
|
+
referencedColumnName: 'id'
|
|
47
|
+
}), _dec11 = (0, _typeorm.Column)({
|
|
48
|
+
type: "varchar",
|
|
49
|
+
length: "36",
|
|
50
|
+
nullable: true
|
|
51
|
+
}), _dec12 = (0, _typeorm.Column)({
|
|
52
|
+
type: "timestamp with time zone",
|
|
53
|
+
nullable: true
|
|
54
|
+
}), _dec13 = (0, _typeorm.Column)({
|
|
55
|
+
type: "timestamp with time zone",
|
|
56
|
+
nullable: true
|
|
57
|
+
}), _dec14 = (0, _typeorm.CreateDateColumn)({
|
|
58
|
+
type: 'timestamp with time zone'
|
|
59
|
+
}), _dec15 = (0, _typeorm.UpdateDateColumn)({
|
|
60
|
+
type: 'timestamp with time zone'
|
|
61
|
+
}), _dec16 = (0, _typeorm.DeleteDateColumn)({
|
|
62
|
+
type: 'timestamp with time zone',
|
|
63
|
+
nullable: true
|
|
64
|
+
}), _dec(_class = (_class2 = class Refund {
|
|
65
|
+
constructor() {
|
|
66
|
+
_initializerDefineProperty(this, "transaction", _descriptor, this);
|
|
67
|
+
|
|
68
|
+
_initializerDefineProperty(this, "status", _descriptor2, this);
|
|
69
|
+
|
|
70
|
+
_initializerDefineProperty(this, "amount", _descriptor3, this);
|
|
71
|
+
|
|
72
|
+
_initializerDefineProperty(this, "requesting_user", _descriptor4, this);
|
|
73
|
+
|
|
74
|
+
_initializerDefineProperty(this, "authorised_user", _descriptor5, this);
|
|
75
|
+
|
|
76
|
+
_initializerDefineProperty(this, "authorisation_code", _descriptor6, this);
|
|
77
|
+
|
|
78
|
+
_initializerDefineProperty(this, "authorised_at", _descriptor7, this);
|
|
79
|
+
|
|
80
|
+
_initializerDefineProperty(this, "completed_at", _descriptor8, this);
|
|
81
|
+
|
|
82
|
+
_initializerDefineProperty(this, "created_at", _descriptor9, this);
|
|
83
|
+
|
|
84
|
+
_initializerDefineProperty(this, "updated_at", _descriptor10, this);
|
|
85
|
+
|
|
86
|
+
_initializerDefineProperty(this, "deleted_at", _descriptor11, this);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
}, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "transaction", [_dec2, _dec3], {
|
|
90
|
+
configurable: true,
|
|
91
|
+
enumerable: true,
|
|
92
|
+
writable: true,
|
|
93
|
+
initializer: function () {
|
|
94
|
+
return _transaction.default;
|
|
95
|
+
}
|
|
96
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "status", [_dec4, _dec5], {
|
|
97
|
+
configurable: true,
|
|
98
|
+
enumerable: true,
|
|
99
|
+
writable: true,
|
|
100
|
+
initializer: function () {
|
|
101
|
+
return _refundStatus.default;
|
|
102
|
+
}
|
|
103
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "amount", [_dec6], {
|
|
104
|
+
configurable: true,
|
|
105
|
+
enumerable: true,
|
|
106
|
+
writable: true,
|
|
107
|
+
initializer: null
|
|
108
|
+
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "requesting_user", [_dec7, _dec8], {
|
|
109
|
+
configurable: true,
|
|
110
|
+
enumerable: true,
|
|
111
|
+
writable: true,
|
|
112
|
+
initializer: function () {
|
|
113
|
+
return _user.default;
|
|
114
|
+
}
|
|
115
|
+
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "authorised_user", [_dec9, _dec10], {
|
|
116
|
+
configurable: true,
|
|
117
|
+
enumerable: true,
|
|
118
|
+
writable: true,
|
|
119
|
+
initializer: function () {
|
|
120
|
+
return _user.default;
|
|
121
|
+
}
|
|
122
|
+
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "authorisation_code", [_dec11], {
|
|
123
|
+
configurable: true,
|
|
124
|
+
enumerable: true,
|
|
125
|
+
writable: true,
|
|
126
|
+
initializer: function () {
|
|
127
|
+
return "";
|
|
128
|
+
}
|
|
129
|
+
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "authorised_at", [_dec12], {
|
|
130
|
+
configurable: true,
|
|
131
|
+
enumerable: true,
|
|
132
|
+
writable: true,
|
|
133
|
+
initializer: null
|
|
134
|
+
}), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "completed_at", [_dec13], {
|
|
135
|
+
configurable: true,
|
|
136
|
+
enumerable: true,
|
|
137
|
+
writable: true,
|
|
138
|
+
initializer: null
|
|
139
|
+
}), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec14], {
|
|
140
|
+
configurable: true,
|
|
141
|
+
enumerable: true,
|
|
142
|
+
writable: true,
|
|
143
|
+
initializer: null
|
|
144
|
+
}), _descriptor10 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec15], {
|
|
145
|
+
configurable: true,
|
|
146
|
+
enumerable: true,
|
|
147
|
+
writable: true,
|
|
148
|
+
initializer: null
|
|
149
|
+
}), _descriptor11 = _applyDecoratedDescriptor(_class2.prototype, "deleted_at", [_dec16], {
|
|
150
|
+
configurable: true,
|
|
151
|
+
enumerable: true,
|
|
152
|
+
writable: true,
|
|
153
|
+
initializer: null
|
|
154
|
+
})), _class2)) || _class);
|
|
155
|
+
exports.default = Refund;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
|
|
8
|
+
var _typeorm = require("typeorm");
|
|
9
|
+
|
|
10
|
+
var _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2;
|
|
11
|
+
|
|
12
|
+
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 }); }
|
|
13
|
+
|
|
14
|
+
function _applyDecoratedDescriptor(target, property, decorators, descriptor, context) { var desc = {}; Object.keys(descriptor).forEach(function (key) { desc[key] = descriptor[key]; }); desc.enumerable = !!desc.enumerable; desc.configurable = !!desc.configurable; if ('value' in desc || desc.initializer) { desc.writable = true; } desc = decorators.slice().reverse().reduce(function (desc, decorator) { return decorator(target, property, desc) || desc; }, desc); if (context && desc.initializer !== void 0) { desc.value = desc.initializer ? desc.initializer.call(context) : void 0; desc.initializer = undefined; } if (desc.initializer === void 0) { Object.defineProperty(target, property, desc); desc = null; } return desc; }
|
|
15
|
+
|
|
16
|
+
function _initializerWarningHelper(descriptor, context) { throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.'); }
|
|
17
|
+
|
|
18
|
+
let RefundStatus = (_dec = (0, _typeorm.Entity)({
|
|
19
|
+
name: 'refund_status',
|
|
20
|
+
schema: 'payment'
|
|
21
|
+
}), _dec2 = (0, _typeorm.PrimaryColumn)("varchar"), _dec3 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class RefundStatus {
|
|
22
|
+
constructor() {
|
|
23
|
+
_initializerDefineProperty(this, "id", _descriptor, this);
|
|
24
|
+
|
|
25
|
+
_initializerDefineProperty(this, "created_at", _descriptor2, this);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
}, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
|
|
29
|
+
configurable: true,
|
|
30
|
+
enumerable: true,
|
|
31
|
+
writable: true,
|
|
32
|
+
initializer: null
|
|
33
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec3], {
|
|
34
|
+
configurable: true,
|
|
35
|
+
enumerable: true,
|
|
36
|
+
writable: true,
|
|
37
|
+
initializer: null
|
|
38
|
+
})), _class2)) || _class);
|
|
39
|
+
exports.default = RefundStatus;
|
|
@@ -37,7 +37,9 @@ var _transactionSettlement = _interopRequireDefault(require("../../acquirer/tran
|
|
|
37
37
|
|
|
38
38
|
var _tokenisationProvider = _interopRequireDefault(require("../tokenisation-provider"));
|
|
39
39
|
|
|
40
|
-
var
|
|
40
|
+
var _refund = _interopRequireDefault(require("../refund"));
|
|
41
|
+
|
|
42
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _dec12, _dec13, _dec14, _dec15, _dec16, _dec17, _dec18, _dec19, _dec20, _dec21, _dec22, _dec23, _dec24, _dec25, _dec26, _dec27, _dec28, _dec29, _dec30, _dec31, _dec32, _dec33, _dec34, _dec35, _dec36, _dec37, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor10, _descriptor11, _descriptor12, _descriptor13, _descriptor14, _descriptor15, _descriptor16, _descriptor17, _descriptor18, _descriptor19, _descriptor20, _descriptor21, _descriptor22, _descriptor23, _descriptor24, _descriptor25;
|
|
41
43
|
|
|
42
44
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
43
45
|
|
|
@@ -97,31 +99,33 @@ let Transaction = (_dec = (0, _typeorm.Entity)({
|
|
|
97
99
|
}), _dec26 = (0, _typeorm.JoinColumn)({
|
|
98
100
|
name: 'tokenisation_provider_id',
|
|
99
101
|
referencedColumnName: 'id'
|
|
100
|
-
}), _dec27 = (0, _typeorm.
|
|
102
|
+
}), _dec27 = (0, _typeorm.OneToOne)(() => _refund.default, refund => refund.transaction, {
|
|
103
|
+
nullable: true
|
|
104
|
+
}), _dec28 = (0, _typeorm.Column)({
|
|
101
105
|
type: "varchar",
|
|
102
106
|
length: "250",
|
|
103
107
|
nullable: true
|
|
104
|
-
}),
|
|
108
|
+
}), _dec29 = (0, _typeorm.Column)({
|
|
105
109
|
type: "varchar",
|
|
106
110
|
length: "3",
|
|
107
111
|
default: _currency.DEFAULT_CURRENCY
|
|
108
|
-
}),
|
|
112
|
+
}), _dec30 = (0, _typeorm.Column)({
|
|
109
113
|
type: "json",
|
|
110
114
|
nullable: true
|
|
111
|
-
}),
|
|
115
|
+
}), _dec31 = (0, _typeorm.Column)({
|
|
112
116
|
type: "timestamp with time zone",
|
|
113
117
|
nullable: true
|
|
114
|
-
}),
|
|
118
|
+
}), _dec32 = (0, _typeorm.Column)({
|
|
115
119
|
type: "text",
|
|
116
120
|
nullable: true
|
|
117
|
-
}),
|
|
121
|
+
}), _dec33 = (0, _typeorm.CreateDateColumn)({
|
|
118
122
|
type: 'timestamp with time zone'
|
|
119
|
-
}),
|
|
123
|
+
}), _dec34 = (0, _typeorm.UpdateDateColumn)({
|
|
120
124
|
type: 'timestamp with time zone'
|
|
121
|
-
}),
|
|
125
|
+
}), _dec35 = (0, _typeorm.OneToMany)(() => _transactionBatch.default, transactionBatch => transactionBatch.transaction), _dec36 = (0, _typeorm.Column)({
|
|
122
126
|
type: "timestamp with time zone",
|
|
123
127
|
nullable: true
|
|
124
|
-
}),
|
|
128
|
+
}), _dec37 = (0, _typeorm.OneToOne)(() => _transactionSettlement.default, transactionSettlement => transactionSettlement.transaction), _dec(_class = (_class2 = class Transaction {
|
|
125
129
|
constructor() {
|
|
126
130
|
_initializerDefineProperty(this, "id", _descriptor, this);
|
|
127
131
|
|
|
@@ -151,25 +155,27 @@ let Transaction = (_dec = (0, _typeorm.Entity)({
|
|
|
151
155
|
|
|
152
156
|
_initializerDefineProperty(this, "tokenisation_provider", _descriptor14, this);
|
|
153
157
|
|
|
154
|
-
_initializerDefineProperty(this, "
|
|
158
|
+
_initializerDefineProperty(this, "refund", _descriptor15, this);
|
|
155
159
|
|
|
156
|
-
_initializerDefineProperty(this, "
|
|
160
|
+
_initializerDefineProperty(this, "provider_reference", _descriptor16, this);
|
|
157
161
|
|
|
158
|
-
_initializerDefineProperty(this, "
|
|
162
|
+
_initializerDefineProperty(this, "currency", _descriptor17, this);
|
|
159
163
|
|
|
160
|
-
_initializerDefineProperty(this, "
|
|
164
|
+
_initializerDefineProperty(this, "provider_metadata", _descriptor18, this);
|
|
161
165
|
|
|
162
|
-
_initializerDefineProperty(this, "
|
|
166
|
+
_initializerDefineProperty(this, "completed_at", _descriptor19, this);
|
|
163
167
|
|
|
164
|
-
_initializerDefineProperty(this, "
|
|
168
|
+
_initializerDefineProperty(this, "message", _descriptor20, this);
|
|
165
169
|
|
|
166
|
-
_initializerDefineProperty(this, "
|
|
170
|
+
_initializerDefineProperty(this, "created_at", _descriptor21, this);
|
|
167
171
|
|
|
168
|
-
_initializerDefineProperty(this, "
|
|
172
|
+
_initializerDefineProperty(this, "updated_at", _descriptor22, this);
|
|
169
173
|
|
|
170
|
-
_initializerDefineProperty(this, "
|
|
174
|
+
_initializerDefineProperty(this, "batch", _descriptor23, this);
|
|
171
175
|
|
|
172
|
-
_initializerDefineProperty(this, "
|
|
176
|
+
_initializerDefineProperty(this, "assigned_at", _descriptor24, this);
|
|
177
|
+
|
|
178
|
+
_initializerDefineProperty(this, "settlement", _descriptor25, this);
|
|
173
179
|
}
|
|
174
180
|
|
|
175
181
|
getPublicData() {
|
|
@@ -374,56 +380,61 @@ let Transaction = (_dec = (0, _typeorm.Entity)({
|
|
|
374
380
|
initializer: function () {
|
|
375
381
|
return _tokenisationProvider.default;
|
|
376
382
|
}
|
|
377
|
-
}), _descriptor15 = _applyDecoratedDescriptor(_class2.prototype, "
|
|
383
|
+
}), _descriptor15 = _applyDecoratedDescriptor(_class2.prototype, "refund", [_dec27], {
|
|
384
|
+
configurable: true,
|
|
385
|
+
enumerable: true,
|
|
386
|
+
writable: true,
|
|
387
|
+
initializer: null
|
|
388
|
+
}), _descriptor16 = _applyDecoratedDescriptor(_class2.prototype, "provider_reference", [_dec28], {
|
|
378
389
|
configurable: true,
|
|
379
390
|
enumerable: true,
|
|
380
391
|
writable: true,
|
|
381
392
|
initializer: function () {
|
|
382
393
|
return "";
|
|
383
394
|
}
|
|
384
|
-
}),
|
|
395
|
+
}), _descriptor17 = _applyDecoratedDescriptor(_class2.prototype, "currency", [_dec29], {
|
|
385
396
|
configurable: true,
|
|
386
397
|
enumerable: true,
|
|
387
398
|
writable: true,
|
|
388
399
|
initializer: function () {
|
|
389
400
|
return _currency.DEFAULT_CURRENCY;
|
|
390
401
|
}
|
|
391
|
-
}),
|
|
402
|
+
}), _descriptor18 = _applyDecoratedDescriptor(_class2.prototype, "provider_metadata", [_dec30], {
|
|
392
403
|
configurable: true,
|
|
393
404
|
enumerable: true,
|
|
394
405
|
writable: true,
|
|
395
406
|
initializer: null
|
|
396
|
-
}),
|
|
407
|
+
}), _descriptor19 = _applyDecoratedDescriptor(_class2.prototype, "completed_at", [_dec31], {
|
|
397
408
|
configurable: true,
|
|
398
409
|
enumerable: true,
|
|
399
410
|
writable: true,
|
|
400
411
|
initializer: null
|
|
401
|
-
}),
|
|
412
|
+
}), _descriptor20 = _applyDecoratedDescriptor(_class2.prototype, "message", [_dec32], {
|
|
402
413
|
configurable: true,
|
|
403
414
|
enumerable: true,
|
|
404
415
|
writable: true,
|
|
405
416
|
initializer: null
|
|
406
|
-
}),
|
|
417
|
+
}), _descriptor21 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec33], {
|
|
407
418
|
configurable: true,
|
|
408
419
|
enumerable: true,
|
|
409
420
|
writable: true,
|
|
410
421
|
initializer: null
|
|
411
|
-
}),
|
|
422
|
+
}), _descriptor22 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec34], {
|
|
412
423
|
configurable: true,
|
|
413
424
|
enumerable: true,
|
|
414
425
|
writable: true,
|
|
415
426
|
initializer: null
|
|
416
|
-
}),
|
|
427
|
+
}), _descriptor23 = _applyDecoratedDescriptor(_class2.prototype, "batch", [_dec35], {
|
|
417
428
|
configurable: true,
|
|
418
429
|
enumerable: true,
|
|
419
430
|
writable: true,
|
|
420
431
|
initializer: null
|
|
421
|
-
}),
|
|
432
|
+
}), _descriptor24 = _applyDecoratedDescriptor(_class2.prototype, "assigned_at", [_dec36], {
|
|
422
433
|
configurable: true,
|
|
423
434
|
enumerable: true,
|
|
424
435
|
writable: true,
|
|
425
436
|
initializer: null
|
|
426
|
-
}),
|
|
437
|
+
}), _descriptor25 = _applyDecoratedDescriptor(_class2.prototype, "settlement", [_dec37], {
|
|
427
438
|
configurable: true,
|
|
428
439
|
enumerable: true,
|
|
429
440
|
writable: true,
|
|
@@ -7,7 +7,11 @@ exports.default = void 0;
|
|
|
7
7
|
|
|
8
8
|
var _typeorm = require("typeorm");
|
|
9
9
|
|
|
10
|
-
var
|
|
10
|
+
var _feature = _interopRequireDefault(require("../feature"));
|
|
11
|
+
|
|
12
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9;
|
|
13
|
+
|
|
14
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
15
|
|
|
12
16
|
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 }); }
|
|
13
17
|
|
|
@@ -36,7 +40,12 @@ let Role = (_dec = (0, _typeorm.Entity)({
|
|
|
36
40
|
}), _dec8 = (0, _typeorm.Column)({
|
|
37
41
|
type: "varchar",
|
|
38
42
|
length: "100"
|
|
39
|
-
}), _dec9 = (0, _typeorm.
|
|
43
|
+
}), _dec9 = (0, _typeorm.ManyToOne)(() => _feature.default, {
|
|
44
|
+
nullable: true
|
|
45
|
+
}), _dec10 = (0, _typeorm.JoinColumn)({
|
|
46
|
+
name: 'dependent_feature_id',
|
|
47
|
+
referencedColumnName: 'id'
|
|
48
|
+
}), _dec11 = (0, _typeorm.CreateDateColumn)(), _dec(_class = (_class2 = class Role {
|
|
40
49
|
constructor() {
|
|
41
50
|
_initializerDefineProperty(this, "id", _descriptor, this);
|
|
42
51
|
|
|
@@ -52,7 +61,9 @@ let Role = (_dec = (0, _typeorm.Entity)({
|
|
|
52
61
|
|
|
53
62
|
_initializerDefineProperty(this, "group", _descriptor7, this);
|
|
54
63
|
|
|
55
|
-
_initializerDefineProperty(this, "
|
|
64
|
+
_initializerDefineProperty(this, "feature", _descriptor8, this);
|
|
65
|
+
|
|
66
|
+
_initializerDefineProperty(this, "created_at", _descriptor9, this);
|
|
56
67
|
}
|
|
57
68
|
|
|
58
69
|
}, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
|
|
@@ -98,7 +109,14 @@ let Role = (_dec = (0, _typeorm.Entity)({
|
|
|
98
109
|
initializer: function () {
|
|
99
110
|
return "";
|
|
100
111
|
}
|
|
101
|
-
}), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "
|
|
112
|
+
}), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "feature", [_dec9, _dec10], {
|
|
113
|
+
configurable: true,
|
|
114
|
+
enumerable: true,
|
|
115
|
+
writable: true,
|
|
116
|
+
initializer: function () {
|
|
117
|
+
return _feature.default;
|
|
118
|
+
}
|
|
119
|
+
}), _descriptor9 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec11], {
|
|
102
120
|
configurable: true,
|
|
103
121
|
enumerable: true,
|
|
104
122
|
writable: true,
|
package/dist/index.js
CHANGED
|
@@ -357,6 +357,18 @@ Object.defineProperty(exports, "RESPONSE_HEADERS", {
|
|
|
357
357
|
return _response.RESPONSE_HEADERS;
|
|
358
358
|
}
|
|
359
359
|
});
|
|
360
|
+
Object.defineProperty(exports, "RefundEntity", {
|
|
361
|
+
enumerable: true,
|
|
362
|
+
get: function () {
|
|
363
|
+
return _refund.default;
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
Object.defineProperty(exports, "RefundStatusEntity", {
|
|
367
|
+
enumerable: true,
|
|
368
|
+
get: function () {
|
|
369
|
+
return _refundStatus.default;
|
|
370
|
+
}
|
|
371
|
+
});
|
|
360
372
|
Object.defineProperty(exports, "RequestService", {
|
|
361
373
|
enumerable: true,
|
|
362
374
|
get: function () {
|
|
@@ -752,6 +764,10 @@ var _creditNote = _interopRequireDefault(require("./entity/payment/credit-note")
|
|
|
752
764
|
|
|
753
765
|
var _ecommerce = _interopRequireDefault(require("./entity/payment/ecommerce"));
|
|
754
766
|
|
|
767
|
+
var _refund = _interopRequireDefault(require("./entity/payment/refund"));
|
|
768
|
+
|
|
769
|
+
var _refundStatus = _interopRequireDefault(require("./entity/payment/refund-status"));
|
|
770
|
+
|
|
755
771
|
var _country = _interopRequireDefault(require("./entity/reference/country"));
|
|
756
772
|
|
|
757
773
|
var _transaction3 = _interopRequireDefault(require("./entity/total-processing/transaction"));
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
const { MigrationInterface, QueryRunner } = require("typeorm");
|
|
2
|
+
|
|
3
|
+
module.exports = class refund1695209857606 {
|
|
4
|
+
name = 'refund1695209857606'
|
|
5
|
+
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`CREATE TABLE "payment"."refund_status" ("id" character varying NOT NULL, "created_at" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "PK_fa085d7386785ed92417426bfc8" PRIMARY KEY ("id"))`);
|
|
8
|
+
await queryRunner.query(`CREATE TABLE "payment"."refund" ("amount" integer NOT NULL, "authorisation_code" character varying(36), "authorised_at" TIMESTAMP WITH TIME ZONE, "completed_at" TIMESTAMP WITH TIME ZONE, "created_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "updated_at" TIMESTAMP WITH TIME ZONE NOT NULL DEFAULT now(), "deleted_at" TIMESTAMP WITH TIME ZONE, "transaction_id" character varying NOT NULL, "status_id" character varying, "requesting_user_id" character varying, "authorised_user_id" character varying, CONSTRAINT "PK_74ffc5427c595968dd777f71bf4" PRIMARY KEY ("transaction_id"))`);
|
|
9
|
+
await queryRunner.query(`ALTER TABLE "payment"."refund" ADD CONSTRAINT "FK_74ffc5427c595968dd777f71bf4" FOREIGN KEY ("transaction_id") REFERENCES "payment"."transaction"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
10
|
+
await queryRunner.query(`ALTER TABLE "payment"."refund" ADD CONSTRAINT "FK_fa085d7386785ed92417426bfc8" FOREIGN KEY ("status_id") REFERENCES "payment"."refund_status"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
11
|
+
await queryRunner.query(`ALTER TABLE "payment"."refund" ADD CONSTRAINT "FK_96b5fcba1efb36ddf31b0517988" FOREIGN KEY ("requesting_user_id") REFERENCES "user"."user"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
12
|
+
await queryRunner.query(`ALTER TABLE "payment"."refund" ADD CONSTRAINT "FK_2c6b00b6c257eba8227005fadfb" FOREIGN KEY ("authorised_user_id") REFERENCES "user"."user"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async down(queryRunner) {
|
|
16
|
+
await queryRunner.query(`ALTER TABLE "payment"."refund" DROP CONSTRAINT "FK_2c6b00b6c257eba8227005fadfb"`);
|
|
17
|
+
await queryRunner.query(`ALTER TABLE "payment"."refund" DROP CONSTRAINT "FK_96b5fcba1efb36ddf31b0517988"`);
|
|
18
|
+
await queryRunner.query(`ALTER TABLE "payment"."refund" DROP CONSTRAINT "FK_fa085d7386785ed92417426bfc8"`);
|
|
19
|
+
await queryRunner.query(`ALTER TABLE "payment"."refund" DROP CONSTRAINT "FK_74ffc5427c595968dd777f71bf4"`);
|
|
20
|
+
await queryRunner.query(`DROP TABLE "payment"."refund"`);
|
|
21
|
+
await queryRunner.query(`DROP TABLE "payment"."refund_status"`);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const { MigrationInterface, QueryRunner } = require("typeorm");
|
|
2
|
+
|
|
3
|
+
module.exports = class dependentFeature1695127749722 {
|
|
4
|
+
name = 'dependentFeature1695127749722'
|
|
5
|
+
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE "user"."role" ADD "dependent_feature_id" uuid`);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
async down(queryRunner) {
|
|
11
|
+
await queryRunner.query(`ALTER TABLE "user"."role" DROP COLUMN "dependent_feature_id"`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -132,16 +132,16 @@ class AuthenticationService extends _dependencyAware.default {
|
|
|
132
132
|
// Fetch the users assigned roles
|
|
133
133
|
const userRoles = await this.fetchUserRoles(this.user.id); // Loop through the roles and determine match count
|
|
134
134
|
|
|
135
|
-
|
|
135
|
+
const rolesMatching = {};
|
|
136
136
|
|
|
137
137
|
for (const userRole of userRoles) {
|
|
138
138
|
if (roles.indexOf(userRole) !== -1) {
|
|
139
|
-
|
|
139
|
+
rolesMatching[userRole] = 1;
|
|
140
140
|
}
|
|
141
141
|
} // Throw an error if the user does not have all the roles
|
|
142
142
|
|
|
143
143
|
|
|
144
|
-
if (
|
|
144
|
+
if (Object.keys(rolesMatching).length !== roles.length) {
|
|
145
145
|
const notFoundResponse = new _response.default(null, 401);
|
|
146
146
|
notFoundResponse.addError({
|
|
147
147
|
title: 'Unauthorized',
|