@felloh-org/lambda-wrapper 1.0.17 → 1.0.18
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/cli/seed/create-schema.js +2 -0
- package/dist/entity/bank/disbursal/index.js +59 -6
- package/dist/entity/bank/index.js +3 -3
- package/dist/entity/bank/ledger/index.js +125 -0
- package/dist/entity/bank/settled-transaction/index.js +97 -0
- package/dist/entity/index.js +5 -1
- package/dist/entity/payment/index.js +5 -1
- package/dist/entity/payment/organisation-payment-provider/index.js +131 -0
- package/dist/entity/{bank/beneficiary-organisation → payment/payment-provider}/index.js +17 -30
- package/dist/entity/payment/transaction/index.js +34 -7
- package/dist/entity/total-processing/index.js +16 -0
- package/dist/entity/total-processing/transaction/index.js +126 -0
- package/dist/entity/total-processing/transaction-metadata/index.js +138 -0
- package/dist/entity/trust-payments/batch/index.js +85 -0
- package/dist/entity/trust-payments/chargeback/index.js +128 -0
- package/dist/entity/trust-payments/index.js +20 -0
- package/dist/entity/{bank/beneficiary-provider → trust-payments/merchant}/index.js +28 -27
- package/dist/entity/trust-payments/transaction/index.js +152 -0
- package/dist/entity/user/organisation/index.js +2 -6
- package/dist/entity/user/user/index.js +1 -3
- package/dist/index.js +100 -36
- package/dist/migration/bank/1642313073694-bank-initial.js +0 -10
- package/dist/migration/bank/1645101410250-bank_disbursal.js +28 -0
- package/dist/migration/bank/1645102501719-bank_disbursal_unique.js +17 -0
- package/dist/migration/bank/1645103420324-ledger.js +19 -0
- package/dist/migration/bank/1645103864454-ledger-defaults.js +15 -0
- package/dist/migration/bank/1645108723739-bank-settled-transaction.js +19 -0
- package/dist/migration/payment/1643717852114-payment-providers.js +19 -0
- package/dist/migration/payment/1643718714719-payment-providers-method.js +15 -0
- package/dist/migration/payment/1643719203328-payment-providers-method.js +22 -0
- package/dist/migration/payment/1644395533722-transaction_provider.js +15 -0
- package/dist/migration/payment/1644396011044-transaction_provider_ref.js +13 -0
- package/dist/migration/total-processing/1644309449035-tpro_transactions.js +13 -0
- package/dist/migration/total-processing/1644411639660-total_processing_entity.js +13 -0
- package/dist/migration/total-processing/1644842797566-relations.js +19 -0
- package/dist/migration/total-processing/1644926407236-tp_rec_nullable.js +13 -0
- package/dist/migration/total-processing/1644933594682-tp_rec_status.js +13 -0
- package/dist/migration/total-processing/1645010756173-tp_transaction_metadata.js +15 -0
- package/dist/migration/trust-payments/1644016335590-tp_merchants.js +13 -0
- package/dist/migration/trust-payments/1644018105481-tp_add_batch.js +15 -0
- package/dist/migration/trust-payments/1644020330502-tp_transaction.js +17 -0
- package/dist/migration/trust-payments/1644791277717-chargeback.js +15 -0
- package/package.json +2 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const { MigrationInterface, QueryRunner } = require("typeorm");
|
|
2
|
+
|
|
3
|
+
module.exports = class tproTransactions1644309449035 {
|
|
4
|
+
name = 'tproTransactions1644309449035'
|
|
5
|
+
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`CREATE TABLE "total_processing"."transaction" ("ndc" character varying NOT NULL, "risk_score" character varying(2) NOT NULL, "amount" integer NOT NULL, "currency" character varying(5) NOT NULL, "reconciliation_id" character varying(30) NOT NULL, "merchant_account_id" character varying(50) NOT NULL, "processing_time" TIMESTAMP NOT NULL, "merchant_name" character varying(1500) NOT NULL, CONSTRAINT "PK_e8f5b58f1647a179840dc613ec3" PRIMARY KEY ("ndc"))`);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
async down(queryRunner) {
|
|
11
|
+
await queryRunner.query(`DROP TABLE "total_processing"."transaction"`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const { MigrationInterface, QueryRunner } = require("typeorm");
|
|
2
|
+
|
|
3
|
+
module.exports = class totalProcessingEntity1644411639660 {
|
|
4
|
+
name = 'totalProcessingEntity1644411639660'
|
|
5
|
+
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE "total_processing"."transaction" ADD "entity_id" character varying(50)`);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
async down(queryRunner) {
|
|
11
|
+
await queryRunner.query(`ALTER TABLE "total_processing"."transaction" DROP COLUMN "entity_id"`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
const { MigrationInterface, QueryRunner } = require("typeorm");
|
|
2
|
+
|
|
3
|
+
module.exports = class relations1644842797566 {
|
|
4
|
+
name = 'relations1644842797566'
|
|
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 "user"."user_organisation" ADD CONSTRAINT "FK_d9628e009b6d71bf677c04f8494" FOREIGN KEY ("organisation_id") REFERENCES "user"."organisation"("id") ON DELETE CASCADE ON UPDATE CASCADE`);
|
|
10
|
+
await queryRunner.query(`ALTER TABLE "user"."user_organisation" ADD CONSTRAINT "FK_81c4608739c8cf71fa1f96e11ae" FOREIGN KEY ("user_id") REFERENCES "user"."user"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async down(queryRunner) {
|
|
14
|
+
await queryRunner.query(`ALTER TABLE "user"."user_organisation" DROP CONSTRAINT "FK_81c4608739c8cf71fa1f96e11ae"`);
|
|
15
|
+
await queryRunner.query(`ALTER TABLE "user"."user_organisation" DROP CONSTRAINT "FK_d9628e009b6d71bf677c04f8494"`);
|
|
16
|
+
await queryRunner.query(`ALTER TABLE "user"."user_organisation" ADD CONSTRAINT "FK_d9628e009b6d71bf677c04f8494" FOREIGN KEY ("organisation_id") REFERENCES "user"."organisation"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
17
|
+
await queryRunner.query(`ALTER TABLE "user"."user_organisation" ADD CONSTRAINT "FK_81c4608739c8cf71fa1f96e11ae" FOREIGN KEY ("user_id") REFERENCES "user"."user"("id") ON DELETE CASCADE ON UPDATE CASCADE`);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const { MigrationInterface, QueryRunner } = require("typeorm");
|
|
2
|
+
|
|
3
|
+
module.exports = class tpRecNullable1644926407236 {
|
|
4
|
+
name = 'tpRecNullable1644926407236'
|
|
5
|
+
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE "total_processing"."transaction" ALTER COLUMN "reconciliation_id" DROP NOT NULL`);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
async down(queryRunner) {
|
|
11
|
+
await queryRunner.query(`ALTER TABLE "total_processing"."transaction" ALTER COLUMN "reconciliation_id" SET NOT NULL`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const { MigrationInterface, QueryRunner } = require("typeorm");
|
|
2
|
+
|
|
3
|
+
module.exports = class tpRecStatus1644933594682 {
|
|
4
|
+
name = 'tpRecStatus1644933594682'
|
|
5
|
+
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`ALTER TABLE "total_processing"."transaction" ADD "status" integer`);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
async down(queryRunner) {
|
|
11
|
+
await queryRunner.query(`ALTER TABLE "total_processing"."transaction" DROP COLUMN "status"`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const { MigrationInterface, QueryRunner } = require("typeorm");
|
|
2
|
+
|
|
3
|
+
module.exports = class tpTransactionMetadata1645010756173 {
|
|
4
|
+
name = 'tpTransactionMetadata1645010756173'
|
|
5
|
+
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`CREATE TABLE "total_processing"."transaction_metadata" ("card_type" character varying(20), "bin_type" character varying(20), "payment_brand" character varying(20), "payment_type" character varying(10), "issuing_country" character varying(10), "currency" character varying(10), "last_four_digits" character varying(4), "cardholder_name" character varying(150), "created_at" TIMESTAMP NOT NULL DEFAULT now(), "ndc" character varying NOT NULL, CONSTRAINT "PK_3d46223f35eba1a34e2fe7f6778" PRIMARY KEY ("ndc"))`);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE "total_processing"."transaction_metadata" ADD CONSTRAINT "FK_3d46223f35eba1a34e2fe7f6778" FOREIGN KEY ("ndc") REFERENCES "total_processing"."transaction"("ndc") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async down(queryRunner) {
|
|
12
|
+
await queryRunner.query(`ALTER TABLE "total_processing"."transaction_metadata" DROP CONSTRAINT "FK_3d46223f35eba1a34e2fe7f6778"`);
|
|
13
|
+
await queryRunner.query(`DROP TABLE "total_processing"."transaction_metadata"`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const { MigrationInterface, QueryRunner } = require("typeorm");
|
|
2
|
+
|
|
3
|
+
module.exports = class tpMerchants1644016335590 {
|
|
4
|
+
name = 'tpMerchants1644016335590'
|
|
5
|
+
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`CREATE TABLE "trust_payments"."merchant" ("merchant_number" character varying(150) NOT NULL, "mid" character varying(150) NOT NULL, "name" character varying(150) NOT NULL, "status" character varying(20) NOT NULL, "created_at" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "PK_f6dece295160ada4ae4b5035503" PRIMARY KEY ("merchant_number"))`);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
async down(queryRunner) {
|
|
11
|
+
await queryRunner.query(`DROP TABLE "trust_payments"."merchant"`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const { MigrationInterface, QueryRunner } = require("typeorm");
|
|
2
|
+
|
|
3
|
+
module.exports = class tpAddBatch1644018105481 {
|
|
4
|
+
name = 'tpAddBatch1644018105481'
|
|
5
|
+
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`CREATE TABLE "trust_payments"."batch" ("bank_reference" character varying NOT NULL, "amount" integer NOT NULL, "posting_date" date NOT NULL, "currency" character varying(5) NOT NULL, "created_at" TIMESTAMP NOT NULL DEFAULT now(), "merchant_number" character varying(150), CONSTRAINT "PK_2764676698c90f2ac84d9255436" PRIMARY KEY ("bank_reference"))`);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE "trust_payments"."batch" ADD CONSTRAINT "FK_f41b6b9d92dac3770ea3f3b0e1b" FOREIGN KEY ("merchant_number") REFERENCES "trust_payments"."merchant"("merchant_number") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async down(queryRunner) {
|
|
12
|
+
await queryRunner.query(`ALTER TABLE "trust_payments"."batch" DROP CONSTRAINT "FK_f41b6b9d92dac3770ea3f3b0e1b"`);
|
|
13
|
+
await queryRunner.query(`DROP TABLE "trust_payments"."batch"`);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const { MigrationInterface, QueryRunner } = require("typeorm");
|
|
2
|
+
|
|
3
|
+
module.exports = class tpTransaction1644020330502 {
|
|
4
|
+
name = 'tpTransaction1644020330502'
|
|
5
|
+
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`CREATE TABLE "trust_payments"."transaction" ("id" character varying NOT NULL, "created" date NOT NULL, "time" character varying(10) NOT NULL, "card_number" character varying(30) NOT NULL, "card_type" character varying(30) NOT NULL, "capture_method" character varying(40) NOT NULL, "auth_code" character varying(15) NOT NULL, "currency" character varying(5) NOT NULL, "amount" integer NOT NULL, "merchant_reference" character varying(40) NOT NULL, "bank_reference" character varying, "merchant_number" character varying(150), CONSTRAINT "PK_89eadb93a89810556e1cbcd6ab9" PRIMARY KEY ("id"))`);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE "trust_payments"."transaction" ADD CONSTRAINT "FK_b64d908fd041c3e7c66451774ad" FOREIGN KEY ("bank_reference") REFERENCES "trust_payments"."batch"("bank_reference") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
9
|
+
await queryRunner.query(`ALTER TABLE "trust_payments"."transaction" ADD CONSTRAINT "FK_a72a7fc3b87d80557ce9196e808" FOREIGN KEY ("merchant_number") REFERENCES "trust_payments"."merchant"("merchant_number") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
async down(queryRunner) {
|
|
13
|
+
await queryRunner.query(`ALTER TABLE "trust_payments"."transaction" DROP CONSTRAINT "FK_a72a7fc3b87d80557ce9196e808"`);
|
|
14
|
+
await queryRunner.query(`ALTER TABLE "trust_payments"."transaction" DROP CONSTRAINT "FK_b64d908fd041c3e7c66451774ad"`);
|
|
15
|
+
await queryRunner.query(`DROP TABLE "trust_payments"."transaction"`);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const { MigrationInterface, QueryRunner } = require("typeorm");
|
|
2
|
+
|
|
3
|
+
module.exports = class chargeback1644791277717 {
|
|
4
|
+
name = 'chargeback1644791277717'
|
|
5
|
+
|
|
6
|
+
async up(queryRunner) {
|
|
7
|
+
await queryRunner.query(`CREATE TABLE "trust_payments"."chargeback" ("id" character varying NOT NULL, "received_date" date, "status" character varying(20) NOT NULL, "reason" character varying(100) NOT NULL, "amount" integer NOT NULL, "due_date" date NOT NULL, "posting_date" date NOT NULL, "merchant_reference" character varying(100) NOT NULL, "created_at" TIMESTAMP NOT NULL DEFAULT now(), "merchant_number" character varying(150), CONSTRAINT "PK_b8733f1a59eed2643b7a879a915" PRIMARY KEY ("id"))`);
|
|
8
|
+
await queryRunner.query(`ALTER TABLE "trust_payments"."chargeback" ADD CONSTRAINT "FK_c3dff25d1fef4447e34b92e82d2" FOREIGN KEY ("merchant_number") REFERENCES "trust_payments"."merchant"("merchant_number") ON DELETE NO ACTION ON UPDATE NO ACTION`);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async down(queryRunner) {
|
|
12
|
+
await queryRunner.query(`ALTER TABLE "trust_payments"."chargeback" DROP CONSTRAINT "FK_c3dff25d1fef4447e34b92e82d2"`);
|
|
13
|
+
await queryRunner.query(`DROP TABLE "trust_payments"."chargeback"`);
|
|
14
|
+
}
|
|
15
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@felloh-org/lambda-wrapper",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.18",
|
|
4
4
|
"description": "Lambda wrapper for all Felloh Serverless Projects",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
"orm:migration:generate": "rm -rf dist && yarn build:orm && ./node_modules/.bin/typeorm migration:generate -o -n",
|
|
11
11
|
"orm:migration:run": "rm -rf dist && yarn build:orm && ./node_modules/.bin/typeorm migration:run",
|
|
12
12
|
"orm:schema:create": "babel-node ./cli/seed/create-schema.js",
|
|
13
|
+
"orm:revert": "rm -rf dist && yarn build:orm && ./node_modules/.bin/typeorm migration:revert",
|
|
13
14
|
"orm:seed": "babel-node ./cli/seed/index.js",
|
|
14
15
|
"start": "yarn build -w",
|
|
15
16
|
"test": "jest --coverage"
|