@devlider001/washlab-backend 1.0.8 → 1.1.0
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 +14 -0
- package/convex/actions.d.ts +158 -0
- package/convex/admin.d.ts +148 -7
- package/convex/attendants.d.ts +332 -18
- package/convex/audit.d.ts +6 -0
- package/convex/customers.d.ts +47 -0
- package/convex/lib/attendance.d.ts +79 -0
- package/convex/lib/audit.d.ts +2 -1
- package/convex/lib/auth.d.ts +46 -4
- package/convex/lib/biometricComparison.d.ts +38 -0
- package/convex/lib/biometricEncryption.d.ts +49 -0
- package/convex/lib/passwordHashing.d.ts +31 -0
- package/convex/lib/tokenHashing.d.ts +26 -0
- package/convex/notifications.d.ts +2 -2
- package/convex/orders.d.ts +425 -221
- package/convex/payments.d.ts +3 -1
- package/convex/schema.d.ts +419 -13
- package/convex/stations.d.ts +77 -0
- package/convex/vouchers.d.ts +4 -4
- package/package.json +1 -1
package/convex/attendants.d.ts
CHANGED
|
@@ -11,16 +11,37 @@ export declare const getByBranch: import("convex/server").RegisteredQuery<"publi
|
|
|
11
11
|
}, Promise<{
|
|
12
12
|
_id: import("convex/values").GenericId<"attendants">;
|
|
13
13
|
_creationTime: number;
|
|
14
|
+
clerkUserId?: string | undefined;
|
|
14
15
|
lastLoginAt?: number | undefined;
|
|
15
|
-
|
|
16
|
+
passcodeHash?: string | undefined;
|
|
17
|
+
authenticationMethods?: ("biometric_face" | "biometric_hand" | "pin" | "password")[] | undefined;
|
|
18
|
+
enrollmentTokenHash?: string | undefined;
|
|
19
|
+
enrollmentTokenExpiresAt?: number | undefined;
|
|
20
|
+
enrolledAt?: number | undefined;
|
|
21
|
+
enrolledBy?: import("convex/values").GenericId<"admins"> | undefined;
|
|
22
|
+
biometricTemplateHash?: string | undefined;
|
|
23
|
+
biometricDataEncrypted?: string | undefined;
|
|
24
|
+
biometricCaptureMetadata?: {
|
|
25
|
+
deviceInfo?: string | undefined;
|
|
26
|
+
captureType: "face" | "hand";
|
|
27
|
+
anglesCaptured: string[];
|
|
28
|
+
captureQuality: number;
|
|
29
|
+
livenessPassed: boolean;
|
|
30
|
+
captureTimestamp: number;
|
|
31
|
+
} | undefined;
|
|
32
|
+
lastVerificationAt?: number | undefined;
|
|
33
|
+
lastVerificationSuccess?: boolean | undefined;
|
|
34
|
+
verificationTimeoutAt?: number | undefined;
|
|
16
35
|
phoneNumber: string;
|
|
17
36
|
email: string;
|
|
18
37
|
name: string;
|
|
19
|
-
clerkUserId: string;
|
|
20
38
|
createdAt: number;
|
|
21
39
|
isDeleted: boolean;
|
|
22
40
|
branchId: import("convex/values").GenericId<"branches">;
|
|
23
41
|
isActive: boolean;
|
|
42
|
+
enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "locked";
|
|
43
|
+
consecutiveFailures: number;
|
|
44
|
+
createdBy: import("convex/values").GenericId<"admins">;
|
|
24
45
|
}[]>>;
|
|
25
46
|
/**
|
|
26
47
|
* Get current attendant profile (from authenticated Clerk session)
|
|
@@ -33,32 +54,85 @@ export declare const getCurrentUser: import("convex/server").RegisteredQuery<"pu
|
|
|
33
54
|
} | null;
|
|
34
55
|
_id: import("convex/values").GenericId<"attendants">;
|
|
35
56
|
_creationTime: number;
|
|
57
|
+
clerkUserId?: string | undefined;
|
|
36
58
|
lastLoginAt?: number | undefined;
|
|
37
|
-
|
|
59
|
+
passcodeHash?: string | undefined;
|
|
60
|
+
authenticationMethods?: ("biometric_face" | "biometric_hand" | "pin" | "password")[] | undefined;
|
|
61
|
+
enrollmentTokenHash?: string | undefined;
|
|
62
|
+
enrollmentTokenExpiresAt?: number | undefined;
|
|
63
|
+
enrolledAt?: number | undefined;
|
|
64
|
+
enrolledBy?: import("convex/values").GenericId<"admins"> | undefined;
|
|
65
|
+
biometricTemplateHash?: string | undefined;
|
|
66
|
+
biometricDataEncrypted?: string | undefined;
|
|
67
|
+
biometricCaptureMetadata?: {
|
|
68
|
+
deviceInfo?: string | undefined;
|
|
69
|
+
captureType: "face" | "hand";
|
|
70
|
+
anglesCaptured: string[];
|
|
71
|
+
captureQuality: number;
|
|
72
|
+
livenessPassed: boolean;
|
|
73
|
+
captureTimestamp: number;
|
|
74
|
+
} | undefined;
|
|
75
|
+
lastVerificationAt?: number | undefined;
|
|
76
|
+
lastVerificationSuccess?: boolean | undefined;
|
|
77
|
+
verificationTimeoutAt?: number | undefined;
|
|
38
78
|
phoneNumber: string;
|
|
39
79
|
email: string;
|
|
40
80
|
name: string;
|
|
41
|
-
clerkUserId: string;
|
|
42
81
|
createdAt: number;
|
|
43
82
|
isDeleted: boolean;
|
|
44
83
|
branchId: import("convex/values").GenericId<"branches">;
|
|
45
84
|
isActive: boolean;
|
|
85
|
+
enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "locked";
|
|
86
|
+
consecutiveFailures: number;
|
|
87
|
+
createdBy: import("convex/values").GenericId<"admins">;
|
|
46
88
|
}>>;
|
|
47
89
|
/**
|
|
48
|
-
* Get current active attendance session
|
|
90
|
+
* Get current active attendance session for authenticated attendant
|
|
91
|
+
* Returns attendance details with branch and attendant info
|
|
49
92
|
*/
|
|
50
|
-
export declare const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
93
|
+
export declare const getActiveAttendanceSession: import("convex/server").RegisteredQuery<"public", {}, Promise<{
|
|
94
|
+
attendance: {
|
|
95
|
+
_id: import("convex/values").GenericId<"attendanceLogs">;
|
|
96
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
97
|
+
branchId: import("convex/values").GenericId<"branches">;
|
|
98
|
+
clockInAt: number;
|
|
99
|
+
deviceId: string | undefined;
|
|
100
|
+
deviceInfo: string | undefined;
|
|
101
|
+
};
|
|
102
|
+
branch: {
|
|
103
|
+
_id: import("convex/values").GenericId<"branches">;
|
|
104
|
+
name: string;
|
|
105
|
+
address: string;
|
|
106
|
+
} | null;
|
|
107
|
+
attendant: {
|
|
108
|
+
_id: import("convex/values").GenericId<"attendants">;
|
|
109
|
+
name: string;
|
|
110
|
+
email: string;
|
|
111
|
+
};
|
|
112
|
+
} | null>>;
|
|
113
|
+
/**
|
|
114
|
+
* Get all active attendances for a branch
|
|
115
|
+
* Useful for station dashboard to show who's currently clocked in
|
|
116
|
+
*/
|
|
117
|
+
export declare const getActiveAttendancesByBranch: import("convex/server").RegisteredQuery<"public", {
|
|
57
118
|
branchId: import("convex/values").GenericId<"branches">;
|
|
58
|
-
|
|
59
|
-
|
|
119
|
+
}, Promise<({
|
|
120
|
+
_id: import("convex/values").GenericId<"attendanceLogs">;
|
|
60
121
|
clockInAt: number;
|
|
61
|
-
|
|
122
|
+
deviceId: string | undefined;
|
|
123
|
+
deviceInfo: string | undefined;
|
|
124
|
+
attendant: null;
|
|
125
|
+
} | {
|
|
126
|
+
_id: import("convex/values").GenericId<"attendanceLogs">;
|
|
127
|
+
clockInAt: number;
|
|
128
|
+
deviceId: string | undefined;
|
|
129
|
+
deviceInfo: string | undefined;
|
|
130
|
+
attendant: {
|
|
131
|
+
_id: import("convex/values").GenericId<"attendants">;
|
|
132
|
+
name: string;
|
|
133
|
+
email: string;
|
|
134
|
+
};
|
|
135
|
+
})[]>>;
|
|
62
136
|
/**
|
|
63
137
|
* Get attendance history - Paginated
|
|
64
138
|
* Supports usePaginatedQuery for infinite scroll
|
|
@@ -71,9 +145,9 @@ export declare const getAttendanceHistory: import("convex/server").RegisteredQue
|
|
|
71
145
|
page: {
|
|
72
146
|
_id: import("convex/values").GenericId<"attendanceLogs">;
|
|
73
147
|
_creationTime: number;
|
|
148
|
+
deviceInfo?: string | undefined;
|
|
74
149
|
clockOutAt?: number | undefined;
|
|
75
150
|
deviceId?: string | undefined;
|
|
76
|
-
deviceInfo?: string | undefined;
|
|
77
151
|
isDeleted: boolean;
|
|
78
152
|
branchId: import("convex/values").GenericId<"branches">;
|
|
79
153
|
isActive: boolean;
|
|
@@ -87,8 +161,8 @@ export declare const getAttendanceHistory: import("convex/server").RegisteredQue
|
|
|
87
161
|
* Clock in attendant (start attendance session)
|
|
88
162
|
*/
|
|
89
163
|
export declare const clockIn: import("convex/server").RegisteredMutation<"public", {
|
|
90
|
-
deviceId?: string | undefined;
|
|
91
164
|
deviceInfo?: string | undefined;
|
|
165
|
+
deviceId?: string | undefined;
|
|
92
166
|
branchId: import("convex/values").GenericId<"branches">;
|
|
93
167
|
}, Promise<import("convex/values").GenericId<"attendanceLogs">>>;
|
|
94
168
|
/**
|
|
@@ -96,7 +170,37 @@ export declare const clockIn: import("convex/server").RegisteredMutation<"public
|
|
|
96
170
|
*/
|
|
97
171
|
export declare const clockOut: import("convex/server").RegisteredMutation<"public", {
|
|
98
172
|
attendanceLogId?: import("convex/values").GenericId<"attendanceLogs"> | undefined;
|
|
99
|
-
}, Promise<
|
|
173
|
+
}, Promise<{
|
|
174
|
+
attendanceLogId: import("convex/values").GenericId<"attendanceLogs">;
|
|
175
|
+
sessionsRevoked: number;
|
|
176
|
+
durationMinutes: number;
|
|
177
|
+
}>>;
|
|
178
|
+
/**
|
|
179
|
+
* Get attendance details by ID
|
|
180
|
+
*/
|
|
181
|
+
export declare const getAttendanceById: import("convex/server").RegisteredQuery<"public", {
|
|
182
|
+
attendanceId: import("convex/values").GenericId<"attendanceLogs">;
|
|
183
|
+
}, Promise<{
|
|
184
|
+
_id: import("convex/values").GenericId<"attendanceLogs">;
|
|
185
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
186
|
+
branchId: import("convex/values").GenericId<"branches">;
|
|
187
|
+
clockInAt: number;
|
|
188
|
+
clockOutAt: number | undefined;
|
|
189
|
+
deviceId: string | undefined;
|
|
190
|
+
deviceInfo: string | undefined;
|
|
191
|
+
isActive: boolean;
|
|
192
|
+
durationMinutes: number;
|
|
193
|
+
attendant: {
|
|
194
|
+
_id: import("convex/values").GenericId<"attendants">;
|
|
195
|
+
name: string;
|
|
196
|
+
email: string;
|
|
197
|
+
} | null;
|
|
198
|
+
branch: {
|
|
199
|
+
_id: import("convex/values").GenericId<"branches">;
|
|
200
|
+
name: string;
|
|
201
|
+
address: string;
|
|
202
|
+
} | null;
|
|
203
|
+
}>>;
|
|
100
204
|
/**
|
|
101
205
|
* Get attendance statistics for a branch
|
|
102
206
|
*/
|
|
@@ -137,4 +241,214 @@ export declare const getAttendanceSummary: import("convex/server").RegisteredQue
|
|
|
137
241
|
end: number;
|
|
138
242
|
};
|
|
139
243
|
}>>;
|
|
244
|
+
/**
|
|
245
|
+
* Verify enrollment token (public query - no auth required)
|
|
246
|
+
*/
|
|
247
|
+
export declare const verifyEnrollmentToken: import("convex/server").RegisteredQuery<"public", {
|
|
248
|
+
token: string;
|
|
249
|
+
}, Promise<{
|
|
250
|
+
valid: boolean;
|
|
251
|
+
error: string;
|
|
252
|
+
attendant?: undefined;
|
|
253
|
+
expiresAt?: undefined;
|
|
254
|
+
} | {
|
|
255
|
+
valid: boolean;
|
|
256
|
+
attendant: {
|
|
257
|
+
id: import("convex/values").GenericId<"attendants">;
|
|
258
|
+
name: string;
|
|
259
|
+
email: string;
|
|
260
|
+
branchId: import("convex/values").GenericId<"branches">;
|
|
261
|
+
branchName: string;
|
|
262
|
+
};
|
|
263
|
+
expiresAt: number;
|
|
264
|
+
error?: undefined;
|
|
265
|
+
}>>;
|
|
266
|
+
/**
|
|
267
|
+
* Start biometric enrollment
|
|
268
|
+
*/
|
|
269
|
+
export declare const startBiometricEnrollment: import("convex/server").RegisteredMutation<"public", {
|
|
270
|
+
method: "face" | "hand";
|
|
271
|
+
enrollmentToken: string;
|
|
272
|
+
}, Promise<{
|
|
273
|
+
sessionId: import("convex/values").GenericId<"biometricVerificationSessions">;
|
|
274
|
+
challenge: string;
|
|
275
|
+
expiresAt: number;
|
|
276
|
+
}>>;
|
|
277
|
+
/**
|
|
278
|
+
* Complete biometric enrollment
|
|
279
|
+
*/
|
|
280
|
+
export declare const completeBiometricEnrollment: import("convex/server").RegisteredMutation<"public", {
|
|
281
|
+
challenge: string;
|
|
282
|
+
enrollmentToken: string;
|
|
283
|
+
biometricData: {
|
|
284
|
+
deviceInfo?: string | undefined;
|
|
285
|
+
captureType: "face" | "hand";
|
|
286
|
+
captureQuality: number;
|
|
287
|
+
angles: string[];
|
|
288
|
+
features: string;
|
|
289
|
+
measurements: string;
|
|
290
|
+
livenessData: string;
|
|
291
|
+
};
|
|
292
|
+
}, Promise<{
|
|
293
|
+
success: boolean;
|
|
294
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
295
|
+
enrolledAt: number;
|
|
296
|
+
}>>;
|
|
297
|
+
/**
|
|
298
|
+
* Find attendant by email (for login)
|
|
299
|
+
*/
|
|
300
|
+
export declare const findByEmail: import("convex/server").RegisteredQuery<"public", {
|
|
301
|
+
email: string;
|
|
302
|
+
}, Promise<{
|
|
303
|
+
id: import("convex/values").GenericId<"attendants">;
|
|
304
|
+
email: string;
|
|
305
|
+
name: string;
|
|
306
|
+
branchId: import("convex/values").GenericId<"branches">;
|
|
307
|
+
authenticationMethods: ("biometric_face" | "biometric_hand" | "pin" | "password")[];
|
|
308
|
+
hasBiometric: boolean;
|
|
309
|
+
hasPin: boolean;
|
|
310
|
+
} | null>>;
|
|
311
|
+
/**
|
|
312
|
+
* Start verification (for login or action)
|
|
313
|
+
* Changed to mutation to allow storing challenges
|
|
314
|
+
*/
|
|
315
|
+
export declare const startVerification: import("convex/server").RegisteredMutation<"public", {
|
|
316
|
+
actionContext?: {
|
|
317
|
+
orderId?: import("convex/values").GenericId<"orders"> | undefined;
|
|
318
|
+
amount?: number | undefined;
|
|
319
|
+
actionType?: string | undefined;
|
|
320
|
+
} | undefined;
|
|
321
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
322
|
+
verificationType: "action" | "login" | "session_renewal";
|
|
323
|
+
}, Promise<{
|
|
324
|
+
challenge: string;
|
|
325
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
326
|
+
verificationType: "action" | "login" | "session_renewal";
|
|
327
|
+
requiresLiveness: boolean;
|
|
328
|
+
}>>;
|
|
329
|
+
/**
|
|
330
|
+
* Verify biometric (complete verification)
|
|
331
|
+
*/
|
|
332
|
+
export declare const verifyBiometric: import("convex/server").RegisteredMutation<"public", {
|
|
333
|
+
actionContext?: {
|
|
334
|
+
orderId?: import("convex/values").GenericId<"orders"> | undefined;
|
|
335
|
+
amount?: number | undefined;
|
|
336
|
+
actionType?: string | undefined;
|
|
337
|
+
} | undefined;
|
|
338
|
+
useFallback?: boolean | undefined;
|
|
339
|
+
fallbackType?: "otp" | "admin_verification" | undefined;
|
|
340
|
+
fallbackCode?: string | undefined;
|
|
341
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
342
|
+
challenge: string;
|
|
343
|
+
verificationType: "action" | "login" | "session_renewal";
|
|
344
|
+
biometricData: {
|
|
345
|
+
deviceInfo?: string | undefined;
|
|
346
|
+
captureType: "face" | "hand";
|
|
347
|
+
captureQuality: number;
|
|
348
|
+
angles: string[];
|
|
349
|
+
features: string;
|
|
350
|
+
measurements: string;
|
|
351
|
+
livenessData: string;
|
|
352
|
+
};
|
|
353
|
+
}, Promise<{
|
|
354
|
+
success: boolean;
|
|
355
|
+
verificationId: import("convex/values").GenericId<"biometricVerifications">;
|
|
356
|
+
expiresAt: number;
|
|
357
|
+
fallbackUsed: "otp" | "admin_verification";
|
|
358
|
+
confidence?: undefined;
|
|
359
|
+
} | {
|
|
360
|
+
success: boolean;
|
|
361
|
+
verificationId: import("convex/values").GenericId<"biometricVerifications">;
|
|
362
|
+
confidence: number;
|
|
363
|
+
expiresAt: number;
|
|
364
|
+
fallbackUsed?: undefined;
|
|
365
|
+
}>>;
|
|
366
|
+
/**
|
|
367
|
+
* Check verification status
|
|
368
|
+
*/
|
|
369
|
+
export declare const checkVerificationStatus: import("convex/server").RegisteredQuery<"public", {
|
|
370
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
371
|
+
}, Promise<{
|
|
372
|
+
isVerified: boolean;
|
|
373
|
+
expiresAt: number | undefined;
|
|
374
|
+
lastVerificationAt: number | undefined;
|
|
375
|
+
consecutiveFailures: number;
|
|
376
|
+
enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "locked";
|
|
377
|
+
}>>;
|
|
378
|
+
/**
|
|
379
|
+
* Create session after successful biometric verification
|
|
380
|
+
*/
|
|
381
|
+
export declare const createSession: import("convex/server").RegisteredMutation<"public", {
|
|
382
|
+
deviceInfo?: string | undefined;
|
|
383
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
384
|
+
}, Promise<{
|
|
385
|
+
success: boolean;
|
|
386
|
+
sessionToken: string;
|
|
387
|
+
refreshToken: string;
|
|
388
|
+
expiresAt: number;
|
|
389
|
+
refreshExpiresAt: number;
|
|
390
|
+
sessionId: import("convex/values").GenericId<"attendantSessions">;
|
|
391
|
+
}>>;
|
|
392
|
+
/**
|
|
393
|
+
* Refresh session access token
|
|
394
|
+
*/
|
|
395
|
+
export declare const refreshSession: import("convex/server").RegisteredMutation<"public", {
|
|
396
|
+
refreshToken: string;
|
|
397
|
+
}, Promise<{
|
|
398
|
+
success: boolean;
|
|
399
|
+
sessionToken: string;
|
|
400
|
+
expiresAt: number;
|
|
401
|
+
}>>;
|
|
402
|
+
/**
|
|
403
|
+
* Logout - invalidate session
|
|
404
|
+
*/
|
|
405
|
+
export declare const logout: import("convex/server").RegisteredMutation<"public", {
|
|
406
|
+
sessionToken?: string | undefined;
|
|
407
|
+
}, Promise<{
|
|
408
|
+
success: boolean;
|
|
409
|
+
sessionsRevoked?: undefined;
|
|
410
|
+
} | {
|
|
411
|
+
success: boolean;
|
|
412
|
+
sessionsRevoked: number;
|
|
413
|
+
}>>;
|
|
414
|
+
/**
|
|
415
|
+
* Authenticate attendant with PIN or Password
|
|
416
|
+
*/
|
|
417
|
+
export declare const authenticateWithPinOrPassword: import("convex/server").RegisteredMutation<"public", {
|
|
418
|
+
deviceInfo?: string | undefined;
|
|
419
|
+
branchId: import("convex/values").GenericId<"branches">;
|
|
420
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
421
|
+
pinOrPassword: string;
|
|
422
|
+
isPin: boolean;
|
|
423
|
+
}, Promise<{
|
|
424
|
+
success: boolean;
|
|
425
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
426
|
+
name: string;
|
|
427
|
+
email: string;
|
|
428
|
+
branchId: import("convex/values").GenericId<"branches">;
|
|
429
|
+
}>>;
|
|
430
|
+
/**
|
|
431
|
+
* Get current session (validate and return session info)
|
|
432
|
+
*/
|
|
433
|
+
export declare const getCurrentSession: import("convex/server").RegisteredQuery<"public", {
|
|
434
|
+
sessionToken: string;
|
|
435
|
+
}, Promise<{
|
|
436
|
+
success: boolean;
|
|
437
|
+
attendant: {
|
|
438
|
+
_id: import("convex/values").GenericId<"attendants">;
|
|
439
|
+
name: string;
|
|
440
|
+
email: string;
|
|
441
|
+
branchId: import("convex/values").GenericId<"branches">;
|
|
442
|
+
};
|
|
443
|
+
branch: {
|
|
444
|
+
_id: import("convex/values").GenericId<"branches">;
|
|
445
|
+
name: string;
|
|
446
|
+
address: string;
|
|
447
|
+
} | null;
|
|
448
|
+
session: {
|
|
449
|
+
expiresAt: number;
|
|
450
|
+
lastActivityAt: number;
|
|
451
|
+
createdAt: number;
|
|
452
|
+
};
|
|
453
|
+
}>>;
|
|
140
454
|
//# sourceMappingURL=attendants.d.ts.map
|
package/convex/audit.d.ts
CHANGED
|
@@ -17,6 +17,7 @@ export declare const getByEntity: import("convex/server").RegisteredQuery<"publi
|
|
|
17
17
|
branchId?: import("convex/values").GenericId<"branches"> | undefined;
|
|
18
18
|
deviceId?: string | undefined;
|
|
19
19
|
entityId?: string | undefined;
|
|
20
|
+
attendanceId?: import("convex/values").GenericId<"attendanceLogs"> | undefined;
|
|
20
21
|
ipAddress?: string | undefined;
|
|
21
22
|
details?: string | undefined;
|
|
22
23
|
oldValue?: string | undefined;
|
|
@@ -41,6 +42,7 @@ export declare const getByActor: import("convex/server").RegisteredQuery<"public
|
|
|
41
42
|
branchId?: import("convex/values").GenericId<"branches"> | undefined;
|
|
42
43
|
deviceId?: string | undefined;
|
|
43
44
|
entityId?: string | undefined;
|
|
45
|
+
attendanceId?: import("convex/values").GenericId<"attendanceLogs"> | undefined;
|
|
44
46
|
ipAddress?: string | undefined;
|
|
45
47
|
details?: string | undefined;
|
|
46
48
|
oldValue?: string | undefined;
|
|
@@ -64,6 +66,7 @@ export declare const getByBranch: import("convex/server").RegisteredQuery<"publi
|
|
|
64
66
|
branchId?: import("convex/values").GenericId<"branches"> | undefined;
|
|
65
67
|
deviceId?: string | undefined;
|
|
66
68
|
entityId?: string | undefined;
|
|
69
|
+
attendanceId?: import("convex/values").GenericId<"attendanceLogs"> | undefined;
|
|
67
70
|
ipAddress?: string | undefined;
|
|
68
71
|
details?: string | undefined;
|
|
69
72
|
oldValue?: string | undefined;
|
|
@@ -87,6 +90,7 @@ export declare const getByAction: import("convex/server").RegisteredQuery<"publi
|
|
|
87
90
|
branchId?: import("convex/values").GenericId<"branches"> | undefined;
|
|
88
91
|
deviceId?: string | undefined;
|
|
89
92
|
entityId?: string | undefined;
|
|
93
|
+
attendanceId?: import("convex/values").GenericId<"attendanceLogs"> | undefined;
|
|
90
94
|
ipAddress?: string | undefined;
|
|
91
95
|
details?: string | undefined;
|
|
92
96
|
oldValue?: string | undefined;
|
|
@@ -111,6 +115,7 @@ export declare const getByTimeRange: import("convex/server").RegisteredQuery<"pu
|
|
|
111
115
|
branchId?: import("convex/values").GenericId<"branches"> | undefined;
|
|
112
116
|
deviceId?: string | undefined;
|
|
113
117
|
entityId?: string | undefined;
|
|
118
|
+
attendanceId?: import("convex/values").GenericId<"attendanceLogs"> | undefined;
|
|
114
119
|
ipAddress?: string | undefined;
|
|
115
120
|
details?: string | undefined;
|
|
116
121
|
oldValue?: string | undefined;
|
|
@@ -147,6 +152,7 @@ export declare const getAll: import("convex/server").RegisteredQuery<"public", {
|
|
|
147
152
|
branchId?: import("convex/values").GenericId<"branches"> | undefined;
|
|
148
153
|
deviceId?: string | undefined;
|
|
149
154
|
entityId?: string | undefined;
|
|
155
|
+
attendanceId?: import("convex/values").GenericId<"attendanceLogs"> | undefined;
|
|
150
156
|
ipAddress?: string | undefined;
|
|
151
157
|
details?: string | undefined;
|
|
152
158
|
oldValue?: string | undefined;
|
package/convex/customers.d.ts
CHANGED
|
@@ -118,6 +118,53 @@ export declare const getOrders: import("convex/server").RegisteredQuery<"public"
|
|
|
118
118
|
isDone: boolean;
|
|
119
119
|
continueCursor: string;
|
|
120
120
|
}>>;
|
|
121
|
+
/**
|
|
122
|
+
* Get active orders for customer (not cancelled or completed)
|
|
123
|
+
* Returns orders that are still in progress
|
|
124
|
+
*/
|
|
125
|
+
export declare const getActiveOrders: import("convex/server").RegisteredQuery<"public", {}, Promise<{
|
|
126
|
+
_id: import("convex/values").GenericId<"orders">;
|
|
127
|
+
_creationTime: number;
|
|
128
|
+
createdBy?: import("convex/values").GenericId<"attendants"> | undefined;
|
|
129
|
+
customerEmail?: string | undefined;
|
|
130
|
+
estimatedWeight?: number | undefined;
|
|
131
|
+
actualWeight?: number | undefined;
|
|
132
|
+
itemCount?: number | undefined;
|
|
133
|
+
estimatedLoads?: number | undefined;
|
|
134
|
+
whitesSeparate?: boolean | undefined;
|
|
135
|
+
bagCardNumber?: string | undefined;
|
|
136
|
+
notes?: string | undefined;
|
|
137
|
+
deliveryAddress?: string | undefined;
|
|
138
|
+
deliveryPhoneNumber?: string | undefined;
|
|
139
|
+
deliveryHall?: string | undefined;
|
|
140
|
+
deliveryRoom?: string | undefined;
|
|
141
|
+
paymentMethod?: "mobile_money" | "card" | "cash" | undefined;
|
|
142
|
+
paymentId?: import("convex/values").GenericId<"payments"> | undefined;
|
|
143
|
+
fulfilledBy?: import("convex/values").GenericId<"attendants"> | undefined;
|
|
144
|
+
status: "pending" | "in_progress" | "ready_for_pickup" | "delivered" | "completed" | "cancelled";
|
|
145
|
+
createdAt: number;
|
|
146
|
+
isDeleted: boolean;
|
|
147
|
+
branchId: import("convex/values").GenericId<"branches">;
|
|
148
|
+
deliveryFee: number;
|
|
149
|
+
customerId: import("convex/values").GenericId<"users">;
|
|
150
|
+
customerPhoneNumber: string;
|
|
151
|
+
orderNumber: string;
|
|
152
|
+
orderType: "walk_in" | "online";
|
|
153
|
+
serviceType: "wash_only" | "wash_and_dry" | "dry_only";
|
|
154
|
+
isDelivery: boolean;
|
|
155
|
+
basePrice: number;
|
|
156
|
+
totalPrice: number;
|
|
157
|
+
finalPrice: number;
|
|
158
|
+
paymentStatus: "pending" | "paid" | "failed" | "refunded";
|
|
159
|
+
updatedAt: number;
|
|
160
|
+
statusHistory: {
|
|
161
|
+
notes?: string | undefined;
|
|
162
|
+
changedBy?: import("convex/values").GenericId<"attendants"> | undefined;
|
|
163
|
+
changedByAdmin?: import("convex/values").GenericId<"admins"> | undefined;
|
|
164
|
+
status: string;
|
|
165
|
+
changedAt: number;
|
|
166
|
+
}[];
|
|
167
|
+
}[]>>;
|
|
121
168
|
/**
|
|
122
169
|
* Get customer loyalty points balance
|
|
123
170
|
* Returns zero points if customer not found
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attendance Utility Functions
|
|
3
|
+
*
|
|
4
|
+
* Provides helper functions for attendance-related operations,
|
|
5
|
+
* including verification and validation for attendance-linked actions.
|
|
6
|
+
*/
|
|
7
|
+
import { QueryCtx, MutationCtx } from "../_generated/server";
|
|
8
|
+
import { Id } from "../_generated/dataModel";
|
|
9
|
+
/**
|
|
10
|
+
* Get active attendance record for an attendant
|
|
11
|
+
* @throws Error if no active attendance found
|
|
12
|
+
*/
|
|
13
|
+
export declare function getActiveAttendance(ctx: QueryCtx | MutationCtx, attendantId: Id<"attendants">): Promise<{
|
|
14
|
+
_id: import("convex/values").GenericId<"attendanceLogs">;
|
|
15
|
+
_creationTime: number;
|
|
16
|
+
deviceInfo?: string | undefined;
|
|
17
|
+
clockOutAt?: number | undefined;
|
|
18
|
+
deviceId?: string | undefined;
|
|
19
|
+
isDeleted: boolean;
|
|
20
|
+
branchId: import("convex/values").GenericId<"branches">;
|
|
21
|
+
isActive: boolean;
|
|
22
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
23
|
+
clockInAt: number;
|
|
24
|
+
}>;
|
|
25
|
+
/**
|
|
26
|
+
* Verify that an attendant has an active attendance session
|
|
27
|
+
* Returns the attendance record if valid, throws error otherwise
|
|
28
|
+
*/
|
|
29
|
+
export declare function verifyActiveAttendance(ctx: QueryCtx | MutationCtx, attendantId: Id<"attendants">, branchId?: Id<"branches">): Promise<{
|
|
30
|
+
_id: import("convex/values").GenericId<"attendanceLogs">;
|
|
31
|
+
_creationTime: number;
|
|
32
|
+
deviceInfo?: string | undefined;
|
|
33
|
+
clockOutAt?: number | undefined;
|
|
34
|
+
deviceId?: string | undefined;
|
|
35
|
+
isDeleted: boolean;
|
|
36
|
+
branchId: import("convex/values").GenericId<"branches">;
|
|
37
|
+
isActive: boolean;
|
|
38
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
39
|
+
clockInAt: number;
|
|
40
|
+
}>;
|
|
41
|
+
/**
|
|
42
|
+
* Check if attendant has active attendance (does not throw, returns boolean)
|
|
43
|
+
*/
|
|
44
|
+
export declare function hasActiveAttendance(ctx: QueryCtx | MutationCtx, attendantId: Id<"attendants">): Promise<boolean>;
|
|
45
|
+
/**
|
|
46
|
+
* Get all active attendances for a branch
|
|
47
|
+
*/
|
|
48
|
+
export declare function getActiveAttendancesByBranch(ctx: QueryCtx | MutationCtx, branchId: Id<"branches">): Promise<{
|
|
49
|
+
_id: import("convex/values").GenericId<"attendanceLogs">;
|
|
50
|
+
_creationTime: number;
|
|
51
|
+
deviceInfo?: string | undefined;
|
|
52
|
+
clockOutAt?: number | undefined;
|
|
53
|
+
deviceId?: string | undefined;
|
|
54
|
+
isDeleted: boolean;
|
|
55
|
+
branchId: import("convex/values").GenericId<"branches">;
|
|
56
|
+
isActive: boolean;
|
|
57
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
58
|
+
clockInAt: number;
|
|
59
|
+
}[]>;
|
|
60
|
+
/**
|
|
61
|
+
* Get attendance history for an attendant
|
|
62
|
+
*/
|
|
63
|
+
export declare function getAttendantAttendanceHistory(ctx: QueryCtx | MutationCtx, attendantId: Id<"attendants">, limit?: number): Promise<{
|
|
64
|
+
_id: import("convex/values").GenericId<"attendanceLogs">;
|
|
65
|
+
_creationTime: number;
|
|
66
|
+
deviceInfo?: string | undefined;
|
|
67
|
+
clockOutAt?: number | undefined;
|
|
68
|
+
deviceId?: string | undefined;
|
|
69
|
+
isDeleted: boolean;
|
|
70
|
+
branchId: import("convex/values").GenericId<"branches">;
|
|
71
|
+
isActive: boolean;
|
|
72
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
73
|
+
clockInAt: number;
|
|
74
|
+
}[]>;
|
|
75
|
+
/**
|
|
76
|
+
* Calculate duration of an attendance session in minutes
|
|
77
|
+
*/
|
|
78
|
+
export declare function calculateAttendanceDuration(clockInAt: number, clockOutAt?: number): number;
|
|
79
|
+
//# sourceMappingURL=attendance.d.ts.map
|
package/convex/lib/audit.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ interface AuditLogParams {
|
|
|
14
14
|
action: string;
|
|
15
15
|
entityType: string;
|
|
16
16
|
entityId?: string;
|
|
17
|
+
attendanceId?: Id<"attendanceLogs">;
|
|
17
18
|
branchId?: Id<"branches">;
|
|
18
19
|
deviceId?: string;
|
|
19
20
|
details?: string;
|
|
@@ -23,7 +24,7 @@ interface AuditLogParams {
|
|
|
23
24
|
/**
|
|
24
25
|
* Create an audit log entry
|
|
25
26
|
*/
|
|
26
|
-
export declare function createAuditLog({ ctx, actorId, actorType, actorRole, action, entityType, entityId, branchId, deviceId, details, oldValue, newValue, }: AuditLogParams): Promise<Id<"auditLogs">>;
|
|
27
|
+
export declare function createAuditLog({ ctx, actorId, actorType, actorRole, action, entityType, entityId, attendanceId, branchId, deviceId, details, oldValue, newValue, }: AuditLogParams): Promise<Id<"auditLogs">>;
|
|
27
28
|
/**
|
|
28
29
|
* Create audit log for order status change
|
|
29
30
|
*/
|