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:
richardtekula
2026-01-22 07:46:50 +01:00
parent 826fd467bc
commit a0a6656a49
4 changed files with 32 additions and 1 deletions

View File

@@ -0,0 +1,2 @@
-- Add postal_code column to companies table
ALTER TABLE "companies" ADD COLUMN IF NOT EXISTS "postal_code" text;

View 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;

View File

@@ -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(),