@devlider001/washlab-backend 1.0.8 → 1.0.9

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.
@@ -1,161 +1,446 @@
1
+ import { Id } from "./_generated/dataModel";
1
2
  /**
2
- * Order Functions
3
+ * Admin Functions
3
4
  *
4
- * Handles order creation (walk-in and online), status updates, and queries.
5
+ * Handles admin operations: branch management, attendant management,
6
+ * system-wide order viewing, analytics, and customer management.
5
7
  */
6
8
  /**
7
- * Get order by order number
9
+ * Get current admin profile (from authenticated Clerk session)
8
10
  */
9
- export declare const getByOrderNumber: import("convex/server").RegisteredQuery<"public", {
10
- orderNumber: string;
11
- }, Promise<{
12
- _id: import("convex/values").GenericId<"orders">;
11
+ export declare const getCurrentUser: import("convex/server").RegisteredQuery<"public", {}, Promise<{
12
+ _id: import("convex/values").GenericId<"admins">;
13
13
  _creationTime: number;
14
- createdBy?: import("convex/values").GenericId<"attendants"> | undefined;
15
- customerEmail?: string | undefined;
16
- estimatedWeight?: number | undefined;
17
- actualWeight?: number | undefined;
18
- itemCount?: number | undefined;
19
- estimatedLoads?: number | undefined;
20
- whitesSeparate?: boolean | undefined;
21
- bagCardNumber?: string | undefined;
22
- notes?: string | undefined;
23
- deliveryAddress?: string | undefined;
24
- deliveryPhoneNumber?: string | undefined;
25
- deliveryHall?: string | undefined;
26
- deliveryRoom?: string | undefined;
27
- paymentMethod?: "mobile_money" | "card" | "cash" | undefined;
28
- paymentId?: import("convex/values").GenericId<"payments"> | undefined;
29
- fulfilledBy?: import("convex/values").GenericId<"attendants"> | undefined;
30
- status: "pending" | "in_progress" | "ready_for_pickup" | "delivered" | "completed" | "cancelled";
14
+ lastLoginAt?: number | undefined;
15
+ email: string;
16
+ name: string;
17
+ clerkUserId: string;
31
18
  createdAt: number;
32
19
  isDeleted: boolean;
33
- branchId: import("convex/values").GenericId<"branches">;
34
- deliveryFee: number;
35
- customerId: import("convex/values").GenericId<"users">;
36
- customerPhoneNumber: string;
37
- orderNumber: string;
38
- orderType: "walk_in" | "online";
39
- serviceType: "wash_only" | "wash_and_dry" | "dry_only";
40
- isDelivery: boolean;
41
- basePrice: number;
42
- totalPrice: number;
43
- finalPrice: number;
44
- paymentStatus: "pending" | "paid" | "failed" | "refunded";
45
- updatedAt: number;
46
- statusHistory: {
47
- notes?: string | undefined;
48
- changedBy?: import("convex/values").GenericId<"attendants"> | undefined;
49
- changedByAdmin?: import("convex/values").GenericId<"admins"> | undefined;
50
- status: string;
51
- changedAt: number;
20
+ role: "super_admin" | "admin";
21
+ }>>;
22
+ /**
23
+ * Get all branches - Paginated
24
+ * Supports usePaginatedQuery for infinite scroll
25
+ */
26
+ export declare const getBranches: import("convex/server").RegisteredQuery<"public", {
27
+ includeInactive?: boolean | undefined;
28
+ paginationOpts: {
29
+ id?: number;
30
+ endCursor?: string | null;
31
+ maximumRowsRead?: number;
32
+ maximumBytesRead?: number;
33
+ numItems: number;
34
+ cursor: string | null;
35
+ };
36
+ }, Promise<{
37
+ page: {
38
+ _id: import("convex/values").GenericId<"branches">;
39
+ _creationTime: number;
40
+ email?: string | undefined;
41
+ phoneNumber: string;
42
+ name: string;
43
+ createdAt: number;
44
+ isDeleted: boolean;
45
+ isActive: boolean;
46
+ createdBy: import("convex/values").GenericId<"admins">;
47
+ code: string;
48
+ address: string;
49
+ city: string;
50
+ country: string;
51
+ pricingPerKg: number;
52
+ deliveryFee: number;
52
53
  }[];
53
- } | null>>;
54
+ isDone: boolean;
55
+ continueCursor: string;
56
+ }>>;
54
57
  /**
55
- * Get orders by customer (from authenticated session)
58
+ * Get branch by code
56
59
  */
57
- export declare const getByCustomer: import("convex/server").RegisteredQuery<"public", {
58
- status?: "pending" | "in_progress" | "ready_for_pickup" | "delivered" | "completed" | "cancelled" | undefined;
59
- limit?: number | undefined;
60
+ export declare const getBranchByCode: import("convex/server").RegisteredQuery<"public", {
61
+ code: string;
60
62
  }, Promise<{
61
- _id: import("convex/values").GenericId<"orders">;
63
+ _id: import("convex/values").GenericId<"branches">;
62
64
  _creationTime: number;
63
- createdBy?: import("convex/values").GenericId<"attendants"> | undefined;
64
- customerEmail?: string | undefined;
65
- estimatedWeight?: number | undefined;
66
- actualWeight?: number | undefined;
67
- itemCount?: number | undefined;
68
- estimatedLoads?: number | undefined;
69
- whitesSeparate?: boolean | undefined;
70
- bagCardNumber?: string | undefined;
71
- notes?: string | undefined;
72
- deliveryAddress?: string | undefined;
73
- deliveryPhoneNumber?: string | undefined;
74
- deliveryHall?: string | undefined;
75
- deliveryRoom?: string | undefined;
76
- paymentMethod?: "mobile_money" | "card" | "cash" | undefined;
77
- paymentId?: import("convex/values").GenericId<"payments"> | undefined;
78
- fulfilledBy?: import("convex/values").GenericId<"attendants"> | undefined;
79
- status: "pending" | "in_progress" | "ready_for_pickup" | "delivered" | "completed" | "cancelled";
65
+ email?: string | undefined;
66
+ phoneNumber: string;
67
+ name: string;
80
68
  createdAt: number;
81
69
  isDeleted: boolean;
82
- branchId: import("convex/values").GenericId<"branches">;
70
+ isActive: boolean;
71
+ createdBy: import("convex/values").GenericId<"admins">;
72
+ code: string;
73
+ address: string;
74
+ city: string;
75
+ country: string;
76
+ pricingPerKg: number;
83
77
  deliveryFee: number;
84
- customerId: import("convex/values").GenericId<"users">;
85
- customerPhoneNumber: string;
86
- orderNumber: string;
87
- orderType: "walk_in" | "online";
88
- serviceType: "wash_only" | "wash_and_dry" | "dry_only";
89
- isDelivery: boolean;
90
- basePrice: number;
91
- totalPrice: number;
92
- finalPrice: number;
93
- paymentStatus: "pending" | "paid" | "failed" | "refunded";
94
- updatedAt: number;
95
- statusHistory: {
96
- notes?: string | undefined;
97
- changedBy?: import("convex/values").GenericId<"attendants"> | undefined;
98
- changedByAdmin?: import("convex/values").GenericId<"admins"> | undefined;
99
- status: string;
100
- changedAt: number;
101
- }[];
102
- }[]>>;
78
+ } | null>>;
103
79
  /**
104
- * Get orders by branch (for POS)
80
+ * Get single branch by ID
105
81
  */
106
- export declare const getByBranch: import("convex/server").RegisteredQuery<"public", {
107
- status?: "pending" | "in_progress" | "ready_for_pickup" | "delivered" | "completed" | "cancelled" | undefined;
108
- limit?: number | undefined;
82
+ export declare const getBranch: import("convex/server").RegisteredQuery<"public", {
109
83
  branchId: import("convex/values").GenericId<"branches">;
110
84
  }, Promise<{
111
- _id: import("convex/values").GenericId<"orders">;
85
+ _id: import("convex/values").GenericId<"branches">;
112
86
  _creationTime: number;
113
- createdBy?: import("convex/values").GenericId<"attendants"> | undefined;
114
- customerEmail?: string | undefined;
115
- estimatedWeight?: number | undefined;
116
- actualWeight?: number | undefined;
117
- itemCount?: number | undefined;
118
- estimatedLoads?: number | undefined;
119
- whitesSeparate?: boolean | undefined;
120
- bagCardNumber?: string | undefined;
121
- notes?: string | undefined;
122
- deliveryAddress?: string | undefined;
123
- deliveryPhoneNumber?: string | undefined;
124
- deliveryHall?: string | undefined;
125
- deliveryRoom?: string | undefined;
126
- paymentMethod?: "mobile_money" | "card" | "cash" | undefined;
127
- paymentId?: import("convex/values").GenericId<"payments"> | undefined;
128
- fulfilledBy?: import("convex/values").GenericId<"attendants"> | undefined;
129
- status: "pending" | "in_progress" | "ready_for_pickup" | "delivered" | "completed" | "cancelled";
87
+ email?: string | undefined;
88
+ phoneNumber: string;
89
+ name: string;
130
90
  createdAt: number;
131
91
  isDeleted: boolean;
132
- branchId: import("convex/values").GenericId<"branches">;
92
+ isActive: boolean;
93
+ createdBy: import("convex/values").GenericId<"admins">;
94
+ code: string;
95
+ address: string;
96
+ city: string;
97
+ country: string;
98
+ pricingPerKg: number;
133
99
  deliveryFee: number;
134
- customerId: import("convex/values").GenericId<"users">;
135
- customerPhoneNumber: string;
136
- orderNumber: string;
137
- orderType: "walk_in" | "online";
138
- serviceType: "wash_only" | "wash_and_dry" | "dry_only";
139
- isDelivery: boolean;
140
- basePrice: number;
141
- totalPrice: number;
142
- finalPrice: number;
143
- paymentStatus: "pending" | "paid" | "failed" | "refunded";
144
- updatedAt: number;
145
- statusHistory: {
100
+ } | null>>;
101
+ /**
102
+ * Get all attendants - Paginated
103
+ * Supports usePaginatedQuery for infinite scroll
104
+ */
105
+ export declare const getAttendants: import("convex/server").RegisteredQuery<"public", {
106
+ branchId?: import("convex/values").GenericId<"branches"> | undefined;
107
+ includeInactive?: boolean | undefined;
108
+ numItems?: number | undefined;
109
+ cursor?: string | undefined;
110
+ }, Promise<{
111
+ page: {
112
+ _id: import("convex/values").GenericId<"attendants">;
113
+ _creationTime: number;
114
+ clerkUserId?: string | undefined;
115
+ lastLoginAt?: number | undefined;
116
+ passcode?: string | undefined;
117
+ enrollmentTokenHash?: string | undefined;
118
+ enrollmentTokenExpiresAt?: number | undefined;
119
+ enrolledAt?: number | undefined;
120
+ enrolledBy?: import("convex/values").GenericId<"admins"> | undefined;
121
+ biometricTemplateHash?: string | undefined;
122
+ biometricDataEncrypted?: string | undefined;
123
+ biometricCaptureMetadata?: {
124
+ deviceInfo?: string | undefined;
125
+ captureType: "face" | "hand";
126
+ anglesCaptured: string[];
127
+ captureQuality: number;
128
+ livenessPassed: boolean;
129
+ captureTimestamp: number;
130
+ } | undefined;
131
+ lastVerificationAt?: number | undefined;
132
+ lastVerificationSuccess?: boolean | undefined;
133
+ verificationTimeoutAt?: number | undefined;
134
+ phoneNumber: string;
135
+ email: string;
136
+ name: string;
137
+ createdAt: number;
138
+ isDeleted: boolean;
139
+ branchId: import("convex/values").GenericId<"branches">;
140
+ isActive: boolean;
141
+ enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "locked";
142
+ consecutiveFailures: number;
143
+ createdBy: import("convex/values").GenericId<"admins">;
144
+ }[];
145
+ isDone: boolean;
146
+ continueCursor: string;
147
+ }>>;
148
+ /**
149
+ * Get all orders (with filters) - Paginated
150
+ * Supports usePaginatedQuery for infinite scroll
151
+ */
152
+ export declare const getOrders: import("convex/server").RegisteredQuery<"public", {
153
+ status?: "pending" | "in_progress" | "ready_for_pickup" | "delivered" | "completed" | "cancelled" | undefined;
154
+ branchId?: import("convex/values").GenericId<"branches"> | undefined;
155
+ startDate?: number | undefined;
156
+ endDate?: number | undefined;
157
+ paginationOpts: {
158
+ id?: number;
159
+ endCursor?: string | null;
160
+ maximumRowsRead?: number;
161
+ maximumBytesRead?: number;
162
+ numItems: number;
163
+ cursor: string | null;
164
+ };
165
+ }, Promise<{
166
+ page: {
167
+ _id: import("convex/values").GenericId<"orders">;
168
+ _creationTime: number;
169
+ createdBy?: import("convex/values").GenericId<"attendants"> | undefined;
170
+ customerEmail?: string | undefined;
171
+ estimatedWeight?: number | undefined;
172
+ actualWeight?: number | undefined;
173
+ itemCount?: number | undefined;
174
+ estimatedLoads?: number | undefined;
175
+ whitesSeparate?: boolean | undefined;
176
+ bagCardNumber?: string | undefined;
146
177
  notes?: string | undefined;
147
- changedBy?: import("convex/values").GenericId<"attendants"> | undefined;
148
- changedByAdmin?: import("convex/values").GenericId<"admins"> | undefined;
149
- status: string;
150
- changedAt: number;
178
+ deliveryAddress?: string | undefined;
179
+ deliveryPhoneNumber?: string | undefined;
180
+ deliveryHall?: string | undefined;
181
+ deliveryRoom?: string | undefined;
182
+ paymentMethod?: "mobile_money" | "card" | "cash" | undefined;
183
+ paymentId?: import("convex/values").GenericId<"payments"> | undefined;
184
+ fulfilledBy?: import("convex/values").GenericId<"attendants"> | undefined;
185
+ status: "pending" | "in_progress" | "ready_for_pickup" | "delivered" | "completed" | "cancelled";
186
+ createdAt: number;
187
+ isDeleted: boolean;
188
+ branchId: import("convex/values").GenericId<"branches">;
189
+ deliveryFee: number;
190
+ customerId: import("convex/values").GenericId<"users">;
191
+ customerPhoneNumber: string;
192
+ orderNumber: string;
193
+ orderType: "walk_in" | "online";
194
+ serviceType: "wash_only" | "wash_and_dry" | "dry_only";
195
+ isDelivery: boolean;
196
+ basePrice: number;
197
+ totalPrice: number;
198
+ finalPrice: number;
199
+ paymentStatus: "pending" | "paid" | "failed" | "refunded";
200
+ updatedAt: number;
201
+ statusHistory: {
202
+ notes?: string | undefined;
203
+ changedBy?: import("convex/values").GenericId<"attendants"> | undefined;
204
+ changedByAdmin?: import("convex/values").GenericId<"admins"> | undefined;
205
+ status: string;
206
+ changedAt: number;
207
+ }[];
208
+ }[];
209
+ isDone: boolean;
210
+ continueCursor: string;
211
+ }>>;
212
+ /**
213
+ * Get analytics dashboard data
214
+ */
215
+ export declare const getAnalytics: import("convex/server").RegisteredQuery<"public", {
216
+ branchId?: import("convex/values").GenericId<"branches"> | undefined;
217
+ startDate?: number | undefined;
218
+ endDate?: number | undefined;
219
+ }, Promise<{
220
+ totalOrders: number;
221
+ totalRevenue: number;
222
+ averageOrderValue: number;
223
+ ordersByStatus: Record<string, number>;
224
+ ordersByDay: Record<string, number>;
225
+ topCustomers: {
226
+ customerId: Id<"users">;
227
+ name: string;
228
+ phoneNumber: string;
229
+ orderCount: number;
230
+ }[];
231
+ dateRange: {
232
+ start: number | undefined;
233
+ end: number | undefined;
234
+ };
235
+ }>>;
236
+ /**
237
+ * Get all customers (with filters) - Paginated
238
+ * Supports usePaginatedQuery for infinite scroll
239
+ */
240
+ export declare const getCustomers: import("convex/server").RegisteredQuery<"public", {
241
+ isRegistered?: boolean | undefined;
242
+ status?: "active" | "blocked" | "suspended" | "restricted" | undefined;
243
+ search?: string | undefined;
244
+ paginationOpts: {
245
+ id?: number;
246
+ endCursor?: string | null;
247
+ maximumRowsRead?: number;
248
+ maximumBytesRead?: number;
249
+ numItems: number;
250
+ cursor: string | null;
251
+ };
252
+ }, Promise<{
253
+ page: {
254
+ orderCount: number;
255
+ completedOrderCount: number;
256
+ totalSpent: number;
257
+ lastOrderDate: number;
258
+ lastOrderNumber: string;
259
+ _id: import("convex/values").GenericId<"users">;
260
+ _creationTime: number;
261
+ email?: string | undefined;
262
+ clerkUserId?: string | undefined;
263
+ status?: "active" | "blocked" | "suspended" | "restricted" | undefined;
264
+ statusNote?: string | undefined;
265
+ statusChangedBy?: import("convex/values").GenericId<"admins"> | undefined;
266
+ statusChangedAt?: number | undefined;
267
+ lastLoginAt?: number | undefined;
268
+ preferredBranchId?: import("convex/values").GenericId<"branches"> | undefined;
269
+ phoneNumber: string;
270
+ name: string;
271
+ isRegistered: boolean;
272
+ isVerified: boolean;
273
+ createdAt: number;
274
+ isDeleted: boolean;
151
275
  }[];
152
- }[]>>;
276
+ isDone: boolean;
277
+ continueCursor: string;
278
+ }>>;
279
+ /**
280
+ * Get customer statistics/aggregations
281
+ */
282
+ export declare const getCustomerStats: import("convex/server").RegisteredQuery<"public", {}, Promise<{
283
+ totalCustomers: number;
284
+ registeredCustomers: number;
285
+ walkInCustomers: number;
286
+ activeCustomers: number;
287
+ blockedCustomers: number;
288
+ suspendedCustomers: number;
289
+ restrictedCustomers: number;
290
+ verifiedCustomers: number;
291
+ customersWithActiveOrders: number;
292
+ totalRevenue: number;
293
+ }>>;
294
+ /**
295
+ * Change customer status (with required note)
296
+ */
297
+ export declare const changeCustomerStatus: import("convex/server").RegisteredMutation<"public", {
298
+ status: "active" | "blocked" | "suspended" | "restricted";
299
+ customerId: import("convex/values").GenericId<"users">;
300
+ note: string;
301
+ }, Promise<import("convex/values").GenericId<"users">>>;
302
+ /**
303
+ * Delete a customer (soft delete)
304
+ */
305
+ export declare const deleteCustomer: import("convex/server").RegisteredMutation<"public", {
306
+ customerId: import("convex/values").GenericId<"users">;
307
+ }, Promise<import("convex/values").GenericId<"users">>>;
308
+ /**
309
+ * Create new branch
310
+ */
311
+ export declare const createBranch: import("convex/server").RegisteredMutation<"public", {
312
+ email?: string | undefined;
313
+ phoneNumber: string;
314
+ name: string;
315
+ code: string;
316
+ address: string;
317
+ city: string;
318
+ country: string;
319
+ pricingPerKg: number;
320
+ deliveryFee: number;
321
+ }, Promise<import("convex/values").GenericId<"branches">>>;
322
+ /**
323
+ * Update branch details
324
+ */
325
+ export declare const updateBranch: import("convex/server").RegisteredMutation<"public", {
326
+ phoneNumber?: string | undefined;
327
+ email?: string | undefined;
328
+ name?: string | undefined;
329
+ isActive?: boolean | undefined;
330
+ code?: string | undefined;
331
+ address?: string | undefined;
332
+ city?: string | undefined;
333
+ country?: string | undefined;
334
+ pricingPerKg?: number | undefined;
335
+ deliveryFee?: number | undefined;
336
+ branchId: import("convex/values").GenericId<"branches">;
337
+ }, Promise<import("convex/values").GenericId<"branches">>>;
153
338
  /**
154
- * Get pending online orders (awaiting drop-off at POS)
339
+ * Toggle branch active status (enable/disable)
155
340
  */
156
- export declare const getPending: import("convex/server").RegisteredQuery<"public", {
341
+ export declare const toggleBranchStatus: import("convex/server").RegisteredMutation<"public", {
157
342
  branchId: import("convex/values").GenericId<"branches">;
158
343
  }, Promise<{
344
+ branchId: import("convex/values").GenericId<"branches">;
345
+ isActive: boolean;
346
+ }>>;
347
+ /**
348
+ * Delete branch (soft delete)
349
+ */
350
+ export declare const deleteBranch: import("convex/server").RegisteredMutation<"public", {
351
+ branchId: import("convex/values").GenericId<"branches">;
352
+ }, Promise<import("convex/values").GenericId<"branches">>>;
353
+ /**
354
+ * Create attendant account
355
+ * Note: Clerk user must be created separately, then link clerkUserId
356
+ */
357
+ export declare const createAttendant: import("convex/server").RegisteredMutation<"public", {
358
+ passcode?: string | undefined;
359
+ phoneNumber: string;
360
+ email: string;
361
+ name: string;
362
+ clerkUserId: string;
363
+ branchId: import("convex/values").GenericId<"branches">;
364
+ }, Promise<import("convex/values").GenericId<"attendants">>>;
365
+ /**
366
+ * Update attendant details
367
+ */
368
+ export declare const updateAttendant: import("convex/server").RegisteredMutation<"public", {
369
+ phoneNumber?: string | undefined;
370
+ email?: string | undefined;
371
+ name?: string | undefined;
372
+ passcode?: string | undefined;
373
+ branchId?: import("convex/values").GenericId<"branches"> | undefined;
374
+ isActive?: boolean | undefined;
375
+ attendantId: import("convex/values").GenericId<"attendants">;
376
+ }, Promise<import("convex/values").GenericId<"attendants">>>;
377
+ /**
378
+ * Assign attendant to branch
379
+ */
380
+ export declare const assignAttendantToBranch: import("convex/server").RegisteredMutation<"public", {
381
+ branchId: import("convex/values").GenericId<"branches">;
382
+ attendantId: import("convex/values").GenericId<"attendants">;
383
+ }, Promise<import("convex/values").GenericId<"attendants">>>;
384
+ /**
385
+ * Delete attendant (soft delete)
386
+ */
387
+ export declare const deleteAttendant: import("convex/server").RegisteredMutation<"public", {
388
+ attendantId: import("convex/values").GenericId<"attendants">;
389
+ }, Promise<import("convex/values").GenericId<"attendants">>>;
390
+ /**
391
+ * Create admin account
392
+ * Only super admins can create other admins
393
+ * Note: Clerk user must be created separately, then link clerkUserId
394
+ */
395
+ export declare const createAdmin: import("convex/server").RegisteredMutation<"public", {
396
+ email: string;
397
+ name: string;
398
+ clerkUserId: string;
399
+ role: "super_admin" | "admin";
400
+ }, Promise<import("convex/values").GenericId<"admins">>>;
401
+ /**
402
+ * Create the first super admin (one-time setup)
403
+ * This function can only be used when no super admins exist in the database
404
+ * After the first super admin is created, use createAdmin instead
405
+ */
406
+ export declare const createFirstSuperAdmin: import("convex/server").RegisteredMutation<"public", {
407
+ email: string;
408
+ name: string;
409
+ clerkUserId: string;
410
+ }, Promise<import("convex/values").GenericId<"admins">>>;
411
+ /**
412
+ * Admin: Update order status (admin can update any order)
413
+ */
414
+ export declare const updateOrderStatus: import("convex/server").RegisteredMutation<"public", {
415
+ notes?: string | undefined;
416
+ orderId: import("convex/values").GenericId<"orders">;
417
+ newStatus: "pending" | "in_progress" | "ready_for_pickup" | "delivered" | "completed" | "cancelled";
418
+ }, Promise<import("convex/values").GenericId<"orders">>>;
419
+ /**
420
+ * Admin: Delete order (soft delete)
421
+ */
422
+ export declare const deleteOrder: import("convex/server").RegisteredMutation<"public", {
423
+ orderId: import("convex/values").GenericId<"orders">;
424
+ }, Promise<import("convex/values").GenericId<"orders">>>;
425
+ /**
426
+ * Admin: Get order details (includes full order information with customer and branch)
427
+ */
428
+ export declare const getOrderDetails: import("convex/server").RegisteredQuery<"public", {
429
+ orderId: import("convex/values").GenericId<"orders">;
430
+ }, Promise<{
431
+ customer: {
432
+ _id: import("convex/values").GenericId<"users">;
433
+ name: string;
434
+ phoneNumber: string;
435
+ email: string | undefined;
436
+ } | null;
437
+ branch: {
438
+ _id: import("convex/values").GenericId<"branches">;
439
+ name: string;
440
+ code: string;
441
+ address: string;
442
+ city: string;
443
+ } | null;
159
444
  _id: import("convex/values").GenericId<"orders">;
160
445
  _creationTime: number;
161
446
  createdBy?: import("convex/values").GenericId<"attendants"> | undefined;
@@ -197,101 +482,13 @@ export declare const getPending: import("convex/server").RegisteredQuery<"public
197
482
  status: string;
198
483
  changedAt: number;
199
484
  }[];
200
- }[]>>;
201
- /**
202
- * Create walk-in order (attendant creates at POS)
203
- */
204
- export declare const createWalkIn: import("convex/server").RegisteredMutation<"public", {
205
- customerEmail?: string | undefined;
206
- bagCardNumber?: string | undefined;
207
- notes?: string | undefined;
208
- deliveryAddress?: string | undefined;
209
- branchId: import("convex/values").GenericId<"branches">;
210
- customerPhoneNumber: string;
211
- serviceType: "wash_only" | "wash_and_dry" | "dry_only";
212
- actualWeight: number;
213
- itemCount: number;
214
- isDelivery: boolean;
215
- customerName: string;
216
- }, Promise<import("convex/values").GenericId<"orders">>>;
485
+ } | null>>;
217
486
  /**
218
- * Create online order (customer creates from website)
219
- * Supports both guest checkout and authenticated users
487
+ * Get order by order number (public - for tracking page)
488
+ * Allows customers to track orders without authentication
220
489
  */
221
- export declare const createOnline: import("convex/server").RegisteredMutation<"public", {
222
- estimatedLoads?: number | undefined;
223
- whitesSeparate?: boolean | undefined;
224
- bagCardNumber?: string | undefined;
225
- notes?: string | undefined;
226
- deliveryAddress?: string | undefined;
227
- deliveryPhoneNumber?: string | undefined;
228
- deliveryHall?: string | undefined;
229
- deliveryRoom?: string | undefined;
230
- branchId: import("convex/values").GenericId<"branches">;
231
- customerPhoneNumber: string;
232
- customerEmail: string;
233
- serviceType: "wash_only" | "wash_and_dry" | "dry_only";
234
- estimatedWeight: number;
235
- itemCount: number;
236
- isDelivery: boolean;
237
- customerName: string;
238
- }, Promise<{
239
- orderId: import("convex/values").GenericId<"orders">;
490
+ export declare const getByOrderNumber: import("convex/server").RegisteredQuery<"public", {
240
491
  orderNumber: string;
241
- isGuest: boolean;
242
- }>>;
243
- /**
244
- * Update order weight (when customer drops off online order)
245
- */
246
- export declare const updateWeight: import("convex/server").RegisteredMutation<"public", {
247
- bagCardNumber?: string | undefined;
248
- actualWeight: number;
249
- itemCount: number;
250
- orderId: import("convex/values").GenericId<"orders">;
251
- }, Promise<void>>;
252
- /**
253
- * Update order status (attendant operation)
254
- */
255
- export declare const updateStatus: import("convex/server").RegisteredMutation<"public", {
256
- notes?: string | undefined;
257
- orderId: import("convex/values").GenericId<"orders">;
258
- newStatus: "in_progress" | "ready_for_pickup" | "delivered" | "completed" | "cancelled";
259
- }, Promise<void>>;
260
- /**
261
- * Cancel order
262
- */
263
- export declare const cancel: import("convex/server").RegisteredMutation<"public", {
264
- reason?: string | undefined;
265
- orderId: import("convex/values").GenericId<"orders">;
266
- }, Promise<import("convex/values").GenericId<"orders">>>;
267
- /**
268
- * Get order statistics summary
269
- */
270
- export declare const getStats: import("convex/server").RegisteredQuery<"public", {
271
- branchId?: import("convex/values").GenericId<"branches"> | undefined;
272
- startDate?: number | undefined;
273
- endDate?: number | undefined;
274
- }, Promise<{
275
- total: number;
276
- byStatus: Record<string, number>;
277
- byType: Record<string, number>;
278
- byServiceType: Record<string, number>;
279
- totalRevenue: number;
280
- averageOrderValue: number;
281
- totalWeight: number;
282
- averageWeight: number;
283
- }>>;
284
- /**
285
- * Get orders by date range with detailed filtering
286
- */
287
- export declare const getByDateRange: import("convex/server").RegisteredQuery<"public", {
288
- status?: "pending" | "in_progress" | "ready_for_pickup" | "delivered" | "completed" | "cancelled" | undefined;
289
- branchId?: import("convex/values").GenericId<"branches"> | undefined;
290
- orderType?: "walk_in" | "online" | undefined;
291
- serviceType?: "wash_only" | "wash_and_dry" | "dry_only" | undefined;
292
- limit?: number | undefined;
293
- startDate: number;
294
- endDate: number;
295
492
  }, Promise<{
296
493
  _id: import("convex/values").GenericId<"orders">;
297
494
  _creationTime: number;
@@ -334,5 +531,5 @@ export declare const getByDateRange: import("convex/server").RegisteredQuery<"pu
334
531
  status: string;
335
532
  changedAt: number;
336
533
  }[];
337
- }[]>>;
534
+ } | null>>;
338
535
  //# sourceMappingURL=orders.d.ts.map