feat: workspace start of week column (closes #361) (#399)

* feat: workspace start of week column

* feat(l10n): add workspace setting for the first day of the week

Fixes #361

* feat: add Saturday as option

* chore: fix migration order

* chore: fix merge

---------

Co-authored-by: Henry <henry_ball@hotmail.co.uk>
This commit is contained in:
Matt
2026-03-11 17:05:03 -03:00
committed by GitHub
parent 94fd2cb11f
commit 8e7a95ff2b
17 changed files with 4362 additions and 1012 deletions

View File

@@ -127,6 +127,7 @@ export const update = async (
plan?: "free" | "pro" | "enterprise";
description?: string;
showEmailsToMembers?: boolean;
weekStartDay?: number;
},
) => {
const [result] = await db
@@ -137,6 +138,7 @@ export const update = async (
plan: workspaceInput.plan,
description: workspaceInput.description,
showEmailsToMembers: workspaceInput.showEmailsToMembers,
weekStartDay: workspaceInput.weekStartDay,
})
.where(eq(workspaces.publicId, workspacePublicId))
.returning({
@@ -147,6 +149,7 @@ export const update = async (
description: workspaces.description,
plan: workspaces.plan,
showEmailsToMembers: workspaces.showEmailsToMembers,
weekStartDay: workspaces.weekStartDay,
});
return result;
@@ -189,6 +192,7 @@ export const getByPublicIdWithMembers = (
name: true,
slug: true,
showEmailsToMembers: true,
weekStartDay: true,
},
with: {
members: {
@@ -274,6 +278,7 @@ export const getAllByUserId = async (db: dbClient, userId: string) => {
description: true,
slug: true,
plan: true,
weekStartDay: true,
deletedAt: true,
},
// https://github.com/drizzle-team/drizzle-orm/issues/2903

View File

@@ -3,6 +3,7 @@ import {
bigint,
bigserial,
boolean,
integer,
pgEnum,
pgTable,
text,
@@ -45,6 +46,7 @@ export const workspaces = pgTable("workspace", {
slug: varchar("slug", { length: 255 }).notNull().unique(),
plan: workspacePlanEnum("plan").notNull().default("free"),
showEmailsToMembers: boolean("showEmailsToMembers").notNull().default(true),
weekStartDay: integer("weekStartDay").notNull().default(1),
createdBy: uuid("createdBy").references(() => users.id, {
onDelete: "set null",
}),