feat(router-phase12): App + routes/index für /invoices [tsc:fail]
This commit is contained in:
parent
b829f10a41
commit
d03cb2491b
@ -1,11 +1,12 @@
|
|||||||
{
|
{
|
||||||
"completed_features": [],
|
"completed_features": [],
|
||||||
"current_feature": "api-client-phase12",
|
"current_feature": "router-phase12",
|
||||||
"started_at": "2026-05-23T06:33:48.406343",
|
"started_at": "2026-05-23T06:33:48.406343",
|
||||||
"attempted_features": [
|
"attempted_features": [
|
||||||
"invoicing-stub",
|
"invoicing-stub",
|
||||||
"time-rounding-rules",
|
"time-rounding-rules",
|
||||||
"user-avatars",
|
"user-avatars",
|
||||||
"app-version-display"
|
"app-version-display",
|
||||||
|
"api-client-phase12"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@ -1533,3 +1533,24 @@ 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.
|
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<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
|
Argument of type 'Promise<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
|
||||||
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, FastifyBaseLogger, FastifyTy
|
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, FastifyBaseLogger, FastifyTy
|
||||||
|
- `06:39:11` **INFO** Committed feature api-client-phase12
|
||||||
|
- `06:39:12` **INFO** Pushed: rc=0
|
||||||
|
|
||||||
|
## Phase-3 Feature: router-phase12 (2026-05-23 06:39:12)
|
||||||
|
|
||||||
|
- `06:39:12` **INFO** Description: App + routes/index für /invoices
|
||||||
|
- `06:39:12` **INFO** Generating apps/api/src/routes/index.ts (ERWEITERT — füge invoiceRoutes ('/api/invoices').…)
|
||||||
|
- `06:39:23` **INFO** wrote 1446 chars in 11.4s (attempt 1)
|
||||||
|
- `06:39:23` **INFO** Generating apps/web/src/App.tsx (ERWEITERT — füge /invoices Route. Behalte alles.…)
|
||||||
|
- `06:40:11` **INFO** wrote 5744 chars in 47.7s (attempt 1)
|
||||||
|
- `06:40:11` **INFO** Generating apps/web/src/components/Nav.tsx (ERWEITERT — füge Invoices-Link in Nav (alle User). Behalte alles.…)
|
||||||
|
- `06:41:09` **INFO** wrote 6049 chars in 58.4s (attempt 1)
|
||||||
|
- `06:41:09` **INFO** Running tsc --noEmit on api…
|
||||||
|
- `06:41:11` **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<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginCallback<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
|
||||||
|
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, 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<FastifyMultipartPlugin>' is not assignable to parameter of type 'FastifyPluginAsync<{ limits: { fileSize: number; }; }, RawServerDefault, FastifyTypeProvider, FastifyBaseLogger>'.
|
||||||
|
Type 'Promise<FastifyMultipartPlugin>' provides no match for the signature '(instance: FastifyInstance<RawServerDefault, IncomingMessage, ServerResponse<IncomingMessage>, FastifyBaseLogger, FastifyTy
|
||||||
|
|||||||
@ -11,6 +11,7 @@ import documentsRoutes from "./documents"
|
|||||||
import searchRoutes from "./search"
|
import searchRoutes from "./search"
|
||||||
import webhookRoutes from "./webhooks"
|
import webhookRoutes from "./webhooks"
|
||||||
import reportsRoutes from "./reports"
|
import reportsRoutes from "./reports"
|
||||||
|
import invoiceRoutes from "./invoices"
|
||||||
|
|
||||||
export async function setupRoutes(server: FastifyInstance) {
|
export async function setupRoutes(server: FastifyInstance) {
|
||||||
server.register(authRoutes, { prefix: "/api/auth" })
|
server.register(authRoutes, { prefix: "/api/auth" })
|
||||||
@ -25,4 +26,5 @@ export async function setupRoutes(server: FastifyInstance) {
|
|||||||
server.register(searchRoutes, { prefix: "/api/search" })
|
server.register(searchRoutes, { prefix: "/api/search" })
|
||||||
server.register(webhookRoutes, { prefix: "/api/webhooks" })
|
server.register(webhookRoutes, { prefix: "/api/webhooks" })
|
||||||
server.register(reportsRoutes, { prefix: "/api/reports" })
|
server.register(reportsRoutes, { prefix: "/api/reports" })
|
||||||
|
server.register(invoiceRoutes, { prefix: "/api/invoices" })
|
||||||
}
|
}
|
||||||
@ -17,6 +17,7 @@ import TwoFactorAuth from "./pages/TwoFactorAuth"
|
|||||||
import Billing from "./pages/Billing"
|
import Billing from "./pages/Billing"
|
||||||
import Integrations from "./pages/Integrations"
|
import Integrations from "./pages/Integrations"
|
||||||
import ProjectTemplates from "./pages/ProjectTemplates"
|
import ProjectTemplates from "./pages/ProjectTemplates"
|
||||||
|
import Invoices from "./pages/Invoices"
|
||||||
import Nav from "./components/Nav"
|
import Nav from "./components/Nav"
|
||||||
import CommandPalette from "./components/CommandPalette"
|
import CommandPalette from "./components/CommandPalette"
|
||||||
import KeyboardHelp from "./components/KeyboardHelp"
|
import KeyboardHelp from "./components/KeyboardHelp"
|
||||||
@ -133,6 +134,13 @@ const documentsRoute = createRoute({
|
|||||||
component: Documents
|
component: Documents
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const invoicesRoute = createRoute({
|
||||||
|
getParentRoute: () => rootRoute,
|
||||||
|
path: "/invoices",
|
||||||
|
beforeLoad: authCheck,
|
||||||
|
component: Invoices
|
||||||
|
})
|
||||||
|
|
||||||
const profileRoute = createRoute({
|
const profileRoute = createRoute({
|
||||||
getParentRoute: () => rootRoute,
|
getParentRoute: () => rootRoute,
|
||||||
path: "/profile",
|
path: "/profile",
|
||||||
@ -161,46 +169,44 @@ const integrationsRoute = createRoute({
|
|||||||
component: Integrations
|
component: Integrations
|
||||||
})
|
})
|
||||||
|
|
||||||
const adminRoute = createRoute({
|
const settingsRoute = createRoute({
|
||||||
getParentRoute: () => rootRoute,
|
getParentRoute: () => rootRoute,
|
||||||
path: "/admin",
|
|
||||||
beforeLoad: adminCheck,
|
|
||||||
component: () => <Outlet />
|
|
||||||
})
|
|
||||||
|
|
||||||
const adminUsersRoute = createRoute({
|
|
||||||
getParentRoute: () => adminRoute,
|
|
||||||
path: "/users",
|
|
||||||
component: AdminUsers
|
|
||||||
})
|
|
||||||
|
|
||||||
const adminSettingsRoute = createRoute({
|
|
||||||
getParentRoute: () => adminRoute,
|
|
||||||
path: "/settings",
|
path: "/settings",
|
||||||
|
beforeLoad: authCheck,
|
||||||
component: Settings
|
component: Settings
|
||||||
})
|
})
|
||||||
|
|
||||||
const adminAuditLogRoute = createRoute({
|
const adminUsersRoute = createRoute({
|
||||||
getParentRoute: () => adminRoute,
|
getParentRoute: () => rootRoute,
|
||||||
path: "/audit-log",
|
path: "/admin/users",
|
||||||
|
beforeLoad: adminCheck,
|
||||||
|
component: AdminUsers
|
||||||
|
})
|
||||||
|
|
||||||
|
const auditLogRoute = createRoute({
|
||||||
|
getParentRoute: () => rootRoute,
|
||||||
|
path: "/admin/audit-log",
|
||||||
|
beforeLoad: adminCheck,
|
||||||
component: AuditLog
|
component: AuditLog
|
||||||
})
|
})
|
||||||
|
|
||||||
const adminWebhooksRoute = createRoute({
|
const webhooksRoute = createRoute({
|
||||||
getParentRoute: () => adminRoute,
|
getParentRoute: () => rootRoute,
|
||||||
path: "/webhooks",
|
path: "/admin/webhooks",
|
||||||
|
beforeLoad: adminCheck,
|
||||||
component: Webhooks
|
component: Webhooks
|
||||||
})
|
})
|
||||||
|
|
||||||
const adminTemplatesRoute = createRoute({
|
const projectTemplatesRoute = createRoute({
|
||||||
getParentRoute: () => adminRoute,
|
getParentRoute: () => rootRoute,
|
||||||
path: "/templates",
|
path: "/admin/templates",
|
||||||
|
beforeLoad: adminCheck,
|
||||||
component: ProjectTemplates
|
component: ProjectTemplates
|
||||||
})
|
})
|
||||||
|
|
||||||
const routeTree = rootRoute.addChildren([
|
const routeTree = [
|
||||||
loginRoute,
|
|
||||||
indexRoute,
|
indexRoute,
|
||||||
|
loginRoute,
|
||||||
timeEntriesRoute,
|
timeEntriesRoute,
|
||||||
calendarRoute,
|
calendarRoute,
|
||||||
customersRoute,
|
customersRoute,
|
||||||
@ -208,14 +214,22 @@ const routeTree = rootRoute.addChildren([
|
|||||||
projectsRoute,
|
projectsRoute,
|
||||||
projectDetailRoute,
|
projectDetailRoute,
|
||||||
documentsRoute,
|
documentsRoute,
|
||||||
|
invoicesRoute,
|
||||||
profileRoute,
|
profileRoute,
|
||||||
twoFactorRoute,
|
twoFactorRoute,
|
||||||
billingRoute,
|
billingRoute,
|
||||||
integrationsRoute,
|
integrationsRoute,
|
||||||
adminRoute
|
settingsRoute,
|
||||||
])
|
adminUsersRoute,
|
||||||
|
auditLogRoute,
|
||||||
|
webhooksRoute,
|
||||||
|
projectTemplatesRoute
|
||||||
|
]
|
||||||
|
|
||||||
const router = createRouter({ routeTree })
|
const router = createRouter({
|
||||||
|
routeTree,
|
||||||
|
defaultPreload: 'intent'
|
||||||
|
})
|
||||||
|
|
||||||
declare module "@tanstack/react-router" {
|
declare module "@tanstack/react-router" {
|
||||||
interface Register {
|
interface Register {
|
||||||
|
|||||||
@ -16,7 +16,8 @@ import {
|
|||||||
Zap,
|
Zap,
|
||||||
CreditCard,
|
CreditCard,
|
||||||
Languages,
|
Languages,
|
||||||
LogOut
|
LogOut,
|
||||||
|
FileText
|
||||||
} from "lucide-react"
|
} from "lucide-react"
|
||||||
import { useQuery } from "@tanstack/react-query"
|
import { useQuery } from "@tanstack/react-query"
|
||||||
import { api } from "../lib/api"
|
import { api } from "../lib/api"
|
||||||
@ -40,6 +41,7 @@ export default function Nav() {
|
|||||||
{ label: "Calendar", to: "/calendar", icon: Calendar },
|
{ label: "Calendar", to: "/calendar", icon: Calendar },
|
||||||
{ label: "Customers", to: "/customers", icon: Users },
|
{ label: "Customers", to: "/customers", icon: Users },
|
||||||
{ label: "Projects", to: "/projects", icon: FolderKanban },
|
{ label: "Projects", to: "/projects", icon: FolderKanban },
|
||||||
|
{ label: "Invoices", to: "/invoices", icon: FileText },
|
||||||
{ label: "Integrations", to: "/integrations", icon: Zap },
|
{ label: "Integrations", to: "/integrations", icon: Zap },
|
||||||
{ label: "Billing", to: "/billing", icon: CreditCard },
|
{ label: "Billing", to: "/billing", icon: CreditCard },
|
||||||
]
|
]
|
||||||
@ -110,34 +112,25 @@ export default function Nav() {
|
|||||||
<div className="flex items-center gap-1 p-1 rounded-full bg-gray-100 dark:bg-slate-800 border border-gray-200 dark:border-slate-700">
|
<div className="flex items-center gap-1 p-1 rounded-full bg-gray-100 dark:bg-slate-800 border border-gray-200 dark:border-slate-700">
|
||||||
<button
|
<button
|
||||||
onClick={() => setLang('en')}
|
onClick={() => setLang('en')}
|
||||||
className={`px-2 py-1 text-[10px] font-bold rounded-full transition-colors ${lang === 'en' ? 'bg-white dark:bg-slate-700 text-indigo-600 dark:text-indigo-400 shadow-sm' : 'text-gray-500 dark:text-slate-400 hover:text-gray-700 dark:hover:text-slate-300'}`}
|
className={`px-2 py-1 rounded-full text-[10px] font-bold transition-colors ${lang === 'en' ? 'bg-white dark:bg-slate-700 text-indigo-600 dark:text-indigo-400 shadow-sm' : 'text-gray-500 dark:text-slate-400 hover:text-gray-700 dark:hover:text-slate-300'}`}
|
||||||
>
|
>
|
||||||
EN
|
EN
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
onClick={() => setLang('de')}
|
onClick={() => setLang('de')}
|
||||||
className={`px-2 py-1 text-[10px] font-bold rounded-full transition-colors ${lang === 'de' ? 'bg-white dark:bg-slate-700 text-indigo-600 dark:text-indigo-400 shadow-sm' : 'text-gray-500 dark:text-slate-400 hover:text-gray-700 dark:hover:text-slate-300'}`}
|
className={`px-2 py-1 rounded-full text-[10px] font-bold transition-colors ${lang === 'de' ? 'bg-white dark:bg-slate-700 text-indigo-600 dark:text-indigo-400 shadow-sm' : 'text-gray-500 dark:text-slate-400 hover:text-gray-700 dark:hover:text-slate-300'}`}
|
||||||
>
|
>
|
||||||
DE
|
DE
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex items-center gap-3 pl-3 border-l border-gray-200 dark:border-slate-800">
|
<div className="h-6 w-px bg-gray-200 dark:bg-slate-700 mx-1" />
|
||||||
{user && (
|
|
||||||
<Avatar name={user.name} size="sm" />
|
<Avatar user={user} />
|
||||||
)}
|
|
||||||
<button
|
|
||||||
onClick={() => api.logout()}
|
|
||||||
className="p-2 text-gray-500 hover:text-red-600 dark:text-slate-400 dark:hover:text-red-400 transition-colors"
|
|
||||||
title="Logout"
|
|
||||||
>
|
|
||||||
<LogOut className="w-5 h-5" />
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button
|
<button
|
||||||
onClick={() => setIsMobileMenuOpen(!isMobileMenuOpen)}
|
|
||||||
className="md:hidden p-2 rounded-md text-gray-500 hover:bg-gray-100 dark:text-slate-400 dark:hover:bg-slate-800"
|
className="md:hidden p-2 rounded-md text-gray-500 hover:bg-gray-100 dark:text-slate-400 dark:hover:bg-slate-800"
|
||||||
|
onClick={() => setIsMobileMenuOpen(!isMobileMenuOpen)}
|
||||||
>
|
>
|
||||||
{isMobileMenuOpen ? <X className="w-6 h-6" /> : <Menu className="w-6 h-6" />}
|
{isMobileMenuOpen ? <X className="w-6 h-6" /> : <Menu className="w-6 h-6" />}
|
||||||
</button>
|
</button>
|
||||||
@ -147,10 +140,16 @@ export default function Nav() {
|
|||||||
|
|
||||||
{/* Mobile Menu */}
|
{/* Mobile Menu */}
|
||||||
{isMobileMenuOpen && (
|
{isMobileMenuOpen && (
|
||||||
<div className="md:hidden bg-white dark:bg-slate-900 border-b border-gray-200 dark:border-slate-800 px-4 py-4 space-y-1">
|
<div className="md:hidden border-t border-gray-200 dark:border-slate-800 bg-white dark:bg-slate-900 px-4 py-4 space-y-1">
|
||||||
{allItems.map((item) => (
|
{allItems.map((item) => (
|
||||||
<NavLink key={item.to} item={item} />
|
<NavLink key={item.to} item={item} />
|
||||||
))}
|
))}
|
||||||
|
<div className="pt-4 mt-4 border-t border-gray-200 dark:border-slate-800">
|
||||||
|
<button className="flex items-center gap-2 w-full px-3 py-2 text-sm font-medium text-red-600 hover:bg-red-50 dark:text-red-400 dark:hover:bg-red-900/20 rounded-md transition-colors">
|
||||||
|
<LogOut className="w-4 h-4" />
|
||||||
|
Sign Out
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</nav>
|
</nav>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user