-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #42 from richard483/feature/payment
Feature/payment
- Loading branch information
Showing
41 changed files
with
1,249 additions
and
155 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
24 changes: 24 additions & 0 deletions
24
prisma/migrations/20231209095627_updated_contract_field/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
Warnings: | ||
- Added the required column `bankAccountName` to the `Contract` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `bankAccountNumber` to the `Contract` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `bankName` to the `Contract` table without a default value. This is not possible if the table is not empty. | ||
- Added the required column `paymentRate` to the `Contract` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- CreateEnum | ||
CREATE TYPE "Bank" AS ENUM ('BCA', 'BNI', 'BRI', 'MANDIRI', 'CIMB', 'MAYBANK'); | ||
|
||
-- CreateEnum | ||
CREATE TYPE "ContractStatus" AS ENUM ('PENDING', 'ONGOING', 'ACCEPTED', 'REJECTED'); | ||
|
||
-- AlterTable | ||
ALTER TABLE "Contract" ADD COLUMN "bankAccountName" TEXT NOT NULL, | ||
ADD COLUMN "bankAccountNumber" BIGINT NOT NULL, | ||
ADD COLUMN "bankName" "Bank" NOT NULL, | ||
ADD COLUMN "paymentRate" BIGINT NOT NULL, | ||
ADD COLUMN "status" "ContractStatus" NOT NULL DEFAULT 'PENDING'; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Contract" ADD CONSTRAINT "Contract_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE; |
4 changes: 4 additions & 0 deletions
4
prisma/migrations/20231209180900_update_some_user_and_contract_schema/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
-- AlterTable | ||
ALTER TABLE "Contract" ALTER COLUMN "bankAccountName" DROP NOT NULL, | ||
ALTER COLUMN "bankAccountNumber" DROP NOT NULL, | ||
ALTER COLUMN "bankName" DROP NOT NULL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
/* | ||
Warnings: | ||
- You are about to alter the column `bankAccountNumber` on the `Contract` table. The data in that column could be lost. The data in that column will be cast from `BigInt` to `Integer`. | ||
- You are about to alter the column `paymentRate` on the `Contract` table. The data in that column could be lost. The data in that column will be cast from `BigInt` to `Integer`. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "Contract" ALTER COLUMN "bankAccountNumber" SET DATA TYPE INTEGER, | ||
ALTER COLUMN "paymentRate" SET DATA TYPE INTEGER; |
13 changes: 13 additions & 0 deletions
13
prisma/migrations/20231216101553_update_contract_model/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `bankAccountName` on the `Contract` table. All the data in the column will be lost. | ||
- You are about to drop the column `bankAccountNumber` on the `Contract` table. All the data in the column will be lost. | ||
- You are about to drop the column `bankName` on the `Contract` table. All the data in the column will be lost. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "Contract" DROP COLUMN "bankAccountName", | ||
DROP COLUMN "bankAccountNumber", | ||
DROP COLUMN "bankName", | ||
ADD COLUMN "paymentRequestId" TEXT; |
11 changes: 11 additions & 0 deletions
11
prisma/migrations/20231216175416_updated_contract_schema/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-- CreateEnum | ||
CREATE TYPE "PaymentStatus" AS ENUM ('PENDING', 'PAID', 'FAILED'); | ||
|
||
-- AlterEnum | ||
ALTER TYPE "ContractStatus" ADD VALUE 'COMPLETED'; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Contract" ADD COLUMN "paymentStatus" "PaymentStatus"; | ||
|
||
-- DropEnum | ||
DROP TYPE "Bank"; |
6 changes: 6 additions & 0 deletions
6
prisma/migrations/20231217190311_updated_payout_migration/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
-- CreateEnum | ||
CREATE TYPE "PayoutStatus" AS ENUM ('PENDING', 'VOIDED', 'FAILED', 'COMPLETED', 'EXPIRED'); | ||
|
||
-- AlterTable | ||
ALTER TABLE "Contract" ADD COLUMN "payoutLinkId" TEXT, | ||
ADD COLUMN "payoutStatus" "PayoutStatus"; |
11 changes: 11 additions & 0 deletions
11
prisma/migrations/20231217193530_updated_payout_schema/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `payoutStatus` on the `Contract` table. All the data in the column will be lost. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "Contract" DROP COLUMN "payoutStatus"; | ||
|
||
-- DropEnum | ||
DROP TYPE "PayoutStatus"; |
39 changes: 39 additions & 0 deletions
39
prisma/migrations/20231226153939_normalized_contract_table/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `paymentRate` on the `Contract` table. All the data in the column will be lost. | ||
- You are about to drop the column `paymentRequestId` on the `Contract` table. All the data in the column will be lost. | ||
- You are about to drop the column `paymentStatus` on the `Contract` table. All the data in the column will be lost. | ||
- You are about to drop the column `payoutLinkId` on the `Contract` table. All the data in the column will be lost. | ||
- A unique constraint covering the columns `[username]` on the table `User` will be added. If there are existing duplicate values, this will fail. | ||
- Made the column `username` on table `User` required. This step will fail if there are existing NULL values in that column. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "Contract" DROP COLUMN "paymentRate", | ||
DROP COLUMN "paymentRequestId", | ||
DROP COLUMN "paymentStatus", | ||
DROP COLUMN "payoutLinkId", | ||
ADD COLUMN "paymentId" TEXT; | ||
|
||
-- AlterTable | ||
ALTER TABLE "User" ALTER COLUMN "username" SET NOT NULL; | ||
|
||
-- CreateTable | ||
CREATE TABLE "Payment" ( | ||
"id" TEXT NOT NULL, | ||
"paymentRate" INTEGER NOT NULL, | ||
"paymentRequestId" TEXT, | ||
"paymentStatus" "PaymentStatus" DEFAULT 'PENDING', | ||
"payoutLinkId" TEXT, | ||
"createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
"updatedAt" TIMESTAMP(3) NOT NULL, | ||
|
||
CONSTRAINT "Payment_pkey" PRIMARY KEY ("id") | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "User_username_key" ON "User"("username"); | ||
|
||
-- AddForeignKey | ||
ALTER TABLE "Contract" ADD CONSTRAINT "Contract_paymentId_fkey" FOREIGN KEY ("paymentId") REFERENCES "Payment"("id") ON DELETE SET NULL ON UPDATE CASCADE; |
12 changes: 12 additions & 0 deletions
12
prisma/migrations/20231226155814_re_adding_payment_rate/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `paymentRate` on the `Payment` table. All the data in the column will be lost. | ||
- Added the required column `paymentRate` to the `Contract` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE "Contract" ADD COLUMN "paymentRate" INTEGER NOT NULL; | ||
|
||
-- AlterTable | ||
ALTER TABLE "Payment" DROP COLUMN "paymentRate"; |
Oops, something went wrong.