feat: add Einnahmen Kategorien management page with CRUD functionality
- Implemented a new route for managing Einnahmen Kategorien. - Added auto-seeding of default Einnahmen Kategorien if none exist. - Integrated category usage tracking to prevent deletion of in-use categories. - Enhanced Einnahmen page to link to the new Kategorien management. - Updated Prisma schema and seed script to include default categories. - Added a modal for detailed view of Einnahmen by category and month. - Refactored existing Einnahmen page to accommodate new category structure. - Introduced PostCSS configuration for Tailwind CSS support. - Created a new migration to update existing category labels in the database. - Added TypeScript configuration for stricter type checking. - Set up Vite configuration for improved development experience with React Router.
This commit is contained in:
@@ -83,11 +83,21 @@ type Pages = {
|
||||
"id": string;
|
||||
};
|
||||
};
|
||||
"/companies/:id/ausgaben/kategorien": {
|
||||
params: {
|
||||
"id": string;
|
||||
};
|
||||
};
|
||||
"/companies/:id/einnahmen": {
|
||||
params: {
|
||||
"id": string;
|
||||
};
|
||||
};
|
||||
"/companies/:id/einnahmen/kategorien": {
|
||||
params: {
|
||||
"id": string;
|
||||
};
|
||||
};
|
||||
"/companies/:id/anlagevermoegen": {
|
||||
params: {
|
||||
"id": string;
|
||||
@@ -200,6 +210,17 @@ type Pages = {
|
||||
"id": string;
|
||||
};
|
||||
};
|
||||
"/api/companies/:id/buchungkategorien": {
|
||||
params: {
|
||||
"id": string;
|
||||
};
|
||||
};
|
||||
"/api/companies/:id/buchungkategorien/:katId": {
|
||||
params: {
|
||||
"id": string;
|
||||
"katId": string;
|
||||
};
|
||||
};
|
||||
"/api/anlagevermoegen": {
|
||||
params: {};
|
||||
};
|
||||
@@ -213,7 +234,7 @@ type Pages = {
|
||||
type RouteFiles = {
|
||||
"root.tsx": {
|
||||
id: "root";
|
||||
page: "/" | "/login" | "/logout" | "/companies" | "/companies/new" | "/companies/:id" | "/companies/:id/edit" | "/companies/:id/customers" | "/companies/:id/leistungen" | "/companies/:id/invoices" | "/companies/:id/invoices/new" | "/companies/:id/invoices/:invoiceId" | "/companies/:id/invoices/:invoiceId/edit" | "/companies/:id/reports" | "/companies/:id/bilanzen" | "/companies/:id/ausgaben" | "/companies/:id/einnahmen" | "/companies/:id/anlagevermoegen" | "/companies/:id/money" | "/archiv" | "/settings/password" | "/admin/mandanten" | "/admin/users" | "/admin/users/new" | "/admin/users/:id" | "/admin/logs" | "/api/companies" | "/api/companies/:id" | "/api/companies/:id/customers" | "/api/companies/:id/invoices" | "/api/companies/:id/money" | "/api/customers" | "/api/customers/:id" | "/api/services" | "/api/services/:id" | "/api/invoices" | "/api/invoices/:id" | "/api/invoices/:id/pdf" | "/api/invoices/:id/xml" | "/api/reports" | "/api/bilanzen" | "/api/ausgaben" | "/api/ausgaben/:id" | "/api/einnahmen" | "/api/einnahmen/:id" | "/api/anlagevermoegen" | "/api/anlagevermoegen/:id";
|
||||
page: "/" | "/login" | "/logout" | "/companies" | "/companies/new" | "/companies/:id" | "/companies/:id/edit" | "/companies/:id/customers" | "/companies/:id/leistungen" | "/companies/:id/invoices" | "/companies/:id/invoices/new" | "/companies/:id/invoices/:invoiceId" | "/companies/:id/invoices/:invoiceId/edit" | "/companies/:id/reports" | "/companies/:id/bilanzen" | "/companies/:id/ausgaben" | "/companies/:id/ausgaben/kategorien" | "/companies/:id/einnahmen" | "/companies/:id/einnahmen/kategorien" | "/companies/:id/anlagevermoegen" | "/companies/:id/money" | "/archiv" | "/settings/password" | "/admin/mandanten" | "/admin/users" | "/admin/users/new" | "/admin/users/:id" | "/admin/logs" | "/api/companies" | "/api/companies/:id" | "/api/companies/:id/customers" | "/api/companies/:id/invoices" | "/api/companies/:id/money" | "/api/customers" | "/api/customers/:id" | "/api/services" | "/api/services/:id" | "/api/invoices" | "/api/invoices/:id" | "/api/invoices/:id/pdf" | "/api/invoices/:id/xml" | "/api/reports" | "/api/bilanzen" | "/api/ausgaben" | "/api/ausgaben/:id" | "/api/einnahmen" | "/api/einnahmen/:id" | "/api/companies/:id/buchungkategorien" | "/api/companies/:id/buchungkategorien/:katId" | "/api/anlagevermoegen" | "/api/anlagevermoegen/:id";
|
||||
};
|
||||
"routes/login.tsx": {
|
||||
id: "routes/login";
|
||||
@@ -225,7 +246,7 @@ type RouteFiles = {
|
||||
};
|
||||
"routes/dashboard-layout.tsx": {
|
||||
id: "routes/dashboard-layout";
|
||||
page: "/" | "/companies" | "/companies/new" | "/companies/:id" | "/companies/:id/edit" | "/companies/:id/customers" | "/companies/:id/leistungen" | "/companies/:id/invoices" | "/companies/:id/invoices/new" | "/companies/:id/invoices/:invoiceId" | "/companies/:id/invoices/:invoiceId/edit" | "/companies/:id/reports" | "/companies/:id/bilanzen" | "/companies/:id/ausgaben" | "/companies/:id/einnahmen" | "/companies/:id/anlagevermoegen" | "/companies/:id/money" | "/archiv" | "/settings/password";
|
||||
page: "/" | "/companies" | "/companies/new" | "/companies/:id" | "/companies/:id/edit" | "/companies/:id/customers" | "/companies/:id/leistungen" | "/companies/:id/invoices" | "/companies/:id/invoices/new" | "/companies/:id/invoices/:invoiceId" | "/companies/:id/invoices/:invoiceId/edit" | "/companies/:id/reports" | "/companies/:id/bilanzen" | "/companies/:id/ausgaben" | "/companies/:id/ausgaben/kategorien" | "/companies/:id/einnahmen" | "/companies/:id/einnahmen/kategorien" | "/companies/:id/anlagevermoegen" | "/companies/:id/money" | "/archiv" | "/settings/password";
|
||||
};
|
||||
"routes/home.tsx": {
|
||||
id: "routes/home";
|
||||
@@ -283,10 +304,18 @@ type RouteFiles = {
|
||||
id: "routes/companies.$id.ausgaben";
|
||||
page: "/companies/:id/ausgaben";
|
||||
};
|
||||
"routes/companies.$id.ausgaben.kategorien.tsx": {
|
||||
id: "routes/companies.$id.ausgaben.kategorien";
|
||||
page: "/companies/:id/ausgaben/kategorien";
|
||||
};
|
||||
"routes/companies.$id.einnahmen.tsx": {
|
||||
id: "routes/companies.$id.einnahmen";
|
||||
page: "/companies/:id/einnahmen";
|
||||
};
|
||||
"routes/companies.$id.einnahmen.kategorien.tsx": {
|
||||
id: "routes/companies.$id.einnahmen.kategorien";
|
||||
page: "/companies/:id/einnahmen/kategorien";
|
||||
};
|
||||
"routes/companies.$id.anlagevermoegen.tsx": {
|
||||
id: "routes/companies.$id.anlagevermoegen";
|
||||
page: "/companies/:id/anlagevermoegen";
|
||||
@@ -403,6 +432,14 @@ type RouteFiles = {
|
||||
id: "routes/api.einnahmen.$id";
|
||||
page: "/api/einnahmen/:id";
|
||||
};
|
||||
"routes/api.companies.$id.buchungkategorien.ts": {
|
||||
id: "routes/api.companies.$id.buchungkategorien";
|
||||
page: "/api/companies/:id/buchungkategorien";
|
||||
};
|
||||
"routes/api.companies.$id.buchungkategorien.$katId.ts": {
|
||||
id: "routes/api.companies.$id.buchungkategorien.$katId";
|
||||
page: "/api/companies/:id/buchungkategorien/:katId";
|
||||
};
|
||||
"routes/api.anlagevermoegen.ts": {
|
||||
id: "routes/api.anlagevermoegen";
|
||||
page: "/api/anlagevermoegen";
|
||||
@@ -432,7 +469,9 @@ type RouteModules = {
|
||||
"routes/companies.$id.reports": typeof import("./app/routes/companies.$id.reports.tsx");
|
||||
"routes/companies.$id.bilanzen": typeof import("./app/routes/companies.$id.bilanzen.tsx");
|
||||
"routes/companies.$id.ausgaben": typeof import("./app/routes/companies.$id.ausgaben.tsx");
|
||||
"routes/companies.$id.ausgaben.kategorien": typeof import("./app/routes/companies.$id.ausgaben.kategorien.tsx");
|
||||
"routes/companies.$id.einnahmen": typeof import("./app/routes/companies.$id.einnahmen.tsx");
|
||||
"routes/companies.$id.einnahmen.kategorien": typeof import("./app/routes/companies.$id.einnahmen.kategorien.tsx");
|
||||
"routes/companies.$id.anlagevermoegen": typeof import("./app/routes/companies.$id.anlagevermoegen.tsx");
|
||||
"routes/companies.$id.money": typeof import("./app/routes/companies.$id.money.tsx");
|
||||
"routes/archiv": typeof import("./app/routes/archiv.tsx");
|
||||
@@ -462,6 +501,8 @@ type RouteModules = {
|
||||
"routes/api.ausgaben.$id": typeof import("./app/routes/api.ausgaben.$id.ts");
|
||||
"routes/api.einnahmen": typeof import("./app/routes/api.einnahmen.ts");
|
||||
"routes/api.einnahmen.$id": typeof import("./app/routes/api.einnahmen.$id.ts");
|
||||
"routes/api.companies.$id.buchungkategorien": typeof import("./app/routes/api.companies.$id.buchungkategorien.ts");
|
||||
"routes/api.companies.$id.buchungkategorien.$katId": typeof import("./app/routes/api.companies.$id.buchungkategorien.$katId.ts");
|
||||
"routes/api.anlagevermoegen": typeof import("./app/routes/api.anlagevermoegen.ts");
|
||||
"routes/api.anlagevermoegen.$id": typeof import("./app/routes/api.anlagevermoegen.$id.ts");
|
||||
};
|
||||
@@ -0,0 +1,62 @@
|
||||
// Generated by React Router
|
||||
|
||||
import type { GetInfo, GetAnnotations } from "react-router/internal";
|
||||
|
||||
type Module = typeof import("../api.companies.$id.buchungkategorien.$katId.js")
|
||||
|
||||
type Info = GetInfo<{
|
||||
file: "routes/api.companies.$id.buchungkategorien.$katId.ts",
|
||||
module: Module
|
||||
}>
|
||||
|
||||
type Matches = [{
|
||||
id: "root";
|
||||
module: typeof import("../../root.js");
|
||||
}, {
|
||||
id: "routes/api.companies.$id.buchungkategorien.$katId";
|
||||
module: typeof import("../api.companies.$id.buchungkategorien.$katId.js");
|
||||
}];
|
||||
|
||||
type Annotations = GetAnnotations<Info & { module: Module, matches: Matches }, false>;
|
||||
|
||||
export namespace Route {
|
||||
// links
|
||||
export type LinkDescriptors = Annotations["LinkDescriptors"];
|
||||
export type LinksFunction = Annotations["LinksFunction"];
|
||||
|
||||
// meta
|
||||
export type MetaArgs = Annotations["MetaArgs"];
|
||||
export type MetaDescriptors = Annotations["MetaDescriptors"];
|
||||
export type MetaFunction = Annotations["MetaFunction"];
|
||||
|
||||
// headers
|
||||
export type HeadersArgs = Annotations["HeadersArgs"];
|
||||
export type HeadersFunction = Annotations["HeadersFunction"];
|
||||
|
||||
// middleware
|
||||
export type MiddlewareFunction = Annotations["MiddlewareFunction"];
|
||||
|
||||
// clientMiddleware
|
||||
export type ClientMiddlewareFunction = Annotations["ClientMiddlewareFunction"];
|
||||
|
||||
// loader
|
||||
export type LoaderArgs = Annotations["LoaderArgs"];
|
||||
|
||||
// clientLoader
|
||||
export type ClientLoaderArgs = Annotations["ClientLoaderArgs"];
|
||||
|
||||
// action
|
||||
export type ActionArgs = Annotations["ActionArgs"];
|
||||
|
||||
// clientAction
|
||||
export type ClientActionArgs = Annotations["ClientActionArgs"];
|
||||
|
||||
// HydrateFallback
|
||||
export type HydrateFallbackProps = Annotations["HydrateFallbackProps"];
|
||||
|
||||
// Component
|
||||
export type ComponentProps = Annotations["ComponentProps"];
|
||||
|
||||
// ErrorBoundary
|
||||
export type ErrorBoundaryProps = Annotations["ErrorBoundaryProps"];
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
// Generated by React Router
|
||||
|
||||
import type { GetInfo, GetAnnotations } from "react-router/internal";
|
||||
|
||||
type Module = typeof import("../api.companies.$id.buchungkategorien.js")
|
||||
|
||||
type Info = GetInfo<{
|
||||
file: "routes/api.companies.$id.buchungkategorien.ts",
|
||||
module: Module
|
||||
}>
|
||||
|
||||
type Matches = [{
|
||||
id: "root";
|
||||
module: typeof import("../../root.js");
|
||||
}, {
|
||||
id: "routes/api.companies.$id.buchungkategorien";
|
||||
module: typeof import("../api.companies.$id.buchungkategorien.js");
|
||||
}];
|
||||
|
||||
type Annotations = GetAnnotations<Info & { module: Module, matches: Matches }, false>;
|
||||
|
||||
export namespace Route {
|
||||
// links
|
||||
export type LinkDescriptors = Annotations["LinkDescriptors"];
|
||||
export type LinksFunction = Annotations["LinksFunction"];
|
||||
|
||||
// meta
|
||||
export type MetaArgs = Annotations["MetaArgs"];
|
||||
export type MetaDescriptors = Annotations["MetaDescriptors"];
|
||||
export type MetaFunction = Annotations["MetaFunction"];
|
||||
|
||||
// headers
|
||||
export type HeadersArgs = Annotations["HeadersArgs"];
|
||||
export type HeadersFunction = Annotations["HeadersFunction"];
|
||||
|
||||
// middleware
|
||||
export type MiddlewareFunction = Annotations["MiddlewareFunction"];
|
||||
|
||||
// clientMiddleware
|
||||
export type ClientMiddlewareFunction = Annotations["ClientMiddlewareFunction"];
|
||||
|
||||
// loader
|
||||
export type LoaderArgs = Annotations["LoaderArgs"];
|
||||
|
||||
// clientLoader
|
||||
export type ClientLoaderArgs = Annotations["ClientLoaderArgs"];
|
||||
|
||||
// action
|
||||
export type ActionArgs = Annotations["ActionArgs"];
|
||||
|
||||
// clientAction
|
||||
export type ClientActionArgs = Annotations["ClientActionArgs"];
|
||||
|
||||
// HydrateFallback
|
||||
export type HydrateFallbackProps = Annotations["HydrateFallbackProps"];
|
||||
|
||||
// Component
|
||||
export type ComponentProps = Annotations["ComponentProps"];
|
||||
|
||||
// ErrorBoundary
|
||||
export type ErrorBoundaryProps = Annotations["ErrorBoundaryProps"];
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
// Generated by React Router
|
||||
|
||||
import type { GetInfo, GetAnnotations } from "react-router/internal";
|
||||
|
||||
type Module = typeof import("../companies.$id.ausgaben.kategorien.js")
|
||||
|
||||
type Info = GetInfo<{
|
||||
file: "routes/companies.$id.ausgaben.kategorien.tsx",
|
||||
module: Module
|
||||
}>
|
||||
|
||||
type Matches = [{
|
||||
id: "root";
|
||||
module: typeof import("../../root.js");
|
||||
}, {
|
||||
id: "routes/dashboard-layout";
|
||||
module: typeof import("../dashboard-layout.js");
|
||||
}, {
|
||||
id: "routes/companies.$id.ausgaben.kategorien";
|
||||
module: typeof import("../companies.$id.ausgaben.kategorien.js");
|
||||
}];
|
||||
|
||||
type Annotations = GetAnnotations<Info & { module: Module, matches: Matches }, false>;
|
||||
|
||||
export namespace Route {
|
||||
// links
|
||||
export type LinkDescriptors = Annotations["LinkDescriptors"];
|
||||
export type LinksFunction = Annotations["LinksFunction"];
|
||||
|
||||
// meta
|
||||
export type MetaArgs = Annotations["MetaArgs"];
|
||||
export type MetaDescriptors = Annotations["MetaDescriptors"];
|
||||
export type MetaFunction = Annotations["MetaFunction"];
|
||||
|
||||
// headers
|
||||
export type HeadersArgs = Annotations["HeadersArgs"];
|
||||
export type HeadersFunction = Annotations["HeadersFunction"];
|
||||
|
||||
// middleware
|
||||
export type MiddlewareFunction = Annotations["MiddlewareFunction"];
|
||||
|
||||
// clientMiddleware
|
||||
export type ClientMiddlewareFunction = Annotations["ClientMiddlewareFunction"];
|
||||
|
||||
// loader
|
||||
export type LoaderArgs = Annotations["LoaderArgs"];
|
||||
|
||||
// clientLoader
|
||||
export type ClientLoaderArgs = Annotations["ClientLoaderArgs"];
|
||||
|
||||
// action
|
||||
export type ActionArgs = Annotations["ActionArgs"];
|
||||
|
||||
// clientAction
|
||||
export type ClientActionArgs = Annotations["ClientActionArgs"];
|
||||
|
||||
// HydrateFallback
|
||||
export type HydrateFallbackProps = Annotations["HydrateFallbackProps"];
|
||||
|
||||
// Component
|
||||
export type ComponentProps = Annotations["ComponentProps"];
|
||||
|
||||
// ErrorBoundary
|
||||
export type ErrorBoundaryProps = Annotations["ErrorBoundaryProps"];
|
||||
}
|
||||
@@ -0,0 +1,65 @@
|
||||
// Generated by React Router
|
||||
|
||||
import type { GetInfo, GetAnnotations } from "react-router/internal";
|
||||
|
||||
type Module = typeof import("../companies.$id.einnahmen.kategorien.js")
|
||||
|
||||
type Info = GetInfo<{
|
||||
file: "routes/companies.$id.einnahmen.kategorien.tsx",
|
||||
module: Module
|
||||
}>
|
||||
|
||||
type Matches = [{
|
||||
id: "root";
|
||||
module: typeof import("../../root.js");
|
||||
}, {
|
||||
id: "routes/dashboard-layout";
|
||||
module: typeof import("../dashboard-layout.js");
|
||||
}, {
|
||||
id: "routes/companies.$id.einnahmen.kategorien";
|
||||
module: typeof import("../companies.$id.einnahmen.kategorien.js");
|
||||
}];
|
||||
|
||||
type Annotations = GetAnnotations<Info & { module: Module, matches: Matches }, false>;
|
||||
|
||||
export namespace Route {
|
||||
// links
|
||||
export type LinkDescriptors = Annotations["LinkDescriptors"];
|
||||
export type LinksFunction = Annotations["LinksFunction"];
|
||||
|
||||
// meta
|
||||
export type MetaArgs = Annotations["MetaArgs"];
|
||||
export type MetaDescriptors = Annotations["MetaDescriptors"];
|
||||
export type MetaFunction = Annotations["MetaFunction"];
|
||||
|
||||
// headers
|
||||
export type HeadersArgs = Annotations["HeadersArgs"];
|
||||
export type HeadersFunction = Annotations["HeadersFunction"];
|
||||
|
||||
// middleware
|
||||
export type MiddlewareFunction = Annotations["MiddlewareFunction"];
|
||||
|
||||
// clientMiddleware
|
||||
export type ClientMiddlewareFunction = Annotations["ClientMiddlewareFunction"];
|
||||
|
||||
// loader
|
||||
export type LoaderArgs = Annotations["LoaderArgs"];
|
||||
|
||||
// clientLoader
|
||||
export type ClientLoaderArgs = Annotations["ClientLoaderArgs"];
|
||||
|
||||
// action
|
||||
export type ActionArgs = Annotations["ActionArgs"];
|
||||
|
||||
// clientAction
|
||||
export type ClientActionArgs = Annotations["ClientActionArgs"];
|
||||
|
||||
// HydrateFallback
|
||||
export type HydrateFallbackProps = Annotations["HydrateFallbackProps"];
|
||||
|
||||
// Component
|
||||
export type ComponentProps = Annotations["ComponentProps"];
|
||||
|
||||
// ErrorBoundary
|
||||
export type ErrorBoundaryProps = Annotations["ErrorBoundaryProps"];
|
||||
}
|
||||
Reference in New Issue
Block a user