@devlider001/washlab-backend 1.0.7 → 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,158 +1,450 @@
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
- estimatedWeight?: number | undefined;
16
- actualWeight?: number | undefined;
17
- itemCount?: number | undefined;
18
- estimatedLoads?: number | undefined;
19
- whitesSeparate?: boolean | undefined;
20
- bagCardNumber?: string | undefined;
21
- notes?: string | undefined;
22
- deliveryAddress?: string | undefined;
23
- deliveryPhoneNumber?: string | undefined;
24
- deliveryHall?: string | undefined;
25
- deliveryRoom?: string | undefined;
26
- paymentMethod?: "mobile_money" | "card" | "cash" | undefined;
27
- paymentId?: import("convex/values").GenericId<"payments"> | undefined;
28
- fulfilledBy?: import("convex/values").GenericId<"attendants"> | undefined;
29
- status: "pending" | "in_progress" | "ready_for_pickup" | "delivered" | "completed" | "cancelled";
14
+ lastLoginAt?: number | undefined;
15
+ email: string;
16
+ name: string;
17
+ clerkUserId: string;
30
18
  createdAt: number;
31
19
  isDeleted: boolean;
32
- branchId: import("convex/values").GenericId<"branches">;
33
- deliveryFee: number;
34
- customerId: import("convex/values").GenericId<"users">;
35
- customerPhoneNumber: string;
36
- orderNumber: string;
37
- orderType: "walk_in" | "online";
38
- serviceType: "wash_only" | "wash_and_dry" | "dry_only";
39
- isDelivery: boolean;
40
- basePrice: number;
41
- totalPrice: number;
42
- finalPrice: number;
43
- paymentStatus: "pending" | "paid" | "failed" | "refunded";
44
- updatedAt: number;
45
- statusHistory: {
46
- notes?: string | undefined;
47
- status: string;
48
- changedAt: number;
49
- changedBy: import("convex/values").GenericId<"attendants">;
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;
50
53
  }[];
51
- } | null>>;
54
+ isDone: boolean;
55
+ continueCursor: string;
56
+ }>>;
52
57
  /**
53
- * Get orders by customer (from authenticated session)
58
+ * Get branch by code
54
59
  */
55
- export declare const getByCustomer: import("convex/server").RegisteredQuery<"public", {
56
- status?: "pending" | "in_progress" | "ready_for_pickup" | "delivered" | "completed" | "cancelled" | undefined;
57
- limit?: number | undefined;
60
+ export declare const getBranchByCode: import("convex/server").RegisteredQuery<"public", {
61
+ code: string;
58
62
  }, Promise<{
59
- _id: import("convex/values").GenericId<"orders">;
63
+ _id: import("convex/values").GenericId<"branches">;
60
64
  _creationTime: number;
61
- createdBy?: import("convex/values").GenericId<"attendants"> | undefined;
62
- estimatedWeight?: number | undefined;
63
- actualWeight?: number | undefined;
64
- itemCount?: number | undefined;
65
- estimatedLoads?: number | undefined;
66
- whitesSeparate?: boolean | undefined;
67
- bagCardNumber?: string | undefined;
68
- notes?: string | undefined;
69
- deliveryAddress?: string | undefined;
70
- deliveryPhoneNumber?: string | undefined;
71
- deliveryHall?: string | undefined;
72
- deliveryRoom?: string | undefined;
73
- paymentMethod?: "mobile_money" | "card" | "cash" | undefined;
74
- paymentId?: import("convex/values").GenericId<"payments"> | undefined;
75
- fulfilledBy?: import("convex/values").GenericId<"attendants"> | undefined;
76
- status: "pending" | "in_progress" | "ready_for_pickup" | "delivered" | "completed" | "cancelled";
65
+ email?: string | undefined;
66
+ phoneNumber: string;
67
+ name: string;
77
68
  createdAt: number;
78
69
  isDeleted: boolean;
79
- 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;
80
77
  deliveryFee: number;
81
- customerId: import("convex/values").GenericId<"users">;
82
- customerPhoneNumber: string;
83
- orderNumber: string;
84
- orderType: "walk_in" | "online";
85
- serviceType: "wash_only" | "wash_and_dry" | "dry_only";
86
- isDelivery: boolean;
87
- basePrice: number;
88
- totalPrice: number;
89
- finalPrice: number;
90
- paymentStatus: "pending" | "paid" | "failed" | "refunded";
91
- updatedAt: number;
92
- statusHistory: {
93
- notes?: string | undefined;
94
- status: string;
95
- changedAt: number;
96
- changedBy: import("convex/values").GenericId<"attendants">;
97
- }[];
98
- }[]>>;
78
+ } | null>>;
99
79
  /**
100
- * Get orders by branch (for POS)
80
+ * Get single branch by ID
101
81
  */
