@devlider001/washlab-backend 1.0.3 → 1.0.5
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/convex/_generated/api.d.ts +6 -0
- package/convex/admin.d.ts +129 -4
- package/convex/analytics.d.ts +87 -0
- package/convex/attendants.d.ts +40 -0
- package/convex/audit.d.ts +39 -0
- package/convex/customers.d.ts +69 -1
- package/convex/lib/auth.d.ts +4 -0
- package/convex/loyalty.d.ts +1 -1
- package/convex/notifications.d.ts +170 -0
- package/convex/orders.d.ts +80 -4
- package/convex/payments.d.ts +47 -2
- package/convex/resources.d.ts +31 -0
- package/convex/schema.d.ts +141 -9
- package/convex/vouchers.d.ts +187 -0
- package/dist/convex/admin.d.ts +377 -0
- package/dist/convex/admin.d.ts.map +1 -0
- package/dist/convex/admin.js +959 -0
- package/dist/convex/admin.js.map +1 -0
- package/dist/convex/analytics.d.ts +87 -0
- package/dist/convex/analytics.d.ts.map +1 -0
- package/dist/convex/analytics.js +361 -0
- package/dist/convex/analytics.js.map +1 -0
- package/dist/convex/attendants.d.ts +140 -0
- package/dist/convex/attendants.d.ts.map +1 -0
- package/dist/convex/attendants.js +337 -0
- package/dist/convex/attendants.js.map +1 -0
- package/dist/convex/audit.d.ts +158 -0
- package/dist/convex/audit.d.ts.map +1 -0
- package/dist/convex/audit.js +184 -0
- package/dist/convex/audit.js.map +1 -0
- package/dist/convex/clerk.d.ts +53 -0
- package/dist/convex/clerk.d.ts.map +1 -0
- package/dist/convex/clerk.js +316 -0
- package/dist/convex/clerk.js.map +1 -0
- package/dist/convex/customers.d.ts +224 -0
- package/dist/convex/customers.d.ts.map +1 -0
- package/dist/convex/customers.js +504 -0
- package/dist/convex/customers.js.map +1 -0
- package/dist/convex/http.d.ts +3 -0
- package/dist/convex/http.d.ts.map +1 -0
- package/dist/convex/http.js +115 -0
- package/dist/convex/http.js.map +1 -0
- package/dist/convex/lib/audit.d.ts +36 -0
- package/dist/convex/lib/audit.d.ts.map +1 -0
- package/dist/convex/lib/audit.js +59 -0
- package/dist/convex/lib/audit.js.map +1 -0
- package/dist/convex/lib/auth.d.ts +96 -0
- package/dist/convex/lib/auth.d.ts.map +1 -0
- package/dist/convex/lib/auth.js +94 -0
- package/dist/convex/lib/auth.js.map +1 -0
- package/dist/convex/lib/utils.d.ts +38 -0
- package/dist/convex/lib/utils.d.ts.map +1 -0
- package/dist/convex/lib/utils.js +71 -0
- package/dist/convex/lib/utils.js.map +1 -0
- package/dist/convex/loyalty.d.ts +82 -0
- package/dist/convex/loyalty.d.ts.map +1 -0
- package/dist/convex/loyalty.js +286 -0
- package/dist/convex/loyalty.js.map +1 -0
- package/dist/convex/orders.d.ts +326 -0
- package/dist/convex/orders.d.ts.map +1 -0
- package/dist/convex/orders.js +570 -0
- package/dist/convex/orders.js.map +1 -0
- package/dist/convex/payments.d.ts +134 -0
- package/dist/convex/payments.d.ts.map +1 -0
- package/dist/convex/payments.js +360 -0
- package/dist/convex/payments.js.map +1 -0
- package/dist/convex/resources.d.ts +119 -0
- package/dist/convex/resources.d.ts.map +1 -0
- package/dist/convex/resources.js +283 -0
- package/dist/convex/resources.js.map +1 -0
- package/dist/convex/schema.d.ts +450 -0
- package/dist/convex/schema.d.ts.map +1 -0
- package/dist/convex/schema.js +347 -0
- package/dist/convex/schema.js.map +1 -0
- package/dist/convex/vouchers.d.ts +187 -0
- package/dist/convex/vouchers.d.ts.map +1 -0
- package/dist/convex/vouchers.js +464 -0
- package/dist/convex/vouchers.js.map +1 -0
- package/dist/src/index.d.ts +9 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +9 -0
- package/dist/src/index.js.map +1 -0
- package/package.json +4 -3
package/convex/schema.d.ts
CHANGED
|
@@ -8,12 +8,16 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
8
8
|
users: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
9
9
|
email?: string | undefined;
|
|
10
10
|
clerkUserId?: string | undefined;
|
|
11
|
+
statusNote?: string | undefined;
|
|
12
|
+
statusChangedBy?: import("convex/values").GenericId<"admins"> | undefined;
|
|
13
|
+
statusChangedAt?: number | undefined;
|
|
11
14
|
lastLoginAt?: number | undefined;
|
|
12
15
|
preferredBranchId?: import("convex/values").GenericId<"branches"> | undefined;
|
|
13
16
|
phoneNumber: string;
|
|
14
17
|
name: string;
|
|
15
18
|
isRegistered: boolean;
|
|
16
19
|
isVerified: boolean;
|
|
20
|
+
status: "active" | "blocked" | "suspended" | "restricted";
|
|
17
21
|
createdAt: number;
|
|
18
22
|
isDeleted: boolean;
|
|
19
23
|
}, {
|
|
@@ -23,14 +27,19 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
23
27
|
clerkUserId: import("convex/values").VString<string | undefined, "optional">;
|
|
24
28
|
isRegistered: import("convex/values").VBoolean<boolean, "required">;
|
|
25
29
|
isVerified: import("convex/values").VBoolean<boolean, "required">;
|
|
30
|
+
status: import("convex/values").VUnion<"active" | "blocked" | "suspended" | "restricted", [import("convex/values").VLiteral<"active", "required">, import("convex/values").VLiteral<"blocked", "required">, import("convex/values").VLiteral<"suspended", "required">, import("convex/values").VLiteral<"restricted", "required">], "required", never>;
|
|
31
|
+
statusNote: import("convex/values").VString<string | undefined, "optional">;
|
|
32
|
+
statusChangedBy: import("convex/values").VId<import("convex/values").GenericId<"admins"> | undefined, "optional">;
|
|
33
|
+
statusChangedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
26
34
|
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
27
35
|
lastLoginAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
28
36
|
preferredBranchId: import("convex/values").VId<import("convex/values").GenericId<"branches"> | undefined, "optional">;
|
|
29
37
|
isDeleted: import("convex/values").VBoolean<boolean, "required">;
|
|
30
|
-
}, "required", "phoneNumber" | "email" | "name" | "clerkUserId" | "isRegistered" | "isVerified" | "createdAt" | "lastLoginAt" | "preferredBranchId" | "isDeleted">, {
|
|
38
|
+
}, "required", "phoneNumber" | "email" | "name" | "clerkUserId" | "isRegistered" | "isVerified" | "status" | "statusNote" | "statusChangedBy" | "statusChangedAt" | "createdAt" | "lastLoginAt" | "preferredBranchId" | "isDeleted">, {
|
|
31
39
|
by_phone: ["phoneNumber", "_creationTime"];
|
|
32
40
|
by_email: ["email", "_creationTime"];
|
|
33
41
|
by_clerk_user: ["clerkUserId", "_creationTime"];
|
|
42
|
+
by_status: ["status", "_creationTime"];
|
|
34
43
|
}, {}, {}>;
|
|
35
44
|
attendants: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
36
45
|
lastLoginAt?: number | undefined;
|
|
@@ -87,6 +96,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
87
96
|
createdAt: number;
|
|
88
97
|
isDeleted: boolean;
|
|
89
98
|
isActive: boolean;
|
|
99
|
+
code: string;
|
|
90
100
|
address: string;
|
|
91
101
|
city: string;
|
|
92
102
|
country: string;
|
|
@@ -95,6 +105,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
95
105
|
createdBy: import("convex/values").GenericId<"admins">;
|
|
96
106
|
}, {
|
|
97
107
|
name: import("convex/values").VString<string, "required">;
|
|
108
|
+
code: import("convex/values").VString<string, "required">;
|
|
98
109
|
address: import("convex/values").VString<string, "required">;
|
|
99
110
|
city: import("convex/values").VString<string, "required">;
|
|
100
111
|
country: import("convex/values").VString<string, "required">;
|
|
@@ -106,9 +117,10 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
106
117
|
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
107
118
|
createdBy: import("convex/values").VId<import("convex/values").GenericId<"admins">, "required">;
|
|
108
119
|
isDeleted: import("convex/values").VBoolean<boolean, "required">;
|
|
109
|
-
}, "required", "phoneNumber" | "email" | "name" | "createdAt" | "isDeleted" | "isActive" | "address" | "city" | "country" | "pricingPerKg" | "deliveryFee" | "createdBy">, {
|
|
120
|
+
}, "required", "phoneNumber" | "email" | "name" | "createdAt" | "isDeleted" | "isActive" | "code" | "address" | "city" | "country" | "pricingPerKg" | "deliveryFee" | "createdBy">, {
|
|
110
121
|
by_city: ["city", "_creationTime"];
|
|
111
122
|
by_active: ["isActive", "_creationTime"];
|
|
123
|
+
by_code: ["code", "_creationTime"];
|
|
112
124
|
}, {}, {}>;
|
|
113
125
|
orders: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
114
126
|
createdBy?: import("convex/values").GenericId<"attendants"> | undefined;
|
|
@@ -117,6 +129,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
117
129
|
itemCount?: number | undefined;
|
|
118
130
|
estimatedLoads?: number | undefined;
|
|
119
131
|
whitesSeparate?: boolean | undefined;
|
|
132
|
+
bagCardNumber?: string | undefined;
|
|
120
133
|
notes?: string | undefined;
|
|
121
134
|
deliveryAddress?: string | undefined;
|
|
122
135
|
deliveryPhoneNumber?: string | undefined;
|
|
@@ -125,6 +138,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
125
138
|
paymentMethod?: "mobile_money" | "card" | "cash" | undefined;
|
|
126
139
|
paymentId?: import("convex/values").GenericId<"payments"> | undefined;
|
|
127
140
|
fulfilledBy?: import("convex/values").GenericId<"attendants"> | undefined;
|
|
141
|
+
status: "pending" | "in_progress" | "ready_for_pickup" | "delivered" | "completed" | "cancelled";
|
|
128
142
|
createdAt: number;
|
|
129
143
|
isDeleted: boolean;
|
|
130
144
|
branchId: import("convex/values").GenericId<"branches">;
|
|
@@ -138,7 +152,6 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
138
152
|
basePrice: number;
|
|
139
153
|
totalPrice: number;
|
|
140
154
|
finalPrice: number;
|
|
141
|
-
status: "pending" | "in_progress" | "ready_for_pickup" | "delivered" | "completed" | "cancelled";
|
|
142
155
|
paymentStatus: "pending" | "paid" | "failed" | "refunded";
|
|
143
156
|
updatedAt: number;
|
|
144
157
|
statusHistory: {
|
|
@@ -159,6 +172,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
159
172
|
itemCount: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
160
173
|
estimatedLoads: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
161
174
|
whitesSeparate: import("convex/values").VBoolean<boolean | undefined, "optional">;
|
|
175
|
+
bagCardNumber: import("convex/values").VString<string | undefined, "optional">;
|
|
162
176
|
notes: import("convex/values").VString<string | undefined, "optional">;
|
|
163
177
|
isDelivery: import("convex/values").VBoolean<boolean, "required">;
|
|
164
178
|
deliveryAddress: import("convex/values").VString<string | undefined, "optional">;
|
|
@@ -192,9 +206,9 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
192
206
|
changedAt: import("convex/values").VFloat64<number, "required">;
|
|
193
207
|
changedBy: import("convex/values").VId<import("convex/values").GenericId<"attendants">, "required">;
|
|
194
208
|
notes: import("convex/values").VString<string | undefined, "optional">;
|
|
195
|
-
}, "required", "
|
|
209
|
+
}, "required", "status" | "notes" | "changedAt" | "changedBy">, "required">;
|
|
196
210
|
isDeleted: import("convex/values").VBoolean<boolean, "required">;
|
|
197
|
-
}, "required", "createdAt" | "isDeleted" | "branchId" | "deliveryFee" | "createdBy" | "customerId" | "customerPhoneNumber" | "orderNumber" | "orderType" | "serviceType" | "estimatedWeight" | "actualWeight" | "itemCount" | "estimatedLoads" | "whitesSeparate" | "notes" | "isDelivery" | "deliveryAddress" | "deliveryPhoneNumber" | "deliveryHall" | "deliveryRoom" | "basePrice" | "totalPrice" | "finalPrice" | "
|
|
211
|
+
}, "required", "status" | "createdAt" | "isDeleted" | "branchId" | "deliveryFee" | "createdBy" | "customerId" | "customerPhoneNumber" | "orderNumber" | "orderType" | "serviceType" | "estimatedWeight" | "actualWeight" | "itemCount" | "estimatedLoads" | "whitesSeparate" | "bagCardNumber" | "notes" | "isDelivery" | "deliveryAddress" | "deliveryPhoneNumber" | "deliveryHall" | "deliveryRoom" | "basePrice" | "totalPrice" | "finalPrice" | "paymentStatus" | "paymentMethod" | "paymentId" | "updatedAt" | "fulfilledBy" | "statusHistory">, {
|
|
198
212
|
by_customer: ["customerId", "_creationTime"];
|
|
199
213
|
by_branch: ["branchId", "_creationTime"];
|
|
200
214
|
by_status: ["status", "_creationTime"];
|
|
@@ -208,10 +222,10 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
208
222
|
gatewayResponse?: string | undefined;
|
|
209
223
|
completedAt?: number | undefined;
|
|
210
224
|
processedBy?: import("convex/values").GenericId<"attendants"> | undefined;
|
|
225
|
+
status: "pending" | "completed" | "failed" | "refunded" | "processing";
|
|
211
226
|
createdAt: number;
|
|
212
227
|
isDeleted: boolean;
|
|
213
228
|
customerId: import("convex/values").GenericId<"users">;
|
|
214
|
-
status: "pending" | "completed" | "failed" | "refunded" | "processing";
|
|
215
229
|
paymentMethod: "mobile_money" | "card" | "cash";
|
|
216
230
|
orderId: import("convex/values").GenericId<"orders">;
|
|
217
231
|
amount: number;
|
|
@@ -229,7 +243,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
229
243
|
completedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
230
244
|
processedBy: import("convex/values").VId<import("convex/values").GenericId<"attendants"> | undefined, "optional">;
|
|
231
245
|
isDeleted: import("convex/values").VBoolean<boolean, "required">;
|
|
232
|
-
}, "required", "
|
|
246
|
+
}, "required", "status" | "createdAt" | "isDeleted" | "customerId" | "paymentMethod" | "orderId" | "amount" | "currency" | "gatewayTransactionId" | "gatewayResponse" | "completedAt" | "processedBy">, {
|
|
233
247
|
by_order: ["orderId", "_creationTime"];
|
|
234
248
|
by_customer: ["customerId", "_creationTime"];
|
|
235
249
|
by_status: ["status", "_creationTime"];
|
|
@@ -258,9 +272,9 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
258
272
|
createdBy?: import("convex/values").GenericId<"admins"> | undefined;
|
|
259
273
|
orderId?: import("convex/values").GenericId<"orders"> | undefined;
|
|
260
274
|
description?: string | undefined;
|
|
275
|
+
type: "earned" | "redeemed" | "expired" | "adjusted";
|
|
261
276
|
createdAt: number;
|
|
262
277
|
isDeleted: boolean;
|
|
263
|
-
type: "earned" | "redeemed" | "expired" | "adjusted";
|
|
264
278
|
customerId: import("convex/values").GenericId<"users">;
|
|
265
279
|
points: number;
|
|
266
280
|
balanceAfter: number;
|
|
@@ -274,7 +288,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
274
288
|
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
275
289
|
createdBy: import("convex/values").VId<import("convex/values").GenericId<"admins"> | undefined, "optional">;
|
|
276
290
|
isDeleted: import("convex/values").VBoolean<boolean, "required">;
|
|
277
|
-
}, "required", "
|
|
291
|
+
}, "required", "type" | "createdAt" | "isDeleted" | "createdBy" | "customerId" | "orderId" | "points" | "balanceAfter" | "description">, {
|
|
278
292
|
by_customer: ["customerId", "_creationTime"];
|
|
279
293
|
by_order: ["orderId", "_creationTime"];
|
|
280
294
|
by_created: ["createdAt", "_creationTime"];
|
|
@@ -364,6 +378,124 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
364
378
|
by_timestamp: ["timestamp", "_creationTime"];
|
|
365
379
|
by_branch: ["branchId", "_creationTime"];
|
|
366
380
|
}, {}, {}>;
|
|
381
|
+
vouchers: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
382
|
+
name?: string | undefined;
|
|
383
|
+
description?: string | undefined;
|
|
384
|
+
maxUsesPerCustomer?: number | undefined;
|
|
385
|
+
validFrom?: number | undefined;
|
|
386
|
+
validUntil?: number | undefined;
|
|
387
|
+
minOrderValue?: number | undefined;
|
|
388
|
+
applicableBranches?: import("convex/values").GenericId<"branches">[] | undefined;
|
|
389
|
+
applicableServiceTypes?: ("wash_only" | "wash_and_dry" | "dry_only")[] | undefined;
|
|
390
|
+
createdAt: number;
|
|
391
|
+
isDeleted: boolean;
|
|
392
|
+
isActive: boolean;
|
|
393
|
+
code: string;
|
|
394
|
+
createdBy: import("convex/values").GenericId<"admins">;
|
|
395
|
+
discountType: "percentage" | "fixed" | "free_wash";
|
|
396
|
+
discountValue: number;
|
|
397
|
+
usageLimit: number;
|
|
398
|
+
usedCount: number;
|
|
399
|
+
}, {
|
|
400
|
+
code: import("convex/values").VString<string, "required">;
|
|
401
|
+
name: import("convex/values").VString<string | undefined, "optional">;
|
|
402
|
+
discountType: import("convex/values").VUnion<"percentage" | "fixed" | "free_wash", [import("convex/values").VLiteral<"percentage", "required">, import("convex/values").VLiteral<"fixed", "required">, import("convex/values").VLiteral<"free_wash", "required">], "required", never>;
|
|
403
|
+
discountValue: import("convex/values").VFloat64<number, "required">;
|
|
404
|
+
usageLimit: import("convex/values").VFloat64<number, "required">;
|
|
405
|
+
usedCount: import("convex/values").VFloat64<number, "required">;
|
|
406
|
+
maxUsesPerCustomer: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
407
|
+
isActive: import("convex/values").VBoolean<boolean, "required">;
|
|
408
|
+
validFrom: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
409
|
+
validUntil: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
410
|
+
minOrderValue: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
411
|
+
applicableBranches: import("convex/values").VArray<import("convex/values").GenericId<"branches">[] | undefined, import("convex/values").VId<import("convex/values").GenericId<"branches">, "required">, "optional">;
|
|
412
|
+
applicableServiceTypes: import("convex/values").VArray<("wash_only" | "wash_and_dry" | "dry_only")[] | undefined, import("convex/values").VUnion<"wash_only" | "wash_and_dry" | "dry_only", [import("convex/values").VLiteral<"wash_only", "required">, import("convex/values").VLiteral<"wash_and_dry", "required">, import("convex/values").VLiteral<"dry_only", "required">], "required", never>, "optional">;
|
|
413
|
+
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
414
|
+
createdBy: import("convex/values").VId<import("convex/values").GenericId<"admins">, "required">;
|
|
415
|
+
description: import("convex/values").VString<string | undefined, "optional">;
|
|
416
|
+
isDeleted: import("convex/values").VBoolean<boolean, "required">;
|
|
417
|
+
}, "required", "name" | "createdAt" | "isDeleted" | "isActive" | "code" | "createdBy" | "description" | "discountType" | "discountValue" | "usageLimit" | "usedCount" | "maxUsesPerCustomer" | "validFrom" | "validUntil" | "minOrderValue" | "applicableBranches" | "applicableServiceTypes">, {
|
|
418
|
+
by_code: ["code", "_creationTime"];
|
|
419
|
+
by_active: ["isActive", "_creationTime"];
|
|
420
|
+
by_created: ["createdAt", "_creationTime"];
|
|
421
|
+
}, {}, {}>;
|
|
422
|
+
voucherUsages: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
423
|
+
usedBy?: import("convex/values").GenericId<"attendants"> | undefined;
|
|
424
|
+
isDeleted: boolean;
|
|
425
|
+
customerId: import("convex/values").GenericId<"users">;
|
|
426
|
+
orderId: import("convex/values").GenericId<"orders">;
|
|
427
|
+
voucherId: import("convex/values").GenericId<"vouchers">;
|
|
428
|
+
discountAmount: number;
|
|
429
|
+
orderTotalBefore: number;
|
|
430
|
+
orderTotalAfter: number;
|
|
431
|
+
usedAt: number;
|
|
432
|
+
}, {
|
|
433
|
+
voucherId: import("convex/values").VId<import("convex/values").GenericId<"vouchers">, "required">;
|
|
434
|
+
orderId: import("convex/values").VId<import("convex/values").GenericId<"orders">, "required">;
|
|
435
|
+
customerId: import("convex/values").VId<import("convex/values").GenericId<"users">, "required">;
|
|
436
|
+
discountAmount: import("convex/values").VFloat64<number, "required">;
|
|
437
|
+
orderTotalBefore: import("convex/values").VFloat64<number, "required">;
|
|
438
|
+
orderTotalAfter: import("convex/values").VFloat64<number, "required">;
|
|
439
|
+
usedAt: import("convex/values").VFloat64<number, "required">;
|
|
440
|
+
usedBy: import("convex/values").VId<import("convex/values").GenericId<"attendants"> | undefined, "optional">;
|
|
441
|
+
isDeleted: import("convex/values").VBoolean<boolean, "required">;
|
|
442
|
+
}, "required", "isDeleted" | "customerId" | "orderId" | "voucherId" | "discountAmount" | "orderTotalBefore" | "orderTotalAfter" | "usedAt" | "usedBy">, {
|
|
443
|
+
by_voucher: ["voucherId", "_creationTime"];
|
|
444
|
+
by_order: ["orderId", "_creationTime"];
|
|
445
|
+
by_customer: ["customerId", "_creationTime"];
|
|
446
|
+
by_used_at: ["usedAt", "_creationTime"];
|
|
447
|
+
}, {}, {}>;
|
|
448
|
+
notifications: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
449
|
+
branchId?: import("convex/values").GenericId<"branches"> | undefined;
|
|
450
|
+
entityType?: string | undefined;
|
|
451
|
+
entityId?: string | undefined;
|
|
452
|
+
actionUrl?: string | undefined;
|
|
453
|
+
actionLabel?: string | undefined;
|
|
454
|
+
readAt?: number | undefined;
|
|
455
|
+
senderId?: string | undefined;
|
|
456
|
+
senderType?: "admin" | "attendant" | "system" | undefined;
|
|
457
|
+
expiresAt?: number | undefined;
|
|
458
|
+
scheduledFor?: number | undefined;
|
|
459
|
+
sentAt?: number | undefined;
|
|
460
|
+
type: "info" | "success" | "warning" | "error" | "order" | "payment" | "system";
|
|
461
|
+
createdAt: number;
|
|
462
|
+
isDeleted: boolean;
|
|
463
|
+
recipientId: string;
|
|
464
|
+
recipientType: "admin" | "customer" | "attendant" | "all";
|
|
465
|
+
title: string;
|
|
466
|
+
message: string;
|
|
467
|
+
priority: "low" | "normal" | "high" | "urgent";
|
|
468
|
+
isRead: boolean;
|
|
469
|
+
}, {
|
|
470
|
+
recipientId: import("convex/values").VString<string, "required">;
|
|
471
|
+
recipientType: import("convex/values").VUnion<"admin" | "customer" | "attendant" | "all", [import("convex/values").VLiteral<"customer", "required">, import("convex/values").VLiteral<"attendant", "required">, import("convex/values").VLiteral<"admin", "required">, import("convex/values").VLiteral<"all", "required">], "required", never>;
|
|
472
|
+
title: import("convex/values").VString<string, "required">;
|
|
473
|
+
message: import("convex/values").VString<string, "required">;
|
|
474
|
+
type: import("convex/values").VUnion<"info" | "success" | "warning" | "error" | "order" | "payment" | "system", [import("convex/values").VLiteral<"info", "required">, import("convex/values").VLiteral<"success", "required">, import("convex/values").VLiteral<"warning", "required">, import("convex/values").VLiteral<"error", "required">, import("convex/values").VLiteral<"order", "required">, import("convex/values").VLiteral<"payment", "required">, import("convex/values").VLiteral<"system", "required">], "required", never>;
|
|
475
|
+
actionUrl: import("convex/values").VString<string | undefined, "optional">;
|
|
476
|
+
actionLabel: import("convex/values").VString<string | undefined, "optional">;
|
|
477
|
+
entityType: import("convex/values").VString<string | undefined, "optional">;
|
|
478
|
+
entityId: import("convex/values").VString<string | undefined, "optional">;
|
|
479
|
+
priority: import("convex/values").VUnion<"low" | "normal" | "high" | "urgent", [import("convex/values").VLiteral<"low", "required">, import("convex/values").VLiteral<"normal", "required">, import("convex/values").VLiteral<"high", "required">, import("convex/values").VLiteral<"urgent", "required">], "required", never>;
|
|
480
|
+
isRead: import("convex/values").VBoolean<boolean, "required">;
|
|
481
|
+
readAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
482
|
+
senderId: import("convex/values").VString<string | undefined, "optional">;
|
|
483
|
+
senderType: import("convex/values").VUnion<"admin" | "attendant" | "system" | undefined, [import("convex/values").VLiteral<"admin", "required">, import("convex/values").VLiteral<"attendant", "required">, import("convex/values").VLiteral<"system", "required">], "optional", never>;
|
|
484
|
+
branchId: import("convex/values").VId<import("convex/values").GenericId<"branches"> | undefined, "optional">;
|
|
485
|
+
expiresAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
486
|
+
scheduledFor: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
487
|
+
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
488
|
+
sentAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
489
|
+
isDeleted: import("convex/values").VBoolean<boolean, "required">;
|
|
490
|
+
}, "required", "type" | "createdAt" | "isDeleted" | "branchId" | "entityType" | "entityId" | "recipientId" | "recipientType" | "title" | "message" | "actionUrl" | "actionLabel" | "priority" | "isRead" | "readAt" | "senderId" | "senderType" | "expiresAt" | "scheduledFor" | "sentAt">, {
|
|
491
|
+
by_recipient: ["recipientId", "recipientType", "_creationTime"];
|
|
492
|
+
by_recipient_read: ["recipientId", "recipientType", "isRead", "_creationTime"];
|
|
493
|
+
by_type: ["type", "_creationTime"];
|
|
494
|
+
by_priority: ["priority", "_creationTime"];
|
|
495
|
+
by_created: ["createdAt", "_creationTime"];
|
|
496
|
+
by_branch: ["branchId", "_creationTime"];
|
|
497
|
+
by_entity: ["entityType", "entityId", "_creationTime"];
|
|
498
|
+
}, {}, {}>;
|
|
367
499
|
}, true>;
|
|
368
500
|
export default _default;
|
|
369
501
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Voucher Functions
|
|
3
|
+
*
|
|
4
|
+
* Handles discount vouchers and promo codes creation, validation, and application.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Get all vouchers (admin only)
|
|
8
|
+
*/
|
|
9
|
+
export declare const getAll: import("convex/server").RegisteredQuery<"public", {
|
|
10
|
+
includeInactive?: boolean | undefined;
|
|
11
|
+
cursor?: string | undefined;
|
|
12
|
+
numItems?: number | undefined;
|
|
13
|
+
}, Promise<{
|
|
14
|
+
page: {
|
|
15
|
+
_id: import("convex/values").GenericId<"vouchers">;
|
|
16
|
+
_creationTime: number;
|
|
17
|
+
name?: string | undefined;
|
|
18
|
+
description?: string | undefined;
|
|
19
|
+
maxUsesPerCustomer?: number | undefined;
|
|
20
|
+
validFrom?: number | undefined;
|
|
21
|
+
validUntil?: number | undefined;
|
|
22
|
+
minOrderValue?: number | undefined;
|
|
23
|
+
applicableBranches?: import("convex/values").GenericId<"branches">[] | undefined;
|
|
24
|
+
applicableServiceTypes?: ("wash_only" | "wash_and_dry" | "dry_only")[] | undefined;
|
|
25
|
+
createdAt: number;
|
|
26
|
+
isDeleted: boolean;
|
|
27
|
+
isActive: boolean;
|
|
28
|
+
code: string;
|
|
29
|
+
createdBy: import("convex/values").GenericId<"admins">;
|
|
30
|
+
discountType: "percentage" | "fixed" | "free_wash";
|
|
31
|
+
discountValue: number;
|
|
32
|
+
usageLimit: number;
|
|
33
|
+
usedCount: number;
|
|
34
|
+
}[];
|
|
35
|
+
isDone: boolean;
|
|
36
|
+
continueCursor: string;
|
|
37
|
+
}>>;
|
|
38
|
+
/**
|
|
39
|
+
* Get active vouchers (public - for customers/attendants)
|
|
40
|
+
*/
|
|
41
|
+
export declare const getActive: import("convex/server").RegisteredQuery<"public", {
|
|
42
|
+
branchId?: import("convex/values").GenericId<"branches"> | undefined;
|
|
43
|
+
}, Promise<{
|
|
44
|
+
_id: import("convex/values").GenericId<"vouchers">;
|
|
45
|
+
_creationTime: number;
|
|
46
|
+
name?: string | undefined;
|
|
47
|
+
description?: string | undefined;
|
|
48
|
+
maxUsesPerCustomer?: number | undefined;
|
|
49
|
+
validFrom?: number | undefined;
|
|
50
|
+
validUntil?: number | undefined;
|
|
51
|
+
minOrderValue?: number | undefined;
|
|
52
|
+
applicableBranches?: import("convex/values").GenericId<"branches">[] | undefined;
|
|
53
|
+
applicableServiceTypes?: ("wash_only" | "wash_and_dry" | "dry_only")[] | undefined;
|
|
54
|
+
createdAt: number;
|
|
55
|
+
isDeleted: boolean;
|
|
56
|
+
isActive: boolean;
|
|
57
|
+
code: string;
|
|
58
|
+
createdBy: import("convex/values").GenericId<"admins">;
|
|
59
|
+
discountType: "percentage" | "fixed" | "free_wash";
|
|
60
|
+
discountValue: number;
|
|
61
|
+
usageLimit: number;
|
|
62
|
+
usedCount: number;
|
|
63
|
+
}[]>>;
|
|
64
|
+
/**
|
|
65
|
+
* Get voucher by code
|
|
66
|
+
*/
|
|
67
|
+
export declare const getByCode: import("convex/server").RegisteredQuery<"public", {
|
|
68
|
+
code: string;
|
|
69
|
+
}, Promise<{
|
|
70
|
+
_id: import("convex/values").GenericId<"vouchers">;
|
|
71
|
+
_creationTime: number;
|
|
72
|
+
name?: string | undefined;
|
|
73
|
+
description?: string | undefined;
|
|
74
|
+
maxUsesPerCustomer?: number | undefined;
|
|
75
|
+
validFrom?: number | undefined;
|
|
76
|
+
validUntil?: number | undefined;
|
|
77
|
+
minOrderValue?: number | undefined;
|
|
78
|
+
applicableBranches?: import("convex/values").GenericId<"branches">[] | undefined;
|
|
79
|
+
applicableServiceTypes?: ("wash_only" | "wash_and_dry" | "dry_only")[] | undefined;
|
|
80
|
+
createdAt: number;
|
|
81
|
+
isDeleted: boolean;
|
|
82
|
+
isActive: boolean;
|
|
83
|
+
code: string;
|
|
84
|
+
createdBy: import("convex/values").GenericId<"admins">;
|
|
85
|
+
discountType: "percentage" | "fixed" | "free_wash";
|
|
86
|
+
discountValue: number;
|
|
87
|
+
usageLimit: number;
|
|
88
|
+
usedCount: number;
|
|
89
|
+
} | null>>;
|
|
90
|
+
/**
|
|
91
|
+
* Validate voucher for order
|
|
92
|
+
*/
|
|
93
|
+
export declare const validate: import("convex/server").RegisteredQuery<"public", {
|
|
94
|
+
serviceType?: "wash_only" | "wash_and_dry" | "dry_only" | undefined;
|
|
95
|
+
branchId: import("convex/values").GenericId<"branches">;
|
|
96
|
+
code: string;
|
|
97
|
+
orderTotal: number;
|
|
98
|
+
}, Promise<{
|
|
99
|
+
valid: boolean;
|
|
100
|
+
error: string;
|
|
101
|
+
voucher?: undefined;
|
|
102
|
+
discountAmount?: undefined;
|
|
103
|
+
finalPrice?: undefined;
|
|
104
|
+
} | {
|
|
105
|
+
valid: boolean;
|
|
106
|
+
voucher: {
|
|
107
|
+
_id: import("convex/values").GenericId<"vouchers">;
|
|
108
|
+
code: string;
|
|
109
|
+
name: string | undefined;
|
|
110
|
+
discountType: "percentage" | "fixed" | "free_wash";
|
|
111
|
+
discountValue: number;
|
|
112
|
+
};
|
|
113
|
+
discountAmount: number;
|
|
114
|
+
finalPrice: number;
|
|
115
|
+
error?: undefined;
|
|
116
|
+
}>>;
|
|
117
|
+
/**
|
|
118
|
+
* Create voucher (admin only)
|
|
119
|
+
*/
|
|
120
|
+
export declare const create: import("convex/server").RegisteredMutation<"public", {
|
|
121
|
+
name?: string | undefined;
|
|
122
|
+
description?: string | undefined;
|
|
123
|
+
maxUsesPerCustomer?: number | undefined;
|
|
124
|
+
validFrom?: number | undefined;
|
|
125
|
+
validUntil?: number | undefined;
|
|
126
|
+
minOrderValue?: number | undefined;
|
|
127
|
+
applicableBranches?: import("convex/values").GenericId<"branches">[] | undefined;
|
|
128
|
+
applicableServiceTypes?: ("wash_only" | "wash_and_dry" | "dry_only")[] | undefined;
|
|
129
|
+
code: string;
|
|
130
|
+
discountType: "percentage" | "fixed" | "free_wash";
|
|
131
|
+
discountValue: number;
|
|
132
|
+
usageLimit: number;
|
|
133
|
+
}, Promise<import("convex/values").GenericId<"vouchers">>>;
|
|
134
|
+
/**
|
|
135
|
+
* Update voucher (admin only)
|
|
136
|
+
*/
|
|
137
|
+
export declare const update: import("convex/server").RegisteredMutation<"public", {
|
|
138
|
+
name?: string | undefined;
|
|
139
|
+
isActive?: boolean | undefined;
|
|
140
|
+
description?: string | undefined;
|
|
141
|
+
discountType?: "percentage" | "fixed" | "free_wash" | undefined;
|
|
142
|
+
discountValue?: number | undefined;
|
|
143
|
+
usageLimit?: number | undefined;
|
|
144
|
+
maxUsesPerCustomer?: number | undefined;
|
|
145
|
+
validFrom?: number | undefined;
|
|
146
|
+
validUntil?: number | undefined;
|
|
147
|
+
minOrderValue?: number | undefined;
|
|
148
|
+
applicableBranches?: import("convex/values").GenericId<"branches">[] | undefined;
|
|
149
|
+
applicableServiceTypes?: ("wash_only" | "wash_and_dry" | "dry_only")[] | undefined;
|
|
150
|
+
voucherId: import("convex/values").GenericId<"vouchers">;
|
|
151
|
+
}, Promise<import("convex/values").GenericId<"vouchers">>>;
|
|
152
|
+
/**
|
|
153
|
+
* Apply voucher to order
|
|
154
|
+
*/
|
|
155
|
+
export declare const applyToOrder: import("convex/server").RegisteredMutation<"public", {
|
|
156
|
+
orderId: import("convex/values").GenericId<"orders">;
|
|
157
|
+
voucherCode: string;
|
|
158
|
+
}, Promise<{
|
|
159
|
+
voucherId: import("convex/values").GenericId<"vouchers">;
|
|
160
|
+
discountAmount: number;
|
|
161
|
+
finalPrice: number;
|
|
162
|
+
}>>;
|
|
163
|
+
/**
|
|
164
|
+
* Get voucher usage history (admin only)
|
|
165
|
+
*/
|
|
166
|
+
export declare const getUsageHistory: import("convex/server").RegisteredQuery<"public", {
|
|
167
|
+
voucherId?: import("convex/values").GenericId<"vouchers"> | undefined;
|
|
168
|
+
cursor?: string | undefined;
|
|
169
|
+
numItems?: number | undefined;
|
|
170
|
+
}, Promise<{
|
|
171
|
+
page: {
|
|
172
|
+
_id: import("convex/values").GenericId<"voucherUsages">;
|
|
173
|
+
_creationTime: number;
|
|
174
|
+
usedBy?: import("convex/values").GenericId<"attendants"> | undefined;
|
|
175
|
+
isDeleted: boolean;
|
|
176
|
+
customerId: import("convex/values").GenericId<"users">;
|
|
177
|
+
orderId: import("convex/values").GenericId<"orders">;
|
|
178
|
+
voucherId: import("convex/values").GenericId<"vouchers">;
|
|
179
|
+
discountAmount: number;
|
|
180
|
+
orderTotalBefore: number;
|
|
181
|
+
orderTotalAfter: number;
|
|
182
|
+
usedAt: number;
|
|
183
|
+
}[];
|
|
184
|
+
isDone: boolean;
|
|
185
|
+
continueCursor: string;
|
|
186
|
+
}>>;
|
|
187
|
+
//# sourceMappingURL=vouchers.d.ts.map
|