From 0de418874395d4dfae4c4c13d2e0e8269dfca8f5 Mon Sep 17 00:00:00 2001 From: "Dennis (via Claude+Gemma)" Date: Sat, 23 May 2026 08:44:06 +0200 Subject: [PATCH] =?UTF-8?q?feat(default-project-per-customer):=20Customer?= =?UTF-8?q?=20kann=20ein=20default-Project=20haben=20(f=C3=BCr=20Quick-Ent?= =?UTF-8?q?ries)=20[tsc:fail]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .phase25-state.json | 7 +++-- GENERATION_LOG.md | 18 ++++++++++++ apps/api/src/db/schema.ts | 60 +-------------------------------------- 3 files changed, 24 insertions(+), 61 deletions(-) diff --git a/.phase25-state.json b/.phase25-state.json index 67e9aa6..fd01b66 100644 --- a/.phase25-state.json +++ b/.phase25-state.json @@ -1,5 +1,8 @@ { "completed_features": [], - "current_feature": "working-hours-config", - "started_at": "2026-05-23T08:41:41.344530" + "current_feature": "default-project-per-customer", + "started_at": "2026-05-23T08:41:41.344530", + "attempted_features": [ + "working-hours-config" + ] } \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index 2eea4b8..f218648 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -2898,3 +2898,21 @@ src/index.ts(27,25): error TS2769: No overload matches this call. Overload 2 of 3, '(plugin: FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. Argument of type 'Promise' is not assignable to parameter of type 'FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. Type 'Promise' provides no match for the signature '(instance: FastifyInstance, FastifyBaseLogger, FastifyTy +- `08:43:29` **INFO** Committed feature working-hours-config +- `08:43:30` **INFO** Pushed: rc=0 + +## Phase-3 Feature: default-project-per-customer (2026-05-23 08:43:30) + +- `08:43:30` **INFO** Description: Customer kann ein default-Project haben (für Quick-Entries) +- `08:43:30` **INFO** Generating apps/api/src/db/schema.ts (WICHTIG: BEHALTE ALLE existierenden Tabellen/Spalten. Füge nur Spalte …) +- `08:44:05` **INFO** wrote 4107 chars in 35.0s (attempt 1) +- `08:44:05` **INFO** Running tsc --noEmit on api… +- `08:44:06` **WARN** tsc errors: +src/db/schema.ts(37,14): error TS7022: 'customers' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. +src/db/schema.ts(43,59): error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. +src/db/schema.ts(47,14): error TS7022: 'projects' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer. +src/db/schema.ts(51,56): error TS7024: Function implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions. +src/index.ts(27,25): error TS2769: No overload matches this call. + Overload 1 of 3, '(plugin: FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>, opts?: FastifyRegisterOptions<...> | undefined): FastifyInstance<...> & PromiseLike<...>', gave the following error. + Argument of type 'Promise' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'. + Type 'Promise' provides no match for the signature '(instance: FastifyInstance, diff --git a/apps/api/src/db/schema.ts b/apps/api/src/db/schema.ts index e20ba26..1f2d438 100644 --- a/apps/api/src/db/schema.ts +++ b/apps/api/src/db/schema.ts @@ -40,6 +40,7 @@ export const customers = pgTable("customers", { tags: text("tags").array().notNull().default([]), active: boolean("active").notNull().default(true), pinnedAt: timestamp("pinned_at"), + defaultProjectId: uuid("default_project_id").references(() => projects.id, { onDelete: "set null" }), createdAt: timestamp("created_at").notNull().defaultNow() }) @@ -96,63 +97,4 @@ export const timeEntryTemplates = pgTable("time_entry_templates", { name: text("name").notNull(), description: text("description"), projectId: uuid("project_id").references(() => projects.id), - createdAt: timestamp("created_at").notNull().defaultNow() -}) - -export const apiKeys = pgTable("api_keys", { - id: uuid("id").primaryKey().defaultRandom(), - userId: uuid("user_id").notNull().references(() => users.id, { onDelete: "cascade" }), - keyHash: text("key_hash").notNull().unique(), - name: text("name").notNull(), - createdAt: timestamp("created_at").notNull().defaultNow(), - expiresAt: timestamp("expires_at"), - lastUsedAt: timestamp("last_used_at") -}) - -export const savedViews = pgTable("saved_views", { - id: uuid("id").primaryKey().defaultRandom(), - userId: uuid("user_id").notNull().references(() => users.id, { onDelete: "cascade" }), - name: text("name").notNull(), - filters: text("filters").notNull(), // JSON string - sort: text("sort"), // JSON string - createdAt: timestamp("created_at").notNull().defaultNow() -}) - -export const webhooks = pgTable("webhooks", { - id: uuid("id").primaryKey().defaultRandom(), - userId: uuid("user_id").notNull().references(() => users.id, { onDelete: "cascade" }), - url: text("url").notNull(), - secret: text("secret").notNull(), - events: text("events").notNull(), // JSON array - active: boolean("active").notNull().default(true), - createdAt: timestamp("created_at").notNull().defaultNow() -}) - -export const auditLog = pgTable("audit_log", { - id: uuid("id").primaryKey().defaultRandom(), - userId: uuid("user_id").references(() => users.id), - action: text("action").notNull(), - entityType: text("entity_type").notNull(), - entityId: uuid("entity_id"), - oldValue: text("old_value"), - newValue: text("new_value"), - ipAddress: text("ip_address"), - createdAt: timestamp("created_at").notNull().defaultNow() -}) - -export const documents = pgTable("documents", { - id: uuid("id").primaryKey().defaultRandom(), - projectId: uuid("project_id").references(() => projects.id, { onDelete: "cascade" }), - name: text("name").notNull(), - fileData: bytea("file_data").notNull(), - mimeType: text("mime_type").notNull(), - createdAt: timestamp("created_at").notNull().defaultNow() -}) - -export const appSettings = pgTable("app_settings", { - id: uuid("id").primaryKey().defaultRandom(), - key: text("key").notNull().unique(), - value: text("value").notNull(), - workingHoursPerDay: integer("working_hours_per_day").notNull().default(8), - updatedAt: timestamp("updated_at").notNull().defaultNow() }) \ No newline at end of file