102
- export declare const getByBranch: import("convex/server").RegisteredQuery<"public", {
103
- status?: "pending" | "in_progress" | "ready_for_pickup" | "delivered" | "completed" | "cancelled" | undefined;
104
- limit?: number | undefined;
82
+ export declare const getBranch: import("convex/server").RegisteredQuery<"public", {
105
83
  branchId: import("convex/values").GenericId<"branches">;
106
84
  }, Promise<{
107
- _id: import("convex/values").GenericId<"orders">;
85
+ _id: import("convex/values").GenericId<"branches">;
108
86
  _creationTime: number;
109
- createdBy?: import("convex/values").GenericId<"attendants"> | undefined;
110
- estimatedWeight?: number | undefined;
111
- actualWeight?: number | undefined;
112
- itemCount?: number | undefined;
113
- estimatedLoads?: number | undefined;
114
- whitesSeparate?: boolean | undefined;
115
- bagCardNumber?: string | undefined;
116
- notes?: string | undefined;
117
- deliveryAddress?: string | undefined;
118
- deliveryPhoneNumber?: string | undefined;
119
- deliveryHall?: string | undefined;
120
- deliveryRoom?: string | undefined;
121
- paymentMethod?: "mobile_money" | "card" | "cash" | undefined;
122
- paymentId?: import("convex/values").GenericId<"payments"> | undefined;
123
- fulfilledBy?: import("convex/values").GenericId<"attendants"> | undefined;
124
- status: "pending" | "in_progress" | "ready_for_pickup" | "delivered" | "completed" | "cancelled";
87
+ email?: string | undefined;
88
+ phoneNumber: string;
89
+ name: string;
125
90
  createdAt: number;
126
91
  isDeleted: boolean;
127
- 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;
128
99
  deliveryFee: number;
129
- customerId: import("convex/values").GenericId<"users">;
130
- customerPhoneNumber: string;
131
- orderNumber: string;
132
- orderType: "walk_in" | "online";
133
- serviceType: "wash_only" | "wash_and_dry" | "dry_only";
134
- isDelivery: boolean;
135
- basePrice: number;
136
- totalPrice: number;
137
- finalPrice: number;
138
- paymentStatus: "pending" | "paid" | "failed" | "refunded";
139
- updatedAt: number;
140
- 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;
141
177
  notes?: string | undefined;
142
- status: string;
143
- changedAt: number;
144
- changedBy: import("convex/values").GenericId<"attendants">;
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;
145
230
  }[];
146
- }[]>>;
231
+ dateRange: {
232
+ start: number | undefined;
233
+ end: number | undefined;
234
+ };
235
+ }>>;
147
236
  /**
148
- * Get pending online orders (awaiting drop-off at POS)
237
+ * Get all customers (with filters) - Paginated
238
+ * Supports usePaginatedQuery for infinite scroll
149
239
  */
150
- export declare const getPending: import("convex/server").RegisteredQuery<"public", {
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;
275
+ }[];
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">>>;
338
+ /**
339
+ * Toggle branch active status (enable/disable)
340
+ */
341
+ export declare const toggleBranchStatus: import("convex/server").RegisteredMutation<"public", {
342
+ branchId: import("convex/values").GenericId<"branches">;
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", {
151
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">;
152
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;
153
444
  _id: import("convex/values").GenericId<"orders">;
154
445
  _creationTime: number;
155
446
  createdBy?: import("convex/values").GenericId<"attendants"> | undefined;
447
+ customerEmail?: string | undefined;
156
448
  estimatedWeight?: number | undefined;
157
449
  actualWeight?: number | undefined;
158
450
  itemCount?: number | undefined;
@@ -185,107 +477,23 @@ export declare const getPending: import("convex/server").RegisteredQuery<"public
185
477
  updatedAt: number;
186
478
  statusHistory: {
187
479
  notes?: string | undefined;
480
+ changedBy?: import("convex/values").GenericId<"attendants"> | undefined;
481
+ changedByAdmin?: import("convex/values").GenericId<"admins"> | undefined;
188
482
  status: string;
189
483
  changedAt: number;
190
- changedBy: import("convex/values").GenericId<"attendants">;
191
484
  }[];
192
- }[]>>;
193
- /**
194
- * Create walk-in order (attendant creates at POS)
195
- */
196
- export declare const createWalkIn: import("convex/server").RegisteredMutation<"public", {
197
- bagCardNumber?: string | undefined;
198
- notes?: string | undefined;
199
- deliveryAddress?: string | undefined;
200
- branchId: import("convex/values").GenericId<"branches">;
201
- customerPhoneNumber: string;
202
- serviceType: "wash_only" | "wash_and_dry" | "dry_only";
203
- actualWeight: number;
204
- itemCount: number;
205
- isDelivery: boolean;
206
- customerName: string;
207
- }, Promise<import("convex/values").GenericId<"orders">>>;
485
+ } | null>>;
208
486
  /**
209
- * Create online order (customer creates from website)
210
- * 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
211
489
  */
