suparisma 1.2.2 → 1.2.6
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/README.md +51 -2
- package/dist/generators/coreGenerator.js +200 -15
- package/dist/generators/hookGenerator.js +20 -2
- package/dist/generators/typeGenerator.js +55 -5
- package/dist/index.js +6 -1
- package/package.json +1 -1
- package/tmp/generated-test/hooks/useSuparismaAsset.ts +94 -0
- package/tmp/generated-test/hooks/useSuparismaChapter.ts +96 -0
- package/tmp/generated-test/hooks/useSuparismaCourse.ts +96 -0
- package/tmp/generated-test/hooks/useSuparismaDeviceSession.ts +94 -0
- package/tmp/generated-test/hooks/useSuparismaEnrollment.ts +92 -0
- package/tmp/generated-test/hooks/useSuparismaLesson.ts +96 -0
- package/tmp/generated-test/hooks/useSuparismaLessonPurchase.ts +92 -0
- package/tmp/generated-test/hooks/useSuparismaLessonQuestion.ts +96 -0
- package/tmp/generated-test/hooks/useSuparismaPayoutMethod.ts +96 -0
- package/tmp/generated-test/hooks/useSuparismaPayoutRequest.ts +96 -0
- package/tmp/generated-test/hooks/useSuparismaQuestionOption.ts +92 -0
- package/tmp/generated-test/hooks/useSuparismaSavedPaymentMethod.ts +96 -0
- package/tmp/generated-test/hooks/useSuparismaTeacherPayoutInfo.ts +96 -0
- package/tmp/generated-test/hooks/useSuparismaThing.ts +96 -0
- package/tmp/generated-test/hooks/useSuparismaUser.ts +96 -0
- package/tmp/generated-test/hooks/useSuparismaVideoNote.ts +96 -0
- package/tmp/generated-test/hooks/useSuparismaWallet.ts +96 -0
- package/tmp/generated-test/hooks/useSuparismaWalletTransaction.ts +96 -0
- package/tmp/generated-test/hooks/useSuparismaWatchProgress.ts +96 -0
- package/tmp/generated-test/index.ts +140 -0
- package/tmp/generated-test/types/AssetTypes.ts +485 -0
- package/tmp/generated-test/types/ChapterTypes.ts +488 -0
- package/tmp/generated-test/types/CourseTypes.ts +519 -0
- package/tmp/generated-test/types/DeviceSessionTypes.ts +489 -0
- package/tmp/generated-test/types/EnrollmentTypes.ts +495 -0
- package/tmp/generated-test/types/LessonPurchaseTypes.ts +490 -0
- package/tmp/generated-test/types/LessonQuestionTypes.ts +496 -0
- package/tmp/generated-test/types/LessonTypes.ts +517 -0
- package/tmp/generated-test/types/PayoutMethodTypes.ts +517 -0
- package/tmp/generated-test/types/PayoutRequestTypes.ts +528 -0
- package/tmp/generated-test/types/QuestionOptionTypes.ts +479 -0
- package/tmp/generated-test/types/SavedPaymentMethodTypes.ts +497 -0
- package/tmp/generated-test/types/TeacherPayoutInfoTypes.ts +480 -0
- package/tmp/generated-test/types/ThingTypes.ts +482 -0
- package/tmp/generated-test/types/UserTypes.ts +487 -0
- package/tmp/generated-test/types/VideoNoteTypes.ts +489 -0
- package/tmp/generated-test/types/WalletTransactionTypes.ts +505 -0
- package/tmp/generated-test/types/WalletTypes.ts +480 -0
- package/tmp/generated-test/types/WatchProgressTypes.ts +493 -0
- package/tmp/generated-test/utils/core.ts +2306 -0
- package/tmp/generated-test/utils/supabase-client.ts +17 -0
- package/tmp/generated-test2/hooks/useSuparismaAsset.ts +94 -0
- package/tmp/generated-test2/hooks/useSuparismaChapter.ts +96 -0
- package/tmp/generated-test2/hooks/useSuparismaCourse.ts +96 -0
- package/tmp/generated-test2/hooks/useSuparismaDeviceSession.ts +94 -0
- package/tmp/generated-test2/hooks/useSuparismaEnrollment.ts +92 -0
- package/tmp/generated-test2/hooks/useSuparismaLesson.ts +96 -0
- package/tmp/generated-test2/hooks/useSuparismaLessonPurchase.ts +92 -0
- package/tmp/generated-test2/hooks/useSuparismaLessonQuestion.ts +96 -0
- package/tmp/generated-test2/hooks/useSuparismaPayoutMethod.ts +96 -0
- package/tmp/generated-test2/hooks/useSuparismaPayoutRequest.ts +96 -0
- package/tmp/generated-test2/hooks/useSuparismaQuestionOption.ts +92 -0
- package/tmp/generated-test2/hooks/useSuparismaSavedPaymentMethod.ts +96 -0
- package/tmp/generated-test2/hooks/useSuparismaTeacherPayoutInfo.ts +96 -0
- package/tmp/generated-test2/hooks/useSuparismaThing.ts +96 -0
- package/tmp/generated-test2/hooks/useSuparismaUser.ts +96 -0
- package/tmp/generated-test2/hooks/useSuparismaVideoNote.ts +96 -0
- package/tmp/generated-test2/hooks/useSuparismaWallet.ts +96 -0
- package/tmp/generated-test2/hooks/useSuparismaWalletTransaction.ts +96 -0
- package/tmp/generated-test2/hooks/useSuparismaWatchProgress.ts +96 -0
- package/tmp/generated-test2/index.ts +140 -0
- package/tmp/generated-test2/types/AssetTypes.ts +485 -0
- package/tmp/generated-test2/types/ChapterTypes.ts +488 -0
- package/tmp/generated-test2/types/CourseTypes.ts +522 -0
- package/tmp/generated-test2/types/DeviceSessionTypes.ts +489 -0
- package/tmp/generated-test2/types/EnrollmentTypes.ts +495 -0
- package/tmp/generated-test2/types/LessonPurchaseTypes.ts +490 -0
- package/tmp/generated-test2/types/LessonQuestionTypes.ts +496 -0
- package/tmp/generated-test2/types/LessonTypes.ts +517 -0
- package/tmp/generated-test2/types/PayoutMethodTypes.ts +517 -0
- package/tmp/generated-test2/types/PayoutRequestTypes.ts +528 -0
- package/tmp/generated-test2/types/QuestionOptionTypes.ts +479 -0
- package/tmp/generated-test2/types/SavedPaymentMethodTypes.ts +497 -0
- package/tmp/generated-test2/types/TeacherPayoutInfoTypes.ts +480 -0
- package/tmp/generated-test2/types/ThingTypes.ts +482 -0
- package/tmp/generated-test2/types/UserTypes.ts +490 -0
- package/tmp/generated-test2/types/VideoNoteTypes.ts +489 -0
- package/tmp/generated-test2/types/WalletTransactionTypes.ts +505 -0
- package/tmp/generated-test2/types/WalletTypes.ts +480 -0
- package/tmp/generated-test2/types/WatchProgressTypes.ts +493 -0
- package/tmp/generated-test2/utils/core.ts +2306 -0
- package/tmp/generated-test2/utils/supabase-client.ts +17 -0
- package/tmp/generated-test3/hooks/useSuparismaAsset.ts +94 -0
- package/tmp/generated-test3/hooks/useSuparismaChapter.ts +98 -0
- package/tmp/generated-test3/hooks/useSuparismaCourse.ts +98 -0
- package/tmp/generated-test3/hooks/useSuparismaDeviceSession.ts +94 -0
- package/tmp/generated-test3/hooks/useSuparismaEnrollment.ts +94 -0
- package/tmp/generated-test3/hooks/useSuparismaLesson.ts +98 -0
- package/tmp/generated-test3/hooks/useSuparismaLessonPurchase.ts +94 -0
- package/tmp/generated-test3/hooks/useSuparismaLessonQuestion.ts +98 -0
- package/tmp/generated-test3/hooks/useSuparismaPayoutMethod.ts +96 -0
- package/tmp/generated-test3/hooks/useSuparismaPayoutRequest.ts +96 -0
- package/tmp/generated-test3/hooks/useSuparismaQuestionOption.ts +94 -0
- package/tmp/generated-test3/hooks/useSuparismaSavedPaymentMethod.ts +96 -0
- package/tmp/generated-test3/hooks/useSuparismaTeacherPayoutInfo.ts +98 -0
- package/tmp/generated-test3/hooks/useSuparismaThing.ts +96 -0
- package/tmp/generated-test3/hooks/useSuparismaUser.ts +98 -0
- package/tmp/generated-test3/hooks/useSuparismaVideoNote.ts +98 -0
- package/tmp/generated-test3/hooks/useSuparismaWallet.ts +98 -0
- package/tmp/generated-test3/hooks/useSuparismaWalletTransaction.ts +98 -0
- package/tmp/generated-test3/hooks/useSuparismaWatchProgress.ts +98 -0
- package/tmp/generated-test3/index.ts +140 -0
- package/tmp/generated-test3/types/AssetTypes.ts +485 -0
- package/tmp/generated-test3/types/ChapterTypes.ts +488 -0
- package/tmp/generated-test3/types/CourseTypes.ts +522 -0
- package/tmp/generated-test3/types/DeviceSessionTypes.ts +489 -0
- package/tmp/generated-test3/types/EnrollmentTypes.ts +495 -0
- package/tmp/generated-test3/types/LessonPurchaseTypes.ts +490 -0
- package/tmp/generated-test3/types/LessonQuestionTypes.ts +496 -0
- package/tmp/generated-test3/types/LessonTypes.ts +517 -0
- package/tmp/generated-test3/types/PayoutMethodTypes.ts +517 -0
- package/tmp/generated-test3/types/PayoutRequestTypes.ts +528 -0
- package/tmp/generated-test3/types/QuestionOptionTypes.ts +479 -0
- package/tmp/generated-test3/types/SavedPaymentMethodTypes.ts +497 -0
- package/tmp/generated-test3/types/TeacherPayoutInfoTypes.ts +480 -0
- package/tmp/generated-test3/types/ThingTypes.ts +482 -0
- package/tmp/generated-test3/types/UserTypes.ts +490 -0
- package/tmp/generated-test3/types/VideoNoteTypes.ts +489 -0
- package/tmp/generated-test3/types/WalletTransactionTypes.ts +505 -0
- package/tmp/generated-test3/types/WalletTypes.ts +480 -0
- package/tmp/generated-test3/types/WatchProgressTypes.ts +493 -0
- package/tmp/generated-test3/utils/core.ts +2316 -0
- package/tmp/generated-test3/utils/supabase-client.ts +17 -0
- package/tmp/prisma-test-schema-2.prisma +339 -0
- package/tmp/prisma-test-schema.prisma +317 -0
|
@@ -0,0 +1,505 @@
|
|
|
1
|
+
// THIS FILE IS AUTO-GENERATED - DO NOT EDIT DIRECTLY
|
|
2
|
+
// Edit the generator script instead
|
|
3
|
+
|
|
4
|
+
import type { WalletTransaction } from '@prisma/client';
|
|
5
|
+
import type { ModelResult, SuparismaOptions, SearchQuery, SearchState, FilterOperators, IncludeValue } from '../utils/core';
|
|
6
|
+
import type { WalletWithRelations, WalletSelectInput } from './WalletTypes';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Extended WalletTransaction type that includes relation fields.
|
|
10
|
+
* This represents the complete shape of WalletTransaction records returned from the database.
|
|
11
|
+
*/
|
|
12
|
+
export interface WalletTransactionWithRelations {
|
|
13
|
+
id: string;
|
|
14
|
+
walletId: string;
|
|
15
|
+
amount: number;
|
|
16
|
+
type: string;
|
|
17
|
+
status: string;
|
|
18
|
+
paymobOrderId?: string;
|
|
19
|
+
paymobTxnId?: string;
|
|
20
|
+
paymentMethod?: string;
|
|
21
|
+
description?: string;
|
|
22
|
+
metadata?: string;
|
|
23
|
+
createdAt: Date;
|
|
24
|
+
updatedAt: Date;
|
|
25
|
+
wallet?: WalletWithRelations;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Input type for creating a new WalletTransaction record.
|
|
30
|
+
* Fields with default values are optional and will be filled automatically if not provided.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* // Create a minimal wallettransaction
|
|
34
|
+
* wallettransaction.create({
|
|
35
|
+
* // Required fields only
|
|
36
|
+
* walletId: string,
|
|
37
|
+
* amount: number,
|
|
38
|
+
* });
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* // Create with optional fields
|
|
42
|
+
* wallettransaction.create({
|
|
43
|
+
* // All fields including optional ones
|
|
44
|
+
* id?: string,
|
|
45
|
+
* walletId: string,
|
|
46
|
+
* amount: number,
|
|
47
|
+
* });
|
|
48
|
+
*/
|
|
49
|
+
export interface WalletTransactionCreateInput {
|
|
50
|
+
id?: string;
|
|
51
|
+
walletId: string;
|
|
52
|
+
amount: number;
|
|
53
|
+
type: string;
|
|
54
|
+
status?: string;
|
|
55
|
+
paymobOrderId?: string;
|
|
56
|
+
paymobTxnId?: string;
|
|
57
|
+
paymentMethod?: string;
|
|
58
|
+
description?: string;
|
|
59
|
+
metadata?: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Input type for updating an existing WalletTransaction record.
|
|
64
|
+
* All fields are optional since you only need to specify the fields you want to change.
|
|
65
|
+
*
|
|
66
|
+
* @example
|
|
67
|
+
* // Update a wallettransaction's fields
|
|
68
|
+
* wallettransaction.update({
|
|
69
|
+
* where: { id: "123" },
|
|
70
|
+
* data: {
|
|
71
|
+
* id?: string,
|
|
72
|
+
* walletId: string,
|
|
73
|
+
* }
|
|
74
|
+
* });
|
|
75
|
+
*/
|
|
76
|
+
export type WalletTransactionUpdateInput = Partial<WalletTransactionCreateInput>;
|
|
77
|
+
|
|
78
|
+
/**
|
|
79
|
+
* Filter type for querying WalletTransaction records.
|
|
80
|
+
* You can filter by any field in the model using equality or advanced filter operators.
|
|
81
|
+
* Supports OR and AND logical operations for complex queries.
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* // Basic filtering
|
|
85
|
+
* wallettransaction.findMany({
|
|
86
|
+
* where: {
|
|
87
|
+
* id: "value",
|
|
88
|
+
* walletId: "value"
|
|
89
|
+
* }
|
|
90
|
+
* });
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* // Advanced filtering
|
|
94
|
+
* wallettransaction.findMany({
|
|
95
|
+
* where: {
|
|
96
|
+
* // Use advanced operators
|
|
97
|
+
* id: { contains: "partial" }
|
|
98
|
+
* }
|
|
99
|
+
* });
|
|
100
|
+
*
|
|
101
|
+
* @example
|
|
102
|
+
* // OR conditions - match ANY condition
|
|
103
|
+
* wallettransaction.findMany({
|
|
104
|
+
* where: {
|
|
105
|
+
* OR: [
|
|
106
|
+
* { id: "value1" },
|
|
107
|
+
* { walletId: { contains: "value2" } }
|
|
108
|
+
* ]
|
|
109
|
+
* }
|
|
110
|
+
* });
|
|
111
|
+
*
|
|
112
|
+
* @example
|
|
113
|
+
* // AND conditions - match ALL conditions
|
|
114
|
+
* wallettransaction.findMany({
|
|
115
|
+
* where: {
|
|
116
|
+
* AND: [
|
|
117
|
+
* { id: "value1" },
|
|
118
|
+
* { walletId: { gt: 100 } }
|
|
119
|
+
* ]
|
|
120
|
+
* }
|
|
121
|
+
* });
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* // Complex nested logic
|
|
125
|
+
* wallettransaction.findMany({
|
|
126
|
+
* where: {
|
|
127
|
+
* active: true, // Regular condition (implicit AND)
|
|
128
|
+
* OR: [
|
|
129
|
+
* { role: "admin" },
|
|
130
|
+
* { role: "moderator" }
|
|
131
|
+
* ]
|
|
132
|
+
* }
|
|
133
|
+
* });
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* // Array filtering (for array fields)
|
|
137
|
+
* wallettransaction.findMany({
|
|
138
|
+
* where: {
|
|
139
|
+
* // Array contains specific items
|
|
140
|
+
|
|
141
|
+
* }
|
|
142
|
+
* });
|
|
143
|
+
*/
|
|
144
|
+
export type WalletTransactionWhereInput = {
|
|
145
|
+
id?: string | FilterOperators<string>;
|
|
146
|
+
walletId?: string | FilterOperators<string>;
|
|
147
|
+
amount?: number | FilterOperators<number>;
|
|
148
|
+
type?: string | FilterOperators<string>;
|
|
149
|
+
status?: string | FilterOperators<string>;
|
|
150
|
+
paymobOrderId?: string | FilterOperators<string>;
|
|
151
|
+
paymobTxnId?: string | FilterOperators<string>;
|
|
152
|
+
paymentMethod?: string | FilterOperators<string>;
|
|
153
|
+
description?: string | FilterOperators<string>;
|
|
154
|
+
metadata?: string | FilterOperators<string>;
|
|
155
|
+
createdAt?: Date | FilterOperators<Date>;
|
|
156
|
+
updatedAt?: Date | FilterOperators<Date>;
|
|
157
|
+
} & {
|
|
158
|
+
/** Match ANY of the provided conditions */
|
|
159
|
+
OR?: WalletTransactionWhereInput[];
|
|
160
|
+
/** Match ALL of the provided conditions */
|
|
161
|
+
AND?: WalletTransactionWhereInput[];
|
|
162
|
+
};
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Unique identifier for finding a specific WalletTransaction record.
|
|
166
|
+
* Usually uses the ID field but can be any field marked as @unique in the schema.
|
|
167
|
+
*
|
|
168
|
+
* @example
|
|
169
|
+
* // Find by ID
|
|
170
|
+
* wallettransaction.findUnique({ id: "123" });
|
|
171
|
+
*
|
|
172
|
+
* @example
|
|
173
|
+
* // Delete by ID
|
|
174
|
+
* wallettransaction.delete({ id: "123" });
|
|
175
|
+
*/
|
|
176
|
+
export type WalletTransactionWhereUniqueInput = {
|
|
177
|
+
id: string;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Sort options for WalletTransaction queries.
|
|
182
|
+
* Specify the field to sort by and the direction ('asc' or 'desc').
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* // Sort by creation date, newest first
|
|
186
|
+
* wallettransaction.findMany({
|
|
187
|
+
* orderBy: { created_at: 'desc' }
|
|
188
|
+
* });
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* // Sort alphabetically
|
|
192
|
+
* wallettransaction.findMany({
|
|
193
|
+
* orderBy: { name: 'asc' }
|
|
194
|
+
* });
|
|
195
|
+
*/
|
|
196
|
+
export type WalletTransactionOrderByInput = {
|
|
197
|
+
[key in keyof WalletTransactionSelectInput]?: 'asc' | 'desc';
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* Select specific scalar fields to return from WalletTransaction queries.
|
|
202
|
+
* Relation fields are intentionally excluded; use `include` for relations.
|
|
203
|
+
*/
|
|
204
|
+
export type WalletTransactionSelectInput = {
|
|
205
|
+
id?: boolean;
|
|
206
|
+
walletId?: boolean;
|
|
207
|
+
amount?: boolean;
|
|
208
|
+
type?: boolean;
|
|
209
|
+
status?: boolean;
|
|
210
|
+
paymobOrderId?: boolean;
|
|
211
|
+
paymobTxnId?: boolean;
|
|
212
|
+
paymentMethod?: boolean;
|
|
213
|
+
description?: boolean;
|
|
214
|
+
metadata?: boolean;
|
|
215
|
+
createdAt?: boolean;
|
|
216
|
+
updatedAt?: boolean;
|
|
217
|
+
};
|
|
218
|
+
|
|
219
|
+
/**
|
|
220
|
+
* Include related records when querying WalletTransaction.
|
|
221
|
+
* Only real Prisma relation fields are allowed here.
|
|
222
|
+
*/
|
|
223
|
+
export type WalletTransactionIncludeInput = {
|
|
224
|
+
wallet?: IncludeValue | { select?: WalletSelectInput };
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Result type for operations that return a single WalletTransaction record.
|
|
229
|
+
*/
|
|
230
|
+
export type WalletTransactionSingleResult = ModelResult<WalletTransactionWithRelations>;
|
|
231
|
+
|
|
232
|
+
/**
|
|
233
|
+
* Result type for operations that return multiple WalletTransaction records.
|
|
234
|
+
*/
|
|
235
|
+
export type WalletTransactionManyResult = ModelResult<WalletTransactionWithRelations[]>;
|
|
236
|
+
|
|
237
|
+
/**
|
|
238
|
+
* Configuration options for the WalletTransaction hook.
|
|
239
|
+
* Includes where filters, ordering, pagination, and field selection.
|
|
240
|
+
*/
|
|
241
|
+
export type UseWalletTransactionOptions = SuparismaOptions<
|
|
242
|
+
WalletTransactionWhereInput,
|
|
243
|
+
WalletTransactionOrderByInput,
|
|
244
|
+
WalletTransactionSelectInput,
|
|
245
|
+
WalletTransactionIncludeInput
|
|
246
|
+
>;
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* The complete API for interacting with WalletTransaction records.
|
|
250
|
+
* This interface defines all available operations and state properties.
|
|
251
|
+
*/
|
|
252
|
+
export interface WalletTransactionHookApi {
|
|
253
|
+
/**
|
|
254
|
+
* Current array of WalletTransaction records.
|
|
255
|
+
* This is automatically updated when:
|
|
256
|
+
* - The initial data is loaded
|
|
257
|
+
* - Mutations are performed (create, update, delete)
|
|
258
|
+
* - Real-time updates are received from other clients
|
|
259
|
+
* - The refresh method is called
|
|
260
|
+
*
|
|
261
|
+
* @example
|
|
262
|
+
* // Render a list of wallettransaction records
|
|
263
|
+
* const { data } = wallettransaction;
|
|
264
|
+
* return (
|
|
265
|
+
* <ul>
|
|
266
|
+
* {data.map(item => (
|
|
267
|
+
* <li key={item.id}>{item.name}</li>
|
|
268
|
+
* ))}
|
|
269
|
+
* </ul>
|
|
270
|
+
* );
|
|
271
|
+
*/
|
|
272
|
+
data: WalletTransactionWithRelations[];
|
|
273
|
+
|
|
274
|
+
/**
|
|
275
|
+
* Error object if the last operation failed, null otherwise.
|
|
276
|
+
*
|
|
277
|
+
* @example
|
|
278
|
+
* // Handle potential errors
|
|
279
|
+
* const { error } = wallettransaction;
|
|
280
|
+
* if (error) {
|
|
281
|
+
* return <div>Error: {error.message}</div>;
|
|
282
|
+
* }
|
|
283
|
+
*/
|
|
284
|
+
error: Error | null;
|
|
285
|
+
|
|
286
|
+
/**
|
|
287
|
+
* Boolean indicating if an operation is in progress.
|
|
288
|
+
*
|
|
289
|
+
* @example
|
|
290
|
+
* // Show loading state
|
|
291
|
+
* const { loading } = wallettransaction;
|
|
292
|
+
* if (loading) {
|
|
293
|
+
* return <div>Loading...</div>;
|
|
294
|
+
* }
|
|
295
|
+
*/
|
|
296
|
+
loading: boolean;
|
|
297
|
+
|
|
298
|
+
/**
|
|
299
|
+
* The current count of records matching the filter criteria.
|
|
300
|
+
* This automatically updates with the data, including realtime updates.
|
|
301
|
+
* It always reflects the current length of the data array, respecting any filters.
|
|
302
|
+
*
|
|
303
|
+
* @example
|
|
304
|
+
* // Display the count in the UI
|
|
305
|
+
* const { count } = wallettransaction;
|
|
306
|
+
* return <div>Total records: {count}</div>;
|
|
307
|
+
*/
|
|
308
|
+
count: number;
|
|
309
|
+
|
|
310
|
+
|
|
311
|
+
|
|
312
|
+
/**
|
|
313
|
+
* Find a single WalletTransaction record by its unique identifier.
|
|
314
|
+
*
|
|
315
|
+
* @param where - The unique identifier to find the record by
|
|
316
|
+
* @returns A promise with the found record or error
|
|
317
|
+
*
|
|
318
|
+
* @example
|
|
319
|
+
* // Find wallettransaction by ID
|
|
320
|
+
* const result = await wallettransaction.findUnique({ id: "123" });
|
|
321
|
+
* if (result.data) {
|
|
322
|
+
* console.log("Found wallettransaction:", result.data);
|
|
323
|
+
* }
|
|
324
|
+
*/
|
|
325
|
+
findUnique: (where: WalletTransactionWhereUniqueInput) => WalletTransactionSingleResult;
|
|
326
|
+
|
|
327
|
+
/**
|
|
328
|
+
* Find multiple WalletTransaction records matching the filter criteria.
|
|
329
|
+
* Supports filtering, sorting, and pagination.
|
|
330
|
+
*
|
|
331
|
+
* @param params - Optional query parameters
|
|
332
|
+
* @returns A promise with the matching records or error
|
|
333
|
+
*
|
|
334
|
+
* @example
|
|
335
|
+
* // Get all wallettransaction records
|
|
336
|
+
* const result = await wallettransaction.findMany();
|
|
337
|
+
*
|
|
338
|
+
* @example
|
|
339
|
+
* // Filter and sort records
|
|
340
|
+
* const result = await wallettransaction.findMany({
|
|
341
|
+
* where: { active: true },
|
|
342
|
+
* orderBy: { created_at: 'desc' },
|
|
343
|
+
* take: 10,
|
|
344
|
+
* skip: 0
|
|
345
|
+
* });
|
|
346
|
+
*/
|
|
347
|
+
findMany: (params?: {
|
|
348
|
+
where?: WalletTransactionWhereInput;
|
|
349
|
+
orderBy?: WalletTransactionOrderByInput;
|
|
350
|
+
take?: number;
|
|
351
|
+
skip?: number;
|
|
352
|
+
}) => WalletTransactionManyResult;
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Find the first WalletTransaction record matching the filter criteria.
|
|
356
|
+
*
|
|
357
|
+
* @param params - Optional query parameters
|
|
358
|
+
* @returns A promise with the first matching record or error
|
|
359
|
+
*
|
|
360
|
+
* @example
|
|
361
|
+
* // Find the first active wallettransaction
|
|
362
|
+
* const result = await wallettransaction.findFirst({
|
|
363
|
+
* where: { active: true }
|
|
364
|
+
* });
|
|
365
|
+
*
|
|
366
|
+
* @example
|
|
367
|
+
* // Find the oldest wallettransaction
|
|
368
|
+
* const result = await wallettransaction.findFirst({
|
|
369
|
+
* orderBy: { created_at: 'asc' }
|
|
370
|
+
* });
|
|
371
|
+
*/
|
|
372
|
+
findFirst: (params?: {
|
|
373
|
+
where?: WalletTransactionWhereInput;
|
|
374
|
+
orderBy?: WalletTransactionOrderByInput;
|
|
375
|
+
}) => WalletTransactionSingleResult;
|
|
376
|
+
|
|
377
|
+
/**
|
|
378
|
+
* Create a new WalletTransaction record.
|
|
379
|
+
* Fields with default values are optional and will use their defaults if not provided.
|
|
380
|
+
*
|
|
381
|
+
* @param data - The data for the new record
|
|
382
|
+
* @returns A promise with the created record or error
|
|
383
|
+
*
|
|
384
|
+
* @example
|
|
385
|
+
* // Create a new wallettransaction
|
|
386
|
+
* const result = await wallettransaction.create({
|
|
387
|
+
* walletId: "value",
|
|
388
|
+
* amount: 42
|
|
389
|
+
* });
|
|
390
|
+
*
|
|
391
|
+
* @example
|
|
392
|
+
* // Create with custom ID (overriding default)
|
|
393
|
+
* const result = await wallettransaction.create({
|
|
394
|
+
* id: "custom-id",
|
|
395
|
+
* walletId: "value"
|
|
396
|
+
* });
|
|
397
|
+
*/
|
|
398
|
+
create: (data: WalletTransactionCreateInput) => WalletTransactionSingleResult;
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* Update an existing WalletTransaction record.
|
|
402
|
+
*
|
|
403
|
+
* @param params - Object with the record identifier and fields to update
|
|
404
|
+
* @returns A promise with the updated record or error
|
|
405
|
+
*
|
|
406
|
+
* @example
|
|
407
|
+
* // Update a wallettransaction's fields
|
|
408
|
+
* const result = await wallettransaction.update({
|
|
409
|
+
* where: { id: "123" },
|
|
410
|
+
* data: {
|
|
411
|
+
* id?: "updated value",
|
|
412
|
+
* walletId: "updated value"
|
|
413
|
+
* }
|
|
414
|
+
* });
|
|
415
|
+
*/
|
|
416
|
+
update: (params: {
|
|
417
|
+
where: WalletTransactionWhereUniqueInput;
|
|
418
|
+
data: WalletTransactionUpdateInput;
|
|
419
|
+
}) => WalletTransactionSingleResult;
|
|
420
|
+
|
|
421
|
+
/**
|
|
422
|
+
* Delete a WalletTransaction record by its unique identifier.
|
|
423
|
+
*
|
|
424
|
+
* @param where - The unique identifier of the record to delete
|
|
425
|
+
* @returns A promise with the deleted record or error
|
|
426
|
+
*
|
|
427
|
+
* @example
|
|
428
|
+
* // Delete a wallettransaction by ID
|
|
429
|
+
* const result = await wallettransaction.delete({ id: "123" });
|
|
430
|
+
* if (result.data) {
|
|
431
|
+
* console.log("Deleted wallettransaction:", result.data);
|
|
432
|
+
* }
|
|
433
|
+
*/
|
|
434
|
+
delete: (where: WalletTransactionWhereUniqueInput) => WalletTransactionSingleResult;
|
|
435
|
+
|
|
436
|
+
/**
|
|
437
|
+
* Delete multiple WalletTransaction records matching the filter criteria.
|
|
438
|
+
*
|
|
439
|
+
* @param params - Optional filter parameters
|
|
440
|
+
* @returns A promise with the count of deleted records or error
|
|
441
|
+
*
|
|
442
|
+
* @example
|
|
443
|
+
* // Delete all inactive wallettransaction records
|
|
444
|
+
* const result = await wallettransaction.deleteMany({
|
|
445
|
+
* where: { active: false }
|
|
446
|
+
* });
|
|
447
|
+
* console.log(`Deleted ${result.count} records`);
|
|
448
|
+
*
|
|
449
|
+
* @example
|
|
450
|
+
* // Delete all wallettransaction records (use with caution!)
|
|
451
|
+
* const result = await wallettransaction.deleteMany();
|
|
452
|
+
*/
|
|
453
|
+
deleteMany: (params?: {
|
|
454
|
+
where?: WalletTransactionWhereInput;
|
|
455
|
+
}) => Promise<{ count: number; error: Error | null }>;
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Create a record if it doesn't exist, or update it if it does.
|
|
459
|
+
*
|
|
460
|
+
* @param params - Object with the identifier, update data, and create data
|
|
461
|
+
* @returns A promise with the created or updated record or error
|
|
462
|
+
*
|
|
463
|
+
* @example
|
|
464
|
+
* // Upsert a wallettransaction by ID
|
|
465
|
+
* const result = await wallettransaction.upsert({
|
|
466
|
+
* where: { id: "123" },
|
|
467
|
+
* update: { name: "Updated Name" },
|
|
468
|
+
* create: {
|
|
469
|
+
* id: "123",
|
|
470
|
+
* name: "New Name",
|
|
471
|
+
* walletId: "value"
|
|
472
|
+
* }
|
|
473
|
+
* });
|
|
474
|
+
*/
|
|
475
|
+
upsert: (params: {
|
|
476
|
+
where: WalletTransactionWhereUniqueInput;
|
|
477
|
+
update: WalletTransactionUpdateInput;
|
|
478
|
+
create: WalletTransactionCreateInput;
|
|
479
|
+
}) => WalletTransactionSingleResult;
|
|
480
|
+
|
|
481
|
+
/**
|
|
482
|
+
* Manually refresh the data with current filter settings.
|
|
483
|
+
* Useful after external operations or when realtime is disabled.
|
|
484
|
+
*
|
|
485
|
+
* @param params - Optional override parameters for this specific refresh
|
|
486
|
+
* @returns A promise with the refreshed data or error
|
|
487
|
+
*
|
|
488
|
+
* @example
|
|
489
|
+
* // Refresh with current filter settings
|
|
490
|
+
* await wallettransaction.refresh();
|
|
491
|
+
*
|
|
492
|
+
* @example
|
|
493
|
+
* // Refresh with different filters for this call only
|
|
494
|
+
* await wallettransaction.refresh({
|
|
495
|
+
* where: { active: true },
|
|
496
|
+
* orderBy: { name: 'asc' }
|
|
497
|
+
* });
|
|
498
|
+
*/
|
|
499
|
+
refresh: (params?: {
|
|
500
|
+
where?: WalletTransactionWhereInput;
|
|
501
|
+
orderBy?: WalletTransactionOrderByInput;
|
|
502
|
+
take?: number;
|
|
503
|
+
skip?: number;
|
|
504
|
+
}) => WalletTransactionManyResult;
|
|
505
|
+
}
|