@cowris/paymentdb-client 1.0.0 → 1.0.2

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.
Files changed (27) hide show
  1. package/package.json +1 -1
  2. package/prisma/generated/paymentdb/client.d.ts +1 -0
  3. package/prisma/generated/paymentdb/client.js +4 -0
  4. package/prisma/generated/paymentdb/default.d.ts +1 -0
  5. package/prisma/generated/paymentdb/default.js +4 -0
  6. package/prisma/generated/paymentdb/edge.d.ts +1 -0
  7. package/prisma/generated/paymentdb/edge.js +346 -0
  8. package/prisma/generated/paymentdb/index-browser.js +333 -0
  9. package/prisma/generated/paymentdb/index.d.ts +22046 -0
  10. package/prisma/generated/paymentdb/index.js +367 -0
  11. package/prisma/generated/paymentdb/libquery_engine-debian-openssl-3.0.x.so.node +0 -0
  12. package/prisma/generated/paymentdb/package.json +146 -0
  13. package/prisma/generated/paymentdb/runtime/edge-esm.js +34 -0
  14. package/prisma/generated/paymentdb/runtime/edge.js +34 -0
  15. package/prisma/generated/paymentdb/runtime/index-browser.d.ts +370 -0
  16. package/prisma/generated/paymentdb/runtime/index-browser.js +16 -0
  17. package/prisma/generated/paymentdb/runtime/library.d.ts +3687 -0
  18. package/prisma/generated/paymentdb/runtime/library.js +146 -0
  19. package/prisma/generated/paymentdb/runtime/react-native.js +83 -0
  20. package/prisma/generated/paymentdb/runtime/wasm-compiler-edge.js +83 -0
  21. package/prisma/generated/paymentdb/runtime/wasm-engine-edge.js +35 -0
  22. package/prisma/generated/paymentdb/schema.prisma +194 -0
  23. package/prisma/generated/paymentdb/wasm.d.ts +1 -0
  24. package/prisma/generated/paymentdb/wasm.js +333 -0
  25. package/prisma/schema/globalPaymentProvider.prisma +5 -4
  26. package/prisma/schema/migrations/20250714015117_create_tables/migration.sql +295 -0
  27. package/prisma/schema/migrations/migration_lock.toml +3 -0
