feat: Add IČO and DIČ fields to companies
- Add ico and dic columns to companies table schema - Add validation for ico and dic in createCompanySchema and updateCompanySchema - Update company.service.js to include ico and dic in all CRUD operations - Include migration file for database changes Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
19
src/db/migrations/0002_soft_black_tarantula.sql
Normal file
19
src/db/migrations/0002_soft_black_tarantula.sql
Normal file
@@ -0,0 +1,19 @@
|
||||
ALTER TYPE "public"."role" ADD VALUE 'team_leader' BEFORE 'member';--> statement-breakpoint
|
||||
ALTER TABLE "companies" ADD COLUMN "postal_code" text;--> statement-breakpoint
|
||||
ALTER TABLE "companies" ADD COLUMN "ico" text;--> statement-breakpoint
|
||||
ALTER TABLE "companies" ADD COLUMN "dic" text;--> statement-breakpoint
|
||||
ALTER TABLE "kurzy" ADD COLUMN "farba" varchar(20);--> statement-breakpoint
|
||||
ALTER TABLE "kurzy" ADD COLUMN "datum_od" date;--> statement-breakpoint
|
||||
ALTER TABLE "kurzy" ADD COLUMN "datum_do" date;--> statement-breakpoint
|
||||
ALTER TABLE "services" ADD COLUMN "pricing_tiers" text;--> statement-breakpoint
|
||||
ALTER TABLE "time_entries" ADD COLUMN "paused_at" timestamp;--> statement-breakpoint
|
||||
ALTER TABLE "time_entries" ADD COLUMN "paused_duration" integer DEFAULT 0 NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "ucastnici" ADD COLUMN "firma_ico" varchar(20);--> statement-breakpoint
|
||||
ALTER TABLE "ucastnici" ADD COLUMN "firma_dic" varchar(20);--> statement-breakpoint
|
||||
ALTER TABLE "ucastnici" ADD COLUMN "firma_ic_dph" varchar(25);--> statement-breakpoint
|
||||
ALTER TABLE "ucastnici" ADD COLUMN "firma_sidlo" text;--> statement-breakpoint
|
||||
ALTER TABLE "ucastnici" ADD COLUMN "needs_followup" boolean DEFAULT false NOT NULL;--> statement-breakpoint
|
||||
ALTER TABLE "users" ADD COLUMN "last_seen" timestamp;--> statement-breakpoint
|
||||
ALTER TABLE "registracie" DROP COLUMN "datum_od";--> statement-breakpoint
|
||||
ALTER TABLE "registracie" DROP COLUMN "datum_do";--> statement-breakpoint
|
||||
ALTER TABLE "registracie" DROP COLUMN "pocet_ucastnikov";
|
||||
3627
src/db/migrations/meta/0002_snapshot.json
Normal file
3627
src/db/migrations/meta/0002_snapshot.json
Normal file
File diff suppressed because it is too large
Load Diff
@@ -15,6 +15,13 @@
|
||||
"when": 1768990516243,
|
||||
"tag": "0001_living_natasha_romanoff",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 2,
|
||||
"version": "7",
|
||||
"when": 1769754011560,
|
||||
"tag": "0002_soft_black_tarantula",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -132,6 +132,8 @@ export const companies = pgTable('companies', {
|
||||
phone: text('phone'),
|
||||
email: text('email'),
|
||||
website: text('website'),
|
||||
ico: text('ico'), // IČO - Company ID number
|
||||
dic: text('dic'), // DIČ - Tax ID number
|
||||
status: companyStatusEnum('status').default('registered').notNull(), // stav firmy
|
||||
createdBy: uuid('created_by').references(() => users.id, { onDelete: 'set null' }),
|
||||
createdAt: timestamp('created_at').defaultNow().notNull(),
|
||||
|
||||
Reference in New Issue
Block a user