diff --git a/.phase8-state.json b/.phase8-state.json index 7aab35f..809c849 100644 --- a/.phase8-state.json +++ b/.phase8-state.json @@ -1,11 +1,12 @@ { "completed_features": [], - "current_feature": "project-stats-page", + "current_feature": "api-client-phase8", "started_at": "2026-05-23T05:49:48.673340", "attempted_features": [ "recent-activity-widget", "time-entry-bulk-actions", "customer-csv-import", - "account-deletion" + "account-deletion", + "project-stats-page" ] } \ No newline at end of file diff --git a/GENERATION_LOG.md b/GENERATION_LOG.md index 7dcf131..e5173c3 100644 --- a/GENERATION_LOG.md +++ b/GENERATION_LOG.md @@ -985,3 +985,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 +- `05:59:05` **INFO** Committed feature project-stats-page +- `05:59:05` **INFO** Pushed: rc=0 + +## Phase-3 Feature: api-client-phase8 (2026-05-23 05:59:05) + +- `05:59:05` **INFO** Description: API um Phase-8 endpoints +- `05:59:05` **INFO** Generating apps/web/src/lib/api.ts (ERWEITERT — behalte ALLES. Füge: bulkDeleteTimeEntries(ids: string[]),…) +- `05:59:47` **INFO** wrote 4754 chars in 41.5s (attempt 1) +- `05:59:47` **INFO** Running tsc --noEmit on api… +- `05:59:48` **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 a712367..04b2bc7 100644 --- a/apps/web/src/lib/api.ts +++ b/apps/web/src/lib/api.ts @@ -58,6 +58,13 @@ export const api = { }) }, + async deleteAccount(password: string) { + return request("/auth/delete-account", { + method: "DELETE", + body: JSON.stringify({ password }) + }) + }, + async updateProfile(data: { name: string }) { return request("/users/me", { method: "PATCH", @@ -83,6 +90,13 @@ export const api = { }) }, + async bulkDeleteTimeEntries(ids: string[]) { + return request("/time-entries/bulk-delete", { + method: "POST", + body: JSON.stringify({ ids }) + }) + }, + async getRunningTimeEntry() { try { return await request("/time-entries/running") @@ -116,6 +130,15 @@ export const api = { }) }, + async importCustomersCsv(file: File) { + const formData = new FormData() + formData.append("file", file) + return request("/customers/import", { + method: "POST", + body: formData + }) + }, + async deleteCustomer(id: string) { return request(`/customers/${id}`, { method: "DELETE" @@ -139,6 +162,10 @@ export const api = { return request(`/projects/${id}`) }, + async getProjectStats(id: string) { + return request(`/projects/${id}/stats`) + }, + async createProject(data: Partial) { return request("/projects", { method: "POST", @@ -161,28 +188,5 @@ export const api = { method: "POST", body: JSON.stringify(data) }) - }, - - async listDocuments() { - return request("/documents") - }, - - async uploadDocument(file: File) { - const formData = new FormData() - formData.append("file", file) - return request("/documents", { - method: "POST", - body: formData - }) - }, - - async deleteDocument(id: string) { - return request(`/documents/${id}`, { - method: "DELETE" - }) - }, - - async search(q: string) { - return request(`/search?q=${encodeURIComponent(q)}`) } } \ No newline at end of file