mirror of
https://github.com/hex248/sprint.git
synced 2026-02-08 10:33:01 +00:00
Merge branch 'master' into development
This commit is contained in:
@@ -412,6 +412,7 @@ export const UserUpdateRequestSchema = z.object({
|
||||
.optional(),
|
||||
avatarURL: z.string().url().nullable().optional(),
|
||||
iconPreference: z.enum(["lucide", "pixel", "phosphor"]).optional(),
|
||||
preferences: z.record(z.boolean()).optional(),
|
||||
});
|
||||
|
||||
export type UserUpdateRequest = z.infer<typeof UserUpdateRequestSchema>;
|
||||
@@ -431,6 +432,7 @@ export const UserResponseSchema = z.object({
|
||||
avatarURL: z.string().nullable(),
|
||||
iconPreference: z.enum(["lucide", "pixel", "phosphor"]),
|
||||
plan: z.string().nullable().optional(),
|
||||
preferences: z.record(z.boolean()).optional(),
|
||||
createdAt: z.string().nullable().optional(),
|
||||
updatedAt: z.string().nullable().optional(),
|
||||
});
|
||||
|
||||
@@ -50,6 +50,10 @@ export const DEFAULT_FEATURES: Record<string, boolean> = {
|
||||
sprints: true,
|
||||
};
|
||||
|
||||
export const DEFAULT_USER_PREFERENCES: Record<string, boolean> = {
|
||||
assignByDefault: false,
|
||||
};
|
||||
|
||||
export const iconStyles = ["pixel", "lucide", "phosphor"] as const;
|
||||
export type IconStyle = (typeof iconStyles)[number];
|
||||
|
||||
@@ -64,6 +68,10 @@ export const User = pgTable("User", {
|
||||
plan: varchar({ length: 32 }).notNull().default("free"),
|
||||
emailVerified: boolean().notNull().default(false),
|
||||
emailVerifiedAt: timestamp({ withTimezone: false }),
|
||||
preferences: json("preferences")
|
||||
.$type<Record<string, boolean>>()
|
||||
.notNull()
|
||||
.default(DEFAULT_USER_PREFERENCES),
|
||||
createdAt: timestamp({ withTimezone: false }).defaultNow(),
|
||||
updatedAt: timestamp({ withTimezone: false }).defaultNow(),
|
||||
});
|
||||
@@ -227,7 +235,9 @@ export const SessionInsertSchema = createInsertSchema(Session);
|
||||
export const TimedSessionSelectSchema = createSelectSchema(TimedSession);
|
||||
export const TimedSessionInsertSchema = createInsertSchema(TimedSession);
|
||||
|
||||
export type UserRecord = z.infer<typeof UserSelectSchema>;
|
||||
export type UserRecord = z.infer<typeof UserSelectSchema> & {
|
||||
preferences: Record<string, boolean>;
|
||||
};
|
||||
export type UserInsert = z.infer<typeof UserInsertSchema>;
|
||||
|
||||
export type OrganisationRecord = z.infer<typeof OrganisationSelectSchema> & {
|
||||
|
||||
Reference in New Issue
Block a user