@devlider001/washlab-backend 1.1.4 → 1.1.51
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/actions.d.ts +4 -4
- package/convex/admin.d.ts +107 -10
- package/convex/attendants.d.ts +32 -3
- package/convex/customers.d.ts +5 -2
- package/convex/inventory.d.ts +131 -0
- package/convex/lib/auth.d.ts +4 -2
- package/convex/lib/hubtel.d.ts +35 -0
- package/convex/lib/utils.d.ts +8 -4
- package/convex/orders.d.ts +13 -7
- package/convex/payments.d.ts +8 -6
- package/convex/schema.d.ts +120 -14
- package/convex/services.d.ts +32 -0
- package/convex/stations.d.ts +130 -4
- package/package.json +1 -1
|
@@ -17,11 +17,13 @@ import type * as branches from "../branches.js";
|
|
|
17
17
|
import type * as clerk from "../clerk.js";
|
|
18
18
|
import type * as customers from "../customers.js";
|
|
19
19
|
import type * as http from "../http.js";
|
|
20
|
+
import type * as inventory from "../inventory.js";
|
|
20
21
|
import type * as lib_attendance from "../lib/attendance.js";
|
|
21
22
|
import type * as lib_audit from "../lib/audit.js";
|
|
22
23
|
import type * as lib_auth from "../lib/auth.js";
|
|
23
24
|
import type * as lib_biometricComparison from "../lib/biometricComparison.js";
|
|
24
25
|
import type * as lib_biometricEncryption from "../lib/biometricEncryption.js";
|
|
26
|
+
import type * as lib_hubtel from "../lib/hubtel.js";
|
|
25
27
|
import type * as lib_passwordHashing from "../lib/passwordHashing.js";
|
|
26
28
|
import type * as lib_tokenHashing from "../lib/tokenHashing.js";
|
|
27
29
|
import type * as lib_utils from "../lib/utils.js";
|
|
@@ -30,6 +32,7 @@ import type * as notifications from "../notifications.js";
|
|
|
30
32
|
import type * as orders from "../orders.js";
|
|
31
33
|
import type * as payments from "../payments.js";
|
|
32
34
|
import type * as resources from "../resources.js";
|
|
35
|
+
import type * as services from "../services.js";
|
|
33
36
|
import type * as stations from "../stations.js";
|
|
34
37
|
import type * as vouchers from "../vouchers.js";
|
|
35
38
|
|
|
@@ -49,11 +52,13 @@ declare const fullApi: ApiFromModules<{
|
|
|
49
52
|
clerk: typeof clerk;
|
|
50
53
|
customers: typeof customers;
|
|
51
54
|
http: typeof http;
|
|
55
|
+
inventory: typeof inventory;
|
|
52
56
|
"lib/attendance": typeof lib_attendance;
|
|
53
57
|
"lib/audit": typeof lib_audit;
|
|
54
58
|
"lib/auth": typeof lib_auth;
|
|
55
59
|
"lib/biometricComparison": typeof lib_biometricComparison;
|
|
56
60
|
"lib/biometricEncryption": typeof lib_biometricEncryption;
|
|
61
|
+
"lib/hubtel": typeof lib_hubtel;
|
|
57
62
|
"lib/passwordHashing": typeof lib_passwordHashing;
|
|
58
63
|
"lib/tokenHashing": typeof lib_tokenHashing;
|
|
59
64
|
"lib/utils": typeof lib_utils;
|
|
@@ -62,6 +67,7 @@ declare const fullApi: ApiFromModules<{
|
|
|
62
67
|
orders: typeof orders;
|
|
63
68
|
payments: typeof payments;
|
|
64
69
|
resources: typeof resources;
|
|
70
|
+
services: typeof services;
|
|
65
71
|
stations: typeof stations;
|
|
66
72
|
vouchers: typeof vouchers;
|
|
67
73
|
}>;
|
package/convex/actions.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export declare const getActionsByAttendance: import("convex/server").RegisteredQ
|
|
|
50
50
|
attendantId: import("convex/values").GenericId<"attendants">;
|
|
51
51
|
attendanceId: import("convex/values").GenericId<"attendanceLogs">;
|
|
52
52
|
actionType: string;
|
|
53
|
-
actionStatus: "
|
|
53
|
+
actionStatus: "completed" | "cancelled" | "pending" | "failed";
|
|
54
54
|
}[]>>;
|
|
55
55
|
/**
|
|
56
56
|
* Get actions by attendant (with pagination)
|
|
@@ -81,7 +81,7 @@ export declare const getActionsByAttendant: import("convex/server").RegisteredQu
|
|
|
81
81
|
attendantId: import("convex/values").GenericId<"attendants">;
|
|
82
82
|
attendanceId: import("convex/values").GenericId<"attendanceLogs">;
|
|
83
83
|
actionType: string;
|
|
84
|
-
actionStatus: "
|
|
84
|
+
actionStatus: "completed" | "cancelled" | "pending" | "failed";
|
|
85
85
|
}>>>;
|
|
86
86
|
/**
|
|
87
87
|
* Get actions by branch (with pagination)
|
|
@@ -115,7 +115,7 @@ export declare const getActionsByBranch: import("convex/server").RegisteredQuery
|
|
|
115
115
|
attendantId: import("convex/values").GenericId<"attendants">;
|
|
116
116
|
attendanceId: import("convex/values").GenericId<"attendanceLogs">;
|
|
117
117
|
actionType: string;
|
|
118
|
-
actionStatus: "
|
|
118
|
+
actionStatus: "completed" | "cancelled" | "pending" | "failed";
|
|
119
119
|
}>>>;
|
|
120
120
|
/**
|
|
121
121
|
* Get actions by entity (e.g., all actions on a specific order)
|
|
@@ -141,7 +141,7 @@ export declare const getActionsByEntity: import("convex/server").RegisteredQuery
|
|
|
141
141
|
attendantId: import("convex/values").GenericId<"attendants">;
|
|
142
142
|
attendanceId: import("convex/values").GenericId<"attendanceLogs">;
|
|
143
143
|
actionType: string;
|
|
144
|
-
actionStatus: "
|
|
144
|
+
actionStatus: "completed" | "cancelled" | "pending" | "failed";
|
|
145
145
|
}[]>>;
|
|
146
146
|
/**
|
|
147
147
|
* Get action statistics for an attendance session
|
package/convex/admin.d.ts
CHANGED
|
@@ -174,6 +174,7 @@ export declare const getAttendants: import("convex/server").RegisteredQuery<"pub
|
|
|
174
174
|
clerkUserId?: string | undefined;
|
|
175
175
|
lastLoginAt?: number | undefined;
|
|
176
176
|
passcodeHash?: string | undefined;
|
|
177
|
+
passcodeSalt?: string | undefined;
|
|
177
178
|
authenticationMethods?: ("biometric_face" | "biometric_hand" | "pin" | "password")[] | undefined;
|
|
178
179
|
enrollmentTokenHash?: string | undefined;
|
|
179
180
|
enrollmentTokenExpiresAt?: number | undefined;
|
|
@@ -199,7 +200,7 @@ export declare const getAttendants: import("convex/server").RegisteredQuery<"pub
|
|
|
199
200
|
isDeleted: boolean;
|
|
200
201
|
branchId: import("convex/values").GenericId<"branches">;
|
|
201
202
|
isActive: boolean;
|
|
202
|
-
enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "locked";
|
|
203
|
+
enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "biometric_complete" | "locked";
|
|
203
204
|
consecutiveFailures: number;
|
|
204
205
|
createdBy: import("convex/values").GenericId<"admins">;
|
|
205
206
|
}[];
|
|
@@ -211,7 +212,7 @@ export declare const getAttendants: import("convex/server").RegisteredQuery<"pub
|
|
|
211
212
|
* Supports usePaginatedQuery for infinite scroll
|
|
212
213
|
*/
|
|
213
214
|
export declare const getOrders: import("convex/server").RegisteredQuery<"public", {
|
|
214
|
-
status?: "
|
|
215
|
+
status?: "pending_dropoff" | "checked_in" | "sorting" | "washing" | "drying" | "folding" | "ready" | "completed" | "cancelled" | "pending" | "in_progress" | "ready_for_pickup" | "delivered" | undefined;
|
|
215
216
|
branchId?: import("convex/values").GenericId<"branches"> | undefined;
|
|
216
217
|
startDate?: number | undefined;
|
|
217
218
|
endDate?: number | undefined;
|
|
@@ -242,8 +243,9 @@ export declare const getOrders: import("convex/server").RegisteredQuery<"public"
|
|
|
242
243
|
deliveryRoom?: string | undefined;
|
|
243
244
|
paymentMethod?: "mobile_money" | "card" | "cash" | undefined;
|
|
244
245
|
paymentId?: import("convex/values").GenericId<"payments"> | undefined;
|
|
246
|
+
assignedTo?: import("convex/values").GenericId<"attendants"> | undefined;
|
|
245
247
|
fulfilledBy?: import("convex/values").GenericId<"attendants"> | undefined;
|
|
246
|
-
status: "
|
|
248
|
+
status: "pending_dropoff" | "checked_in" | "sorting" | "washing" | "drying" | "folding" | "ready" | "completed" | "cancelled" | "pending" | "in_progress" | "ready_for_pickup" | "delivered";
|
|
247
249
|
createdAt: number;
|
|
248
250
|
isDeleted: boolean;
|
|
249
251
|
branchId: import("convex/values").GenericId<"branches">;
|
|
@@ -455,7 +457,7 @@ export declare const changeAttendantStatus: import("convex/server").RegisteredMu
|
|
|
455
457
|
attendantId: import("convex/values").GenericId<"attendants">;
|
|
456
458
|
}, Promise<{
|
|
457
459
|
attendantId: import("convex/values").GenericId<"attendants">;
|
|
458
|
-
oldStatus: "active" | "suspended" | "invited" | "enrolling" | "locked";
|
|
460
|
+
oldStatus: "active" | "suspended" | "invited" | "enrolling" | "biometric_complete" | "locked";
|
|
459
461
|
newStatus: "active" | "suspended" | "invited" | "enrolling" | "locked";
|
|
460
462
|
}>>;
|
|
461
463
|
/**
|
|
@@ -466,7 +468,7 @@ export declare const suspendAttendant: import("convex/server").RegisteredMutatio
|
|
|
466
468
|
attendantId: import("convex/values").GenericId<"attendants">;
|
|
467
469
|
}, Promise<{
|
|
468
470
|
attendantId: import("convex/values").GenericId<"attendants">;
|
|
469
|
-
oldStatus: "active" | "invited" | "enrolling" | "locked";
|
|
471
|
+
oldStatus: "active" | "invited" | "enrolling" | "biometric_complete" | "locked";
|
|
470
472
|
newStatus: string;
|
|
471
473
|
}>>;
|
|
472
474
|
/**
|
|
@@ -477,7 +479,7 @@ export declare const activateAttendant: import("convex/server").RegisteredMutati
|
|
|
477
479
|
attendantId: import("convex/values").GenericId<"attendants">;
|
|
478
480
|
}, Promise<{
|
|
479
481
|
attendantId: import("convex/values").GenericId<"attendants">;
|
|
480
|
-
oldStatus: "suspended" | "invited" | "enrolling" | "locked";
|
|
482
|
+
oldStatus: "suspended" | "invited" | "enrolling" | "biometric_complete" | "locked";
|
|
481
483
|
newStatus: string;
|
|
482
484
|
}>>;
|
|
483
485
|
/**
|
|
@@ -488,7 +490,7 @@ export declare const lockAttendant: import("convex/server").RegisteredMutation<"
|
|
|
488
490
|
attendantId: import("convex/values").GenericId<"attendants">;
|
|
489
491
|
}, Promise<{
|
|
490
492
|
attendantId: import("convex/values").GenericId<"attendants">;
|
|
491
|
-
oldStatus: "active" | "suspended" | "invited" | "enrolling";
|
|
493
|
+
oldStatus: "active" | "suspended" | "invited" | "enrolling" | "biometric_complete";
|
|
492
494
|
newStatus: string;
|
|
493
495
|
}>>;
|
|
494
496
|
/**
|
|
@@ -543,7 +545,7 @@ export declare const createFirstSuperAdmin: import("convex/server").RegisteredMu
|
|
|
543
545
|
export declare const updateOrderStatus: import("convex/server").RegisteredMutation<"public", {
|
|
544
546
|
notes?: string | undefined;
|
|
545
547
|
orderId: import("convex/values").GenericId<"orders">;
|
|
546
|
-
newStatus: "
|
|
548
|
+
newStatus: "pending_dropoff" | "checked_in" | "sorting" | "washing" | "drying" | "folding" | "ready" | "completed" | "cancelled" | "pending" | "in_progress" | "ready_for_pickup" | "delivered";
|
|
547
549
|
}, Promise<import("convex/values").GenericId<"orders">>>;
|
|
548
550
|
/**
|
|
549
551
|
* Admin: Delete order (soft delete)
|
|
@@ -587,8 +589,9 @@ export declare const getOrderDetails: import("convex/server").RegisteredQuery<"p
|
|
|
587
589
|
deliveryRoom?: string | undefined;
|
|
588
590
|
paymentMethod?: "mobile_money" | "card" | "cash" | undefined;
|
|
589
591
|
paymentId?: import("convex/values").GenericId<"payments"> | undefined;
|
|
592
|
+
assignedTo?: import("convex/values").GenericId<"attendants"> | undefined;
|
|
590
593
|
fulfilledBy?: import("convex/values").GenericId<"attendants"> | undefined;
|
|
591
|
-
status: "
|
|
594
|
+
status: "pending_dropoff" | "checked_in" | "sorting" | "washing" | "drying" | "folding" | "ready" | "completed" | "cancelled" | "pending" | "in_progress" | "ready_for_pickup" | "delivered";
|
|
592
595
|
createdAt: number;
|
|
593
596
|
isDeleted: boolean;
|
|
594
597
|
branchId: import("convex/values").GenericId<"branches">;
|
|
@@ -640,7 +643,7 @@ export declare const listAttendantEnrollments: import("convex/server").Registere
|
|
|
640
643
|
email: string;
|
|
641
644
|
phoneNumber: string;
|
|
642
645
|
branchId: import("convex/values").GenericId<"branches">;
|
|
643
|
-
enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "locked";
|
|
646
|
+
enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "biometric_complete" | "locked";
|
|
644
647
|
enrolledAt: number | undefined;
|
|
645
648
|
enrollmentTokenExpiresAt: number | undefined;
|
|
646
649
|
lastVerificationAt: number | undefined;
|
|
@@ -658,4 +661,98 @@ export declare const resendEnrollmentLink: import("convex/server").RegisteredMut
|
|
|
658
661
|
enrollmentLink: string;
|
|
659
662
|
expiresAt: number;
|
|
660
663
|
}>>;
|
|
664
|
+
/**
|
|
665
|
+
* Get system settings
|
|
666
|
+
*/
|
|
667
|
+
export declare const getSystemSettings: import("convex/server").RegisteredQuery<"public", {}, Promise<{
|
|
668
|
+
businessName: string;
|
|
669
|
+
contactPhone: string;
|
|
670
|
+
contactEmail: string;
|
|
671
|
+
notifyNewOrders: boolean;
|
|
672
|
+
notifyCompletedOrders: boolean;
|
|
673
|
+
requireBiometricPayment: boolean;
|
|
674
|
+
autoLogoutMinutes: number;
|
|
675
|
+
}>>;
|
|
676
|
+
/**
|
|
677
|
+
* Update system settings
|
|
678
|
+
*/
|
|
679
|
+
export declare const updateSystemSettings: import("convex/server").RegisteredMutation<"public", {
|
|
680
|
+
businessName: string;
|
|
681
|
+
contactPhone: string;
|
|
682
|
+
contactEmail: string;
|
|
683
|
+
notifyNewOrders: boolean;
|
|
684
|
+
notifyCompletedOrders: boolean;
|
|
685
|
+
requireBiometricPayment: boolean;
|
|
686
|
+
autoLogoutMinutes: number;
|
|
687
|
+
}, Promise<{
|
|
688
|
+
success: boolean;
|
|
689
|
+
}>>;
|
|
690
|
+
/**
|
|
691
|
+
* Get all services
|
|
692
|
+
*/
|
|
693
|
+
export declare const getServices: import("convex/server").RegisteredQuery<"public", {}, Promise<{
|
|
694
|
+
_id: import("convex/values").GenericId<"services">;
|
|
695
|
+
_creationTime: number;
|
|
696
|
+
description?: string | undefined;
|
|
697
|
+
updatedBy?: import("convex/values").GenericId<"admins"> | undefined;
|
|
698
|
+
imageStorageId?: import("convex/values").GenericId<"_storage"> | undefined;
|
|
699
|
+
imageUrl?: string | undefined;
|
|
700
|
+
name: string;
|
|
701
|
+
createdAt: number;
|
|
702
|
+
isDeleted: boolean;
|
|
703
|
+
isActive: boolean;
|
|
704
|
+
createdBy: import("convex/values").GenericId<"admins">;
|
|
705
|
+
code: string;
|
|
706
|
+
basePrice: number;
|
|
707
|
+
updatedAt: number;
|
|
708
|
+
pricingType: "per_kg" | "per_load";
|
|
709
|
+
}[]>>;
|
|
710
|
+
/**
|
|
711
|
+
* Create a new service
|
|
712
|
+
*/
|
|
713
|
+
export declare const createService: import("convex/server").RegisteredMutation<"public", {
|
|
714
|
+
description?: string | undefined;
|
|
715
|
+
imageStorageId?: import("convex/values").GenericId<"_storage"> | undefined;
|
|
716
|
+
imageUrl?: string | undefined;
|
|
717
|
+
name: string;
|
|
718
|
+
code: string;
|
|
719
|
+
basePrice: number;
|
|
720
|
+
pricingType: "per_kg" | "per_load";
|
|
721
|
+
}, Promise<{
|
|
722
|
+
success: boolean;
|
|
723
|
+
serviceId: import("convex/values").GenericId<"services">;
|
|
724
|
+
}>>;
|
|
725
|
+
/**
|
|
726
|
+
* Update a service
|
|
727
|
+
*/
|
|
728
|
+
export declare const updateService: import("convex/server").RegisteredMutation<"public", {
|
|
729
|
+
name?: string | undefined;
|
|
730
|
+
isActive?: boolean | undefined;
|
|
731
|
+
basePrice?: number | undefined;
|
|
732
|
+
description?: string | undefined;
|
|
733
|
+
imageStorageId?: import("convex/values").GenericId<"_storage"> | undefined;
|
|
734
|
+
imageUrl?: string | undefined;
|
|
735
|
+
pricingType?: "per_kg" | "per_load" | undefined;
|
|
736
|
+
serviceId: import("convex/values").GenericId<"services">;
|
|
737
|
+
}, Promise<{
|
|
738
|
+
success: boolean;
|
|
739
|
+
}>>;
|
|
740
|
+
/**
|
|
741
|
+
* Delete a service (soft delete)
|
|
742
|
+
*/
|
|
743
|
+
export declare const deleteService: import("convex/server").RegisteredMutation<"public", {
|
|
744
|
+
serviceId: import("convex/values").GenericId<"services">;
|
|
745
|
+
}, Promise<{
|
|
746
|
+
success: boolean;
|
|
747
|
+
}>>;
|
|
748
|
+
/**
|
|
749
|
+
* Generate upload URL for service images
|
|
750
|
+
*/
|
|
751
|
+
export declare const generateServiceImageUploadUrl: import("convex/server").RegisteredMutation<"public", {}, Promise<string>>;
|
|
752
|
+
/**
|
|
753
|
+
* Get service image URL from storage ID
|
|
754
|
+
*/
|
|
755
|
+
export declare const getServiceImageUrl: import("convex/server").RegisteredQuery<"public", {
|
|
756
|
+
storageId: import("convex/values").GenericId<"_storage">;
|
|
757
|
+
}, Promise<string | null>>;
|
|
661
758
|
//# sourceMappingURL=admin.d.ts.map
|
package/convex/attendants.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export declare const getByBranch: import("convex/server").RegisteredQuery<"publi
|
|
|
14
14
|
clerkUserId?: string | undefined;
|
|
15
15
|
lastLoginAt?: number | undefined;
|
|
16
16
|
passcodeHash?: string | undefined;
|
|
17
|
+
passcodeSalt?: string | undefined;
|
|
17
18
|
authenticationMethods?: ("biometric_face" | "biometric_hand" | "pin" | "password")[] | undefined;
|
|
18
19
|
enrollmentTokenHash?: string | undefined;
|
|
19
20
|
enrollmentTokenExpiresAt?: number | undefined;
|
|
@@ -39,7 +40,7 @@ export declare const getByBranch: import("convex/server").RegisteredQuery<"publi
|
|
|
39
40
|
isDeleted: boolean;
|
|
40
41
|
branchId: import("convex/values").GenericId<"branches">;
|
|
41
42
|
isActive: boolean;
|
|
42
|
-
enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "locked";
|
|
43
|
+
enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "biometric_complete" | "locked";
|
|
43
44
|
consecutiveFailures: number;
|
|
44
45
|
createdBy: import("convex/values").GenericId<"admins">;
|
|
45
46
|
}[]>>;
|
|
@@ -57,6 +58,7 @@ export declare const getCurrentUser: import("convex/server").RegisteredQuery<"pu
|
|
|
57
58
|
clerkUserId?: string | undefined;
|
|
58
59
|
lastLoginAt?: number | undefined;
|
|
59
60
|
passcodeHash?: string | undefined;
|
|
61
|
+
passcodeSalt?: string | undefined;
|
|
60
62
|
authenticationMethods?: ("biometric_face" | "biometric_hand" | "pin" | "password")[] | undefined;
|
|
61
63
|
enrollmentTokenHash?: string | undefined;
|
|
62
64
|
enrollmentTokenExpiresAt?: number | undefined;
|
|
@@ -82,7 +84,7 @@ export declare const getCurrentUser: import("convex/server").RegisteredQuery<"pu
|
|
|
82
84
|
isDeleted: boolean;
|
|
83
85
|
branchId: import("convex/values").GenericId<"branches">;
|
|
84
86
|
isActive: boolean;
|
|
85
|
-
enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "locked";
|
|
87
|
+
enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "biometric_complete" | "locked";
|
|
86
88
|
consecutiveFailures: number;
|
|
87
89
|
createdBy: import("convex/values").GenericId<"admins">;
|
|
88
90
|
}>>;
|
|
@@ -163,12 +165,14 @@ export declare const getAttendanceHistory: import("convex/server").RegisteredQue
|
|
|
163
165
|
export declare const clockIn: import("convex/server").RegisteredMutation<"public", {
|
|
164
166
|
deviceInfo?: string | undefined;
|
|
165
167
|
deviceId?: string | undefined;
|
|
168
|
+
verificationId?: import("convex/values").GenericId<"biometricVerifications"> | undefined;
|
|
166
169
|
branchId: import("convex/values").GenericId<"branches">;
|
|
167
170
|
}, Promise<import("convex/values").GenericId<"attendanceLogs">>>;
|
|
168
171
|
/**
|
|
169
172
|
* Clock out attendant (end attendance session)
|
|
170
173
|
*/
|
|
171
174
|
export declare const clockOut: import("convex/server").RegisteredMutation<"public", {
|
|
175
|
+
verificationId?: import("convex/values").GenericId<"biometricVerifications"> | undefined;
|
|
172
176
|
attendanceLogId?: import("convex/values").GenericId<"attendanceLogs"> | undefined;
|
|
173
177
|
}, Promise<{
|
|
174
178
|
attendanceLogId: import("convex/values").GenericId<"attendanceLogs">;
|
|
@@ -293,6 +297,31 @@ export declare const completeBiometricEnrollment: import("convex/server").Regist
|
|
|
293
297
|
success: boolean;
|
|
294
298
|
attendantId: import("convex/values").GenericId<"attendants">;
|
|
295
299
|
enrolledAt: number;
|
|
300
|
+
requiresPIN: boolean;
|
|
301
|
+
}>>;
|
|
302
|
+
/**
|
|
303
|
+
* Complete PIN setup after biometric enrollment
|
|
304
|
+
* This is the second step of enrollment
|
|
305
|
+
*/
|
|
306
|
+
export declare const completePINSetup: import("convex/server").RegisteredMutation<"public", {
|
|
307
|
+
pin: string;
|
|
308
|
+
enrollmentToken: string;
|
|
309
|
+
}, Promise<{
|
|
310
|
+
success: boolean;
|
|
311
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
312
|
+
}>>;
|
|
313
|
+
/**
|
|
314
|
+
* Verify PIN for attendant actions and create verification record
|
|
315
|
+
*/
|
|
316
|
+
export declare const verifyAttendantPIN: import("convex/server").RegisteredMutation<"public", {
|
|
317
|
+
orderId?: import("convex/values").GenericId<"orders"> | undefined;
|
|
318
|
+
actionType?: string | undefined;
|
|
319
|
+
pin: string;
|
|
320
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
321
|
+
}, Promise<{
|
|
322
|
+
success: boolean;
|
|
323
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
324
|
+
verificationId: import("convex/values").GenericId<"biometricVerifications">;
|
|
296
325
|
}>>;
|
|
297
326
|
/**
|
|
298
327
|
* Find attendant by email (for login)
|
|
@@ -374,7 +403,7 @@ export declare const checkVerificationStatus: import("convex/server").Registered
|
|
|
374
403
|
expiresAt: number | undefined;
|
|
375
404
|
lastVerificationAt: number | undefined;
|
|
376
405
|
consecutiveFailures: number;
|
|
377
|
-
enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "locked";
|
|
406
|
+
enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "biometric_complete" | "locked";
|
|
378
407
|
}>>;
|
|
379
408
|
/**
|
|
380
409
|
* Create session after successful biometric verification
|
package/convex/customers.d.ts
CHANGED
|
@@ -92,8 +92,9 @@ export declare const getOrders: import("convex/server").RegisteredQuery<"public"
|
|
|
92
92
|
deliveryRoom?: string | undefined;
|
|
93
93
|
paymentMethod?: "mobile_money" | "card" | "cash" | undefined;
|
|
94
94
|
paymentId?: import("convex/values").GenericId<"payments"> | undefined;
|
|
95
|
+
assignedTo?: import("convex/values").GenericId<"attendants"> | undefined;
|
|
95
96
|
fulfilledBy?: import("convex/values").GenericId<"attendants"> | undefined;
|
|
96
|
-
status: "
|
|
97
|
+
status: "pending_dropoff" | "checked_in" | "sorting" | "washing" | "drying" | "folding" | "ready" | "completed" | "cancelled" | "pending" | "in_progress" | "ready_for_pickup" | "delivered";
|
|
97
98
|
createdAt: number;
|
|
98
99
|
isDeleted: boolean;
|
|
99
100
|
branchId: import("convex/values").GenericId<"branches">;
|
|
@@ -142,8 +143,9 @@ export declare const getActiveOrders: import("convex/server").RegisteredQuery<"p
|
|
|
142
143
|
deliveryRoom?: string | undefined;
|
|
143
144
|
paymentMethod?: "mobile_money" | "card" | "cash" | undefined;
|
|
144
145
|
paymentId?: import("convex/values").GenericId<"payments"> | undefined;
|
|
146
|
+
assignedTo?: import("convex/values").GenericId<"attendants"> | undefined;
|
|
145
147
|
fulfilledBy?: import("convex/values").GenericId<"attendants"> | undefined;
|
|
146
|
-
status: "
|
|
148
|
+
status: "pending_dropoff" | "checked_in" | "sorting" | "washing" | "drying" | "folding" | "ready" | "completed" | "cancelled" | "pending" | "in_progress" | "ready_for_pickup" | "delivered";
|
|
147
149
|
createdAt: number;
|
|
148
150
|
isDeleted: boolean;
|
|
149
151
|
branchId: import("convex/values").GenericId<"branches">;
|
|
@@ -190,6 +192,7 @@ export declare const getLoyaltyPoints: import("convex/server").RegisteredQuery<"
|
|
|
190
192
|
*/
|
|
191
193
|
export declare const createGuest: import("convex/server").RegisteredMutation<"public", {
|
|
192
194
|
phoneNumber: string;
|
|
195
|
+
email: string;
|
|
193
196
|
name: string;
|
|
194
197
|
}, Promise<import("convex/values").GenericId<"users">>>;
|
|
195
198
|
/**
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Get inventory items for a branch
|
|
3
|
+
*/
|
|
4
|
+
export declare const getByBranch: import("convex/server").RegisteredQuery<"public", {
|
|
5
|
+
status?: "low" | "critical" | "ok" | "ordered" | undefined;
|
|
6
|
+
branchId?: import("convex/values").GenericId<"branches"> | undefined;
|
|
7
|
+
category?: "cleaning_supplies" | "add_ons" | "facility" | "retail" | "operational" | undefined;
|
|
8
|
+
}, Promise<{
|
|
9
|
+
status: "low" | "critical" | "ok" | "ordered";
|
|
10
|
+
_id: import("convex/values").GenericId<"inventoryItems">;
|
|
11
|
+
_creationTime: number;
|
|
12
|
+
createdBy?: import("convex/values").GenericId<"admins"> | undefined;
|
|
13
|
+
description?: string | undefined;
|
|
14
|
+
updatedBy?: import("convex/values").GenericId<"admins"> | undefined;
|
|
15
|
+
orderedAt?: number | undefined;
|
|
16
|
+
expectedArrivalDate?: number | undefined;
|
|
17
|
+
arrivalDate?: number | undefined;
|
|
18
|
+
orderQuantity?: number | undefined;
|
|
19
|
+
lastRestockedAt?: number | undefined;
|
|
20
|
+
name: string;
|
|
21
|
+
createdAt: number;
|
|
22
|
+
isDeleted: boolean;
|
|
23
|
+
branchId: import("convex/values").GenericId<"branches">;
|
|
24
|
+
updatedAt: number;
|
|
25
|
+
category: "cleaning_supplies" | "add_ons" | "facility" | "retail" | "operational";
|
|
26
|
+
unit: string;
|
|
27
|
+
currentStock: number;
|
|
28
|
+
maxStock: number;
|
|
29
|
+
minStock: number;
|
|
30
|
+
reorderPoint: number;
|
|
31
|
+
}[]>>;
|
|
32
|
+
/**
|
|
33
|
+
* Get inventory items for station (attendant view)
|
|
34
|
+
*/
|
|
35
|
+
export declare const getStationInventory: import("convex/server").RegisteredQuery<"public", {
|
|
36
|
+
stationToken: string;
|
|
37
|
+
}, Promise<{
|
|
38
|
+
status: "low" | "critical" | "ok" | "ordered";
|
|
39
|
+
_id: import("convex/values").GenericId<"inventoryItems">;
|
|
40
|
+
_creationTime: number;
|
|
41
|
+
createdBy?: import("convex/values").GenericId<"admins"> | undefined;
|
|
42
|
+
description?: string | undefined;
|
|
43
|
+
updatedBy?: import("convex/values").GenericId<"admins"> | undefined;
|
|
44
|
+
orderedAt?: number | undefined;
|
|
45
|
+
expectedArrivalDate?: number | undefined;
|
|
46
|
+
arrivalDate?: number | undefined;
|
|
47
|
+
orderQuantity?: number | undefined;
|
|
48
|
+
lastRestockedAt?: number | undefined;
|
|
49
|
+
name: string;
|
|
50
|
+
createdAt: number;
|
|
51
|
+
isDeleted: boolean;
|
|
52
|
+
branchId: import("convex/values").GenericId<"branches">;
|
|
53
|
+
updatedAt: number;
|
|
54
|
+
category: "cleaning_supplies" | "add_ons" | "facility" | "retail" | "operational";
|
|
55
|
+
unit: string;
|
|
56
|
+
currentStock: number;
|
|
57
|
+
maxStock: number;
|
|
58
|
+
minStock: number;
|
|
59
|
+
reorderPoint: number;
|
|
60
|
+
}[]>>;
|
|
61
|
+
/**
|
|
62
|
+
* Create new inventory item (admin or attendant)
|
|
63
|
+
*/
|
|
64
|
+
export declare const create: import("convex/server").RegisteredMutation<"public", {
|
|
65
|
+
branchId?: import("convex/values").GenericId<"branches"> | undefined;
|
|
66
|
+
description?: string | undefined;
|
|
67
|
+
verificationId?: import("convex/values").GenericId<"biometricVerifications"> | undefined;
|
|
68
|
+
stationToken?: string | undefined;
|
|
69
|
+
name: string;
|
|
70
|
+
category: "cleaning_supplies" | "add_ons" | "facility" | "retail" | "operational";
|
|
71
|
+
unit: string;
|
|
72
|
+
currentStock: number;
|
|
73
|
+
maxStock: number;
|
|
74
|
+
minStock: number;
|
|
75
|
+
reorderPoint: number;
|
|
76
|
+
}, Promise<import("convex/values").GenericId<"inventoryItems">>>;
|
|
77
|
+
/**
|
|
78
|
+
* Update inventory stock level
|
|
79
|
+
*/
|
|
80
|
+
export declare const updateStock: import("convex/server").RegisteredMutation<"public", {
|
|
81
|
+
stationToken?: string | undefined;
|
|
82
|
+
currentStock: number;
|
|
83
|
+
itemId: import("convex/values").GenericId<"inventoryItems">;
|
|
84
|
+
}, Promise<{
|
|
85
|
+
success: boolean;
|
|
86
|
+
}>>;
|
|
87
|
+
/**
|
|
88
|
+
* Place order for inventory item
|
|
89
|
+
*/
|
|
90
|
+
export declare const placeOrder: import("convex/server").RegisteredMutation<"public", {
|
|
91
|
+
expectedArrivalDate?: number | undefined;
|
|
92
|
+
stationToken?: string | undefined;
|
|
93
|
+
orderQuantity: number;
|
|
94
|
+
itemId: import("convex/values").GenericId<"inventoryItems">;
|
|
95
|
+
}, Promise<{
|
|
96
|
+
success: boolean;
|
|
97
|
+
}>>;
|
|
98
|
+
/**
|
|
99
|
+
* Mark order as received (restock)
|
|
100
|
+
*/
|
|
101
|
+
export declare const receiveOrder: import("convex/server").RegisteredMutation<"public", {
|
|
102
|
+
stationToken?: string | undefined;
|
|
103
|
+
receivedQuantity?: number | undefined;
|
|
104
|
+
itemId: import("convex/values").GenericId<"inventoryItems">;
|
|
105
|
+
}, Promise<{
|
|
106
|
+
success: boolean;
|
|
107
|
+
}>>;
|
|
108
|
+
/**
|
|
109
|
+
* Update inventory item details (admin only)
|
|
110
|
+
*/
|
|
111
|
+
export declare const update: import("convex/server").RegisteredMutation<"public", {
|
|
112
|
+
name?: string | undefined;
|
|
113
|
+
description?: string | undefined;
|
|
114
|
+
category?: "cleaning_supplies" | "add_ons" | "facility" | "retail" | "operational" | undefined;
|
|
115
|
+
unit?: string | undefined;
|
|
116
|
+
maxStock?: number | undefined;
|
|
117
|
+
minStock?: number | undefined;
|
|
118
|
+
reorderPoint?: number | undefined;
|
|
119
|
+
itemId: import("convex/values").GenericId<"inventoryItems">;
|
|
120
|
+
}, Promise<{
|
|
121
|
+
success: boolean;
|
|
122
|
+
}>>;
|
|
123
|
+
/**
|
|
124
|
+
* Delete inventory item (soft delete, admin only)
|
|
125
|
+
*/
|
|
126
|
+
export declare const deleteItem: import("convex/server").RegisteredMutation<"public", {
|
|
127
|
+
itemId: import("convex/values").GenericId<"inventoryItems">;
|
|
128
|
+
}, Promise<{
|
|
129
|
+
success: boolean;
|
|
130
|
+
}>>;
|
|
131
|
+
//# sourceMappingURL=inventory.d.ts.map
|
package/convex/lib/auth.d.ts
CHANGED
|
@@ -60,6 +60,7 @@ export declare function getCurrentAttendant(ctx: QueryCtx | MutationCtx): Promis
|
|
|
60
60
|
clerkUserId?: string | undefined;
|
|
61
61
|
lastLoginAt?: number | undefined;
|
|
62
62
|
passcodeHash?: string | undefined;
|
|
63
|
+
passcodeSalt?: string | undefined;
|
|
63
64
|
authenticationMethods?: ("biometric_face" | "biometric_hand" | "pin" | "password")[] | undefined;
|
|
64
65
|
enrollmentTokenHash?: string | undefined;
|
|
65
66
|
enrollmentTokenExpiresAt?: number | undefined;
|
|
@@ -85,7 +86,7 @@ export declare function getCurrentAttendant(ctx: QueryCtx | MutationCtx): Promis
|
|
|
85
86
|
isDeleted: boolean;
|
|
86
87
|
branchId: import("convex/values").GenericId<"branches">;
|
|
87
88
|
isActive: boolean;
|
|
88
|
-
enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "locked";
|
|
89
|
+
enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "biometric_complete" | "locked";
|
|
89
90
|
consecutiveFailures: number;
|
|
90
91
|
createdBy: import("convex/values").GenericId<"admins">;
|
|
91
92
|
}>;
|
|
@@ -129,6 +130,7 @@ export declare function verifyAttendantBranch(ctx: QueryCtx | MutationCtx, atten
|
|
|
129
130
|
clerkUserId?: string | undefined;
|
|
130
131
|
lastLoginAt?: number | undefined;
|
|
131
132
|
passcodeHash?: string | undefined;
|
|
133
|
+
passcodeSalt?: string | undefined;
|
|
132
134
|
authenticationMethods?: ("biometric_face" | "biometric_hand" | "pin" | "password")[] | undefined;
|
|
133
135
|
enrollmentTokenHash?: string | undefined;
|
|
134
136
|
enrollmentTokenExpiresAt?: number | undefined;
|
|
@@ -154,7 +156,7 @@ export declare function verifyAttendantBranch(ctx: QueryCtx | MutationCtx, atten
|
|
|
154
156
|
isDeleted: boolean;
|
|
155
157
|
branchId: import("convex/values").GenericId<"branches">;
|
|
156
158
|
isActive: boolean;
|
|
157
|
-
enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "locked";
|
|
159
|
+
enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "biometric_complete" | "locked";
|
|
158
160
|
consecutiveFailures: number;
|
|
159
161
|
createdBy: import("convex/values").GenericId<"admins">;
|
|
160
162
|
}>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hubtel Payment Integration
|
|
3
|
+
*
|
|
4
|
+
* Functions for sending USSD codes and processing payments via Hubtel
|
|
5
|
+
*
|
|
6
|
+
* Note: This requires Hubtel API credentials to be configured in Convex environment variables
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Send USSD payment code to customer
|
|
10
|
+
* This will trigger a USSD prompt on the customer's phone
|
|
11
|
+
*
|
|
12
|
+
* Note: Environment variables should be set in Convex dashboard
|
|
13
|
+
* For now, we'll use a placeholder that needs to be configured
|
|
14
|
+
*
|
|
15
|
+
* @param phoneNumber - Customer phone number (can be in various formats)
|
|
16
|
+
* @param amount - Payment amount in GHS
|
|
17
|
+
* @param orderNumber - Order number for reference
|
|
18
|
+
* @param description - Payment description
|
|
19
|
+
* @returns Object with success status and message/error
|
|
20
|
+
*/
|
|
21
|
+
export declare function sendUSSDCode(phoneNumber: string, amount: number, orderNumber: string, description?: string): Promise<{
|
|
22
|
+
success: boolean;
|
|
23
|
+
message?: string;
|
|
24
|
+
error?: string;
|
|
25
|
+
transactionRef?: string;
|
|
26
|
+
}>;
|
|
27
|
+
/**
|
|
28
|
+
* Verify payment status from Hubtel callback
|
|
29
|
+
*/
|
|
30
|
+
export declare function verifyPaymentStatus(transactionRef: string): Promise<{
|
|
31
|
+
paid: boolean;
|
|
32
|
+
amount?: number;
|
|
33
|
+
transactionId?: string;
|
|
34
|
+
}>;
|
|
35
|
+
//# sourceMappingURL=hubtel.d.ts.map
|
package/convex/lib/utils.d.ts
CHANGED
|
@@ -16,17 +16,21 @@ export declare function calculateOrderPrice(weight: number, pricingPerKg: number
|
|
|
16
16
|
totalPrice: number;
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
|
-
* Calculate service price based on service type
|
|
20
|
-
*
|
|
19
|
+
* Calculate service price based on service type and weight
|
|
20
|
+
* Pricing rules:
|
|
21
|
+
* - Machine capacity: 8kg per load
|
|
22
|
+
* - Plus 1 minus 1 logic: weight ≤ 8kg = 1 load, > 8kg but ≤ 16kg = 2 loads, etc.
|
|
21
23
|
* - wash_only: ₵25/load
|
|
22
24
|
* - wash_and_dry: ₵50/load
|
|
23
25
|
* - dry_only: ₵25/load
|
|
26
|
+
* - whitesSeparate: adds another ₵25 (separate wash for whites)
|
|
24
27
|
*/
|
|
25
|
-
export declare function calculateServicePrice(serviceType: "wash_only" | "wash_and_dry" | "dry_only",
|
|
26
|
-
deliveryFee: number, isDelivery: boolean): {
|
|
28
|
+
export declare function calculateServicePrice(serviceType: "wash_only" | "wash_and_dry" | "dry_only", actualWeight: number, whitesSeparate: boolean | undefined, deliveryFee: number, isDelivery: boolean): {
|
|
27
29
|
basePrice: number;
|
|
28
30
|
deliveryFee: number;
|
|
29
31
|
totalPrice: number;
|
|
32
|
+
numberOfLoads: number;
|
|
33
|
+
whitesLoads: number;
|
|
30
34
|
};
|
|
31
35
|
/**
|
|
32
36
|
* Format date to YYYY-MM-DD string
|