Make hourly rate optional for clients and invoices

This commit is contained in:
2025-07-31 19:11:20 -04:00
parent 817689001c
commit d9515f7723
6 changed files with 104 additions and 40 deletions

View File

@@ -42,7 +42,7 @@ const createClientSchema = z.object({
.max(100, "Country name is too long")
.optional()
.or(z.literal("")),
defaultHourlyRate: z.number().min(0, "Rate must be positive").default(100),
defaultHourlyRate: z.number().min(0, "Rate must be positive").optional(),
});
const updateClientSchema = createClientSchema.partial().extend({

View File

@@ -108,7 +108,7 @@ export const clients = createTable(
state: d.varchar({ length: 50 }),
postalCode: d.varchar({ length: 20 }),
country: d.varchar({ length: 100 }),
defaultHourlyRate: d.real().notNull().default(100.0),
defaultHourlyRate: d.real(),
createdById: d
.varchar({ length: 255 })
.notNull()