From 8a8a8732865ffd4364e6029e4a4117e6afb0fc92 Mon Sep 17 00:00:00 2001 From: "Dennis (via Claude+Gemma)" Date: Sat, 23 May 2026 04:55:59 +0200 Subject: [PATCH] claude-fix: FastifyInstance type, routes/index mount, lucide upgrade, projects where-filter --- .phase2-state.json | 3 ++- GENERATION_LOG.md | 7 +++++++ apps/api/src/routes/auth.ts | 4 ++-- apps/api/src/routes/customers.ts | 4 ++-- apps/api/src/routes/index.ts | 15 +++++++-------- apps/api/src/routes/projects.ts | 16 ++++++---------- apps/api/src/routes/time-entries.ts | 4 ++-- apps/web/package.json | 1 + pnpm-lock.yaml | 11 +++++++++++ 9 files changed, 40 insertions(+), 25 deletions(-) diff --git a/.phase2-state.json b/.phase2-state.json index d480067..d32483f 100644 --- a/.phase2-state.json +++ b/.phase2-state.json @@ -7,6 +7,7 @@ "projects-crud", "api-client-extensions", "router-with-new-pages", - "dashboard-stats" + "dashboard-stats", + "active-timer-widget" ] } \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index 83f596b..b2f0cc5 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -342,3 +342,10 @@ src/routes/customers.ts(14,49): error TS7006: Parameter 'reply' implicitly has a src/routes/customers.ts(22,11): error TS2339: Property 'get' does not exist on type 'FastifyPluginAsync'. src/routes/customers.ts(22,27): error TS7006: Parameter 'request' implicitly has an 'any' type. src/routes/customers.ts(22,36): error TS7006: Parameter +- `04:48:33` **INFO** Committed feature active-timer-widget +- `04:48:33` **INFO** Pushed: rc=0 +- `04:48:33` **WARN** ⚠️ Feature active-timer-widget partial — moving on + +## Phase-2 Run beendet (2026-05-23 04:48:33) + +- `04:48:33` **INFO** OK: 0, Attempted: 6, Total: 6 diff --git a/apps/api/src/routes/auth.ts b/apps/api/src/routes/auth.ts index 6d1299f..1446841 100644 --- a/apps/api/src/routes/auth.ts +++ b/apps/api/src/routes/auth.ts @@ -1,11 +1,11 @@ -import { FastifyPluginAsync } from "fastify" +import { FastifyInstance } from "fastify" import argon2 from "argon2" import { db } from "../db" import { users } from "../db/schema" import { eq } from "drizzle-orm" import { LoginRequestSchema } from "@emberclone/shared" -export default async function authRoutes(fastify: FastifyPluginAsync) { +export default async function authRoutes(fastify: FastifyInstance) { fastify.post("/login", async (request, reply) => { const body = LoginRequestSchema.parse(request.body) diff --git a/apps/api/src/routes/customers.ts b/apps/api/src/routes/customers.ts index c1e1982..bf3e76a 100644 --- a/apps/api/src/routes/customers.ts +++ b/apps/api/src/routes/customers.ts @@ -1,4 +1,4 @@ -import { FastifyPluginAsync } from "fastify" +import { FastifyInstance } from "fastify" import { db } from "../db" import { customers } from "../db/schema" import { eq, and } from "drizzle-orm" @@ -10,7 +10,7 @@ const CustomerSchema = z.object({ const CustomerUpdateSchema = CustomerSchema.partial() -export default async function customerRoutes(fastify: FastifyPluginAsync) { +export default async function customerRoutes(fastify: FastifyInstance) { fastify.addHook("preHandler", async (request, reply) => { try { await request.jwtVerify() diff --git a/apps/api/src/routes/index.ts b/apps/api/src/routes/index.ts index 5b04eeb..f64eb26 100644 --- a/apps/api/src/routes/index.ts +++ b/apps/api/src/routes/index.ts @@ -1,13 +1,12 @@ import { FastifyInstance } from "fastify" import authRoutes from "./auth" +import customerRoutes from "./customers" +import projectRoutes from "./projects" import timeEntryRoutes from "./time-entries" export async function setupRoutes(server: FastifyInstance) { - server.register(authRoutes, { - prefix: "/api/auth" - }) - - server.register(timeEntryRoutes, { - prefix: "/api/time-entries" - }) -} \ No newline at end of file + server.register(authRoutes, { prefix: "/api/auth" }) + server.register(timeEntryRoutes, { prefix: "/api/time-entries" }) + server.register(customerRoutes, { prefix: "/api/customers" }) + server.register(projectRoutes, { prefix: "/api/projects" }) +} diff --git a/apps/api/src/routes/projects.ts b/apps/api/src/routes/projects.ts index 9f0f322..357445e 100644 --- a/apps/api/src/routes/projects.ts +++ b/apps/api/src/routes/projects.ts @@ -1,4 +1,4 @@ -import { FastifyPluginAsync } from "fastify" +import { FastifyInstance } from "fastify" import { db } from "../db" import { projects } from "../db/schema" import { eq } from "drizzle-orm" @@ -11,7 +11,7 @@ const ProjectSchema = z.object({ const ProjectUpdateSchema = ProjectSchema.partial() -export default async function projectRoutes(fastify: FastifyPluginAsync) { +export default async function projectRoutes(fastify: FastifyInstance) { fastify.addHook("preHandler", async (request, reply) => { try { await request.jwtVerify() @@ -24,18 +24,14 @@ export default async function projectRoutes(fastify: FastifyPluginAsync) { const { onlyActive, customerId } = request.query as { onlyActive?: string, customerId?: string } const isActiveDefault = onlyActive !== "false" - const filters = [] - if (isActiveDefault) { - filters.push(eq(projects.active, true)) - } - if (customerId) { - filters.push(eq(projects.customerId, customerId)) - } + const conds = [] + if (isActiveDefault) conds.push(eq(projects.active, true)) + if (customerId) conds.push(eq(projects.customerId, customerId)) const results = await db .select() .from(projects) - .where(filters.length > 0 ? and(...filters) : undefined) + .where(conds.length ? and(...conds) : undefined as any) .orderBy(projects.name) return results diff --git a/apps/api/src/routes/time-entries.ts b/apps/api/src/routes/time-entries.ts index 1fdb63b..b7179c2 100644 --- a/apps/api/src/routes/time-entries.ts +++ b/apps/api/src/routes/time-entries.ts @@ -1,4 +1,4 @@ -import { FastifyPluginAsync } from "fastify" +import { FastifyInstance } from "fastify" import { db } from "../db" import { timeEntries } from "../db/schema" import { eq, and, gte, lte, isNull } from "drizzle-orm" @@ -18,7 +18,7 @@ const StartEntrySchema = z.object({ description: z.string().min(1) }) -export default async function timeEntryRoutes(fastify: FastifyPluginAsync) { +export default async function timeEntryRoutes(fastify: FastifyInstance) { fastify.addHook("preHandler", async (request, reply) => { try { await request.jwtVerify() diff --git a/apps/web/package.json b/apps/web/package.json index 1c7040f..64bdde3 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -12,6 +12,7 @@ "@emberclone/shared": "workspace:*", "@tanstack/react-query": "^5.59.0", "@tanstack/react-router": "^1.62.7", + "lucide-react": "^1.16.0", "react": "^18.3.1", "react-dom": "^18.3.1" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 582130b..98396dd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -72,6 +72,9 @@ importers: '@tanstack/react-router': specifier: ^1.62.7 version: 1.170.7(react-dom@18.3.1)(react@18.3.1) + lucide-react: + specifier: ^1.16.0 + version: 1.16.0(react@18.3.1) react: specifier: ^18.3.1 version: 18.3.1 @@ -2548,6 +2551,14 @@ packages: yallist: 3.1.1 dev: true + /lucide-react@1.16.0(react@18.3.1): + resolution: {integrity: sha512-dYwyPzb4MEKpGUmNYk3WKWPnMrHs3FKM+q94kAnJrcDIqqn1hq2xY8scaS2ovsOCM5D51ey2gaRG3PBb1vgoYQ==} + peerDependencies: + react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0 + dependencies: + react: 18.3.1 + dev: false + /merge2@1.4.1: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'}