feat: Hotfix Part1 - Backend support for company postal code, service tiers, timesheet naming
- Add postal_code column to companies table
- Add pricing_tiers column to services table for tiered pricing
- Update timesheet upload to generate filename in format {firstname}-{lastname}-timesheet-{date}
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2
src/db/migrations/0008_add_company_postal_code.sql
Normal file
2
src/db/migrations/0008_add_company_postal_code.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
-- Add postal_code column to companies table
|
||||
ALTER TABLE "companies" ADD COLUMN IF NOT EXISTS "postal_code" text;
|
||||
2
src/db/migrations/0009_add_service_pricing_tiers.sql
Normal file
2
src/db/migrations/0009_add_service_pricing_tiers.sql
Normal file
@@ -0,0 +1,2 @@
|
||||
-- Add pricing_tiers column to services table for tiered pricing
|
||||
ALTER TABLE "services" ADD COLUMN IF NOT EXISTS "pricing_tiers" text;
|
||||
@@ -126,6 +126,7 @@ export const companies = pgTable('companies', {
|
||||
description: text('description'),
|
||||
address: text('address'),
|
||||
city: text('city'),
|
||||
postalCode: text('postal_code'),
|
||||
country: text('country'),
|
||||
phone: text('phone'),
|
||||
email: text('email'),
|
||||
@@ -320,6 +321,7 @@ export const services = pgTable('services', {
|
||||
id: uuid('id').primaryKey().defaultRandom(),
|
||||
name: text('name').notNull(),
|
||||
price: text('price').notNull(), // stored as text for flexibility with decimal
|
||||
pricingTiers: text('pricing_tiers'), // JSON array of tiers: [{tier: "Silver", price: "€149"}, ...]
|
||||
description: text('description'),
|
||||
createdBy: uuid('created_by').references(() => users.id, { onDelete: 'set null' }),
|
||||
createdAt: timestamp('created_at').defaultNow().notNull(),
|
||||
|
||||
Reference in New Issue
Block a user