Polish onboarding, invoices, and time clock while promoting the first registrant to admin.

Refresh onboarding wizard and shell, tighten invoice edit/detail flows, align timer widgets with the redesigned clock panel, and assign admin role on first signup.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-06-26 03:40:25 -04:00
co-authored by Cursor
parent c53f2e6c4d
commit 3fb61ff4dd
37 changed files with 1135 additions and 481 deletions
+6 -4
View File
@@ -6,6 +6,7 @@ import { TRPCError } from "@trpc/server";
import type { db } from "~/server/db";
import {
computeTrackedHours,
resolveBillingDescription,
type ClockOutOutcome,
} from "~/lib/time-clock";
import { defaultDueDate, generateInvoiceNumber } from "~/lib/draft-invoice";
@@ -457,12 +458,13 @@ export const timeEntriesRouter = createTRPCRouter({
const endedAt = new Date();
const hours = computeHours(entry.startedAt, endedAt);
const description = input?.description?.trim() ?? entry.description;
const rawDescription = input?.description?.trim() ?? entry.description?.trim() ?? "";
const billingDescription = resolveBillingDescription(rawDescription);
const rate = entry.rate ?? 0;
const [updated] = await ctx.db
.update(timeEntries)
.set({ endedAt, hours, description, updatedAt: new Date() })
.set({ endedAt, hours, description: rawDescription, updatedAt: new Date() })
.where(eq(timeEntries.id, entry.id))
.returning();
@@ -478,7 +480,7 @@ export const timeEntriesRouter = createTRPCRouter({
ctx.session.user.id,
entry.invoiceId,
updated.id,
description,
billingDescription,
hours,
rate,
endedAt,
@@ -490,7 +492,7 @@ export const timeEntriesRouter = createTRPCRouter({
ctx.session.user.id,
entry.clientId,
updated.id,
description,
billingDescription,
hours,
rate,
endedAt,