@devlider001/washlab-backend 1.0.4 → 1.0.6
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 +2 -0
- package/convex/admin.d.ts +1 -1
- package/convex/audit.d.ts +39 -0
- package/convex/customers.d.ts +12 -5
- package/convex/lib/auth.d.ts +24 -1
- package/convex/notifications.d.ts +170 -0
- package/convex/schema.d.ts +53 -2
- package/dist/convex/admin.d.ts +377 -0
- package/dist/convex/admin.d.ts.map +1 -0
- package/dist/convex/admin.js +959 -0
- package/dist/convex/admin.js.map +1 -0
- package/dist/convex/analytics.d.ts +87 -0
- package/dist/convex/analytics.d.ts.map +1 -0
- package/dist/convex/analytics.js +361 -0
- package/dist/convex/analytics.js.map +1 -0
- package/dist/convex/attendants.d.ts +140 -0
- package/dist/convex/attendants.d.ts.map +1 -0
- package/dist/convex/attendants.js +337 -0
- package/dist/convex/attendants.js.map +1 -0
- package/dist/convex/audit.d.ts +158 -0
- package/dist/convex/audit.d.ts.map +1 -0
- package/dist/convex/audit.js +184 -0
- package/dist/convex/audit.js.map +1 -0
- package/dist/convex/clerk.d.ts +53 -0
- package/dist/convex/clerk.d.ts.map +1 -0
- package/dist/convex/clerk.js +316 -0
- package/dist/convex/clerk.js.map +1 -0
- package/dist/convex/customers.d.ts +224 -0
- package/dist/convex/customers.d.ts.map +1 -0
- package/dist/convex/customers.js +504 -0
- package/dist/convex/customers.js.map +1 -0
- package/dist/convex/http.d.ts +3 -0
- package/dist/convex/http.d.ts.map +1 -0
- package/dist/convex/http.js +115 -0
- package/dist/convex/http.js.map +1 -0
- package/dist/convex/lib/audit.d.ts +36 -0
- package/dist/convex/lib/audit.d.ts.map +1 -0
- package/dist/convex/lib/audit.js +59 -0
- package/dist/convex/lib/audit.js.map +1 -0
- package/dist/convex/lib/auth.d.ts +96 -0
- package/dist/convex/lib/auth.d.ts.map +1 -0
- package/dist/convex/lib/auth.js +94 -0
- package/dist/convex/lib/auth.js.map +1 -0
- package/dist/convex/lib/utils.d.ts +38 -0
- package/dist/convex/lib/utils.d.ts.map +1 -0
- package/dist/convex/lib/utils.js +71 -0
- package/dist/convex/lib/utils.js.map +1 -0
- package/dist/convex/loyalty.d.ts +82 -0
- package/dist/convex/loyalty.d.ts.map +1 -0
- package/dist/convex/loyalty.js +286 -0
- package/dist/convex/loyalty.js.map +1 -0
- package/dist/convex/orders.d.ts +326 -0
- package/dist/convex/orders.d.ts.map +1 -0
- package/dist/convex/orders.js +570 -0
- package/dist/convex/orders.js.map +1 -0
- package/dist/convex/payments.d.ts +134 -0
- package/dist/convex/payments.d.ts.map +1 -0
- package/dist/convex/payments.js +360 -0
- package/dist/convex/payments.js.map +1 -0
- package/dist/convex/resources.d.ts +119 -0
- package/dist/convex/resources.d.ts.map +1 -0
- package/dist/convex/resources.js +283 -0
- package/dist/convex/resources.js.map +1 -0
- package/dist/convex/schema.d.ts +450 -0
- package/dist/convex/schema.d.ts.map +1 -0
- package/dist/convex/schema.js +347 -0
- package/dist/convex/schema.js.map +1 -0
- package/dist/convex/vouchers.d.ts +187 -0
- package/dist/convex/vouchers.d.ts.map +1 -0
- package/dist/convex/vouchers.js +464 -0
- package/dist/convex/vouchers.js.map +1 -0
- package/dist/src/index.d.ts +9 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +9 -0
- package/dist/src/index.js.map +1 -0
- package/package.json +5 -3
- package/convex/_generated/api.js +0 -23
- package/convex/_generated/server.js +0 -93
|
@@ -19,6 +19,7 @@ import type * as lib_audit from "../lib/audit.js";
|
|
|
19
19
|
import type * as lib_auth from "../lib/auth.js";
|
|
20
20
|
import type * as lib_utils from "../lib/utils.js";
|
|
21
21
|
import type * as loyalty from "../loyalty.js";
|
|
22
|
+
import type * as notifications from "../notifications.js";
|
|
22
23
|
import type * as orders from "../orders.js";
|
|
23
24
|
import type * as payments from "../payments.js";
|
|
24
25
|
import type * as resources from "../resources.js";
|
|
@@ -42,6 +43,7 @@ declare const fullApi: ApiFromModules<{
|
|
|
42
43
|
"lib/auth": typeof lib_auth;
|
|
43
44
|
"lib/utils": typeof lib_utils;
|
|
44
45
|
loyalty: typeof loyalty;
|
|
46
|
+
notifications: typeof notifications;
|
|
45
47
|
orders: typeof orders;
|
|
46
48
|
payments: typeof payments;
|
|
47
49
|
resources: typeof resources;
|
package/convex/admin.d.ts
CHANGED
|
@@ -226,6 +226,7 @@ export declare const getCustomers: import("convex/server").RegisteredQuery<"publ
|
|
|
226
226
|
_creationTime: number;
|
|
227
227
|
email?: string | undefined;
|
|
228
228
|
clerkUserId?: string | undefined;
|
|
229
|
+
status?: "active" | "blocked" | "suspended" | "restricted" | undefined;
|
|
229
230
|
statusNote?: string | undefined;
|
|
230
231
|
statusChangedBy?: import("convex/values").GenericId<"admins"> | undefined;
|
|
231
232
|
statusChangedAt?: number | undefined;
|
|
@@ -235,7 +236,6 @@ export declare const getCustomers: import("convex/server").RegisteredQuery<"publ
|
|
|
235
236
|
name: string;
|
|
236
237
|
isRegistered: boolean;
|
|
237
238
|
isVerified: boolean;
|
|
238
|
-
status: "active" | "blocked" | "suspended" | "restricted";
|
|
239
239
|
createdAt: number;
|
|
240
240
|
isDeleted: boolean;
|
|
241
241
|
}[];
|
package/convex/audit.d.ts
CHANGED
|
@@ -122,4 +122,43 @@ export declare const getByTimeRange: import("convex/server").RegisteredQuery<"pu
|
|
|
122
122
|
entityType: string;
|
|
123
123
|
timestamp: number;
|
|
124
124
|
}[]>>;
|
|
125
|
+
/**
|
|
126
|
+
* Get all audit logs with filters - Paginated
|
|
127
|
+
* Supports usePaginatedQuery for infinite scroll
|
|
128
|
+
*/
|
|
129
|
+
export declare const getAll: import("convex/server").RegisteredQuery<"public", {
|
|
130
|
+
actorType?: "admin" | "customer" | "attendant" | undefined;
|
|
131
|
+
action?: string | undefined;
|
|
132
|
+
entityType?: string | undefined;
|
|
133
|
+
startTimestamp?: number | undefined;
|
|
134
|
+
endTimestamp?: number | undefined;
|
|
135
|
+
paginationOpts: {
|
|
136
|
+
id?: number;
|
|
137
|
+
endCursor?: string | null;
|
|
138
|
+
maximumRowsRead?: number;
|
|
139
|
+
maximumBytesRead?: number;
|
|
140
|
+
numItems: number;
|
|
141
|
+
cursor: string | null;
|
|
142
|
+
};
|
|
143
|
+
}, Promise<{
|
|
144
|
+
page: {
|
|
145
|
+
_id: import("convex/values").GenericId<"auditLogs">;
|
|
146
|
+
_creationTime: number;
|
|
147
|
+
branchId?: import("convex/values").GenericId<"branches"> | undefined;
|
|
148
|
+
deviceId?: string | undefined;
|
|
149
|
+
entityId?: string | undefined;
|
|
150
|
+
ipAddress?: string | undefined;
|
|
151
|
+
details?: string | undefined;
|
|
152
|
+
oldValue?: string | undefined;
|
|
153
|
+
newValue?: string | undefined;
|
|
154
|
+
actorId: string;
|
|
155
|
+
actorType: "admin" | "customer" | "attendant";
|
|
156
|
+
actorRole: string;
|
|
157
|
+
action: string;
|
|
158
|
+
entityType: string;
|
|
159
|
+
timestamp: number;
|
|
160
|
+
}[];
|
|
161
|
+
isDone: boolean;
|
|
162
|
+
continueCursor: string;
|
|
163
|
+
}>>;
|
|
125
164
|
//# sourceMappingURL=audit.d.ts.map
|
package/convex/customers.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export declare const getByPhone: import("convex/server").RegisteredQuery<"public
|
|
|
16
16
|
_creationTime: number;
|
|
17
17
|
email?: string | undefined;
|
|
18
18
|
clerkUserId?: string | undefined;
|
|
19
|
+
status?: "active" | "blocked" | "suspended" | "restricted" | undefined;
|
|
19
20
|
statusNote?: string | undefined;
|
|
20
21
|
statusChangedBy?: import("convex/values").GenericId<"admins"> | undefined;
|
|
21
22
|
statusChangedAt?: number | undefined;
|
|
@@ -25,12 +26,12 @@ export declare const getByPhone: import("convex/server").RegisteredQuery<"public
|
|
|
25
26
|
name: string;
|
|
26
27
|
isRegistered: boolean;
|
|
27
28
|
isVerified: boolean;
|
|
28
|
-
status: "active" | "blocked" | "suspended" | "restricted";
|
|
29
29
|
createdAt: number;
|
|
30
30
|
isDeleted: boolean;
|
|
31
31
|
} | null>>;
|
|
32
32
|
/**
|
|
33
33
|
* Get current customer profile (from authenticated Clerk session)
|
|
34
|
+
* Returns null if customer hasn't completed registration yet
|
|
34
35
|
*/
|
|
35
36
|
export declare const getProfile: import("convex/server").RegisteredQuery<"public", {}, Promise<{
|
|
36
37
|
orderCount: number;
|
|
@@ -39,6 +40,7 @@ export declare const getProfile: import("convex/server").RegisteredQuery<"public
|
|
|
39
40
|
_creationTime: number;
|
|
40
41
|
email?: string | undefined;
|
|
41
42
|
clerkUserId?: string | undefined;
|
|
43
|
+
status?: "active" | "blocked" | "suspended" | "restricted" | undefined;
|
|
42
44
|
statusNote?: string | undefined;
|
|
43
45
|
statusChangedBy?: import("convex/values").GenericId<"admins"> | undefined;
|
|
44
46
|
statusChangedAt?: number | undefined;
|
|
@@ -48,18 +50,22 @@ export declare const getProfile: import("convex/server").RegisteredQuery<"public
|
|
|
48
50
|
name: string;
|
|
49
51
|
isRegistered: boolean;
|
|
50
52
|
isVerified: boolean;
|
|
51
|
-
status: "active" | "blocked" | "suspended" | "restricted";
|
|
52
53
|
createdAt: number;
|
|
53
54
|
isDeleted: boolean;
|
|
54
|
-
}>>;
|
|
55
|
+
} | null>>;
|
|
55
56
|
/**
|
|
56
57
|
* Get customer order history - Paginated
|
|
57
58
|
* Supports usePaginatedQuery for infinite scroll
|
|
59
|
+
* Returns empty results if customer not found
|
|
58
60
|
*/
|
|
59
61
|
export declare const getOrders: import("convex/server").RegisteredQuery<"public", {
|
|
60
62
|
cursor?: string | undefined;
|
|
61
63
|
numItems?: number | undefined;
|
|
62
64
|
}, Promise<{
|
|
65
|
+
page: never[];
|
|
66
|
+
isDone: boolean;
|
|
67
|
+
continueCursor: null;
|
|
68
|
+
} | {
|
|
63
69
|
page: {
|
|
64
70
|
_id: import("convex/values").GenericId<"orders">;
|
|
65
71
|
_creationTime: number;
|
|
@@ -106,6 +112,7 @@ export declare const getOrders: import("convex/server").RegisteredQuery<"public"
|
|
|
106
112
|
}>>;
|
|
107
113
|
/**
|
|
108
114
|
* Get customer loyalty points balance
|
|
115
|
+
* Returns zero points if customer not found
|
|
109
116
|
*/
|
|
110
117
|
export declare const getLoyaltyPoints: import("convex/server").RegisteredQuery<"public", {}, Promise<{
|
|
111
118
|
points: number;
|
|
@@ -178,6 +185,7 @@ export declare const search: import("convex/server").RegisteredQuery<"public", {
|
|
|
178
185
|
_creationTime: number;
|
|
179
186
|
email?: string | undefined;
|
|
180
187
|
clerkUserId?: string | undefined;
|
|
188
|
+
status?: "active" | "blocked" | "suspended" | "restricted" | undefined;
|
|
181
189
|
statusNote?: string | undefined;
|
|
182
190
|
statusChangedBy?: import("convex/values").GenericId<"admins"> | undefined;
|
|
183
191
|
statusChangedAt?: number | undefined;
|
|
@@ -187,7 +195,6 @@ export declare const search: import("convex/server").RegisteredQuery<"public", {
|
|
|
187
195
|
name: string;
|
|
188
196
|
isRegistered: boolean;
|
|
189
197
|
isVerified: boolean;
|
|
190
|
-
status: "active" | "blocked" | "suspended" | "restricted";
|
|
191
198
|
createdAt: number;
|
|
192
199
|
isDeleted: boolean;
|
|
193
200
|
}[]>>;
|
|
@@ -208,6 +215,7 @@ export declare const getDetails: import("convex/server").RegisteredQuery<"public
|
|
|
208
215
|
_creationTime: number;
|
|
209
216
|
email?: string | undefined;
|
|
210
217
|
clerkUserId?: string | undefined;
|
|
218
|
+
status?: "active" | "blocked" | "suspended" | "restricted" | undefined;
|
|
211
219
|
statusNote?: string | undefined;
|
|
212
220
|
statusChangedBy?: import("convex/values").GenericId<"admins"> | undefined;
|
|
213
221
|
statusChangedAt?: number | undefined;
|
|
@@ -217,7 +225,6 @@ export declare const getDetails: import("convex/server").RegisteredQuery<"public
|
|
|
217
225
|
name: string;
|
|
218
226
|
isRegistered: boolean;
|
|
219
227
|
isVerified: boolean;
|
|
220
|
-
status: "active" | "blocked" | "suspended" | "restricted";
|
|
221
228
|
createdAt: number;
|
|
222
229
|
isDeleted: boolean;
|
|
223
230
|
}>>;
|
package/convex/lib/auth.d.ts
CHANGED
|
@@ -5,6 +5,29 @@ import { Id } from "../_generated/dataModel";
|
|
|
5
5
|
* @throws Error if user is not authenticated
|
|
6
6
|
*/
|
|
7
7
|
export declare function getClerkIdentity(ctx: QueryCtx | MutationCtx): Promise<import("convex/server").UserIdentity>;
|
|
8
|
+
/**
|
|
9
|
+
* Find current customer user from Clerk identity
|
|
10
|
+
* Returns null if customer doesn't exist (for profile check scenarios)
|
|
11
|
+
* @throws Error if user is not authenticated
|
|
12
|
+
*/
|
|
13
|
+
export declare function findCurrentCustomer(ctx: QueryCtx | MutationCtx): Promise<{
|
|
14
|
+
_id: import("convex/values").GenericId<"users">;
|
|
15
|
+
_creationTime: number;
|
|
16
|
+
email?: string | undefined;
|
|
17
|
+
clerkUserId?: string | undefined;
|
|
18
|
+
status?: "active" | "blocked" | "suspended" | "restricted" | undefined;
|
|
19
|
+
statusNote?: string | undefined;
|
|
20
|
+
statusChangedBy?: import("convex/values").GenericId<"admins"> | undefined;
|
|
21
|
+
statusChangedAt?: number | undefined;
|
|
22
|
+
lastLoginAt?: number | undefined;
|
|
23
|
+
preferredBranchId?: import("convex/values").GenericId<"branches"> | undefined;
|
|
24
|
+
phoneNumber: string;
|
|
25
|
+
name: string;
|
|
26
|
+
isRegistered: boolean;
|
|
27
|
+
isVerified: boolean;
|
|
28
|
+
createdAt: number;
|
|
29
|
+
isDeleted: boolean;
|
|
30
|
+
} | null>;
|
|
8
31
|
/**
|
|
9
32
|
* Get current customer user from Clerk identity
|
|
10
33
|
* @throws Error if user is not authenticated or not found
|
|
@@ -14,6 +37,7 @@ export declare function getCurrentCustomer(ctx: QueryCtx | MutationCtx): Promise
|
|
|
14
37
|
_creationTime: number;
|
|
15
38
|
email?: string | undefined;
|
|
16
39
|
clerkUserId?: string | undefined;
|
|
40
|
+
status?: "active" | "blocked" | "suspended" | "restricted" | undefined;
|
|
17
41
|
statusNote?: string | undefined;
|
|
18
42
|
statusChangedBy?: import("convex/values").GenericId<"admins"> | undefined;
|
|
19
43
|
statusChangedAt?: number | undefined;
|
|
@@ -23,7 +47,6 @@ export declare function getCurrentCustomer(ctx: QueryCtx | MutationCtx): Promise
|
|
|
23
47
|
name: string;
|
|
24
48
|
isRegistered: boolean;
|
|
25
49
|
isVerified: boolean;
|
|
26
|
-
status: "active" | "blocked" | "suspended" | "restricted";
|
|
27
50
|
createdAt: number;
|
|
28
51
|
isDeleted: boolean;
|
|
29
52
|
}>;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Notification Functions
|
|
3
|
+
*
|
|
4
|
+
* Handles creating, reading, and managing system notifications
|
|
5
|
+
* for customers, attendants, and admins.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Get notifications for current user - Paginated
|
|
9
|
+
* Supports usePaginatedQuery for infinite scroll
|
|
10
|
+
*/
|
|
11
|
+
export declare const getMyNotifications: import("convex/server").RegisteredQuery<"public", {
|
|
12
|
+
type?: "info" | "success" | "warning" | "error" | "order" | "payment" | "system" | undefined;
|
|
13
|
+
isRead?: boolean | undefined;
|
|
14
|
+
paginationOpts: {
|
|
15
|
+
id?: number;
|
|
16
|
+
endCursor?: string | null;
|
|
17
|
+
maximumRowsRead?: number;
|
|
18
|
+
maximumBytesRead?: number;
|
|
19
|
+
numItems: number;
|
|
20
|
+
cursor: string | null;
|
|
21
|
+
};
|
|
22
|
+
}, Promise<{
|
|
23
|
+
page: never[];
|
|
24
|
+
isDone: boolean;
|
|
25
|
+
continueCursor: null;
|
|
26
|
+
} | {
|
|
27
|
+
page: {
|
|
28
|
+
_id: import("convex/values").GenericId<"notifications">;
|
|
29
|
+
_creationTime: number;
|
|
30
|
+
branchId?: import("convex/values").GenericId<"branches"> | undefined;
|
|
31
|
+
entityType?: string | undefined;
|
|
32
|
+
entityId?: string | undefined;
|
|
33
|
+
actionUrl?: string | undefined;
|
|
34
|
+
actionLabel?: string | undefined;
|
|
35
|
+
readAt?: number | undefined;
|
|
36
|
+
senderId?: string | undefined;
|
|
37
|
+
senderType?: "admin" | "attendant" | "system" | undefined;
|
|
38
|
+
expiresAt?: number | undefined;
|
|
39
|
+
scheduledFor?: number | undefined;
|
|
40
|
+
sentAt?: number | undefined;
|
|
41
|
+
type: "info" | "success" | "warning" | "error" | "order" | "payment" | "system";
|
|
42
|
+
createdAt: number;
|
|
43
|
+
isDeleted: boolean;
|
|
44
|
+
recipientId: string;
|
|
45
|
+
recipientType: "admin" | "customer" | "attendant" | "all";
|
|
46
|
+
title: string;
|
|
47
|
+
message: string;
|
|
48
|
+
priority: "low" | "normal" | "high" | "urgent";
|
|
49
|
+
isRead: boolean;
|
|
50
|
+
}[];
|
|
51
|
+
isDone: boolean;
|
|
52
|
+
continueCursor: string;
|
|
53
|
+
}>>;
|
|
54
|
+
/**
|
|
55
|
+
* Get unread notification count for current user
|
|
56
|
+
*/
|
|
57
|
+
export declare const getUnreadCount: import("convex/server").RegisteredQuery<"public", {}, Promise<number>>;
|
|
58
|
+
/**
|
|
59
|
+
* Mark notification as read
|
|
60
|
+
*/
|
|
61
|
+
export declare const markAsRead: import("convex/server").RegisteredMutation<"public", {
|
|
62
|
+
notificationId: import("convex/values").GenericId<"notifications">;
|
|
63
|
+
}, Promise<{
|
|
64
|
+
success: boolean;
|
|
65
|
+
}>>;
|
|
66
|
+
/**
|
|
67
|
+
* Mark all notifications as read for current user
|
|
68
|
+
*/
|
|
69
|
+
export declare const markAllAsRead: import("convex/server").RegisteredMutation<"public", {}, Promise<{
|
|
70
|
+
success: boolean;
|
|
71
|
+
count: number;
|
|
72
|
+
}>>;
|
|
73
|
+
/**
|
|
74
|
+
* Delete notification (soft delete)
|
|
75
|
+
*/
|
|
76
|
+
export declare const deleteNotification: import("convex/server").RegisteredMutation<"public", {
|
|
77
|
+
notificationId: import("convex/values").GenericId<"notifications">;
|
|
78
|
+
}, Promise<{
|
|
79
|
+
success: boolean;
|
|
80
|
+
}>>;
|
|
81
|
+
/**
|
|
82
|
+
* Get all notifications (admin only) - Paginated
|
|
83
|
+
*/
|
|
84
|
+
export declare const getAllNotifications: import("convex/server").RegisteredQuery<"public", {
|
|
85
|
+
type?: "info" | "success" | "warning" | "error" | "order" | "payment" | "system" | undefined;
|
|
86
|
+
recipientType?: "admin" | "customer" | "attendant" | "all" | undefined;
|
|
87
|
+
isRead?: boolean | undefined;
|
|
88
|
+
paginationOpts: {
|
|
89
|
+
id?: number;
|
|
90
|
+
endCursor?: string | null;
|
|
91
|
+
maximumRowsRead?: number;
|
|
92
|
+
maximumBytesRead?: number;
|
|
93
|
+
numItems: number;
|
|
94
|
+
cursor: string | null;
|
|
95
|
+
};
|
|
96
|
+
}, Promise<{
|
|
97
|
+
page: {
|
|
98
|
+
_id: import("convex/values").GenericId<"notifications">;
|
|
99
|
+
_creationTime: number;
|
|
100
|
+
branchId?: import("convex/values").GenericId<"branches"> | undefined;
|
|
101
|
+
entityType?: string | undefined;
|
|
102
|
+
entityId?: string | undefined;
|
|
103
|
+
actionUrl?: string | undefined;
|
|
104
|
+
actionLabel?: string | undefined;
|
|
105
|
+
readAt?: number | undefined;
|
|
106
|
+
senderId?: string | undefined;
|
|
107
|
+
senderType?: "admin" | "attendant" | "system" | undefined;
|
|
108
|
+
expiresAt?: number | undefined;
|
|
109
|
+
scheduledFor?: number | undefined;
|
|
110
|
+
sentAt?: number | undefined;
|
|
111
|
+
type: "info" | "success" | "warning" | "error" | "order" | "payment" | "system";
|
|
112
|
+
createdAt: number;
|
|
113
|
+
isDeleted: boolean;
|
|
114
|
+
recipientId: string;
|
|
115
|
+
recipientType: "admin" | "customer" | "attendant" | "all";
|
|
116
|
+
title: string;
|
|
117
|
+
message: string;
|
|
118
|
+
priority: "low" | "normal" | "high" | "urgent";
|
|
119
|
+
isRead: boolean;
|
|
120
|
+
}[];
|
|
121
|
+
isDone: boolean;
|
|
122
|
+
continueCursor: string;
|
|
123
|
+
}>>;
|
|
124
|
+
/**
|
|
125
|
+
* Create notification (admin only)
|
|
126
|
+
*/
|
|
127
|
+
export declare const createNotification: import("convex/server").RegisteredMutation<"public", {
|
|
128
|
+
branchId?: import("convex/values").GenericId<"branches"> | undefined;
|
|
129
|
+
entityType?: string | undefined;
|
|
130
|
+
entityId?: string | undefined;
|
|
131
|
+
recipientId?: string | undefined;
|
|
132
|
+
actionUrl?: string | undefined;
|
|
133
|
+
actionLabel?: string | undefined;
|
|
134
|
+
priority?: "low" | "normal" | "high" | "urgent" | undefined;
|
|
135
|
+
expiresAt?: number | undefined;
|
|
136
|
+
scheduledFor?: number | undefined;
|
|
137
|
+
type: "info" | "success" | "warning" | "error" | "order" | "payment" | "system";
|
|
138
|
+
recipientType: "admin" | "customer" | "attendant" | "all";
|
|
139
|
+
title: string;
|
|
140
|
+
message: string;
|
|
141
|
+
}, Promise<{
|
|
142
|
+
notificationId: import("convex/values").GenericId<"notifications">;
|
|
143
|
+
success: boolean;
|
|
144
|
+
}>>;
|
|
145
|
+
/**
|
|
146
|
+
* Delete notification (admin only - hard delete)
|
|
147
|
+
*/
|
|
148
|
+
export declare const adminDeleteNotification: import("convex/server").RegisteredMutation<"public", {
|
|
149
|
+
notificationId: import("convex/values").GenericId<"notifications">;
|
|
150
|
+
}, Promise<{
|
|
151
|
+
success: boolean;
|
|
152
|
+
}>>;
|
|
153
|
+
/**
|
|
154
|
+
* Create notification (internal - for system use)
|
|
155
|
+
*/
|
|
156
|
+
export declare const createSystemNotification: import("convex/server").RegisteredMutation<"internal", {
|
|
157
|
+
branchId?: import("convex/values").GenericId<"branches"> | undefined;
|
|
158
|
+
entityType?: string | undefined;
|
|
159
|
+
entityId?: string | undefined;
|
|
160
|
+
actionUrl?: string | undefined;
|
|
161
|
+
actionLabel?: string | undefined;
|
|
162
|
+
priority?: "low" | "normal" | "high" | "urgent" | undefined;
|
|
163
|
+
expiresAt?: number | undefined;
|
|
164
|
+
type: "info" | "success" | "warning" | "error" | "order" | "payment" | "system";
|
|
165
|
+
recipientId: string;
|
|
166
|
+
recipientType: "admin" | "customer" | "attendant" | "all";
|
|
167
|
+
title: string;
|
|
168
|
+
message: string;
|
|
169
|
+
}, Promise<import("convex/values").GenericId<"notifications">>>;
|
|
170
|
+
//# sourceMappingURL=notifications.d.ts.map
|
package/convex/schema.d.ts
CHANGED
|
@@ -8,6 +8,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
8
8
|
users: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
9
9
|
email?: string | undefined;
|
|
10
10
|
clerkUserId?: string | undefined;
|
|
11
|
+
status?: "active" | "blocked" | "suspended" | "restricted" | undefined;
|
|
11
12
|
statusNote?: string | undefined;
|
|
12
13
|
statusChangedBy?: import("convex/values").GenericId<"admins"> | undefined;
|
|
13
14
|
statusChangedAt?: number | undefined;
|
|
@@ -17,7 +18,6 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
17
18
|
name: string;
|
|
18
19
|
isRegistered: boolean;
|
|
19
20
|
isVerified: boolean;
|
|
20
|
-
status: "active" | "blocked" | "suspended" | "restricted";
|
|
21
21
|
createdAt: number;
|
|
22
22
|
isDeleted: boolean;
|
|
23
23
|
}, {
|
|
@@ -27,7 +27,7 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
27
27
|
clerkUserId: import("convex/values").VString<string | undefined, "optional">;
|
|
28
28
|
isRegistered: import("convex/values").VBoolean<boolean, "required">;
|
|
29
29
|
isVerified: import("convex/values").VBoolean<boolean, "required">;
|
|
30
|
-
status: import("convex/values").VUnion<"active" | "blocked" | "suspended" | "restricted", [import("convex/values").VLiteral<"active", "required">, import("convex/values").VLiteral<"blocked", "required">, import("convex/values").VLiteral<"suspended", "required">, import("convex/values").VLiteral<"restricted", "required">], "
|
|
30
|
+
status: import("convex/values").VUnion<"active" | "blocked" | "suspended" | "restricted" | undefined, [import("convex/values").VLiteral<"active", "required">, import("convex/values").VLiteral<"blocked", "required">, import("convex/values").VLiteral<"suspended", "required">, import("convex/values").VLiteral<"restricted", "required">], "optional", never>;
|
|
31
31
|
statusNote: import("convex/values").VString<string | undefined, "optional">;
|
|
32
32
|
statusChangedBy: import("convex/values").VId<import("convex/values").GenericId<"admins"> | undefined, "optional">;
|
|
33
33
|
statusChangedAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
@@ -445,6 +445,57 @@ declare const _default: import("convex/server").SchemaDefinition<{
|
|
|
445
445
|
by_customer: ["customerId", "_creationTime"];
|
|
446
446
|
by_used_at: ["usedAt", "_creationTime"];
|
|
447
447
|
}, {}, {}>;
|
|
448
|
+
notifications: import("convex/server").TableDefinition<import("convex/values").VObject<{
|
|
449
|
+
branchId?: import("convex/values").GenericId<"branches"> | undefined;
|
|
450
|
+
entityType?: string | undefined;
|
|
451
|
+
entityId?: string | undefined;
|
|
452
|
+
actionUrl?: string | undefined;
|
|
453
|
+
actionLabel?: string | undefined;
|
|
454
|
+
readAt?: number | undefined;
|
|
455
|
+
senderId?: string | undefined;
|
|
456
|
+
senderType?: "admin" | "attendant" | "system" | undefined;
|
|
457
|
+
expiresAt?: number | undefined;
|
|
458
|
+
scheduledFor?: number | undefined;
|
|
459
|
+
sentAt?: number | undefined;
|
|
460
|
+
type: "info" | "success" | "warning" | "error" | "order" | "payment" | "system";
|
|
461
|
+
createdAt: number;
|
|
462
|
+
isDeleted: boolean;
|
|
463
|
+
recipientId: string;
|
|
464
|
+
recipientType: "admin" | "customer" | "attendant" | "all";
|
|
465
|
+
title: string;
|
|
466
|
+
message: string;
|
|
467
|
+
priority: "low" | "normal" | "high" | "urgent";
|
|
468
|
+
isRead: boolean;
|
|
469
|
+
}, {
|
|
470
|
+
recipientId: import("convex/values").VString<string, "required">;
|
|
471
|
+
recipientType: import("convex/values").VUnion<"admin" | "customer" | "attendant" | "all", [import("convex/values").VLiteral<"customer", "required">, import("convex/values").VLiteral<"attendant", "required">, import("convex/values").VLiteral<"admin", "required">, import("convex/values").VLiteral<"all", "required">], "required", never>;
|
|
472
|
+
title: import("convex/values").VString<string, "required">;
|
|
473
|
+
message: import("convex/values").VString<string, "required">;
|
|
474
|
+
type: import("convex/values").VUnion<"info" | "success" | "warning" | "error" | "order" | "payment" | "system", [import("convex/values").VLiteral<"info", "required">, import("convex/values").VLiteral<"success", "required">, import("convex/values").VLiteral<"warning", "required">, import("convex/values").VLiteral<"error", "required">, import("convex/values").VLiteral<"order", "required">, import("convex/values").VLiteral<"payment", "required">, import("convex/values").VLiteral<"system", "required">], "required", never>;
|
|
475
|
+
actionUrl: import("convex/values").VString<string | undefined, "optional">;
|
|
476
|
+
actionLabel: import("convex/values").VString<string | undefined, "optional">;
|
|
477
|
+
entityType: import("convex/values").VString<string | undefined, "optional">;
|
|
478
|
+
entityId: import("convex/values").VString<string | undefined, "optional">;
|
|
479
|
+
priority: import("convex/values").VUnion<"low" | "normal" | "high" | "urgent", [import("convex/values").VLiteral<"low", "required">, import("convex/values").VLiteral<"normal", "required">, import("convex/values").VLiteral<"high", "required">, import("convex/values").VLiteral<"urgent", "required">], "required", never>;
|
|
480
|
+
isRead: import("convex/values").VBoolean<boolean, "required">;
|
|
481
|
+
readAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
482
|
+
senderId: import("convex/values").VString<string | undefined, "optional">;
|
|
483
|
+
senderType: import("convex/values").VUnion<"admin" | "attendant" | "system" | undefined, [import("convex/values").VLiteral<"admin", "required">, import("convex/values").VLiteral<"attendant", "required">, import("convex/values").VLiteral<"system", "required">], "optional", never>;
|
|
484
|
+
branchId: import("convex/values").VId<import("convex/values").GenericId<"branches"> | undefined, "optional">;
|
|
485
|
+
expiresAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
486
|
+
scheduledFor: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
487
|
+
createdAt: import("convex/values").VFloat64<number, "required">;
|
|
488
|
+
sentAt: import("convex/values").VFloat64<number | undefined, "optional">;
|
|
489
|
+
isDeleted: import("convex/values").VBoolean<boolean, "required">;
|
|
490
|
+
}, "required", "type" | "createdAt" | "isDeleted" | "branchId" | "entityType" | "entityId" | "recipientId" | "recipientType" | "title" | "message" | "actionUrl" | "actionLabel" | "priority" | "isRead" | "readAt" | "senderId" | "senderType" | "expiresAt" | "scheduledFor" | "sentAt">, {
|
|
491
|
+
by_recipient: ["recipientId", "recipientType", "_creationTime"];
|
|
492
|
+
by_recipient_read: ["recipientId", "recipientType", "isRead", "_creationTime"];
|
|
493
|
+
by_type: ["type", "_creationTime"];
|
|
494
|
+
by_priority: ["priority", "_creationTime"];
|
|
495
|
+
by_created: ["createdAt", "_creationTime"];
|
|
496
|
+
by_branch: ["branchId", "_creationTime"];
|
|
497
|
+
by_entity: ["entityType", "entityId", "_creationTime"];
|
|
498
|
+
}, {}, {}>;
|
|
448
499
|
}, true>;
|
|
449
500
|
export default _default;
|
|
450
501
|
//# sourceMappingURL=schema.d.ts.map
|