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

183 lines
4.9 KiB
TypeScript

import type { ModuleClientParams } from "@erp/core/client";
import { lazy } from "react";
import { Outlet, type RouteObject } from "react-router-dom";
const ProformasListPage = lazy(() =>
import("./proformas/list").then((m) => ({ default: m.ListProformasPage }))
);
const ArchivedProformasListPage = lazy(() =>
import("./proformas/list").then((m) => ({ default: m.ListArchivedProformasPage }))
);
const DeletedProformasListPage = lazy(() =>
import("./proformas/list").then((m) => ({ default: m.ListDeletedProformasPage }))
);
const ProformasCreatePage = lazy(() =>
import("./proformas/create").then((m) => ({ default: m.ProformaCreatePage }))
);
const ProformaUpdatePage = lazy(() =>
import("./proformas/update").then((m) => ({ default: m.ProformaUpdatePage }))
);
const ProformaDetailPage = lazy(() =>
import("./proformas/detail").then((m) => ({ default: m.ProformaDetailPage }))
);
const RecurringProformasListPage = lazy(() =>
import("./recurring-proformas").then((m) => ({ default: m.ListRecurringProformasPage }))
);
const RecurringProformaCreatePage = lazy(() =>
import("./recurring-proformas").then((m) => ({ default: m.RecurringProformaCreatePage }))
);
const RecurringProformaDetailPage = lazy(() =>
import("./recurring-proformas").then((m) => ({ default: m.RecurringProformaDetailPage }))
);
const IssuedInvoiceListPage = lazy(() =>
import("./issued-invoices/list").then((m) => ({ default: m.ListIssuedInvoicesPage }))
);
const IssuedInvoiceDetailPage = lazy(() =>
import("./issued-invoices/detail").then((m) => ({ default: m.IssuedInvoiceDetailPage }))
);
const CompanyVerifactuSettingsPage = lazy(() =>
import("./settings/verifactu").then((m) => ({ default: m.CompanyVerifactuSettingsPage }))
);
export const CustomerInvoiceRoutes = (params: ModuleClientParams): RouteObject[] => {
return [
{
path: "proformas",
handle: {
layout: "app-sidebar",
protected: true,
},
element: <Outlet context={params} />,
children: [
{
index: true,
element: <ProformasListPage />,
},
{
path: "list",
element: <ProformasListPage />,
},
{
path: "archived",
element: <ArchivedProformasListPage />,
},
{
path: "deleted",
element: <DeletedProformasListPage />,
},
],
},
{
path: "proformas/create",
handle: {
layout: "app-fullscreen",
protected: true,
},
element: <ProformasCreatePage />,
},
{
path: "proformas/:id/edit",
handle: {
layout: "app-fullscreen",
protected: true,
},
element: <ProformaUpdatePage />,
},
{
path: "proformas/:id",
handle: {
layout: "app-fullscreen",
protected: true,
},
element: <ProformaDetailPage />,
},
{
path: "recurring-proformas",
handle: {
layout: "app-sidebar",
protected: true,
},
element: <RecurringProformasListPage />,
},
{
path: "recurring-proformas/archived",
handle: {
layout: "app-sidebar",
protected: true,
},
element: <RecurringProformasListPage />,
},
{
path: "recurring-proformas/create",
handle: {
layout: "app-fullscreen",
protected: true,
},
element: <RecurringProformaCreatePage />,
},
{
path: "recurring-proformas/:recurring_proforma_id",
handle: {
layout: "app-fullscreen",
protected: true,
},
element: <RecurringProformaDetailPage />,
},
{
path: "customer-invoices",
handle: {
layout: "app-sidebar",
protected: true,
},
element: <Outlet context={params} />,
children: [
{ path: "", index: true, element: <IssuedInvoiceListPage /> }, // index
{ path: "list", element: <IssuedInvoiceListPage /> },
/*
{ path: "create", element: <CustomerInvoicesList /> },
{ path: ":id", element: <CustomerInvoicesList /> },
{ 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 /> },
{ path: ":id/preview", element: <CustomerInvoicesList /> },
*/
],
},
{
path: "customer-invoices/:id",
handle: {
layout: "app-fullscreen",
protected: true,
},
element: <IssuedInvoiceDetailPage />,
},
{
path: "settings/billing/verifactu",
handle: {
layout: "app-sidebar",
protected: true,
},
element: <CompanyVerifactuSettingsPage />,
},
];
};