@devlider001/washlab-backend 1.0.9 → 1.1.1
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 +8 -0
- package/convex/actions.d.ts +158 -0
- package/convex/admin.d.ts +93 -13
- package/convex/attendants.d.ts +159 -15
- package/convex/audit.d.ts +6 -0
- package/convex/customers.d.ts +6 -0
- package/convex/lib/attendance.d.ts +79 -0
- package/convex/lib/audit.d.ts +2 -1
- package/convex/lib/auth.d.ts +4 -2
- package/convex/lib/passwordHashing.d.ts +31 -0
- package/convex/orders.d.ts +14 -3
- package/convex/payments.d.ts +3 -0
- package/convex/schema.d.ts +91 -5
- package/convex/stations.d.ts +445 -0
- package/convex/vouchers.d.ts +1 -1
- package/package.json +1 -1
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* @module
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
+
import type * as actions from "../actions.js";
|
|
11
12
|
import type * as admin from "../admin.js";
|
|
12
13
|
import type * as analytics from "../analytics.js";
|
|
13
14
|
import type * as attendants from "../attendants.js";
|
|
@@ -16,10 +17,12 @@ import type * as branches from "../branches.js";
|
|
|
16
17
|
import type * as clerk from "../clerk.js";
|
|
17
18
|
import type * as customers from "../customers.js";
|
|
18
19
|
import type * as http from "../http.js";
|
|
20
|
+
import type * as lib_attendance from "../lib/attendance.js";
|
|
19
21
|
import type * as lib_audit from "../lib/audit.js";
|
|
20
22
|
import type * as lib_auth from "../lib/auth.js";
|
|
21
23
|
import type * as lib_biometricComparison from "../lib/biometricComparison.js";
|
|
22
24
|
import type * as lib_biometricEncryption from "../lib/biometricEncryption.js";
|
|
25
|
+
import type * as lib_passwordHashing from "../lib/passwordHashing.js";
|
|
23
26
|
import type * as lib_tokenHashing from "../lib/tokenHashing.js";
|
|
24
27
|
import type * as lib_utils from "../lib/utils.js";
|
|
25
28
|
import type * as loyalty from "../loyalty.js";
|
|
@@ -27,6 +30,7 @@ import type * as notifications from "../notifications.js";
|
|
|
27
30
|
import type * as orders from "../orders.js";
|
|
28
31
|
import type * as payments from "../payments.js";
|
|
29
32
|
import type * as resources from "../resources.js";
|
|
33
|
+
import type * as stations from "../stations.js";
|
|
30
34
|
import type * as vouchers from "../vouchers.js";
|
|
31
35
|
|
|
32
36
|
import type {
|
|
@@ -36,6 +40,7 @@ import type {
|
|
|
36
40
|
} from "convex/server";
|
|
37
41
|
|
|
38
42
|
declare const fullApi: ApiFromModules<{
|
|
43
|
+
actions: typeof actions;
|
|
39
44
|
admin: typeof admin;
|
|
40
45
|
analytics: typeof analytics;
|
|
41
46
|
attendants: typeof attendants;
|
|
@@ -44,10 +49,12 @@ declare const fullApi: ApiFromModules<{
|
|
|
44
49
|
clerk: typeof clerk;
|
|
45
50
|
customers: typeof customers;
|
|
46
51
|
http: typeof http;
|
|
52
|
+
"lib/attendance": typeof lib_attendance;
|
|
47
53
|
"lib/audit": typeof lib_audit;
|
|
48
54
|
"lib/auth": typeof lib_auth;
|
|
49
55
|
"lib/biometricComparison": typeof lib_biometricComparison;
|
|
50
56
|
"lib/biometricEncryption": typeof lib_biometricEncryption;
|
|
57
|
+
"lib/passwordHashing": typeof lib_passwordHashing;
|
|
51
58
|
"lib/tokenHashing": typeof lib_tokenHashing;
|
|
52
59
|
"lib/utils": typeof lib_utils;
|
|
53
60
|
loyalty: typeof loyalty;
|
|
@@ -55,6 +62,7 @@ declare const fullApi: ApiFromModules<{
|
|
|
55
62
|
orders: typeof orders;
|
|
56
63
|
payments: typeof payments;
|
|
57
64
|
resources: typeof resources;
|
|
65
|
+
stations: typeof stations;
|
|
58
66
|
vouchers: typeof vouchers;
|
|
59
67
|
}>;
|
|
60
68
|
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Action Execution Functions
|
|
3
|
+
*
|
|
4
|
+
* Handles attendance-linked action execution with verification.
|
|
5
|
+
* All critical actions must be linked to an active attendance session.
|
|
6
|
+
*/
|
|
7
|
+
import { MutationCtx } from "./_generated/server";
|
|
8
|
+
import { Id } from "./_generated/dataModel";
|
|
9
|
+
/**
|
|
10
|
+
* Create action log entry (attendance-linked)
|
|
11
|
+
* This is called after verifying attendance and executing the action
|
|
12
|
+
* Note: This function requires MutationCtx for insert operations
|
|
13
|
+
*/
|
|
14
|
+
export declare function createActionLog(ctx: MutationCtx, attendanceId: Id<"attendanceLogs">, attendantId: Id<"attendants">, branchId: Id<"branches">, actionType: string, entityType: string, entityId: string | Id<"orders">, deviceId?: string, metadata?: Record<string, any>, actionStatus?: "pending" | "completed" | "failed" | "cancelled"): Promise<Id<"actionLogs">>;
|
|
15
|
+
/**
|
|
16
|
+
* Execute action with attendance verification
|
|
17
|
+
* This is the main entry point for critical actions
|
|
18
|
+
*/
|
|
19
|
+
export declare const executeAction: import("convex/server").RegisteredMutation<"public", {
|
|
20
|
+
branchId?: import("convex/values").GenericId<"branches"> | undefined;
|
|
21
|
+
deviceId?: string | undefined;
|
|
22
|
+
metadata?: string | undefined;
|
|
23
|
+
entityType: string;
|
|
24
|
+
entityId: string;
|
|
25
|
+
actionType: string;
|
|
26
|
+
}, Promise<{
|
|
27
|
+
success: boolean;
|
|
28
|
+
actionLogId: Id<"actionLogs">;
|
|
29
|
+
attendanceId: import("convex/values").GenericId<"attendanceLogs">;
|
|
30
|
+
timestamp: number;
|
|
31
|
+
}>>;
|
|
32
|
+
/**
|
|
33
|
+
* Get actions by attendance session
|
|
34
|
+
*/
|
|
35
|
+
export declare const getActionsByAttendance: import("convex/server").RegisteredQuery<"public", {
|
|
36
|
+
attendanceId: import("convex/values").GenericId<"attendanceLogs">;
|
|
37
|
+
}, Promise<{
|
|
38
|
+
_id: import("convex/values").GenericId<"actionLogs">;
|
|
39
|
+
_creationTime: number;
|
|
40
|
+
amount?: number | undefined;
|
|
41
|
+
completedAt?: number | undefined;
|
|
42
|
+
entityType?: string | undefined;
|
|
43
|
+
entityId?: import("convex/values").GenericId<"orders"> | undefined;
|
|
44
|
+
errorMessage?: string | undefined;
|
|
45
|
+
actionData?: string | undefined;
|
|
46
|
+
verificationMethod?: "biometric_face" | "biometric_hand" | "pin" | "password" | undefined;
|
|
47
|
+
verificationId?: import("convex/values").GenericId<"biometricVerifications"> | undefined;
|
|
48
|
+
createdAt: number;
|
|
49
|
+
branchId: import("convex/values").GenericId<"branches">;
|
|
50
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
51
|
+
attendanceId: import("convex/values").GenericId<"attendanceLogs">;
|
|
52
|
+
actionType: string;
|
|
53
|
+
actionStatus: "pending" | "completed" | "cancelled" | "failed";
|
|
54
|
+
}[]>>;
|
|
55
|
+
/**
|
|
56
|
+
* Get actions by attendant (with pagination)
|
|
57
|
+
*/
|
|
58
|
+
export declare const getActionsByAttendant: import("convex/server").RegisteredQuery<"public", {
|
|
59
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
60
|
+
paginationOpts: {
|
|
61
|
+
id?: number;
|
|
62
|
+
endCursor?: string | null;
|
|
63
|
+
maximumRowsRead?: number;
|
|
64
|
+
maximumBytesRead?: number;
|
|
65
|
+
numItems: number;
|
|
66
|
+
cursor: string | null;
|
|
67
|
+
};
|
|
68
|
+
}, Promise<import("convex/server").PaginationResult<{
|
|
69
|
+
_id: import("convex/values").GenericId<"actionLogs">;
|
|
70
|
+
_creationTime: number;
|
|
71
|
+
amount?: number | undefined;
|
|
72
|
+
completedAt?: number | undefined;
|
|
73
|
+
entityType?: string | undefined;
|
|
74
|
+
entityId?: import("convex/values").GenericId<"orders"> | undefined;
|
|
75
|
+
errorMessage?: string | undefined;
|
|
76
|
+
actionData?: string | undefined;
|
|
77
|
+
verificationMethod?: "biometric_face" | "biometric_hand" | "pin" | "password" | undefined;
|
|
78
|
+
verificationId?: import("convex/values").GenericId<"biometricVerifications"> | undefined;
|
|
79
|
+
createdAt: number;
|
|
80
|
+
branchId: import("convex/values").GenericId<"branches">;
|
|
81
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
82
|
+
attendanceId: import("convex/values").GenericId<"attendanceLogs">;
|
|
83
|
+
actionType: string;
|
|
84
|
+
actionStatus: "pending" | "completed" | "cancelled" | "failed";
|
|
85
|
+
}>>>;
|
|
86
|
+
/**
|
|
87
|
+
* Get actions by branch (with pagination)
|
|
88
|
+
*/
|
|
89
|
+
export declare const getActionsByBranch: import("convex/server").RegisteredQuery<"public", {
|
|
90
|
+
actionType?: string | undefined;
|
|
91
|
+
startDate?: number | undefined;
|
|
92
|
+
endDate?: number | undefined;
|
|
93
|
+
branchId: import("convex/values").GenericId<"branches">;
|
|
94
|
+
paginationOpts: {
|
|
95
|
+
id?: number;
|
|
96
|
+
endCursor?: string | null;
|
|
97
|
+
maximumRowsRead?: number;
|
|
98
|
+
maximumBytesRead?: number;
|
|
99
|
+
numItems: number;
|
|
100
|
+
cursor: string | null;
|
|
101
|
+
};
|
|
102
|
+
}, Promise<import("convex/server").PaginationResult<{
|
|
103
|
+
_id: import("convex/values").GenericId<"actionLogs">;
|
|
104
|
+
_creationTime: number;
|
|
105
|
+
amount?: number | undefined;
|
|
106
|
+
completedAt?: number | undefined;
|
|
107
|
+
entityType?: string | undefined;
|
|
108
|
+
entityId?: import("convex/values").GenericId<"orders"> | undefined;
|
|
109
|
+
errorMessage?: string | undefined;
|
|
110
|
+
actionData?: string | undefined;
|
|
111
|
+
verificationMethod?: "biometric_face" | "biometric_hand" | "pin" | "password" | undefined;
|
|
112
|
+
verificationId?: import("convex/values").GenericId<"biometricVerifications"> | undefined;
|
|
113
|
+
createdAt: number;
|
|
114
|
+
branchId: import("convex/values").GenericId<"branches">;
|
|
115
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
116
|
+
attendanceId: import("convex/values").GenericId<"attendanceLogs">;
|
|
117
|
+
actionType: string;
|
|
118
|
+
actionStatus: "pending" | "completed" | "cancelled" | "failed";
|
|
119
|
+
}>>>;
|
|
120
|
+
/**
|
|
121
|
+
* Get actions by entity (e.g., all actions on a specific order)
|
|
122
|
+
* Note: Currently only supports orders as entityType due to schema limitation
|
|
123
|
+
* This query is not optimized for large datasets - consider using pagination or adding an index
|
|
124
|
+
*/
|
|
125
|
+
export declare const getActionsByEntity: import("convex/server").RegisteredQuery<"public", {
|
|
126
|
+
entityType: string;
|
|
127
|
+
entityId: import("convex/values").GenericId<"orders">;
|
|
128
|
+
}, Promise<{
|
|
129
|
+
_id: import("convex/values").GenericId<"actionLogs">;
|
|
130
|
+
_creationTime: number;
|
|
131
|
+
amount?: number | undefined;
|
|
132
|
+
completedAt?: number | undefined;
|
|
133
|
+
entityType?: string | undefined;
|
|
134
|
+
entityId?: import("convex/values").GenericId<"orders"> | undefined;
|
|
135
|
+
errorMessage?: string | undefined;
|
|
136
|
+
actionData?: string | undefined;
|
|
137
|
+
verificationMethod?: "biometric_face" | "biometric_hand" | "pin" | "password" | undefined;
|
|
138
|
+
verificationId?: import("convex/values").GenericId<"biometricVerifications"> | undefined;
|
|
139
|
+
createdAt: number;
|
|
140
|
+
branchId: import("convex/values").GenericId<"branches">;
|
|
141
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
142
|
+
attendanceId: import("convex/values").GenericId<"attendanceLogs">;
|
|
143
|
+
actionType: string;
|
|
144
|
+
actionStatus: "pending" | "completed" | "cancelled" | "failed";
|
|
145
|
+
}[]>>;
|
|
146
|
+
/**
|
|
147
|
+
* Get action statistics for an attendance session
|
|
148
|
+
*/
|
|
149
|
+
export declare const getAttendanceActionStats: import("convex/server").RegisteredQuery<"public", {
|
|
150
|
+
attendanceId: import("convex/values").GenericId<"attendanceLogs">;
|
|
151
|
+
}, Promise<{
|
|
152
|
+
totalActions: number;
|
|
153
|
+
actionsByType: Record<string, number>;
|
|
154
|
+
firstAction: number | null;
|
|
155
|
+
lastAction: number | null;
|
|
156
|
+
durationMinutes: number | null;
|
|
157
|
+
}>>;
|
|
158
|
+
//# sourceMappingURL=actions.d.ts.map
|
package/convex/admin.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ import { Id } from "./_generated/dataModel";
|
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
9
|
* Get current admin profile (from authenticated Clerk session)
|
|
10
|
+
* Returns null if user is authenticated but not an admin (for redirect to unauthorized page)
|
|
11
|
+
* Returns null if user is not authenticated (frontend handles redirect to sign-in)
|
|
10
12
|
*/
|
|
11
13
|
export declare const getCurrentUser: import("convex/server").RegisteredQuery<"public", {}, Promise<{
|
|
12
14
|
_id: import("convex/values").GenericId<"admins">;
|
|
@@ -18,7 +20,7 @@ export declare const getCurrentUser: import("convex/server").RegisteredQuery<"pu
|
|
|
18
20
|
createdAt: number;
|
|
19
21
|
isDeleted: boolean;
|
|
20
22
|
role: "super_admin" | "admin";
|
|
21
|
-
}>>;
|
|
23
|
+
} | null>>;
|
|
22
24
|
/**
|
|
23
25
|
* Get all branches - Paginated
|
|
24
26
|
* Supports usePaginatedQuery for infinite scroll
|
|
@@ -38,6 +40,9 @@ export declare const getBranches: import("convex/server").RegisteredQuery<"publi
|
|
|
38
40
|
_id: import("convex/values").GenericId<"branches">;
|
|
39
41
|
_creationTime: number;
|
|
40
42
|
email?: string | undefined;
|
|
43
|
+
terminalId?: string | undefined;
|
|
44
|
+
stationPinHash?: string | undefined;
|
|
45
|
+
requireStationLogin?: boolean | undefined;
|
|
41
46
|
phoneNumber: string;
|
|
42
47
|
name: string;
|
|
43
48
|
createdAt: number;
|
|
@@ -54,6 +59,14 @@ export declare const getBranches: import("convex/server").RegisteredQuery<"publi
|
|
|
54
59
|
isDone: boolean;
|
|
55
60
|
continueCursor: string;
|
|
56
61
|
}>>;
|
|
62
|
+
/**
|
|
63
|
+
* Get all active branches with codes (public - no auth required)
|
|
64
|
+
* Used for displaying available branch codes on login page
|
|
65
|
+
*/
|
|
66
|
+
export declare const getActiveBranchesList: import("convex/server").RegisteredQuery<"public", {}, Promise<{
|
|
67
|
+
code: string;
|
|
68
|
+
name: string;
|
|
69
|
+
}[]>>;
|
|
57
70
|
/**
|
|
58
71
|
* Get branch by code
|
|
59
72
|
*/
|
|
@@ -61,20 +74,15 @@ export declare const getBranchByCode: import("convex/server").RegisteredQuery<"p
|
|
|
61
74
|
code: string;
|
|
62
75
|
}, Promise<{
|
|
63
76
|
_id: import("convex/values").GenericId<"branches">;
|
|
64
|
-
_creationTime: number;
|
|
65
|
-
email?: string | undefined;
|
|
66
|
-
phoneNumber: string;
|
|
67
77
|
name: string;
|
|
68
|
-
createdAt: number;
|
|
69
|
-
isDeleted: boolean;
|
|
70
|
-
isActive: boolean;
|
|
71
|
-
createdBy: import("convex/values").GenericId<"admins">;
|
|
72
78
|
code: string;
|
|
73
79
|
address: string;
|
|
74
80
|
city: string;
|
|
75
81
|
country: string;
|
|
76
|
-
|
|
77
|
-
|
|
82
|
+
phoneNumber: string;
|
|
83
|
+
email: string | undefined;
|
|
84
|
+
requireStationLogin: boolean;
|
|
85
|
+
hasStationPin: boolean;
|
|
78
86
|
} | null>>;
|
|
79
87
|
/**
|
|
80
88
|
* Get single branch by ID
|
|
@@ -85,6 +93,9 @@ export declare const getBranch: import("convex/server").RegisteredQuery<"public"
|
|
|
85
93
|
_id: import("convex/values").GenericId<"branches">;
|
|
86
94
|
_creationTime: number;
|
|
87
95
|
email?: string | undefined;
|
|
96
|
+
terminalId?: string | undefined;
|
|
97
|
+
stationPinHash?: string | undefined;
|
|
98
|
+
requireStationLogin?: boolean | undefined;
|
|
88
99
|
phoneNumber: string;
|
|
89
100
|
name: string;
|
|
90
101
|
createdAt: number;
|
|
@@ -104,16 +115,17 @@ export declare const getBranch: import("convex/server").RegisteredQuery<"public"
|
|
|
104
115
|
*/
|
|
105
116
|
export declare const getAttendants: import("convex/server").RegisteredQuery<"public", {
|
|
106
117
|
branchId?: import("convex/values").GenericId<"branches"> | undefined;
|
|
107
|
-
includeInactive?: boolean | undefined;
|
|
108
118
|
numItems?: number | undefined;
|
|
109
119
|
cursor?: string | undefined;
|
|
120
|
+
includeInactive?: boolean | undefined;
|
|
110
121
|
}, Promise<{
|
|
111
122
|
page: {
|
|
112
123
|
_id: import("convex/values").GenericId<"attendants">;
|
|
113
124
|
_creationTime: number;
|
|
114
125
|
clerkUserId?: string | undefined;
|
|
115
126
|
lastLoginAt?: number | undefined;
|
|
116
|
-
|
|
127
|
+
passcodeHash?: string | undefined;
|
|
128
|
+
authenticationMethods?: ("biometric_face" | "biometric_hand" | "pin" | "password")[] | undefined;
|
|
117
129
|
enrollmentTokenHash?: string | undefined;
|
|
118
130
|
enrollmentTokenExpiresAt?: number | undefined;
|
|
119
131
|
enrolledAt?: number | undefined;
|
|
@@ -313,11 +325,13 @@ export declare const createBranch: import("convex/server").RegisteredMutation<"p
|
|
|
313
325
|
phoneNumber: string;
|
|
314
326
|
name: string;
|
|
315
327
|
code: string;
|
|
328
|
+
terminalId: string;
|
|
316
329
|
address: string;
|
|
317
330
|
city: string;
|
|
318
331
|
country: string;
|
|
319
332
|
pricingPerKg: number;
|
|
320
333
|
deliveryFee: number;
|
|
334
|
+
stationPin: string;
|
|
321
335
|
}, Promise<import("convex/values").GenericId<"branches">>>;
|
|
322
336
|
/**
|
|
323
337
|
* Update branch details
|
|
@@ -328,11 +342,13 @@ export declare const updateBranch: import("convex/server").RegisteredMutation<"p
|
|
|
328
342
|
name?: string | undefined;
|
|
329
343
|
isActive?: boolean | undefined;
|
|
330
344
|
code?: string | undefined;
|
|
345
|
+
terminalId?: string | undefined;
|
|
331
346
|
address?: string | undefined;
|
|
332
347
|
city?: string | undefined;
|
|
333
348
|
country?: string | undefined;
|
|
334
349
|
pricingPerKg?: number | undefined;
|
|
335
350
|
deliveryFee?: number | undefined;
|
|
351
|
+
stationPin?: string | undefined;
|
|
336
352
|
branchId: import("convex/values").GenericId<"branches">;
|
|
337
353
|
}, Promise<import("convex/values").GenericId<"branches">>>;
|
|
338
354
|
/**
|
|
@@ -369,9 +385,9 @@ export declare const updateAttendant: import("convex/server").RegisteredMutation
|
|
|
369
385
|
phoneNumber?: string | undefined;
|
|
370
386
|
email?: string | undefined;
|
|
371
387
|
name?: string | undefined;
|
|
372
|
-
passcode?: string | undefined;
|
|
373
388
|
branchId?: import("convex/values").GenericId<"branches"> | undefined;
|
|
374
389
|
isActive?: boolean | undefined;
|
|
390
|
+
passcode?: string | undefined;
|
|
375
391
|
attendantId: import("convex/values").GenericId<"attendants">;
|
|
376
392
|
}, Promise<import("convex/values").GenericId<"attendants">>>;
|
|
377
393
|
/**
|
|
@@ -381,6 +397,70 @@ export declare const assignAttendantToBranch: import("convex/server").Registered
|
|
|
381
397
|
branchId: import("convex/values").GenericId<"branches">;
|
|
382
398
|
attendantId: import("convex/values").GenericId<"attendants">;
|
|
383
399
|
}, Promise<import("convex/values").GenericId<"attendants">>>;
|
|
400
|
+
/**
|
|
401
|
+
* Change attendant enrollment status (suspend, activate, lock, unlock)
|
|
402
|
+
*/
|
|
403
|
+
export declare const changeAttendantStatus: import("convex/server").RegisteredMutation<"public", {
|
|
404
|
+
reason?: string | undefined;
|
|
405
|
+
status: "active" | "suspended" | "invited" | "enrolling" | "locked";
|
|
406
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
407
|
+
}, Promise<{
|
|
408
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
409
|
+
oldStatus: "active" | "suspended" | "invited" | "enrolling" | "locked";
|
|
410
|
+
newStatus: "active" | "suspended" | "invited" | "enrolling" | "locked";
|
|
411
|
+
}>>;
|
|
412
|
+
/**
|
|
413
|
+
* Suspend attendant (convenience function)
|
|
414
|
+
*/
|
|
415
|
+
export declare const suspendAttendant: import("convex/server").RegisteredMutation<"public", {
|
|
416
|
+
reason?: string | undefined;
|
|
417
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
418
|
+
}, Promise<{
|
|
419
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
420
|
+
oldStatus: "active" | "invited" | "enrolling" | "locked";
|
|
421
|
+
newStatus: string;
|
|
422
|
+
}>>;
|
|
423
|
+
/**
|
|
424
|
+
* Activate attendant (convenience function - unsuspend/unlock)
|
|
425
|
+
*/
|
|
426
|
+
export declare const activateAttendant: import("convex/server").RegisteredMutation<"public", {
|
|
427
|
+
reason?: string | undefined;
|
|
428
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
429
|
+
}, Promise<{
|
|
430
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
431
|
+
oldStatus: "suspended" | "invited" | "enrolling" | "locked";
|
|
432
|
+
newStatus: string;
|
|
433
|
+
}>>;
|
|
434
|
+
/**
|
|
435
|
+
* Lock attendant (convenience function)
|
|
436
|
+
*/
|
|
437
|
+
export declare const lockAttendant: import("convex/server").RegisteredMutation<"public", {
|
|
438
|
+
reason?: string | undefined;
|
|
439
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
440
|
+
}, Promise<{
|
|
441
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
442
|
+
oldStatus: "active" | "suspended" | "invited" | "enrolling";
|
|
443
|
+
newStatus: string;
|
|
444
|
+
}>>;
|
|
445
|
+
/**
|
|
446
|
+
* Reset attendant verification failures
|
|
447
|
+
*/
|
|
448
|
+
export declare const resetAttendantFailures: import("convex/server").RegisteredMutation<"public", {
|
|
449
|
+
reason?: string | undefined;
|
|
450
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
451
|
+
}, Promise<{
|
|
452
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
453
|
+
}>>;
|
|
454
|
+
/**
|
|
455
|
+
* Revoke all active sessions for an attendant
|
|
456
|
+
*/
|
|
457
|
+
export declare const revokeAttendantSessions: import("convex/server").RegisteredMutation<"public", {
|
|
458
|
+
reason?: string | undefined;
|
|
459
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
460
|
+
}, Promise<{
|
|
461
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
462
|
+
sessionsRevoked: number;
|
|
463
|
+
}>>;
|
|
384
464
|
/**
|
|
385
465
|
* Delete attendant (soft delete)
|
|
386
466
|
*/
|
package/convex/attendants.d.ts
CHANGED
|
@@ -13,7 +13,8 @@ export declare const getByBranch: import("convex/server").RegisteredQuery<"publi
|
|
|
13
13
|
_creationTime: number;
|
|
14
14
|
clerkUserId?: string | undefined;
|
|
15
15
|
lastLoginAt?: number | undefined;
|
|
16
|
-
|
|
16
|
+
passcodeHash?: string | undefined;
|
|
17
|
+
authenticationMethods?: ("biometric_face" | "biometric_hand" | "pin" | "password")[] | undefined;
|
|
17
18
|
enrollmentTokenHash?: string | undefined;
|
|
18
19
|
enrollmentTokenExpiresAt?: number | undefined;
|
|
19
20
|
enrolledAt?: number | undefined;
|
|
@@ -55,7 +56,8 @@ export declare const getCurrentUser: import("convex/server").RegisteredQuery<"pu
|
|
|
55
56
|
_creationTime: number;
|
|
56
57
|
clerkUserId?: string | undefined;
|
|
57
58
|
lastLoginAt?: number | undefined;
|
|
58
|
-
|
|
59
|
+
passcodeHash?: string | undefined;
|
|
60
|
+
authenticationMethods?: ("biometric_face" | "biometric_hand" | "pin" | "password")[] | undefined;
|
|
59
61
|
enrollmentTokenHash?: string | undefined;
|
|
60
62
|
enrollmentTokenExpiresAt?: number | undefined;
|
|
61
63
|
enrolledAt?: number | undefined;
|
|
@@ -85,20 +87,52 @@ export declare const getCurrentUser: import("convex/server").RegisteredQuery<"pu
|
|
|
85
87
|
createdBy: import("convex/values").GenericId<"admins">;
|
|
86
88
|
}>>;
|
|
87
89
|
/**
|
|
88
|
-
* Get current active attendance session
|
|
90
|
+
* Get current active attendance session for authenticated attendant
|
|
91
|
+
* Returns attendance details with branch and attendant info
|
|
89
92
|
*/
|
|
90
|
-
export declare const
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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", {
|
|
97
118
|
branchId: import("convex/values").GenericId<"branches">;
|
|
98
|
-
|
|
99
|
-
|
|
119
|
+
}, Promise<({
|
|
120
|
+
_id: import("convex/values").GenericId<"attendanceLogs">;
|
|
100
121
|
clockInAt: number;
|
|
101
|
-
|
|
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
|
+
})[]>>;
|
|
102
136
|
/**
|
|
103
137
|
* Get attendance history - Paginated
|
|
104
138
|
* Supports usePaginatedQuery for infinite scroll
|
|
@@ -136,7 +170,37 @@ export declare const clockIn: import("convex/server").RegisteredMutation<"public
|
|
|
136
170
|
*/
|
|
137
171
|
export declare const clockOut: import("convex/server").RegisteredMutation<"public", {
|
|
138
172
|
attendanceLogId?: import("convex/values").GenericId<"attendanceLogs"> | undefined;
|
|
139
|
-
}, 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
|
+
}>>;
|
|
140
204
|
/**
|
|
141
205
|
* Get attendance statistics for a branch
|
|
142
206
|
*/
|
|
@@ -237,9 +301,13 @@ export declare const findByEmail: import("convex/server").RegisteredQuery<"publi
|
|
|
237
301
|
email: string;
|
|
238
302
|
}, Promise<{
|
|
239
303
|
id: import("convex/values").GenericId<"attendants">;
|
|
240
|
-
name: string;
|
|
241
304
|
email: string;
|
|
305
|
+
name: string;
|
|
242
306
|
branchId: import("convex/values").GenericId<"branches">;
|
|
307
|
+
authenticationMethods: ("biometric_face" | "biometric_hand" | "pin" | "password")[];
|
|
308
|
+
hasBiometric: boolean;
|
|
309
|
+
hasPin: boolean;
|
|
310
|
+
hasPassword: boolean;
|
|
243
311
|
} | null>>;
|
|
244
312
|
/**
|
|
245
313
|
* Start verification (for login or action)
|
|
@@ -308,4 +376,80 @@ export declare const checkVerificationStatus: import("convex/server").Registered
|
|
|
308
376
|
consecutiveFailures: number;
|
|
309
377
|
enrollmentStatus: "active" | "suspended" | "invited" | "enrolling" | "locked";
|
|
310
378
|
}>>;
|
|
379
|
+
/**
|
|
380
|
+
* Create session after successful biometric verification
|
|
381
|
+
*/
|
|
382
|
+
export declare const createSession: import("convex/server").RegisteredMutation<"public", {
|
|
383
|
+
deviceInfo?: string | undefined;
|
|
384
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
385
|
+
}, Promise<{
|
|
386
|
+
success: boolean;
|
|
387
|
+
sessionToken: string;
|
|
388
|
+
refreshToken: string;
|
|
389
|
+
expiresAt: number;
|
|
390
|
+
refreshExpiresAt: number;
|
|
391
|
+
sessionId: import("convex/values").GenericId<"attendantSessions">;
|
|
392
|
+
}>>;
|
|
393
|
+
/**
|
|
394
|
+
* Refresh session access token
|
|
395
|
+
*/
|
|
396
|
+
export declare const refreshSession: import("convex/server").RegisteredMutation<"public", {
|
|
397
|
+
refreshToken: string;
|
|
398
|
+
}, Promise<{
|
|
399
|
+
success: boolean;
|
|
400
|
+
sessionToken: string;
|
|
401
|
+
expiresAt: number;
|
|
402
|
+
}>>;
|
|
403
|
+
/**
|
|
404
|
+
* Logout - invalidate session
|
|
405
|
+
*/
|
|
406
|
+
export declare const logout: import("convex/server").RegisteredMutation<"public", {
|
|
407
|
+
sessionToken?: string | undefined;
|
|
408
|
+
}, Promise<{
|
|
409
|
+
success: boolean;
|
|
410
|
+
sessionsRevoked?: undefined;
|
|
411
|
+
} | {
|
|
412
|
+
success: boolean;
|
|
413
|
+
sessionsRevoked: number;
|
|
414
|
+
}>>;
|
|
415
|
+
/**
|
|
416
|
+
* Authenticate attendant with PIN or Password
|
|
417
|
+
*/
|
|
418
|
+
export declare const authenticateWithPinOrPassword: import("convex/server").RegisteredMutation<"public", {
|
|
419
|
+
deviceInfo?: string | undefined;
|
|
420
|
+
branchId: import("convex/values").GenericId<"branches">;
|
|
421
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
422
|
+
pinOrPassword: string;
|
|
423
|
+
isPin: boolean;
|
|
424
|
+
}, Promise<{
|
|
425
|
+
success: boolean;
|
|
426
|
+
attendantId: import("convex/values").GenericId<"attendants">;
|
|
427
|
+
name: string;
|
|
428
|
+
email: string;
|
|
429
|
+
branchId: import("convex/values").GenericId<"branches">;
|
|
430
|
+
}>>;
|
|
431
|
+
/**
|
|
432
|
+
* Get current session (validate and return session info)
|
|
433
|
+
*/
|
|
434
|
+
export declare const getCurrentSession: import("convex/server").RegisteredQuery<"public", {
|
|
435
|
+
sessionToken: string;
|
|
436
|
+
}, Promise<{
|
|
437
|
+
success: boolean;
|
|
438
|
+
attendant: {
|
|
439
|
+
_id: import("convex/values").GenericId<"attendants">;
|
|
440
|
+
name: string;
|
|
441
|
+
email: string;
|
|
442
|
+
branchId: import("convex/values").GenericId<"branches">;
|
|
443
|
+
};
|
|
444
|
+
branch: {
|
|
445
|
+
_id: import("convex/values").GenericId<"branches">;
|
|
446
|
+
name: string;
|
|
447
|
+
address: string;
|
|
448
|
+
} | null;
|
|
449
|
+
session: {
|
|
450
|
+
expiresAt: number;
|
|
451
|
+
lastActivityAt: number;
|
|
452
|
+
createdAt: number;
|
|
453
|
+
};
|
|
454
|
+
}>>;
|
|
311
455
|
//# sourceMappingURL=attendants.d.ts.map
|