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