diff --git a/apps/server/src/register-modules.ts b/apps/server/src/register-modules.ts
index f318eba4..934dd0ed 100644
--- a/apps/server/src/register-modules.ts
+++ b/apps/server/src/register-modules.ts
@@ -8,5 +8,5 @@ export const registerModules = () => {
//registerModule(authAPIModule);
registerModule(customersAPIModule);
registerModule(customerInvoicesAPIModule);
- // registerModule(verifactuAPIModule);
+ //registerModule(verifactuAPIModule);
};
diff --git a/modules/customer-invoices/src/api/infrastructure/express/customer-invoices.routes.ts b/modules/customer-invoices/src/api/infrastructure/express/customer-invoices.routes.ts
index 455965af..175f1a14 100644
--- a/modules/customer-invoices/src/api/infrastructure/express/customer-invoices.routes.ts
+++ b/modules/customer-invoices/src/api/infrastructure/express/customer-invoices.routes.ts
@@ -1,5 +1,6 @@
import { RequestWithAuth, enforceTenant, enforceUser, mockUser } from "@erp/auth/api";
-import { ILogger, ModuleParams, validateRequest } from "@erp/core/api";
+import { ModuleParams, validateRequest } from "@erp/core/api";
+import { ILogger } from "@repo/rdx-logger";
import { Application, NextFunction, Request, Response, Router } from "express";
import { Sequelize } from "sequelize";
import {
@@ -115,5 +116,5 @@ export const customerInvoicesRouter = (params: ModuleParams) => {
}
);
- app.use(`${baseRoutePath}/proforma-invoices`, router);
+ app.use(`${baseRoutePath}/customer-invoices`, router);
};
diff --git a/modules/customer-invoices/src/web/components/customer-invoices-list-grid.tsx b/modules/customer-invoices/src/web/components/customer-invoices-list-grid.tsx
index 13669e01..65bb0bc0 100644
--- a/modules/customer-invoices/src/web/components/customer-invoices-list-grid.tsx
+++ b/modules/customer-invoices/src/web/components/customer-invoices-list-grid.tsx
@@ -10,6 +10,7 @@ import { useMemo, useState } from "react";
import { MoneyDTO } from "@erp/core";
import { formatDate, formatMoney } from "@erp/core/client";
+import { ErrorOverlay } from "@repo/rdx-ui/components";
import { Button } from "@repo/shadcn-ui/components";
import { AgGridReact } from "ag-grid-react";
import { ChevronRightIcon } from "lucide-react";
@@ -23,7 +24,6 @@ ModuleRegistry.registerModules([AllCommunityModule]);
// Create new GridExample component
export const CustomerInvoicesListGrid = () => {
const { t } = useTranslation();
-
const navigate = useNavigate();
const {
@@ -141,6 +141,19 @@ export const CustomerInvoicesListGrid = () => {
[autoSizeStrategy, colDefs]
);
+ if (isLoadError) {
+ return (
+ <>
+
+ >
+ );
+ }
+
// Container: Defines the grid's theme & dimensions.
return (
import("./pages").then((m) => ({ default: m.CustomerInvoiceCreate }))
);
-//const LogoutPage = lazy(() => import("./app").then((m) => ({ default: m.LogoutPage })));
-
-/*const DealerLayout = lazy(() => import("./app").then((m) => ({ default: m.DealerLayout })));
-const DealersList = lazy(() => import("./app").then((m) => ({ default: m.DealersList })));
-
-const LoginPageWithLanguageSelector = lazy(() =>
- import("./app").then((m) => ({ default: m.LoginPageWithLanguageSelector }))
-);
-
-
-const CustomerInvoiceEdit = lazy(() => import("./app").then((m) => ({ default: m.CustomerInvoiceEdit })));
-const SettingsEditor = lazy(() => import("./app").then((m) => ({ default: m.SettingsEditor })));
-const SettingsLayout = lazy(() => import("./app").then((m) => ({ default: m.SettingsLayout })));
-const CatalogLayout = lazy(() => import("./app").then((m) => ({ default: m.CatalogLayout })));
-const CatalogList = lazy(() => import("./app").then((m) => ({ default: m.CatalogList })));
-const DashboardPage = lazy(() => import("./app").then((m) => ({ default: m.DashboardPage })));
-const CustomerInvoicesLayout = lazy(() => import("./app").then((m) => ({ default: m.CustomerInvoicesLayout })));
-const CustomerInvoicesList = lazy(() => import("./app").then((m) => ({ default: m.CustomerInvoicesList })));*/
-
export const CustomerInvoiceRoutes = (params: ModuleClientParams): RouteObject[] => {
return [
{
diff --git a/modules/customer-invoices/src/web/pages/list.tsx b/modules/customer-invoices/src/web/pages/customer-invoices-list.tsx
similarity index 83%
rename from modules/customer-invoices/src/web/pages/list.tsx
rename to modules/customer-invoices/src/web/pages/customer-invoices-list.tsx
index 25e4ba31..e5aeb021 100644
--- a/modules/customer-invoices/src/web/pages/list.tsx
+++ b/modules/customer-invoices/src/web/pages/customer-invoices-list.tsx
@@ -1,7 +1,6 @@
import { AppBreadcrumb, AppContent } from "@repo/rdx-ui/components";
import { Button } from "@repo/shadcn-ui/components";
import { PlusIcon } from "lucide-react";
-import { useState } from "react";
import { useNavigate } from "react-router-dom";
import { CustomerInvoicesListGrid } from "../components";
import { useTranslation } from "../i18n";
@@ -9,17 +8,6 @@ import { useTranslation } from "../i18n";
export const CustomerInvoicesList = () => {
const { t } = useTranslation();
const navigate = useNavigate();
- const [status, setStatus] = useState("all");
-
- /*const CustomerInvoiceStatuses = [
- { value: "all", label: t("customerInvoices.list.tabs.all") },
- { value: "draft", label: t("customerInvoices.list.tabs.draft") },
- { value: "ready", label: t("customerInvoices.list.tabs.ready") },
- { value: "delivered", label: t("customerInvoices.list.tabs.delivered") },
- { value: "accepted", label: t("customerInvoices.list.tabs.accepted") },
- { value: "rejected", label: t("customerInvoices.list.tabs.rejected") },
- { value: "archived", label: t("customerInvoices.list.tabs.archived") },
- ];*/
return (
<>
diff --git a/modules/customer-invoices/src/web/pages/index.ts b/modules/customer-invoices/src/web/pages/index.ts
index d1c12f23..9fe62f07 100644
--- a/modules/customer-invoices/src/web/pages/index.ts
+++ b/modules/customer-invoices/src/web/pages/index.ts
@@ -1,2 +1,2 @@
export * from "./create";
-export * from "./list";
+export * from "./customer-invoices-list";
diff --git a/modules/customer-invoices/src/web/schemas/customer-invoices.api.schema.ts b/modules/customer-invoices/src/web/schemas/customer-invoices.api.schema.ts
new file mode 100644
index 00000000..0d709a87
--- /dev/null
+++ b/modules/customer-invoices/src/web/schemas/customer-invoices.api.schema.ts
@@ -0,0 +1,13 @@
+//import * as z from "zod/v4";
+
+import { ListCustomerInvoicesResponseDTO } from "@erp/customer-invoices/common";
+
+/*export const CustomerCreateSchema = CreateCustomerRequestSchema;
+export const CustomerUpdateSchema = UpdateCustomerByIdRequestSchema;
+export const CustomerSchema = GetCustomerByIdResponseSchema.omit({
+ metadata: true,
+});
+
+export type CustomerData = z.infer
;*/
+
+export type CustomerInvoicesListData = ListCustomerInvoicesResponseDTO;
diff --git a/modules/customer-invoices/src/web/schemas/customer-invoices.form.schema.ts b/modules/customer-invoices/src/web/schemas/customer-invoices.form.schema.ts
new file mode 100644
index 00000000..8b137891
--- /dev/null
+++ b/modules/customer-invoices/src/web/schemas/customer-invoices.form.schema.ts
@@ -0,0 +1 @@
+
diff --git a/modules/customer-invoices/src/web/schemas/index.ts b/modules/customer-invoices/src/web/schemas/index.ts
new file mode 100644
index 00000000..cda9c8dc
--- /dev/null
+++ b/modules/customer-invoices/src/web/schemas/index.ts
@@ -0,0 +1,2 @@
+export * from "./customer-invoices.api.schema";
+export * from "./customer-invoices.form.schema";
diff --git a/modules/customers/src/api/domain/repositories/customer-repository.interface.ts b/modules/customers/src/api/domain/repositories/customer-repository.interface.ts
index d3d013ed..c1270ff3 100644
--- a/modules/customers/src/api/domain/repositories/customer-repository.interface.ts
+++ b/modules/customers/src/api/domain/repositories/customer-repository.interface.ts
@@ -1,6 +1,7 @@
import { Criteria } from "@repo/rdx-criteria/server";
import { UniqueID } from "@repo/rdx-ddd";
import { Collection, Result } from "@repo/rdx-utils";
+import { CustomerListDTO } from "../../infrastructure/mappers";
import { Customer } from "../aggregates";
/**
@@ -42,7 +43,7 @@ export interface ICustomerRepository {
companyId: UniqueID,
criteria: Criteria,
transaction?: any
- ): Promise>>;
+ ): Promise, Error>>;
/**
* Elimina un Customer por su ID, dentro de una empresa.
diff --git a/modules/customers/src/api/domain/value-objects/customer-address-type.ts b/modules/customers/src/api/domain/value-objects/customer-address-type.ts
index 61529481..8dbe2de4 100644
--- a/modules/customers/src/api/domain/value-objects/customer-address-type.ts
+++ b/modules/customers/src/api/domain/value-objects/customer-address-type.ts
@@ -14,10 +14,10 @@ export class CustomerAddressType extends ValueObject
private static readonly ALLOWED_TYPES = ["shipping", "billing"];
static create(value: string): Result {
- if (!this.ALLOWED_TYPES.includes(value)) {
+ if (!CustomerAddressType.ALLOWED_TYPES.includes(value)) {
return Result.fail(
new Error(
- `Invalid address type: ${value}. Allowed types are: ${this.ALLOWED_TYPES.join(", ")}`
+ `Invalid address type: ${value}. Allowed types are: ${CustomerAddressType.ALLOWED_TYPES.join(", ")}`
)
);
}
diff --git a/modules/customers/src/api/domain/value-objects/customer-number.ts b/modules/customers/src/api/domain/value-objects/customer-number.ts
index d8ed16c3..aa9a5f4b 100644
--- a/modules/customers/src/api/domain/value-objects/customer-number.ts
+++ b/modules/customers/src/api/domain/value-objects/customer-number.ts
@@ -1,5 +1,4 @@
-import { DomainValidationError } from "@erp/core/api";
-import { ValueObject } from "@repo/rdx-ddd";
+import { DomainValidationError, ValueObject } from "@repo/rdx-ddd";
import { Result } from "@repo/rdx-utils";
import * as z from "zod/v4";
diff --git a/modules/customers/src/api/domain/value-objects/customer-serie.ts b/modules/customers/src/api/domain/value-objects/customer-serie.ts
index cab2a1d9..618fafa4 100644
--- a/modules/customers/src/api/domain/value-objects/customer-serie.ts
+++ b/modules/customers/src/api/domain/value-objects/customer-serie.ts
@@ -1,5 +1,4 @@
-import { DomainValidationError } from "@erp/core/api";
-import { ValueObject } from "@repo/rdx-ddd";
+import { DomainValidationError, ValueObject } from "@repo/rdx-ddd";
import { Maybe, Result } from "@repo/rdx-utils";
import * as z from "zod/v4";
diff --git a/modules/customers/src/api/domain/value-objects/customer-status.ts b/modules/customers/src/api/domain/value-objects/customer-status.ts
index d3ff0a2e..7653ef1d 100644
--- a/modules/customers/src/api/domain/value-objects/customer-status.ts
+++ b/modules/customers/src/api/domain/value-objects/customer-status.ts
@@ -1,5 +1,4 @@
-import { DomainValidationError } from "@erp/core/api";
-import { ValueObject } from "@repo/rdx-ddd";
+import { DomainValidationError, ValueObject } from "@repo/rdx-ddd";
import { Result } from "@repo/rdx-utils";
interface ICustomerStatusProps {
diff --git a/modules/customers/src/common/locales/en.json b/modules/customers/src/common/locales/en.json
index f1dd48e2..e659f3b0 100644
--- a/modules/customers/src/common/locales/en.json
+++ b/modules/customers/src/common/locales/en.json
@@ -5,6 +5,12 @@
"cancel": "Cancel",
"save": "Save"
},
+ "catalog": {
+ "status": {
+ "active": "active",
+ "inactive": "inactive"
+ }
+ },
"pages": {
"title": "Customers",
"description": "Manage your customers",
diff --git a/modules/customers/src/common/locales/es.json b/modules/customers/src/common/locales/es.json
index 35c739f5..5e5a058f 100644
--- a/modules/customers/src/common/locales/es.json
+++ b/modules/customers/src/common/locales/es.json
@@ -5,6 +5,12 @@
"cancel": "Cancelar",
"save": "Guardar"
},
+ "catalog": {
+ "status": {
+ "active": "activo",
+ "inactive": "inactivo"
+ }
+ },
"pages": {
"title": "Clientes",
"description": "Gestiona tus clientes",
@@ -96,6 +102,7 @@
"placeholder": "Ingrese el correo electrónico",
"description": "La dirección de correo electrónico principal del cliente"
},
+
"email_secondary": {
"label": "Email secundario",
"placeholder": "Ingrese el correo electrónico",
@@ -107,6 +114,7 @@
"placeholder": "Ingrese el número de teléfono",
"description": "El número de teléfono del cliente"
},
+
"phone_secondary": {
"label": "Teléfono secundario",
"placeholder": "Ingrese el número de teléfono secundario",
@@ -118,6 +126,7 @@
"placeholder": "Ingrese el número de teléfono",
"description": "El número de teléfono del cliente"
},
+
"mobile_secondary": {
"label": "Teléfono secundario",
"placeholder": "Ingrese el número de teléfono secundario",
@@ -129,21 +138,25 @@
"placeholder": "Ingrese el número de fax",
"description": "El número de fax del cliente"
},
+
"website": {
"label": "Sitio web",
"placeholder": "Ingrese la URL del sitio web",
"description": "El sitio web del cliente"
},
+
"default_taxes": {
"label": "Impuesto por defecto",
"placeholder": "Seleccione el impuesto por defecto",
"description": "La tasa de impuesto por defecto para el cliente"
},
+
"language_code": {
"label": "Idioma",
"placeholder": "Seleccione el idioma",
"description": "El idioma preferido del cliente"
},
+
"currency_code": {
"label": "Moneda",
"placeholder": "Seleccione la moneda",
diff --git a/modules/customers/src/web/components/customer-status-badge.tsx b/modules/customers/src/web/components/customer-status-badge.tsx
index d91e0549..98f45737 100644
--- a/modules/customers/src/web/components/customer-status-badge.tsx
+++ b/modules/customers/src/web/components/customer-status-badge.tsx
@@ -42,7 +42,7 @@ export const CustomerStatusBadge = forwardRef
- {t(`status.${status}`)}
+ {t(`catalog.status.${status}`)}
);
}
diff --git a/modules/customers/src/web/components/customers-list-grid.tsx b/modules/customers/src/web/components/customers-list-grid.tsx
index aa4534f2..8d6f4fac 100644
--- a/modules/customers/src/web/components/customers-list-grid.tsx
+++ b/modules/customers/src/web/components/customers-list-grid.tsx
@@ -67,7 +67,7 @@ export const CustomersListGrid = () => {
{
field: "status",
headerName: t("pages.list.grid_columns.status"),
- maxWidth: 125,
+ maxWidth: 135,
cellRenderer: (params: ValueFormatterParams) => {
return ;
},
diff --git a/modules/customers/src/web/components/editor/customer-basic-info-fields.tsx b/modules/customers/src/web/components/editor/customer-basic-info-fields.tsx
index b141e535..3593791a 100644
--- a/modules/customers/src/web/components/editor/customer-basic-info-fields.tsx
+++ b/modules/customers/src/web/components/editor/customer-basic-info-fields.tsx
@@ -33,8 +33,8 @@ export const CustomerBasicInfoFields = () => {
return (