@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/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;
@@ -29,9 +29,15 @@ export declare const getByPhone: import("convex/server").RegisteredQuery<"public
29
29
  createdAt: number;
30
30
  isDeleted: boolean;
31
31
  } | null>>;
32
+ /**
33
+ * Check if authenticated user is an admin or attendant
34
+ * Returns true if user is admin/attendant (should be blocked from customer app)
35
+ */
36
+ export declare const checkIsAdminOrAttendant: import("convex/server").RegisteredQuery<"public", {}, Promise<boolean>>;
32
37
  /**
33
38
  * Get current customer profile (from authenticated Clerk session)
34
39
  * Returns null if customer hasn't completed registration yet
40
+ * Returns null if user is admin/attendant (will be handled by unauthorized page)
35
41
  */
36
42
  export declare const getProfile: import("convex/server").RegisteredQuery<"public", {}, Promise<{
37
43
  orderCount: number;
@@ -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
@@ -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
  */
@@ -59,7 +59,8 @@ export declare function getCurrentAttendant(ctx: QueryCtx | MutationCtx): Promis
59
59
  _creationTime: number;
60
60
  clerkUserId?: string | undefined;
61
61
  lastLoginAt?: number | undefined;
62
- passcode?: string | undefined;
62
+ passcodeHash?: string | undefined;
63
+ authenticationMethods?: ("biometric_face" | "biometric_hand" | "pin" | "password")[] | undefined;
63
64
  enrollmentTokenHash?: string | undefined;
64
65
  enrollmentTokenExpiresAt?: number | undefined;
65
66
  enrolledAt?: number | undefined;
@@ -127,7 +128,8 @@ export declare function verifyAttendantBranch(ctx: QueryCtx | MutationCtx, atten
127
128
  _creationTime: number;
128
129
  clerkUserId?: string | undefined;
129
130
  lastLoginAt?: number | undefined;
130
- passcode?: string | undefined;
131
+ passcodeHash?: string | undefined;
132
+ authenticationMethods?: ("biometric_face" | "biometric_hand" | "pin" | "password")[] | undefined;
131
133
  enrollmentTokenHash?: string | undefined;
132
134
  enrollmentTokenExpiresAt?: number | undefined;
133
135
  enrolledAt?: number | undefined;
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Password/PIN Hashing Utilities
3
+ *
4
+ * Provides secure password/PIN hashing using Web Crypto API.
5
+ * Uses PBKDF2 for password hashing (more secure than SHA-256 for passwords).
6
+ */
7
+ /**
8
+ * Hash a password or PIN using PBKDF2
9
+ * This is more secure than SHA-256 for passwords as it's designed for this purpose
10
+ */
11
+ export declare function hashPassword(password: string, salt?: string): Promise<{
12
+ hash: string;
13
+ salt: string;
14
+ }>;
15
+ /**
16
+ * Verify a password or PIN against its hash
17
+ */
18
+ export declare function verifyPassword(password: string, hash: string, salt: string): Promise<boolean>;
19
+ /**
20
+ * Simple PIN hashing (4-6 digits) - uses SHA-256 with salt for simplicity
21
+ * PINs are less secure, so we use a simpler approach but still with salt
22
+ */
23
+ export declare function hashPIN(pin: string, salt?: string): Promise<{
24
+ hash: string;
25
+ salt: string;
26
+ }>;
27
+ /**
28
+ * Verify a PIN against its hash
29
+ */
30
+ export declare function verifyPIN(pin: string, hash: string, salt: string): Promise<boolean>;
31
+ //# sourceMappingURL=passwordHashing.d.ts.map
@@ -38,6 +38,9 @@ export declare const getBranches: import("convex/server").RegisteredQuery<"publi
38
38
  _id: import("convex/values").GenericId<"branches">;
39
39
  _creationTime: number;
40
40
  email?: string | undefined;
41
+ terminalId?: string | undefined;
42
+ stationPinHash?: string | undefined;
43
+ requireStationLogin?: boolean | undefined;
41
44
  phoneNumber: string;
42
45
  name: string;
43
46
  createdAt: number;
@@ -63,6 +66,9 @@ export declare const getBranchByCode: import("convex/server").RegisteredQuery<"p
63
66
  _id: import("convex/values").GenericId<"branches">;
64
67
  _creationTime: number;
65
68
  email?: string | undefined;
69
+ terminalId?: string | undefined;
70
+ stationPinHash?: string | undefined;
71
+ requireStationLogin?: boolean | undefined;
66
72
  phoneNumber: string;
67
73
  name: string;
68
74
  createdAt: number;
@@ -85,6 +91,9 @@ export declare const getBranch: import("convex/server").RegisteredQuery<"public"
85
91
  _id: import("convex/values").GenericId<"branches">;
86
92
  _creationTime: number;
87
93
  email?: string | undefined;
94
+ terminalId?: string | undefined;
95
+ stationPinHash?: string | undefined;
96
+ requireStationLogin?: boolean | undefined;
88
97
  phoneNumber: string;
89
98
  name: string;
90
99
  createdAt: number;
@@ -104,16 +113,17 @@ export declare const getBranch: import("convex/server").RegisteredQuery<"public"
104
113
  */
105
114
  export declare const getAttendants: import("convex/server").RegisteredQuery<"public", {
106
115
  branchId?: import("convex/values").GenericId<"branches"> | undefined;
107
- includeInactive?: boolean | undefined;
108
116
  numItems?: number | undefined;
109
117
  cursor?: string | undefined;
118
+ includeInactive?: boolean | undefined;
110
119
  }, Promise<{
111
120
  page: {
112
121
  _id: import("convex/values").GenericId<"attendants">;
113
122
  _creationTime: number;
114
123
  clerkUserId?: string | undefined;
115
124
  lastLoginAt?: number | undefined;
116
- passcode?: string | undefined;
125
+ passcodeHash?: string | undefined;
126
+ authenticationMethods?: ("biometric_face" | "biometric_hand" | "pin" | "password")[] | undefined;
117
127
  enrollmentTokenHash?: string | undefined;
118
128
  enrollmentTokenExpiresAt?: number | undefined;
119
129
  enrolledAt?: number | undefined;
@@ -313,6 +323,7 @@ export declare const createBranch: import("convex/server").RegisteredMutation<"p
313
323
  phoneNumber: string;
314
324
  name: string;
315
325
  code: string;
326
+ terminalId: string;
316
327
  address: string;
317
328
  city: string;
318
329
  country: string;
@@ -369,9 +380,9 @@ export declare const updateAttendant: import("convex/server").RegisteredMutation
369
380
  phoneNumber?: string | undefined;
370
381
  email?: string | undefined;
371
382
  name?: string | undefined;
372
- passcode?: string | undefined;
373
383
  branchId?: import("convex/values").GenericId<"branches"> | undefined;
374
384
  isActive?: boolean | undefined;
385
+ passcode?: string | undefined;
375
386
  attendantId: import("convex/values").GenericId<"attendants">;
376
387
  }, Promise<import("convex/values").GenericId<"attendants">>>;
377
388
  /**
@@ -226,6 +226,9 @@ export declare const getTransactionHistory: import("convex/server").RegisteredQu
226
226
  _id: import("convex/values").GenericId<"branches">;
227
227
  _creationTime: number;
228
228
  email?: string | undefined;
229
+ terminalId?: string | undefined;
230
+ stationPinHash?: string | undefined;
231
+ requireStationLogin?: boolean | undefined;
229
232
  phoneNumber: string;
230
233
  name: string;
231
234
  createdAt: number;
@@ -44,7 +44,8 @@ declare const _default: import("convex/server").SchemaDefinition<{
44
44
  attendants: import("convex/server").TableDefinition<import("convex/values").VObject<{
45
45
  clerkUserId?: string | undefined;
46
46
  lastLoginAt?: number | undefined;
47
- passcode?: string | undefined;
47
+ passcodeHash?: string | undefined;
48
+ authenticationMethods?: ("biometric_face" | "biometric_hand" | "pin" | "password")[] | undefined;
48
49
  enrollmentTokenHash?: string | undefined;
49
50
  enrollmentTokenExpiresAt?: number | undefined;
50
51
  enrolledAt?: number | undefined;
@@ -77,7 +78,8 @@ declare const _default: import("convex/server").SchemaDefinition<{
77
78
  email: import("convex/values").VString<string, "required">;
78
79
  phoneNumber: import("convex/values").VString<string, "required">;
79
80
  clerkUserId: import("convex/values").VString<string | undefined, "optional">;
80
- passcode: import("convex/values").VString<string | undefined, "optional">;
81
+ passcodeHash: import("convex/values").VString<string | undefined, "optional">;
82
+ authenticationMethods: import("convex/values").VArray<("biometric_face" | "biometric_hand" | "pin" | "password")[] | undefined, import("convex/values").VUnion<"biometric_face" | "biometric_hand" | "pin" | "password", [import("convex/values").VLiteral<"biometric_face", "required">, import("convex/values").VLiteral<"biometric_hand", "required">, import("convex/values").VLiteral<"pin", "required">, import("convex/values").VLiteral<"password", "required">], "required", never>, "optional">;
81
83
  branchId: import("convex/values").VId<import("convex/values").GenericId<"branches">, "required">;
82
84
  isActive: import("convex/values").VBoolean<boolean, "required">;
83
85
  enrollmentStatus: import("convex/values").VUnion<"active" | "suspended" | "invited" | "enrolling" | "locked", [import("convex/values").VLiteral<"invited", "required">, import("convex/values").VLiteral<"enrolling", "required">, import("convex/values").VLiteral<"active", "required">, import("convex/values").VLiteral<"suspended", "required">, import("convex/values").VLiteral<"locked", "required">], "required", never>;
@@ -110,7 +112,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
110
112
  createdBy: import("convex/values").VId<import("convex/values").GenericId<"admins">, "required">;
111
113
  lastLoginAt: import("convex/values").VFloat64<number | undefined, "optional">;
112
114
  isDeleted: import("convex/values").VBoolean<boolean, "required">;
113
- }, "required", "phoneNumber" | "email" | "name" | "clerkUserId" | "createdAt" | "lastLoginAt" | "isDeleted" | "passcode" | "branchId" | "isActive" | "enrollmentStatus" | "enrollmentTokenHash" | "enrollmentTokenExpiresAt" | "enrolledAt" | "enrolledBy" | "biometricTemplateHash" | "biometricDataEncrypted" | "biometricCaptureMetadata" | "lastVerificationAt" | "lastVerificationSuccess" | "consecutiveFailures" | "verificationTimeoutAt" | "createdBy" | "biometricCaptureMetadata.captureType" | "biometricCaptureMetadata.anglesCaptured" | "biometricCaptureMetadata.captureQuality" | "biometricCaptureMetadata.livenessPassed" | "biometricCaptureMetadata.deviceInfo" | "biometricCaptureMetadata.captureTimestamp">, {
115
+ }, "required", "phoneNumber" | "email" | "name" | "clerkUserId" | "createdAt" | "lastLoginAt" | "isDeleted" | "passcodeHash" | "authenticationMethods" | "branchId" | "isActive" | "enrollmentStatus" | "enrollmentTokenHash" | "enrollmentTokenExpiresAt" | "enrolledAt" | "enrolledBy" | "biometricTemplateHash" | "biometricDataEncrypted" | "biometricCaptureMetadata" | "lastVerificationAt" | "lastVerificationSuccess" | "consecutiveFailures" | "verificationTimeoutAt" | "createdBy" | "biometricCaptureMetadata.captureType" | "biometricCaptureMetadata.anglesCaptured" | "biometricCaptureMetadata.captureQuality" | "biometricCaptureMetadata.livenessPassed" | "biometricCaptureMetadata.deviceInfo" | "biometricCaptureMetadata.captureTimestamp">, {
114
116
  by_branch: ["branchId", "_creationTime"];
115
117
  by_email: ["email", "_creationTime"];
116
118
  by_phone: ["phoneNumber", "_creationTime"];
@@ -140,6 +142,9 @@ declare const _default: import("convex/server").SchemaDefinition<{
140
142
  }, {}, {}>;
141
143
  branches: import("convex/server").TableDefinition<import("convex/values").VObject<{
142
144
  email?: string | undefined;
145
+ terminalId?: string | undefined;
146
+ stationPinHash?: string | undefined;
147
+ requireStationLogin?: boolean | undefined;
143
148
  phoneNumber: string;
144
149
  name: string;
145
150
  createdAt: number;
@@ -155,6 +160,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
155
160
  }, {
156
161
  name: import("convex/values").VString<string, "required">;
157
162
  code: import("convex/values").VString<string, "required">;
163
+ terminalId: import("convex/values").VString<string | undefined, "optional">;
158
164
  address: import("convex/values").VString<string, "required">;
159
165
  city: import("convex/values").VString<string, "required">;
160
166
  country: import("convex/values").VString<string, "required">;
@@ -162,14 +168,17 @@ declare const _default: import("convex/server").SchemaDefinition<{
162
168
  email: import("convex/values").VString<string | undefined, "optional">;
163
169
  pricingPerKg: import("convex/values").VFloat64<number, "required">;
164
170
  deliveryFee: import("convex/values").VFloat64<number, "required">;
171
+ stationPinHash: import("convex/values").VString<string | undefined, "optional">;
172
+ requireStationLogin: import("convex/values").VBoolean<boolean | undefined, "optional">;
165
173
  isActive: import("convex/values").VBoolean<boolean, "required">;
166
174
  createdAt: import("convex/values").VFloat64<number, "required">;
167
175
  createdBy: import("convex/values").VId<import("convex/values").GenericId<"admins">, "required">;
168
176
  isDeleted: import("convex/values").VBoolean<boolean, "required">;
169
- }, "required", "phoneNumber" | "email" | "name" | "createdAt" | "isDeleted" | "isActive" | "createdBy" | "code" | "address" | "city" | "country" | "pricingPerKg" | "deliveryFee">, {
177
+ }, "required", "phoneNumber" | "email" | "name" | "createdAt" | "isDeleted" | "isActive" | "createdBy" | "code" | "terminalId" | "address" | "city" | "country" | "pricingPerKg" | "deliveryFee" | "stationPinHash" | "requireStationLogin">, {
170
178
  by_city: ["city", "_creationTime"];
171
179
  by_active: ["isActive", "_creationTime"];
172
180
  by_code: ["code", "_creationTime"];
181
+ by_terminal_id: ["terminalId", "_creationTime"];
173
182
  }, {}, {}>;
174
183
  orders: import("convex/server").TableDefinition<import("convex/values").VObject<{
175
184
  createdBy?: import("convex/values").GenericId<"attendants"> | undefined;
@@ -404,6 +413,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
404
413
  branchId?: import("convex/values").GenericId<"branches"> | undefined;
405
414
  deviceId?: string | undefined;
406
415
  entityId?: string | undefined;
416
+ attendanceId?: import("convex/values").GenericId<"attendanceLogs"> | undefined;
407
417
  ipAddress?: string | undefined;
408
418
  details?: string | undefined;
409
419
  oldValue?: string | undefined;
@@ -421,6 +431,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
421
431
  action: import("convex/values").VString<string, "required">;
422
432
  entityType: import("convex/values").VString<string, "required">;
423
433
  entityId: import("convex/values").VString<string | undefined, "optional">;
434
+ attendanceId: import("convex/values").VId<import("convex/values").GenericId<"attendanceLogs"> | undefined, "optional">;
424
435
  branchId: import("convex/values").VId<import("convex/values").GenericId<"branches"> | undefined, "optional">;
425
436
  deviceId: import("convex/values").VString<string | undefined, "optional">;
426
437
  ipAddress: import("convex/values").VString<string | undefined, "optional">;
@@ -428,12 +439,13 @@ declare const _default: import("convex/server").SchemaDefinition<{
428
439
  oldValue: import("convex/values").VString<string | undefined, "optional">;
429
440
  newValue: import("convex/values").VString<string | undefined, "optional">;
430
441
  timestamp: import("convex/values").VFloat64<number, "required">;
431
- }, "required", "branchId" | "deviceId" | "actorId" | "actorType" | "actorRole" | "action" | "entityType" | "entityId" | "ipAddress" | "details" | "oldValue" | "newValue" | "timestamp">, {
442
+ }, "required", "branchId" | "deviceId" | "actorId" | "actorType" | "actorRole" | "action" | "entityType" | "entityId" | "attendanceId" | "ipAddress" | "details" | "oldValue" | "newValue" | "timestamp">, {
432
443
  by_actor: ["actorId", "actorType", "_creationTime"];
433
444
  by_action: ["action", "_creationTime"];
434
445
  by_entity: ["entityType", "entityId", "_creationTime"];
435
446
  by_timestamp: ["timestamp", "_creationTime"];
436
447
  by_branch: ["branchId", "_creationTime"];
448
+ by_attendance: ["attendanceId", "_creationTime"];
437
449
  }, {}, {}>;
438
450
  vouchers: import("convex/server").TableDefinition<import("convex/values").VObject<{
439
451
  name?: string | undefined;
@@ -640,6 +652,41 @@ declare const _default: import("convex/server").SchemaDefinition<{
640
652
  by_status: ["status", "_creationTime"];
641
653
  by_challenge_hash: ["challengeHash", "_creationTime"];
642
654
  }, {}, {}>;
655
+ stationSessions: import("convex/server").TableDefinition<import("convex/values").VObject<{
656
+ deviceInfo?: string | undefined;
657
+ ipAddress?: string | undefined;
658
+ loggedInBy?: import("convex/values").GenericId<"attendants"> | undefined;
659
+ stationPinUsed?: boolean | undefined;
660
+ loggedOutAt?: number | undefined;
661
+ loggedOutBy?: import("convex/values").GenericId<"attendants"> | undefined;
662
+ isDeleted: boolean;
663
+ branchId: import("convex/values").GenericId<"branches">;
664
+ isActive: boolean;
665
+ deviceId: string;
666
+ expiresAt: number;
667
+ sessionTokenHash: string;
668
+ loggedInAt: number;
669
+ }, {
670
+ branchId: import("convex/values").VId<import("convex/values").GenericId<"branches">, "required">;
671
+ deviceId: import("convex/values").VString<string, "required">;
672
+ sessionTokenHash: import("convex/values").VString<string, "required">;
673
+ deviceInfo: import("convex/values").VString<string | undefined, "optional">;
674
+ ipAddress: import("convex/values").VString<string | undefined, "optional">;
675
+ loggedInBy: import("convex/values").VId<import("convex/values").GenericId<"attendants"> | undefined, "optional">;
676
+ loggedInAt: import("convex/values").VFloat64<number, "required">;
677
+ stationPinUsed: import("convex/values").VBoolean<boolean | undefined, "optional">;
678
+ expiresAt: import("convex/values").VFloat64<number, "required">;
679
+ isActive: import("convex/values").VBoolean<boolean, "required">;
680
+ loggedOutAt: import("convex/values").VFloat64<number | undefined, "optional">;
681
+ loggedOutBy: import("convex/values").VId<import("convex/values").GenericId<"attendants"> | undefined, "optional">;
682
+ isDeleted: import("convex/values").VBoolean<boolean, "required">;
683
+ }, "required", "isDeleted" | "branchId" | "isActive" | "deviceInfo" | "deviceId" | "ipAddress" | "expiresAt" | "sessionTokenHash" | "loggedInBy" | "loggedInAt" | "stationPinUsed" | "loggedOutAt" | "loggedOutBy">, {
684
+ by_branch: ["branchId", "_creationTime"];
685
+ by_device: ["deviceId", "_creationTime"];
686
+ by_session_token: ["sessionTokenHash", "_creationTime"];
687
+ by_active: ["isActive", "_creationTime"];
688
+ by_branch_device: ["branchId", "deviceId", "_creationTime"];
689
+ }, {}, {}>;
643
690
  attendantSessions: import("convex/server").TableDefinition<import("convex/values").VObject<{
644
691
  deviceInfo?: string | undefined;
645
692
  ipAddress?: string | undefined;
@@ -842,6 +889,45 @@ declare const _default: import("convex/server").SchemaDefinition<{
842
889
  by_verified_at: ["verifiedAt", "_creationTime"];
843
890
  by_success: ["success", "_creationTime"];
844
891
  }, {}, {}>;
892
+ actionLogs: import("convex/server").TableDefinition<import("convex/values").VObject<{
893
+ amount?: number | undefined;
894
+ completedAt?: number | undefined;
895
+ entityType?: string | undefined;
896
+ entityId?: import("convex/values").GenericId<"orders"> | undefined;
897
+ errorMessage?: string | undefined;
898
+ actionData?: string | undefined;
899
+ verificationMethod?: "biometric_face" | "biometric_hand" | "pin" | "password" | undefined;
900
+ verificationId?: import("convex/values").GenericId<"biometricVerifications"> | undefined;
901
+ createdAt: number;
902
+ branchId: import("convex/values").GenericId<"branches">;
903
+ attendantId: import("convex/values").GenericId<"attendants">;
904
+ attendanceId: import("convex/values").GenericId<"attendanceLogs">;
905
+ actionType: string;
906
+ actionStatus: "pending" | "completed" | "cancelled" | "failed";
907
+ }, {
908
+ attendanceId: import("convex/values").VId<import("convex/values").GenericId<"attendanceLogs">, "required">;
909
+ attendantId: import("convex/values").VId<import("convex/values").GenericId<"attendants">, "required">;
910
+ branchId: import("convex/values").VId<import("convex/values").GenericId<"branches">, "required">;
911
+ actionType: import("convex/values").VString<string, "required">;
912
+ actionStatus: import("convex/values").VUnion<"pending" | "completed" | "cancelled" | "failed", [import("convex/values").VLiteral<"pending", "required">, import("convex/values").VLiteral<"completed", "required">, import("convex/values").VLiteral<"failed", "required">, import("convex/values").VLiteral<"cancelled", "required">], "required", never>;
913
+ entityType: import("convex/values").VString<string | undefined, "optional">;
914
+ entityId: import("convex/values").VId<import("convex/values").GenericId<"orders"> | undefined, "optional">;
915
+ actionData: import("convex/values").VString<string | undefined, "optional">;
916
+ errorMessage: import("convex/values").VString<string | undefined, "optional">;
917
+ amount: import("convex/values").VFloat64<number | undefined, "optional">;
918
+ verificationMethod: import("convex/values").VUnion<"biometric_face" | "biometric_hand" | "pin" | "password" | undefined, [import("convex/values").VLiteral<"biometric_face", "required">, import("convex/values").VLiteral<"biometric_hand", "required">, import("convex/values").VLiteral<"pin", "required">, import("convex/values").VLiteral<"password", "required">], "optional", never>;
919
+ verificationId: import("convex/values").VId<import("convex/values").GenericId<"biometricVerifications"> | undefined, "optional">;
920
+ createdAt: import("convex/values").VFloat64<number, "required">;
921
+ completedAt: import("convex/values").VFloat64<number | undefined, "optional">;
922
+ }, "required", "createdAt" | "branchId" | "amount" | "completedAt" | "attendantId" | "entityType" | "entityId" | "attendanceId" | "errorMessage" | "actionType" | "actionStatus" | "actionData" | "verificationMethod" | "verificationId">, {
923
+ by_attendance: ["attendanceId", "_creationTime"];
924
+ by_attendant: ["attendantId", "_creationTime"];
925
+ by_branch: ["branchId", "_creationTime"];
926
+ by_action_type: ["actionType", "_creationTime"];
927
+ by_status: ["actionStatus", "_creationTime"];
928
+ by_created_at: ["createdAt", "_creationTime"];
929
+ by_attendance_created: ["attendanceId", "createdAt", "_creationTime"];
930
+ }, {}, {}>;
845
931
  }, true>;
846
932
  export default _default;
847
933
  //# sourceMappingURL=schema.d.ts.map