diff --git a/.phase16-state.json b/.phase16-state.json index f4b996b..40ed6fa 100644 --- a/.phase16-state.json +++ b/.phase16-state.json @@ -1,11 +1,12 @@ { "completed_features": [], - "current_feature": "dark-mode-improvements", + "current_feature": "api-client-phase16", "started_at": "2026-05-23T07:08:48.804883", "attempted_features": [ "pinned-customers", "smart-suggestions", "recent-projects-quick-access", - "time-entry-templates" + "time-entry-templates", + "dark-mode-improvements" ] } \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index 55e34ec..97be53c 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -1975,3 +1975,20 @@ 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 +- `07:16:21` **INFO** Committed feature dark-mode-improvements +- `07:16:22` **INFO** Pushed: rc=0 + +## Phase-3 Feature: api-client-phase16 (2026-05-23 07:16:22) + +- `07:16:22` **INFO** Description: API um time-entry-templates erweitert +- `07:16:22` **INFO** Generating apps/web/src/lib/api.ts (ERWEITERT — behalte ALLES. Füge: listTimeEntryTemplates(), createTimeE…) +- `07:17:05` **INFO** wrote 4966 chars in 43.3s (attempt 1) +- `07:17:05` **INFO** Running tsc --noEmit on api… +- `07:17:07` **WARN** tsc errors: +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, FastifyBaseLogger, FastifyTypeProvider>, opts: { ...; }, done: (err?: Error | undefined) => void): void'. + 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 diff --git a/apps/web/src/lib/api.ts b/apps/web/src/lib/api.ts index eae7f85..34fa545 100644 --- a/apps/web/src/lib/api.ts +++ b/apps/web/src/lib/api.ts @@ -142,6 +142,30 @@ export const api = { }) }, + async listTimeEntryTemplates() { + return request("/time-entry-templates") + }, + + async createTimeEntryTemplate(data: any) { + return request("/time-entry-templates", { + method: "POST", + body: JSON.stringify(data) + }) + }, + + async updateTimeEntryTemplate(id: string, data: any) { + return request(`/time-entry-templates/${id}`, { + method: "PATCH", + body: JSON.stringify(data) + }) + }, + + async deleteTimeEntryTemplate(id: string) { + return request(`/time-entry-templates/${id}`, { + method: "DELETE" + }) + }, + async listCustomers() { return request("/customers") }, @@ -162,39 +186,17 @@ export const api = { }) }, - async deleteCustomer(id: string) { + async pinCustomer(id: string) { return request(`/customers/${id}`, { - method: "DELETE" + method: "PATCH", + body: JSON.stringify({ pinnedAt: new Date().toISOString() }) }) }, - async archiveCustomer(id: string) { - return request(`/customers/${id}/archive`, { - method: "POST" - }) - }, - - async unarchiveCustomer(id: string) { - return request(`/customers/${id}/unarchive`, { - method: "POST" - }) - }, - - async listSavedViews(opts?: Record) { - const query = opts ? `?${new URLSearchParams(opts).toString()}` : "" - return request(`/saved-views${query}`) - }, - - async createSavedView(data: any) { - return request("/saved-views", { - method: "POST", - body: JSON.stringify(data) - }) - }, - - async deleteSavedView(id: string) { - return request(`/saved-views/${id}`, { - method: "DELETE" + async unpinCustomer(id: string) { + return request(`/customers/${id}`, { + method: "PATCH", + body: JSON.stringify({ pinnedAt: null }) }) } } \ No newline at end of file