[rewrite] Updated frontend structure and played with custom routes
This commit is contained in:
1 parent
43063dcf4e
commit
073f01d070
243 files changed
+11778
-11940
No files matched your search
@@ -0,0 +1,32 @@
|
||||
import { z } from "zod";
|
||||
|
||||
const userStatusSchema = z.union([
|
||||
z.literal("active"),
|
||||
z.literal("inactive"),
|
||||
z.literal("invited"),
|
||||
z.literal("suspended")
|
||||
]);
|
||||
export type UserStatus = z.infer<typeof userStatusSchema>;
|
||||
|
||||
const userRoleSchema = z.union([
|
||||
z.literal("superadmin"),
|
||||
z.literal("admin"),
|
||||
z.literal("cashier"),
|
||||
z.literal("manager")
|
||||
]);
|
||||
|
||||
const userSchema = z.object({
|
||||
id: z.string(),
|
||||
firstName: z.string(),
|
||||
lastName: z.string(),
|
||||
username: z.string(),
|
||||
email: z.string(),
|
||||
phoneNumber: z.string(),
|
||||
status: userStatusSchema,
|
||||
role: userRoleSchema,
|
||||
createdAt: z.coerce.date(),
|
||||
updatedAt: z.coerce.date()
|
||||
});
|
||||
export type User = z.infer<typeof userSchema>;
|
||||
|
||||
export const userListSchema = z.array(userSchema);
|
||||
Reference in new issue
Block a user