@@ -0,0 +1,333 @@
1
+
2
+ /* !!! This is code generated by Prisma. Do not edit directly. !!!
3
+ /* eslint-disable */
4
+
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+
7
+ const {
8
+ Decimal,
9
+ objectEnumValues,
10
+ makeStrictEnum,
11
+ Public,
12
+ getRuntime,
13
+ skip
14
+ } = require('./runtime/index-browser.js')
15
+
16
+
17
+ const Prisma = {}
18
+
19
+ exports.Prisma = Prisma
20
+ exports.$Enums = {}
21
+
22
+ /**
23
+ * Prisma Client JS version: 6.11.1
24
+ * Query Engine version: f40f79ec31188888a2e33acda0ecc8fd10a853a9
25
+ */
26
+ Prisma.prismaVersion = {
27
+ client: "6.11.1",
28
+ engine: "f40f79ec31188888a2e33acda0ecc8fd10a853a9"
29
+ }
30
+
31
+ Prisma.PrismaClientKnownRequestError = () => {
32
+ const runtimeName = getRuntime().prettyName;
33
+ throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
34
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
35
+ )};
36
+ Prisma.PrismaClientUnknownRequestError = () => {
37
+ const runtimeName = getRuntime().prettyName;
38
+ throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
39
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
40
+ )}
41
+ Prisma.PrismaClientRustPanicError = () => {
42
+ const runtimeName = getRuntime().prettyName;
43
+ throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
44
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
45
+ )}
46
+ Prisma.PrismaClientInitializationError = () => {
47
+ const runtimeName = getRuntime().prettyName;
48
+ throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
49
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
50
+ )}
51
+ Prisma.PrismaClientValidationError = () => {
52
+ const runtimeName = getRuntime().prettyName;
53
+ throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
54
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
55
+ )}
56
+ Prisma.Decimal = Decimal
57
+
58
+ /**
59
+ * Re-export of sql-template-tag
60
+ */
61
+ Prisma.sql = () => {
62
+ const runtimeName = getRuntime().prettyName;
63
+ throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
64
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
65
+ )}
66
+ Prisma.empty = () => {
67
+ const runtimeName = getRuntime().prettyName;
68
+ throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
69
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
70
+ )}
71
+ Prisma.join = () => {
72
+ const runtimeName = getRuntime().prettyName;
73
+ throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
74
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
75
+ )}
76
+ Prisma.raw = () => {
77
+ const runtimeName = getRuntime().prettyName;
78
+ throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
79
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
80
+ )}
81
+ Prisma.validator = Public.validator
82
+
83
+ /**
84
+ * Extensions
85
+ */
86
+ Prisma.getExtensionContext = () => {
87
+ const runtimeName = getRuntime().prettyName;
88
+ throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
89
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
90
+ )}
91
+ Prisma.defineExtension = () => {
92
+ const runtimeName = getRuntime().prettyName;
93
+ throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
94
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
95
+ )}
96
+
97
+ /**
98
+ * Shorthand utilities for JSON filtering
99
+ */
100
+ Prisma.DbNull = objectEnumValues.instances.DbNull
101
+ Prisma.JsonNull = objectEnumValues.instances.JsonNull
102
+ Prisma.AnyNull = objectEnumValues.instances.AnyNull
103
+
104
+ Prisma.NullTypes = {
105
+ DbNull: objectEnumValues.classes.DbNull,
106
+ JsonNull: objectEnumValues.classes.JsonNull,
107
+ AnyNull: objectEnumValues.classes.AnyNull
108
+ }
109
+
110
+
111
+
112
+ /**
113
+ * Enums
114
+ */
115
+
116
+ exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
117
+ ReadUncommitted: 'ReadUncommitted',
118
+ ReadCommitted: 'ReadCommitted',
119
+ RepeatableRead: 'RepeatableRead',
120
+ Serializable: 'Serializable'
121
+ });
122
+
123
+ exports.Prisma.PaymentAccountScalarFieldEnum = {
124
+ id: 'id',
125
+ account_number: 'account_number',
126
+ email: 'email',
127
+ currency_id: 'currency_id',
128
+ wallet_id: 'wallet_id'
129
+ };
130
+
131
+ exports.Prisma.CurrencyScalarFieldEnum = {
132
+ id: 'id',
133
+ name: 'name',
134
+ symbol: 'symbol',
135
+ code: 'code',
136
+ country: 'country',
137
+ created_at: 'created_at',
138
+ updated_at: 'updated_at'
139
+ };
140
+
141
+ exports.Prisma.SenderAccountInformationScalarFieldEnum = {
142
+ id: 'id',
143
+ account_firstname: 'account_firstname',
144
+ account_lastname: 'account_lastname',
145
+ account_number: 'account_number',
146
+ account_email: 'account_email',
147
+ account_bank_name: 'account_bank_name'
148
+ };
149
+
150
+ exports.Prisma.FundingScalarFieldEnum = {
151
+ id: 'id',
152
+ transaction_id: 'transaction_id',
153
+ account_id: 'account_id',
154
+ status: 'status',
155
+ amount: 'amount',
156
+ source_currency_id: 'source_currency_id',
157
+ destination_currency_id: 'destination_currency_id',
158
+ sender_account_information_id: 'sender_account_information_id'
159
+ };
160
+
161
+ exports.Prisma.GlobalPaymentProviderScalarFieldEnum = {
162
+ id: 'id',
163
+ name: 'name',
164
+ created_at: 'created_at',
165
+ updated_at: 'updated_at'
166
+ };
167
+
168
+ exports.Prisma.ManagedWalletScalarFieldEnum = {
169
+ id: 'id',
170
+ account_id: 'account_id',
171
+ customer_name: 'customer_name',
172
+ wallet_identifier: 'wallet_identifier',
173
+ account_number: 'account_number',
174
+ email: 'email',
175
+ balance: 'balance',
176
+ currency_id: 'currency_id',
177
+ global_payment_provider_id: 'global_payment_provider_id',
178
+ type: 'type',
179
+ created_at: 'created_at',
180
+ updated_at: 'updated_at'
181
+ };
182
+
183
+ exports.Prisma.OtpScalarFieldEnum = {
184
+ id: 'id',
185
+ email: 'email',
186
+ otp: 'otp',
187
+ created_at: 'created_at',
188
+ updated_at: 'updated_at',
189
+ expires_at: 'expires_at'
190
+ };
191
+
192
+ exports.Prisma.ReversalScalarFieldEnum = {
193
+ id: 'id',
194
+ transaction_id: 'transaction_id',
195
+ account_id: 'account_id',
196
+ source_currency_id: 'source_currency_id',
197
+ destination_currency_id: 'destination_currency_id',
198
+ amount: 'amount',
199
+ status: 'status'
200
+ };
201
+
202
+ exports.Prisma.TransactionScalarFieldEnum = {
203
+ id: 'id',
204
+ account_id: 'account_id',
205
+ funding_id: 'funding_id',
206
+ withdrawal_id: 'withdrawal_id',
207
+ reversal_id: 'reversal_id',
208
+ transfer_id: 'transfer_id',
209
+ type: 'type',
210
+ status: 'status',
211
+ metadata: 'metadata',
212
+ provider_id: 'provider_id',
213
+ reference_id: 'reference_id',
214
+ created_at: 'created_at',
215
+ upadated_at: 'upadated_at'
216
+ };
217
+
218
+ exports.Prisma.TransferDestinationAccountDetailsScalarFieldEnum = {
219
+ id: 'id',
220
+ account_firstname: 'account_firstname',
221
+ account_lastname: 'account_lastname',
222
+ account_number: 'account_number',
223
+ account_email: 'account_email',
224
+ account_bank_name: 'account_bank_name'
225
+ };
226
+
227
+ exports.Prisma.TransferScalarFieldEnum = {
228
+ id: 'id',
229
+ transaction_id: 'transaction_id',
230
+ from_account_id: 'from_account_id',
231
+ to_account_id: 'to_account_id',
232
+ destination_account_details_id: 'destination_account_details_id',
233
+ source_currency_id: 'source_currency_id',
234
+ destination_currency_id: 'destination_currency_id',
235
+ amount_in_source_currency: 'amount_in_source_currency',
236
+ amount_in_destination_currency: 'amount_in_destination_currency',
237
+ status: 'status'
238
+ };
239
+
240
+ exports.Prisma.WithdrawalDestinationAccountDetailsScalarFieldEnum = {
241
+ id: 'id',
242
+ account_firstname: 'account_firstname',
243
+ account_lastname: 'account_lastname',
244
+ account_number: 'account_number',
245
+ account_email: 'account_email',
246
+ account_bank_name: 'account_bank_name'
247
+ };
248
+
249
+ exports.Prisma.WithdrawalScalarFieldEnum = {
250
+ id: 'id',
251
+ transaction_id: 'transaction_id',
252
+ from_account_id: 'from_account_id',
253
+ amount_in_source_currency: 'amount_in_source_currency',
254
+ status: 'status',
255
+ destination_account_details_id: 'destination_account_details_id',
256
+ source_currency_id: 'source_currency_id',
257
+ destination_currency_id: 'destination_currency_id',
258
+ amount_in_destination_currency: 'amount_in_destination_currency'
259
+ };
260
+
261
+ exports.Prisma.SortOrder = {
262
+ asc: 'asc',
263
+ desc: 'desc'
264
+ };
265
+
266
+ exports.Prisma.NullableJsonNullValueInput = {
267
+ DbNull: Prisma.DbNull,
268
+ JsonNull: Prisma.JsonNull
269
+ };
270
+
271
+ exports.Prisma.QueryMode = {
272
+ default: 'default',
273
+ insensitive: 'insensitive'
274
+ };
275
+
276
+ exports.Prisma.NullsOrder = {
277
+ first: 'first',
278
+ last: 'last'
279
+ };
280
+
281
+ exports.Prisma.JsonNullValueFilter = {
282
+ DbNull: Prisma.DbNull,
283
+ JsonNull: Prisma.JsonNull,
284
+ AnyNull: Prisma.AnyNull
285
+ };
286
+
287
+
288
+ exports.Prisma.ModelName = {
289
+ PaymentAccount: 'PaymentAccount',
290
+ Currency: 'Currency',
291
+ SenderAccountInformation: 'SenderAccountInformation',
292
+ Funding: 'Funding',
293
+ GlobalPaymentProvider: 'GlobalPaymentProvider',
294
+ ManagedWallet: 'ManagedWallet',
295
+ Otp: 'Otp',
296
+ Reversal: 'Reversal',
297
+ Transaction: 'Transaction',
298
+ TransferDestinationAccountDetails: 'TransferDestinationAccountDetails',
299
+ Transfer: 'Transfer',
300
+ WithdrawalDestinationAccountDetails: 'WithdrawalDestinationAccountDetails',
301
+ Withdrawal: 'Withdrawal'
302
+ };
303
+
304
+ /**
305
+ * This is a stub Prisma Client that will error at runtime if called.
306
+ */
307
+ class PrismaClient {
308
+ constructor() {
309
+ return new Proxy(this, {
310
+ get(target, prop) {
311
+ let message
312
+ const runtime = getRuntime()
313
+ if (runtime.isEdge) {
314
+ message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either:
315
+ - Use Prisma Accelerate: https://pris.ly/d/accelerate
316
+ - Use Driver Adapters: https://pris.ly/d/driver-adapters
317
+ `;
318
+ } else {
319
+ message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).'
320
+ }
321
+
322
+ message += `
323
+ If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report`
324
+
325
+ throw new Error(message)
326
+ }
327
+ })
328
+ }
329
+ }
330
+
331
+ exports.PrismaClient = PrismaClient
332
+
333
+ Object.assign(exports, Prisma)
@@ -1,9 +1,10 @@
1
1
  model GlobalPaymentProvider {
2
- id String @id @default(uuid())
3
- name String
2
+ id String @id @default(uuid())
3
+ name String
4
+ idx Int @default(autoincrement())
4
5
  supported_currencies Currency[]
5
- created_at DateTime @default(now())
6
- updated_at DateTime @updatedAt
6
+ created_at DateTime @default(now())
7
+ updated_at DateTime @updatedAt
7
8
 
8
9
  transactions Transaction[]
9
10
  }
@@ -0,0 +1,295 @@
1
+ -- CreateTable
2
+ CREATE TABLE "PaymentAccount" (
3
+ "id" TEXT NOT NULL,
4
+ "account_number" TEXT,
5
+ "email" TEXT,
6
+ "currency_id" TEXT NOT NULL,
7
+ "wallet_id" TEXT NOT NULL,
8
+
9
+ CONSTRAINT "PaymentAccount_pkey" PRIMARY KEY ("id")
10
+ );
11
+
12
+ -- CreateTable
13
+ CREATE TABLE "Currency" (
14
+ "id" TEXT NOT NULL,
15
+ "name" TEXT NOT NULL,
16
+ "symbol" TEXT NOT NULL,
17
+ "code" TEXT,
18
+ "country" TEXT NOT NULL,
19
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
20
+ "updated_at" TIMESTAMP(3) NOT NULL,
21
+
22
+ CONSTRAINT "Currency_pkey" PRIMARY KEY ("id")
23
+ );
24
+
25
+ -- CreateTable
26
+ CREATE TABLE "SenderAccountInformation" (
27
+ "id" TEXT NOT NULL,
28
+ "account_firstname" TEXT DEFAULT '',
29
+ "account_lastname" TEXT DEFAULT '',
30
+ "account_number" TEXT,
31
+ "account_email" TEXT,
32
+ "account_bank_name" TEXT,
33
+
34
+ CONSTRAINT "SenderAccountInformation_pkey" PRIMARY KEY ("id")
35
+ );
36
+
37
+ -- CreateTable
38
+ CREATE TABLE "Funding" (
39
+ "id" TEXT NOT NULL,
40
+ "transaction_id" TEXT NOT NULL,
41
+ "account_id" TEXT NOT NULL,
42
+ "status" TEXT NOT NULL,
43
+ "amount" TEXT NOT NULL,
44
+ "source_currency_id" TEXT,
45
+ "destination_currency_id" TEXT NOT NULL,
46
+ "sender_account_information_id" TEXT,
47
+
48
+ CONSTRAINT "Funding_pkey" PRIMARY KEY ("id")
49
+ );
50
+
51
+ -- CreateTable
52
+ CREATE TABLE "GlobalPaymentProvider" (
53
+ "id" TEXT NOT NULL,
54
+ "name" TEXT NOT NULL,
55
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
56
+ "updated_at" TIMESTAMP(3) NOT NULL,
57
+
58
+ CONSTRAINT "GlobalPaymentProvider_pkey" PRIMARY KEY ("id")
59
+ );
60
+
61
+ -- CreateTable
62
+ CREATE TABLE "ManagedWallet" (
63
+ "id" TEXT NOT NULL,
64
+ "account_id" TEXT NOT NULL,
65
+ "customer_name" TEXT,
66
+ "wallet_identifier" TEXT,
67
+ "account_number" TEXT,
68
+ "email" TEXT,
69
+ "balance" TEXT NOT NULL DEFAULT '0.00',
70
+ "currency_id" TEXT NOT NULL,
71
+ "global_payment_provider_id" TEXT NOT NULL,
72
+ "type" TEXT NOT NULL,
73
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
74
+ "updated_at" TIMESTAMP(3) NOT NULL,
75
+
76
+ CONSTRAINT "ManagedWallet_pkey" PRIMARY KEY ("id")
77
+ );
78
+
79
+ -- CreateTable
80
+ CREATE TABLE "Otp" (
81
+ "id" TEXT NOT NULL,
82
+ "email" TEXT NOT NULL,
83
+ "otp" TEXT NOT NULL,
84
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
85
+ "updated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
86
+ "expires_at" TIMESTAMP(3) NOT NULL,
87
+
88
+ CONSTRAINT "Otp_pkey" PRIMARY KEY ("id")
89
+ );
90
+
91
+ -- CreateTable
92
+ CREATE TABLE "Reversal" (
93
+ "id" TEXT NOT NULL,
94
+ "transaction_id" TEXT NOT NULL,
95
+ "account_id" TEXT NOT NULL,
96
+ "source_currency_id" TEXT,
97
+ "destination_currency_id" TEXT NOT NULL,
98
+ "amount" TEXT NOT NULL,
99
+ "status" TEXT NOT NULL,
100
+
101
+ CONSTRAINT "Reversal_pkey" PRIMARY KEY ("id")
102
+ );
103
+
104
+ -- CreateTable
105
+ CREATE TABLE "Transaction" (
106
+ "id" TEXT NOT NULL,
107
+ "account_id" TEXT NOT NULL,
108
+ "funding_id" TEXT,
109
+ "withdrawal_id" TEXT,
110
+ "reversal_id" TEXT,
111
+ "transfer_id" TEXT,
112
+ "type" TEXT NOT NULL,
113
+ "status" TEXT NOT NULL,
114
+ "metadata" JSONB,
115
+ "provider_id" TEXT,
116
+ "reference_id" TEXT,
117
+ "created_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
118
+ "upadated_at" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
119
+
120
+ CONSTRAINT "Transaction_pkey" PRIMARY KEY ("id")
121
+ );
122
+
123
+ -- CreateTable
124
+ CREATE TABLE "TransferDestinationAccountDetails" (
125
+ "id" TEXT NOT NULL,
126
+ "account_firstname" TEXT NOT NULL DEFAULT '',
127
+ "account_lastname" TEXT NOT NULL DEFAULT '',
128
+ "account_number" TEXT,
129
+ "account_email" TEXT,
130
+ "account_bank_name" TEXT,
131
+
132
+ CONSTRAINT "TransferDestinationAccountDetails_pkey" PRIMARY KEY ("id")
133
+ );
134
+
135
+ -- CreateTable
136
+ CREATE TABLE "Transfer" (
137
+ "id" TEXT NOT NULL,
138
+ "transaction_id" TEXT NOT NULL,
139
+ "from_account_id" TEXT NOT NULL,
140
+ "to_account_id" TEXT,
141
+ "destination_account_details_id" TEXT,
142
+ "source_currency_id" TEXT NOT NULL,
143
+ "destination_currency_id" TEXT NOT NULL,
144
+ "amount_in_source_currency" TEXT NOT NULL,
145
+ "amount_in_destination_currency" TEXT NOT NULL,
146
+ "status" TEXT NOT NULL,
147
+
148
+ CONSTRAINT "Transfer_pkey" PRIMARY KEY ("id")
149
+ );
150
+
151
+ -- CreateTable
152
+ CREATE TABLE "WithdrawalDestinationAccountDetails" (
153
+ "id" TEXT NOT NULL,
154
+ "account_firstname" TEXT NOT NULL DEFAULT '',
155
+ "account_lastname" TEXT NOT NULL DEFAULT '',
156
+ "account_number" TEXT,
157
+ "account_email" TEXT,
158
+ "account_bank_name" TEXT,
159
+
160
+ CONSTRAINT "WithdrawalDestinationAccountDetails_pkey" PRIMARY KEY ("id")
161
+ );
162
+
163
+ -- CreateTable
164
+ CREATE TABLE "Withdrawal" (
165
+ "id" TEXT NOT NULL,
166
+ "transaction_id" TEXT NOT NULL,
167
+ "from_account_id" TEXT NOT NULL,
168
+ "amount_in_source_currency" TEXT NOT NULL,
169
+ "status" TEXT NOT NULL,
170
+ "destination_account_details_id" TEXT,
171
+ "source_currency_id" TEXT NOT NULL,
172
+ "destination_currency_id" TEXT NOT NULL,
173
+ "amount_in_destination_currency" TEXT NOT NULL,
174
+
175
+ CONSTRAINT "Withdrawal_pkey" PRIMARY KEY ("id")
176
+ );
177
+
178
+ -- CreateTable
179
+ CREATE TABLE "_CurrencyToGlobalPaymentProvider" (
180
+ "A" TEXT NOT NULL,
181
+ "B" TEXT NOT NULL,
182
+
183
+ CONSTRAINT "_CurrencyToGlobalPaymentProvider_AB_pkey" PRIMARY KEY ("A","B")
184
+ );
185
+
186
+ -- CreateIndex
187
+ CREATE UNIQUE INDEX "PaymentAccount_account_number_key" ON "PaymentAccount"("account_number");
188
+
189
+ -- CreateIndex
190
+ CREATE UNIQUE INDEX "PaymentAccount_wallet_id_key" ON "PaymentAccount"("wallet_id");
191
+
192
+ -- CreateIndex
193
+ CREATE INDEX "wallet_id_index" ON "PaymentAccount"("wallet_id");
194
+
195
+ -- CreateIndex
196
+ CREATE INDEX "wallet_account_number" ON "PaymentAccount"("account_number");
197
+
198
+ -- CreateIndex
199
+ CREATE UNIQUE INDEX "Currency_name_key" ON "Currency"("name");
200
+
201
+ -- CreateIndex
202
+ CREATE UNIQUE INDEX "Funding_transaction_id_key" ON "Funding"("transaction_id");
203
+
204
+ -- CreateIndex
205
+ CREATE UNIQUE INDEX "Funding_sender_account_information_id_key" ON "Funding"("sender_account_information_id");
206
+
207
+ -- CreateIndex
208
+ CREATE INDEX "otp_email_index" ON "Otp"("email");
209
+
210
+ -- CreateIndex
211
+ CREATE INDEX "otp_str_index" ON "Otp"("otp");
212
+
213
+ -- CreateIndex
214
+ CREATE UNIQUE INDEX "Reversal_transaction_id_key" ON "Reversal"("transaction_id");
215
+
216
+ -- CreateIndex
217
+ CREATE UNIQUE INDEX "Transaction_id_key" ON "Transaction"("id");
218
+
219
+ -- CreateIndex
220
+ CREATE UNIQUE INDEX "Transaction_funding_id_key" ON "Transaction"("funding_id");
221
+
222
+ -- CreateIndex
223
+ CREATE UNIQUE INDEX "Transaction_withdrawal_id_key" ON "Transaction"("withdrawal_id");
224
+
225
+ -- CreateIndex
226
+ CREATE UNIQUE INDEX "Transaction_reversal_id_key" ON "Transaction"("reversal_id");
227
+
228
+ -- CreateIndex
229
+ CREATE UNIQUE INDEX "Transaction_transfer_id_key" ON "Transaction"("transfer_id");
230
+
231
+ -- CreateIndex
232
+ CREATE UNIQUE INDEX "Transfer_transaction_id_key" ON "Transfer"("transaction_id");
233
+
234
+ -- CreateIndex
235
+ CREATE UNIQUE INDEX "Transfer_destination_account_details_id_key" ON "Transfer"("destination_account_details_id");
236
+
237
+ -- CreateIndex
238
+ CREATE UNIQUE INDEX "Transfer_source_currency_id_key" ON "Transfer"("source_currency_id");
239
+
240
+ -- CreateIndex
241
+ CREATE UNIQUE INDEX "Transfer_destination_currency_id_key" ON "Transfer"("destination_currency_id");
242
+
243
+ -- CreateIndex
244
+ CREATE UNIQUE INDEX "Withdrawal_transaction_id_key" ON "Withdrawal"("transaction_id");
245
+
246
+ -- CreateIndex
247
+ CREATE UNIQUE INDEX "Withdrawal_destination_account_details_id_key" ON "Withdrawal"("destination_account_details_id");
248
+
249
+ -- CreateIndex
250
+ CREATE UNIQUE INDEX "Withdrawal_source_currency_id_key" ON "Withdrawal"("source_currency_id");
251
+
252
+ -- CreateIndex
253
+ CREATE UNIQUE INDEX "Withdrawal_destination_currency_id_key" ON "Withdrawal"("destination_currency_id");
254
+
255
+ -- CreateIndex
256
+ CREATE INDEX "_CurrencyToGlobalPaymentProvider_B_index" ON "_CurrencyToGlobalPaymentProvider"("B");
257
+
258
+ -- AddForeignKey
259
+ ALTER TABLE "PaymentAccount" ADD CONSTRAINT "PaymentAccount_currency_id_fkey" FOREIGN KEY ("currency_id") REFERENCES "Currency"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
260
+
261
+ -- AddForeignKey
262
+ ALTER TABLE "Funding" ADD CONSTRAINT "Funding_sender_account_information_id_fkey" FOREIGN KEY ("sender_account_information_id") REFERENCES "SenderAccountInformation"("id") ON DELETE SET NULL ON UPDATE CASCADE;
263
+
264
+ -- AddForeignKey
265
+ ALTER TABLE "ManagedWallet" ADD CONSTRAINT "ManagedWallet_account_id_fkey" FOREIGN KEY ("account_id") REFERENCES "PaymentAccount"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
266
+
267
+ -- AddForeignKey
268
+ ALTER TABLE "Transaction" ADD CONSTRAINT "Transaction_provider_id_fkey" FOREIGN KEY ("provider_id") REFERENCES "GlobalPaymentProvider"("id") ON DELETE SET NULL ON UPDATE CASCADE;
269
+
270
+ -- AddForeignKey
271
+ ALTER TABLE "Transaction" ADD CONSTRAINT "Transaction_account_id_fkey" FOREIGN KEY ("account_id") REFERENCES "PaymentAccount"("id") ON DELETE RESTRICT ON UPDATE CASCADE;
272
+
273
+ -- AddForeignKey
274
+ ALTER TABLE "Transaction" ADD CONSTRAINT "Transaction_transfer_id_fkey" FOREIGN KEY ("transfer_id") REFERENCES "Transfer"("id") ON DELETE SET NULL ON UPDATE CASCADE;
275
+
276
+ -- AddForeignKey
277
+ ALTER TABLE "Transaction" ADD CONSTRAINT "Transaction_funding_id_fkey" FOREIGN KEY ("funding_id") REFERENCES "Funding"("id") ON DELETE SET NULL ON UPDATE CASCADE;
278
+
279
+ -- AddForeignKey
280
+ ALTER TABLE "Transaction" ADD CONSTRAINT "Transaction_withdrawal_id_fkey" FOREIGN KEY ("withdrawal_id") REFERENCES "Withdrawal"("id") ON DELETE SET NULL ON UPDATE CASCADE;
281
+
282
+ -- AddForeignKey
283
+ ALTER TABLE "Transaction" ADD CONSTRAINT "Transaction_reversal_id_fkey" FOREIGN KEY ("reversal_id") REFERENCES "Reversal"("id") ON DELETE SET NULL ON UPDATE CASCADE;
284
+
285
+ -- AddForeignKey
286
+ ALTER TABLE "Transfer" ADD CONSTRAINT "Transfer_destination_account_details_id_fkey" FOREIGN KEY ("destination_account_details_id") REFERENCES "TransferDestinationAccountDetails"("id") ON DELETE SET NULL ON UPDATE CASCADE;
287
+
288
+ -- AddForeignKey
289
+ ALTER TABLE "Withdrawal" ADD CONSTRAINT "Withdrawal_destination_account_details_id_fkey" FOREIGN KEY ("destination_account_details_id") REFERENCES "WithdrawalDestinationAccountDetails"("id") ON DELETE SET NULL ON UPDATE CASCADE;
290
+
291
+ -- AddForeignKey
292
+ ALTER TABLE "_CurrencyToGlobalPaymentProvider" ADD CONSTRAINT "_CurrencyToGlobalPaymentProvider_A_fkey" FOREIGN KEY ("A") REFERENCES "Currency"("id") ON DELETE CASCADE ON UPDATE CASCADE;
293
+
294
+ -- AddForeignKey
295
+ ALTER TABLE "_CurrencyToGlobalPaymentProvider" ADD CONSTRAINT "_CurrencyToGlobalPaymentProvider_B_fkey" FOREIGN KEY ("B") REFERENCES "GlobalPaymentProvider"("id") ON DELETE CASCADE ON UPDATE CASCADE;
@@ -0,0 +1,3 @@
1
+ # Please do not edit this file manually
2
+ # It should be added in your version-control system (e.g., Git)
3
+ provider = "postgresql"