@felloh-org/lambda-wrapper 1.1.8 → 1.1.11
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/bank/beneficiary/index.js +126 -0
- package/dist/entity/bank/index.js +3 -1
- package/dist/entity/bank/transaction-batch/index.js +25 -22
- package/dist/index.js +10 -2
- package/dist/migration/1651671204869-beneficiary.js +17 -0
- package/dist/migration/bank/1651659772400-batches_id_chage.js +25 -0
- package/dist/migration/bank/1651660836295-batches_completed_at.js +13 -0
- package/package.json +1 -1
|
@@ -0,0 +1,126 @@
|
|
|
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 _organisation = _interopRequireDefault(require("../../user/organisation"));
|
|
11
|
+
|
|
12
|
+
var _account = _interopRequireDefault(require("../account"));
|
|
13
|
+
|
|
14
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8;
|
|
15
|
+
|
|
16
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
17
|
+
|
|
18
|
+
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 }); }
|
|
19
|
+
|
|
20
|
+
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; }
|
|
21
|
+
|
|
22
|
+
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.'); }
|
|
23
|
+
|
|
24
|
+
let Beneficiary = (_dec = (0, _typeorm.Entity)({
|
|
25
|
+
name: 'beneficiary',
|
|
26
|
+
schema: 'bank'
|
|
27
|
+
}), _dec2 = (0, _typeorm.PrimaryColumn)("varchar", {
|
|
28
|
+
unique: true
|
|
29
|
+
}), _dec3 = (0, _typeorm.ManyToOne)(() => _organisation.default), _dec4 = (0, _typeorm.JoinColumn)({
|
|
30
|
+
name: 'organisation_id',
|
|
31
|
+
referencedColumnName: 'id'
|
|
32
|
+
}), _dec5 = (0, _typeorm.ManyToOne)(() => _account.default), _dec6 = (0, _typeorm.JoinColumn)({
|
|
33
|
+
name: 'iban',
|
|
34
|
+
referencedColumnName: 'iban'
|
|
35
|
+
}), _dec7 = (0, _typeorm.Column)({
|
|
36
|
+
type: "varchar",
|
|
37
|
+
length: "50"
|
|
38
|
+
}), _dec8 = (0, _typeorm.CreateDateColumn)({
|
|
39
|
+
type: 'timestamp with time zone'
|
|
40
|
+
}), _dec9 = (0, _typeorm.UpdateDateColumn)({
|
|
41
|
+
type: 'timestamp with time zone'
|
|
42
|
+
}), _dec10 = (0, _typeorm.DeleteDateColumn)({
|
|
43
|
+
type: 'timestamp with time zone'
|
|
44
|
+
}), _dec11 = (0, _typeorm.Column)({
|
|
45
|
+
type: "boolean",
|
|
46
|
+
default: false
|
|
47
|
+
}), _dec(_class = (_class2 = class Beneficiary {
|
|
48
|
+
constructor() {
|
|
49
|
+
_initializerDefineProperty(this, "id", _descriptor, this);
|
|
50
|
+
|
|
51
|
+
_initializerDefineProperty(this, "organisation", _descriptor2, this);
|
|
52
|
+
|
|
53
|
+
_initializerDefineProperty(this, "iban", _descriptor3, this);
|
|
54
|
+
|
|
55
|
+
_initializerDefineProperty(this, "provider_reference", _descriptor4, this);
|
|
56
|
+
|
|
57
|
+
_initializerDefineProperty(this, "created_at", _descriptor5, this);
|
|
58
|
+
|
|
59
|
+
_initializerDefineProperty(this, "updated_at", _descriptor6, this);
|
|
60
|
+
|
|
61
|
+
_initializerDefineProperty(this, "deleted_at", _descriptor7, this);
|
|
62
|
+
|
|
63
|
+
_initializerDefineProperty(this, "is_active", _descriptor8, this);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
getPublicData() {
|
|
67
|
+
return {
|
|
68
|
+
id: this.id,
|
|
69
|
+
iban: this.iban,
|
|
70
|
+
organisation: this.organisation,
|
|
71
|
+
provider_reference: this.provider_reference,
|
|
72
|
+
created_at: this.created_at,
|
|
73
|
+
is_active: this.is_active
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
}, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "id", [_dec2], {
|
|
78
|
+
configurable: true,
|
|
79
|
+
enumerable: true,
|
|
80
|
+
writable: true,
|
|
81
|
+
initializer: function () {
|
|
82
|
+
return undefined;
|
|
83
|
+
}
|
|
84
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "organisation", [_dec3, _dec4], {
|
|
85
|
+
configurable: true,
|
|
86
|
+
enumerable: true,
|
|
87
|
+
writable: true,
|
|
88
|
+
initializer: function () {
|
|
89
|
+
return _organisation.default;
|
|
90
|
+
}
|
|
91
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "iban", [_dec5, _dec6], {
|
|
92
|
+
configurable: true,
|
|
93
|
+
enumerable: true,
|
|
94
|
+
writable: true,
|
|
95
|
+
initializer: function () {
|
|
96
|
+
return _account.default;
|
|
97
|
+
}
|
|
98
|
+
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "provider_reference", [_dec7], {
|
|
99
|
+
configurable: true,
|
|
100
|
+
enumerable: true,
|
|
101
|
+
writable: true,
|
|
102
|
+
initializer: null
|
|
103
|
+
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec8], {
|
|
104
|
+
configurable: true,
|
|
105
|
+
enumerable: true,
|
|
106
|
+
writable: true,
|
|
107
|
+
initializer: null
|
|
108
|
+
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec9], {
|
|
109
|
+
configurable: true,
|
|
110
|
+
enumerable: true,
|
|
111
|
+
writable: true,
|
|
112
|
+
initializer: null
|
|
113
|
+
}), _descriptor7 = _applyDecoratedDescriptor(_class2.prototype, "deleted_at", [_dec10], {
|
|
114
|
+
configurable: true,
|
|
115
|
+
enumerable: true,
|
|
116
|
+
writable: true,
|
|
117
|
+
initializer: null
|
|
118
|
+
}), _descriptor8 = _applyDecoratedDescriptor(_class2.prototype, "is_active", [_dec11], {
|
|
119
|
+
configurable: true,
|
|
120
|
+
enumerable: true,
|
|
121
|
+
writable: true,
|
|
122
|
+
initializer: function () {
|
|
123
|
+
return false;
|
|
124
|
+
}
|
|
125
|
+
})), _class2)) || _class);
|
|
126
|
+
exports.default = Beneficiary;
|
|
@@ -15,8 +15,10 @@ var _settledTransaction = _interopRequireDefault(require("./settled-transaction"
|
|
|
15
15
|
|
|
16
16
|
var _transactionBatch = _interopRequireDefault(require("./transaction-batch"));
|
|
17
17
|
|
|
18
|
+
var _beneficiary = _interopRequireDefault(require("./beneficiary"));
|
|
19
|
+
|
|
18
20
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
21
|
|
|
20
|
-
const ENTITIES = [_account.default, _disbursal.default, _ledger.default, _settledTransaction.default, _transactionBatch.default];
|
|
22
|
+
const ENTITIES = [_account.default, _disbursal.default, _ledger.default, _settledTransaction.default, _transactionBatch.default, _beneficiary.default];
|
|
21
23
|
var _default = ENTITIES;
|
|
22
24
|
exports.default = _default;
|
|
@@ -24,65 +24,68 @@ function _initializerWarningHelper(descriptor, context) { throw new Error('Decor
|
|
|
24
24
|
let TransactionBatch = (_dec = (0, _typeorm.Entity)({
|
|
25
25
|
name: 'transaction_batch',
|
|
26
26
|
schema: 'bank'
|
|
27
|
-
}), _dec2 = (0, _typeorm.
|
|
27
|
+
}), _dec2 = (0, _typeorm.ManyToOne)(() => _transaction.default, {
|
|
28
|
+
primary: true
|
|
29
|
+
}), _dec3 = (0, _typeorm.JoinColumn)({
|
|
28
30
|
name: 'transaction_id',
|
|
29
31
|
referencedColumnName: 'id'
|
|
30
|
-
}),
|
|
32
|
+
}), _dec4 = (0, _typeorm.ManyToOne)(() => _disbursal.default), _dec5 = (0, _typeorm.JoinColumn)({
|
|
31
33
|
name: 'disbursal_id',
|
|
32
34
|
referencedColumnName: 'id'
|
|
33
|
-
}),
|
|
35
|
+
}), _dec6 = (0, _typeorm.CreateDateColumn)({
|
|
34
36
|
type: 'timestamp with time zone'
|
|
35
|
-
}),
|
|
37
|
+
}), _dec7 = (0, _typeorm.UpdateDateColumn)({
|
|
36
38
|
type: 'timestamp with time zone'
|
|
37
|
-
}),
|
|
39
|
+
}), _dec8 = (0, _typeorm.DeleteDateColumn)({
|
|
38
40
|
type: 'timestamp with time zone'
|
|
41
|
+
}), _dec9 = (0, _typeorm.Column)({
|
|
42
|
+
type: "timestamp with time zone",
|
|
43
|
+
nullable: true
|
|
39
44
|
}), _dec(_class = (_class2 = class TransactionBatch {
|
|
40
45
|
constructor() {
|
|
41
|
-
_initializerDefineProperty(this, "
|
|
46
|
+
_initializerDefineProperty(this, "transaction", _descriptor, this);
|
|
42
47
|
|
|
43
|
-
_initializerDefineProperty(this, "
|
|
48
|
+
_initializerDefineProperty(this, "disbursal", _descriptor2, this);
|
|
44
49
|
|
|
45
|
-
_initializerDefineProperty(this, "
|
|
50
|
+
_initializerDefineProperty(this, "created_at", _descriptor3, this);
|
|
46
51
|
|
|
47
|
-
_initializerDefineProperty(this, "
|
|
52
|
+
_initializerDefineProperty(this, "updated_at", _descriptor4, this);
|
|
48
53
|
|
|
49
|
-
_initializerDefineProperty(this, "
|
|
54
|
+
_initializerDefineProperty(this, "deleted_at", _descriptor5, this);
|
|
50
55
|
|
|
51
|
-
_initializerDefineProperty(this, "
|
|
56
|
+
_initializerDefineProperty(this, "completed_at", _descriptor6, this);
|
|
52
57
|
}
|
|
53
58
|
|
|
54
|
-
}, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "
|
|
59
|
+
}, (_descriptor = _applyDecoratedDescriptor(_class2.prototype, "transaction", [_dec2, _dec3], {
|
|
55
60
|
configurable: true,
|
|
56
61
|
enumerable: true,
|
|
57
62
|
writable: true,
|
|
58
63
|
initializer: function () {
|
|
59
|
-
return
|
|
64
|
+
return _transaction.default;
|
|
60
65
|
}
|
|
61
|
-
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "
|
|
66
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "disbursal", [_dec4, _dec5], {
|
|
62
67
|
configurable: true,
|
|
63
68
|
enumerable: true,
|
|
64
69
|
writable: true,
|
|
65
70
|
initializer: function () {
|
|
66
|
-
return
|
|
71
|
+
return _disbursal.default;
|
|
67
72
|
}
|
|
68
|
-
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "
|
|
73
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec6], {
|
|
69
74
|
configurable: true,
|
|
70
75
|
enumerable: true,
|
|
71
76
|
writable: true,
|
|
72
|
-
initializer:
|
|
73
|
-
|
|
74
|
-
}
|
|
75
|
-
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "created_at", [_dec7], {
|
|
77
|
+
initializer: null
|
|
78
|
+
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "updated_at", [_dec7], {
|
|
76
79
|
configurable: true,
|
|
77
80
|
enumerable: true,
|
|
78
81
|
writable: true,
|
|
79
82
|
initializer: null
|
|
80
|
-
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "
|
|
83
|
+
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "deleted_at", [_dec8], {
|
|
81
84
|
configurable: true,
|
|
82
85
|
enumerable: true,
|
|
83
86
|
writable: true,
|
|
84
87
|
initializer: null
|
|
85
|
-
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "
|
|
88
|
+
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "completed_at", [_dec9], {
|
|
86
89
|
configurable: true,
|
|
87
90
|
enumerable: true,
|
|
88
91
|
writable: true,
|
package/dist/index.js
CHANGED
|
@@ -15,6 +15,12 @@ Object.defineProperty(exports, "AccountEntity", {
|
|
|
15
15
|
return _account.default;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
+
Object.defineProperty(exports, "BenficiaryEntity", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return _beneficiary.default;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
18
24
|
Object.defineProperty(exports, "BookingComponentEntity", {
|
|
19
25
|
enumerable: true,
|
|
20
26
|
get: function () {
|
|
@@ -132,7 +138,7 @@ Object.defineProperty(exports, "NuapayBalanceEntity", {
|
|
|
132
138
|
Object.defineProperty(exports, "NuapayBeneficiaryEntity", {
|
|
133
139
|
enumerable: true,
|
|
134
140
|
get: function () {
|
|
135
|
-
return
|
|
141
|
+
return _beneficiary2.default;
|
|
136
142
|
}
|
|
137
143
|
});
|
|
138
144
|
Object.defineProperty(exports, "NuapayTransactionEntity", {
|
|
@@ -408,11 +414,13 @@ var _settledTransaction = _interopRequireDefault(require("./entity/bank/settled-
|
|
|
408
414
|
|
|
409
415
|
var _transactionBatch = _interopRequireDefault(require("./entity/bank/transaction-batch"));
|
|
410
416
|
|
|
417
|
+
var _beneficiary = _interopRequireDefault(require("./entity/bank/beneficiary"));
|
|
418
|
+
|
|
411
419
|
var _account2 = _interopRequireDefault(require("./entity/nuapay/account"));
|
|
412
420
|
|
|
413
421
|
var _balance = _interopRequireDefault(require("./entity/nuapay/balance"));
|
|
414
422
|
|
|
415
|
-
var
|
|
423
|
+
var _beneficiary2 = _interopRequireDefault(require("./entity/nuapay/beneficiary"));
|
|
416
424
|
|
|
417
425
|
var _transaction = _interopRequireDefault(require("./entity/nuapay/transaction"));
|
|
418
426
|
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const { MigrationInterface, QueryRunner } = require("typeorm");
|
|
2
|
+
|
|
3
|
+
module.exports = class beneficiary1651671204869 {
|
|
4
|
+
name = 'beneficiary1651671204869'
|
|
5
|
+
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`CREATE TABLE "bank"."beneficiary" ("id" character varying NOT NULL, "provider_reference" character varying(50) NOT NULL, "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, "is_active" boolean NOT NULL DEFAULT false, "organisation_id" character varying(150), "iban" character varying(22), CONSTRAINT "PK_c7514d7fed62b8e619cb1840f41" PRIMARY KEY ("id"))`);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE "bank"."beneficiary" ADD CONSTRAINT "FK_ffd5169bc5af13fe1f7886c57c7" FOREIGN KEY ("organisation_id") REFERENCES "user"."organisation"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
9
|
+
await queryRunner.query(`ALTER TABLE "bank"."beneficiary" ADD CONSTRAINT "FK_d63349762c9c1f7859fba127025" FOREIGN KEY ("iban") REFERENCES "bank"."account"("iban") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
async down(queryRunner) {
|
|
13
|
+
await queryRunner.query(`ALTER TABLE "bank"."beneficiary" DROP CONSTRAINT "FK_d63349762c9c1f7859fba127025"`);
|
|
14
|
+
await queryRunner.query(`ALTER TABLE "bank"."beneficiary" DROP CONSTRAINT "FK_ffd5169bc5af13fe1f7886c57c7"`);
|
|
15
|
+
await queryRunner.query(`DROP TABLE "bank"."beneficiary"`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
const { MigrationInterface, QueryRunner } = require("typeorm");
|
|
2
|
+
|
|
3
|
+
module.exports = class batchesIdChage1651659772400 {
|
|
4
|
+
name = 'batchesIdChage1651659772400'
|
|
5
|
+
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE "user"."user_organisation" DROP CONSTRAINT "FK_81c4608739c8cf71fa1f96e11ae"`);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE "user"."user_organisation" DROP CONSTRAINT "FK_d9628e009b6d71bf677c04f8494"`);
|
|
9
|
+
await queryRunner.query(`ALTER TABLE "bank"."transaction_batch" DROP CONSTRAINT "PK_28b5ba6c2707e3c245748be801d"`);
|
|
10
|
+
await queryRunner.query(`ALTER TABLE "bank"."transaction_batch" DROP COLUMN "id"`);
|
|
11
|
+
await queryRunner.query(`ALTER TABLE "bank"."transaction_batch" DROP CONSTRAINT "FK_e37fb3179be38490e78f27319ea"`);
|
|
12
|
+
await queryRunner.query(`ALTER TABLE "bank"."transaction_batch" ALTER COLUMN "transaction_id" SET NOT NULL`);
|
|
13
|
+
await queryRunner.query(`ALTER TABLE "bank"."transaction_batch" ADD CONSTRAINT "PK_e37fb3179be38490e78f27319ea" PRIMARY KEY ("transaction_id")`);
|
|
14
|
+
await queryRunner.query(`ALTER TABLE "bank"."transaction_batch" ADD CONSTRAINT "FK_e37fb3179be38490e78f27319ea" FOREIGN KEY ("transaction_id") REFERENCES "payment"."transaction"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
async down(queryRunner) {
|
|
18
|
+
await queryRunner.query(`ALTER TABLE "bank"."transaction_batch" DROP CONSTRAINT "FK_e37fb3179be38490e78f27319ea"`);
|
|
19
|
+
await queryRunner.query(`ALTER TABLE "bank"."transaction_batch" DROP CONSTRAINT "PK_e37fb3179be38490e78f27319ea"`);
|
|
20
|
+
await queryRunner.query(`ALTER TABLE "bank"."transaction_batch" ALTER COLUMN "transaction_id" DROP NOT NULL`);
|
|
21
|
+
await queryRunner.query(`ALTER TABLE "bank"."transaction_batch" ADD CONSTRAINT "FK_e37fb3179be38490e78f27319ea" FOREIGN KEY ("transaction_id") REFERENCES "bank"."transaction"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
22
|
+
await queryRunner.query(`ALTER TABLE "bank"."transaction_batch" ADD "id" character varying NOT NULL`);
|
|
23
|
+
await queryRunner.query(`ALTER TABLE "bank"."transaction_batch" ADD CONSTRAINT "PK_28b5ba6c2707e3c245748be801d" PRIMARY KEY ("id")`);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const { MigrationInterface, QueryRunner } = require("typeorm");
|
|
2
|
+
|
|
3
|
+
module.exports = class batchesCompletedAt1651660836295 {
|
|
4
|
+
name = 'batchesCompletedAt1651660836295'
|
|
5
|
+
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE "bank"."transaction_batch" ADD "completed_at" TIMESTAMP WITH TIME ZONE`);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
async down(queryRunner) {
|
|
11
|
+
await queryRunner.query(`ALTER TABLE "bank"."transaction_batch" DROP COLUMN "completed_at"`);
|
|
12
|
+
}
|
|
13
|
+
}
|