@cowris/paymentdb-client 2.0.1 → 2.1.0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cowris/paymentdb-client",
3
- "version": "2.0.1",
3
+ "version": "2.1.0",
4
4
  "description": "This is a Prisma Client package for the Cowris PaymentDB. It provides a simple interface to interact with the Payment database, allowing you to perform CRUD operations on payment and transaction data and related tables.",
5
5
  "main": "index.js",
6
6
  "private": false,
@@ -9,6 +9,7 @@ model PaymentAccount {
9
9
  wallet_webhook_url String?
10
10
  managed_wallets ManagedWallet[]
11
11
  transactions Transaction[]
12
+ withdrawal_accounts WithdrawalAccount[]
12
13
 
13
14
  @@index([wallet_id], name: "wallet_id_index")
14
15
  @@index([account_number], name: "wallet_account_number")
@@ -21,6 +21,7 @@ model Hold {
21
21
  updated_at DateTime @updatedAt
22
22
 
23
23
  @@index([account_id])
24
+ @@index([managed_wallet_id])
24
25
  @@index([status])
25
26
  @@index([expires_at])
26
27
  }
@@ -0,0 +1,28 @@
1
+ -- CreateTable
2
+ CREATE TABLE "WithdrawalAccount" (
3
+ "id" TEXT NOT NULL,
4
+ "account_number" TEXT,
5
+ "account_bank_code" TEXT,
6
+ "account_bank_name" TEXT,
7
+ "account_firstname" TEXT NOT NULL,
8
+ "account_lastname" TEXT,
9
+ "account_email" TEXT,
10
+ "currency_id" TEXT NOT NULL,
11
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
12
+ "updated_at" TIMESTAMP(3) NOT NULL,
13
+ "account_id" TEXT NOT NULL,
14
+
15
+ CONSTRAINT "WithdrawalAccount_pkey" PRIMARY KEY ("id")
16
+ );
17
+
18
+ -- CreateIndex
19
+ CREATE INDEX "withdrawal_account_currency_index" ON "WithdrawalAccount"("currency_id");
20
+
21
+ -- CreateIndex
22
+ CREATE UNIQUE INDEX "WithdrawalAccount_account_number_account_bank_code_currency_key" ON "WithdrawalAccount"("account_number", "account_bank_code", "currency_id");
23
+
24
+ -- CreateIndex
25
+ CREATE INDEX "Hold_managed_wallet_id_idx" ON "Hold"("managed_wallet_id");
26
+
27
+ -- AddForeignKey
28
+ ALTER TABLE "WithdrawalAccount" ADD CONSTRAINT "WithdrawalAccount_account_id_fkey" FOREIGN KEY ("account_id") REFERENCES "PaymentAccount"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
@@ -0,0 +1,18 @@
1
+ model WithdrawalAccount {
2
+ id String @id @default(uuid())
3
+ account_number String?
4
+ account_bank_code String?
5
+ account_bank_name String?
6
+ account_firstname String
7
+ account_lastname String?
8
+ account_email String?
9
+ currency_id String
10
+ created_at DateTime @default(now())
11
+ updated_at DateTime @updatedAt
12
+
13
+ account_id String
14
+ account PaymentAccount @relation(fields: [account_id], references: [id])
15
+
16
+ @@unique([account_number, account_bank_code, currency_id], name: "unique_withdrawal_account")
17
+ @@index([currency_id], name: "withdrawal_account_currency_index")
18
+ }