Uecko_ERP/modules/customer-invoices/src/web/customer-invoice-routes.tsx

93 lines
2.6 KiB
TypeScript
Raw Normal View History

2025-11-11 18:57:04 +00:00
import type { ModuleClientParams } from "@erp/core/client";
2025-06-11 15:13:44 +00:00
import { lazy } from "react";
2025-11-11 18:57:04 +00:00
import { Outlet, type RouteObject } from "react-router-dom";
2025-06-11 15:13:44 +00:00
2025-11-17 10:26:54 +00:00
const ProformaLayout = lazy(() =>
2026-04-12 19:12:10 +00:00
import("./proformas/shared/ui").then((m) => ({ default: m.ProformaLayout }))
2025-11-17 10:26:54 +00:00
);
const ProformasListPage = lazy(() =>
2026-04-05 18:17:47 +00:00
import("./proformas/list").then((m) => ({ default: m.ListProformasPage }))
2025-06-11 15:13:44 +00:00
);
2025-06-24 18:38:57 +00:00
2026-03-23 11:13:33 +00:00
/*const ProformasCreatePage = lazy(() =>
2026-03-07 18:27:23 +00:00
import("./proformas/create").then((m) => ({ default: m.ProformaCreatePage }))
2026-03-23 11:13:33 +00:00
);*/
2025-06-24 18:38:57 +00:00
2026-04-07 19:44:51 +00:00
const ProformaUpdatePage = lazy(() =>
import("./proformas/update").then((m) => ({ default: m.ProformaUpdatePage }))
);
2025-06-11 15:13:44 +00:00
2026-03-07 18:27:23 +00:00
const IssuedInvoicesLayout = lazy(() =>
2026-04-12 19:12:10 +00:00
import("./issued-invoices/shared/ui").then((m) => ({ default: m.IssuedInvoicesLayout }))
2026-03-07 18:27:23 +00:00
);
const IssuedInvoiceListPage = lazy(() =>
2026-04-12 17:44:56 +00:00
import("./issued-invoices/list").then((m) => ({ default: m.ListIssuedInvoicesPage }))
2026-03-07 18:27:23 +00:00
);
2025-06-11 15:13:44 +00:00
export const CustomerInvoiceRoutes = (params: ModuleClientParams): RouteObject[] => {
return [
2025-11-11 18:57:04 +00:00
{
path: "proformas",
2026-06-02 16:40:23 +00:00
handle: {
layout: "app-sidebar",
protected: true,
},
2025-11-11 18:57:04 +00:00
element: (
2025-11-17 10:26:54 +00:00
<ProformaLayout>
2025-11-11 18:57:04 +00:00
<Outlet context={params} />
2025-11-17 10:26:54 +00:00
</ProformaLayout>
2025-11-11 18:57:04 +00:00
),
children: [
2026-06-02 16:40:23 +00:00
{
index: true,
element: <ProformasListPage />,
},
{
path: "list",
element: <ProformasListPage />,
},
2025-11-11 18:57:04 +00:00
],
},
2026-06-02 16:40:23 +00:00
{
path: "proformas/:id/edit",
handle: {
layout: "app-fullscreen",
protected: true,
},
element: <ProformaUpdatePage />,
},
2025-11-16 21:11:46 +00:00
{
2025-06-24 18:38:57 +00:00
path: "customer-invoices",
2026-06-02 16:40:23 +00:00
handle: {
layout: "app-sidebar",
protected: true,
},
2025-06-11 15:13:44 +00:00
element: (
2025-11-17 10:26:54 +00:00
<IssuedInvoicesLayout>
2025-06-11 15:13:44 +00:00
<Outlet context={params} />
2025-11-17 10:26:54 +00:00
</IssuedInvoicesLayout>
2025-06-11 15:13:44 +00:00
),
children: [
2025-11-16 21:11:46 +00:00
{ path: "", index: true, element: <IssuedInvoiceListPage /> }, // index
{ path: "list", element: <IssuedInvoiceListPage /> },
/*
2025-11-13 11:49:36 +00:00
{ path: "create", element: <CustomerInvoicesList /> },
2025-06-11 15:13:44 +00:00
{ path: ":id", element: <CustomerInvoicesList /> },
2026-04-07 19:44:51 +00:00
2025-06-11 15:13:44 +00:00
{ path: ":id/delete", element: <CustomerInvoicesList /> },
{ path: ":id/view", element: <CustomerInvoicesList /> },
{ path: ":id/print", element: <CustomerInvoicesList /> },
{ path: ":id/email", element: <CustomerInvoicesList /> },
{ path: ":id/download", element: <CustomerInvoicesList /> },
{ path: ":id/duplicate", element: <CustomerInvoicesList /> },
2025-11-13 11:49:36 +00:00
{ path: ":id/preview", element: <CustomerInvoicesList /> },
2025-11-16 21:11:46 +00:00
*/
2025-06-11 15:13:44 +00:00
],
2025-11-16 21:11:46 +00:00
},
2025-06-11 15:13:44 +00:00
];
};