212
- export declare const createOnline: import("convex/server").RegisteredMutation<"public", {
213
- estimatedLoads?: number | undefined;
214
- whitesSeparate?: boolean | undefined;
215
- bagCardNumber?: string | undefined;
216
- notes?: string | undefined;
217
- deliveryAddress?: string | undefined;
218
- deliveryPhoneNumber?: string | undefined;
219
- deliveryHall?: string | undefined;
220
- deliveryRoom?: string | undefined;
221
- branchId: import("convex/values").GenericId<"branches">;
222
- customerPhoneNumber: string;
223
- serviceType: "wash_only" | "wash_and_dry" | "dry_only";
224
- estimatedWeight: number;
225
- itemCount: number;
226
- isDelivery: boolean;
227
- customerName: string;
228
- }, Promise<{
229
- orderId: import("convex/values").GenericId<"orders">;
490
+ export declare const getByOrderNumber: import("convex/server").RegisteredQuery<"public", {
230
491
  orderNumber: string;
231
- isGuest: boolean;
232
- }>>;
233
- /**
234
- * Update order weight (when customer drops off online order)
235
- */
236
- export declare const updateWeight: import("convex/server").RegisteredMutation<"public", {
237
- bagCardNumber?: string | undefined;
238
- actualWeight: number;
239
- itemCount: number;
240
- orderId: import("convex/values").GenericId<"orders">;
241
- }, Promise<void>>;
242
- /**
243
- * Update order status (attendant operation)
244
- */
245
- export declare const updateStatus: import("convex/server").RegisteredMutation<"public", {
246
- notes?: string | undefined;
247
- orderId: import("convex/values").GenericId<"orders">;
248
- newStatus: "in_progress" | "ready_for_pickup" | "delivered" | "completed" | "cancelled";
249
- }, Promise<void>>;
250
- /**
251
- * Cancel order
252
- */
253
- export declare const cancel: import("convex/server").RegisteredMutation<"public", {
254
- reason?: string | undefined;
255
- orderId: import("convex/values").GenericId<"orders">;
256
- }, Promise<import("convex/values").GenericId<"orders">>>;
257
- /**
258
- * Get order statistics summary
259
- */
260
- export declare const getStats: import("convex/server").RegisteredQuery<"public", {
261
- branchId?: import("convex/values").GenericId<"branches"> | undefined;
262
- startDate?: number | undefined;
263
- endDate?: number | undefined;
264
- }, Promise<{
265
- total: number;
266
- byStatus: Record<string, number>;
267
- byType: Record<string, number>;
268
- byServiceType: Record<string, number>;
269
- totalRevenue: number;
270
- averageOrderValue: number;
271
- totalWeight: number;
272
- averageWeight: number;
273
- }>>;
274
- /**
275
- * Get orders by date range with detailed filtering
276
- */
277
- export declare const getByDateRange: import("convex/server").RegisteredQuery<"public", {
278
- status?: "pending" | "in_progress" | "ready_for_pickup" | "delivered" | "completed" | "cancelled" | undefined;
279
- branchId?: import("convex/values").GenericId<"branches"> | undefined;
280
- orderType?: "walk_in" | "online" | undefined;
281
- serviceType?: "wash_only" | "wash_and_dry" | "dry_only" | undefined;
282
- limit?: number | undefined;
283
- startDate: number;
284
- endDate: number;
285
492
  }, Promise<{
286
493
  _id: import("convex/values").GenericId<"orders">;
287
494
  _creationTime: number;
288
495
  createdBy?: import("convex/values").GenericId<"attendants"> | undefined;
496
+ customerEmail?: string | undefined;
289
497
  estimatedWeight?: number | undefined;
290
498
  actualWeight?: number | undefined;
291
499
  itemCount?: number | undefined;
@@ -318,9 +526,10 @@ export declare const getByDateRange: import("convex/server").RegisteredQuery<"pu
318
526
  updatedAt: number;
319
527
  statusHistory: {
320
528
  notes?: string | undefined;
529
+ changedBy?: import("convex/values").GenericId<"attendants"> | undefined;
530
+ changedByAdmin?: import("convex/values").GenericId<"admins"> | undefined;
321
531
  status: string;
322
532
  changedAt: number;
323
- changedBy: import("convex/values").GenericId<"attendants">;
324
533
  }[];
325
- }[]>>;
534
+ } | null>>;
326
535
  //# sourceMappingURL=orders.d.ts.map