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