UNPKG

@lomray/microservice-payment-stripe

Version:

Stripe payment microservice based on NodeJS & inverted json.

36 lines (32 loc) 1.39 kB
'use strict'; var tslib = require('tslib'); class refund1692635371272 { constructor() { this.name = 'refund1692635371272'; } up(queryRunner) { return tslib.__awaiter(this, void 0, void 0, function* () { /** * Update transaction type values */ yield queryRunner.query(`ALTER TYPE "public"."transaction_status_enum" ADD VALUE 'partialRefunded'`); /** * Create refund table */ yield queryRunner.query(`CREATE TABLE "refund" (id uuid, "transactionId" varchar(66) NOT NULL, "amount" integer NOT NULL, "entityId" character varying(36), "params" json NOT NULL DEFAULT '{}', "status" "public"."transaction_status_enum" NOT NULL DEFAULT 'initial', "createdAt" TIMESTAMP NOT NULL DEFAULT now(), "updatedAt" TIMESTAMP NOT NULL DEFAULT now(), CONSTRAINT "refund(pk):id" PRIMARY KEY ("id"))`); }); } down(queryRunner) { return tslib.__awaiter(this, void 0, void 0, function* () { /** * Revert transaction type */ yield queryRunner.query(`ALTER TYPE "public"."transaction_status_enum" DROP VALUE 'partialRefunded'`); /** * Drop refund table */ yield queryRunner.query(`DROP TABLE "refund"`); }); } } module.exports = refund1692635371272;