From cc90f64cb4e9cd1c7ff2bd47b4cdf399e1aad14f Mon Sep 17 00:00:00 2001 From: david Date: Mon, 29 Jun 2026 12:47:03 +0200 Subject: [PATCH] Limpieza --- .../create.bak.no-vale/entities/index.ts | 3 -- .../proforma-create-form-default.entity.ts | 49 ------------------- .../entities/proforma-create-form.entity.ts | 37 -------------- .../entities/proforma-create-form.schema.ts | 48 ------------------ .../proforma-item-create-form.entity.ts | 9 ---- .../web/proformas/create.bak.no-vale/index.ts | 1 - .../proformas/create.bak.no-vale/ui/index.ts | 1 - .../create.bak.no-vale/ui/pages/index.ts | 1 - .../ui/pages/proforma-create-page.tsx | 48 ------------------ 9 files changed, 197 deletions(-) delete mode 100644 modules/customer-invoices/src/web/proformas/create.bak.no-vale/entities/index.ts delete mode 100644 modules/customer-invoices/src/web/proformas/create.bak.no-vale/entities/proforma-create-form-default.entity.ts delete mode 100644 modules/customer-invoices/src/web/proformas/create.bak.no-vale/entities/proforma-create-form.entity.ts delete mode 100644 modules/customer-invoices/src/web/proformas/create.bak.no-vale/entities/proforma-create-form.schema.ts delete mode 100644 modules/customer-invoices/src/web/proformas/create.bak.no-vale/entities/proforma-item-create-form.entity.ts delete mode 100644 modules/customer-invoices/src/web/proformas/create.bak.no-vale/index.ts delete mode 100644 modules/customer-invoices/src/web/proformas/create.bak.no-vale/ui/index.ts delete mode 100644 modules/customer-invoices/src/web/proformas/create.bak.no-vale/ui/pages/index.ts delete mode 100644 modules/customer-invoices/src/web/proformas/create.bak.no-vale/ui/pages/proforma-create-page.tsx diff --git a/modules/customer-invoices/src/web/proformas/create.bak.no-vale/entities/index.ts b/modules/customer-invoices/src/web/proformas/create.bak.no-vale/entities/index.ts deleted file mode 100644 index a1605cb3..00000000 --- a/modules/customer-invoices/src/web/proformas/create.bak.no-vale/entities/index.ts +++ /dev/null @@ -1,3 +0,0 @@ -export * from "./proforma-create-form.entity"; -export * from "./proforma-create-form.schema"; -export * from "./proforma-create-form-default.entity"; diff --git a/modules/customer-invoices/src/web/proformas/create.bak.no-vale/entities/proforma-create-form-default.entity.ts b/modules/customer-invoices/src/web/proformas/create.bak.no-vale/entities/proforma-create-form-default.entity.ts deleted file mode 100644 index 832ad429..00000000 --- a/modules/customer-invoices/src/web/proformas/create.bak.no-vale/entities/proforma-create-form-default.entity.ts +++ /dev/null @@ -1,49 +0,0 @@ -/** - * Valor por defecto para el formulario de creación de proformas. - * - * Reglas: - * - debe ser un objeto que cumpla con la interfaz ProformaCreateForm - * - debe tener valores por defecto razonables para cada campo, evitando campos vacíos o nulos cuando sea posible - * - el shape del objeto debe coincidir exactamente con el de ProformaCreateForm, sin campos adicionales ni transformaciones - * - orientado a la UI, no a la API ni al dominio, es decir, debe ser un objeto que se pueda usar directamente para inicializar un formulario en la interfaz de usuario - */ - -export const defaultProformaCreateForm: ProformaCreateForm = { - invoiceNumber: "", - series: "", - - invoiceDate: "", - operationDate: "", - - customerId: "", - - reference: "", - isCompany: true, - name: "", - tradeName: "", - tin: "", - - defaultTaxes: [], - - street: "", - street2: "", - city: "", - province: "", - postalCode: "", - country: "es", - - primaryEmail: "", - secondaryEmail: "", - primaryPhone: "", - secondaryPhone: "", - primaryMobile: "", - secondaryMobile: "", - - fax: "", - website: "", - - legalRecord: "", - - languageCode: "es", - currencyCode: "EUR", -}; diff --git a/modules/customer-invoices/src/web/proformas/create.bak.no-vale/entities/proforma-create-form.entity.ts b/modules/customer-invoices/src/web/proformas/create.bak.no-vale/entities/proforma-create-form.entity.ts deleted file mode 100644 index f936f93a..00000000 --- a/modules/customer-invoices/src/web/proformas/create.bak.no-vale/entities/proforma-create-form.entity.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * ProformaCreateForm representa el shape de datos del formulario de creación de proforma. - * Es decir, los campos que se muestran en el formulario y que el usuario puede editar. - * - * Este shape es específico para la UI y no tiene por qué coincidir - * con el shape del dominio ni con el de la API. - * - * Debe cumplir las siguientes reglas: - * - nombres en camelCase - * - tipos orientados a UI/form - * - sin campos de solo lectura que no se editen - * - sin shape DTO - * - sin detalles impuestos por el widget - */ - -import type { ProformaItemForm } from "../../shared/entities"; - -export interface ProformaCreateForm { - series: string; - - invoiceDate: string; - operationDate: string; - - customerId: string; - - reference: string; - notes: string; - - languageCode: string; - currencyCode: string; - - globalDiscountPercentage: number; - - paymentMethod: string; - - items: ProformaItemForm[]; -} diff --git a/modules/customer-invoices/src/web/proformas/create.bak.no-vale/entities/proforma-create-form.schema.ts b/modules/customer-invoices/src/web/proformas/create.bak.no-vale/entities/proforma-create-form.schema.ts deleted file mode 100644 index c21cdcb2..00000000 --- a/modules/customer-invoices/src/web/proformas/create.bak.no-vale/entities/proforma-create-form.schema.ts +++ /dev/null @@ -1,48 +0,0 @@ -import { z } from "zod/v4"; - -/** - * Este esquema es para validar los datos del formulario de creación de cliente. - * No tiene por qué coincidir con el shape de la entidad ni con el de la API. - * Solo define los campos que se muestran en el formulario y sus validaciones. - * - * Reglas: - * - no meter transformaciones silenciosas raras en el esquema (ej: .toUpperCase()) - * - nombres en camelCase - * - tipos orientados a UI/form - * - sin campos de solo lectura que no se editen - * - sin shape DTO - * - sin detalles impuestos por el widget - */ - -export const CustomerCreateFormSchema = z.object({ - reference: z.string(), - isCompany: z.boolean(), - name: z.string().min(1, "El nombre es obligatorio"), - tradeName: z.string(), - tin: z.string(), - - defaultTaxes: z.array(z.string()), - - street: z.string(), - street2: z.string(), - city: z.string(), - province: z.string(), - postalCode: z.string(), - country: z.string().min(1, "El país es obligatorio"), - - primaryEmail: z.email("Email inválido"), - secondaryEmail: z.email("Email inválido"), - - primaryPhone: z.string(), - secondaryPhone: z.string(), - primaryMobile: z.string(), - secondaryMobile: z.string(), - - fax: z.string(), - website: z.url("URL inválida"), - - legalRecord: z.string(), - - languageCode: z.string().min(1, "El idioma es obligatorio"), - currencyCode: z.string().min(1, "La moneda es obligatoria"), -}); diff --git a/modules/customer-invoices/src/web/proformas/create.bak.no-vale/entities/proforma-item-create-form.entity.ts b/modules/customer-invoices/src/web/proformas/create.bak.no-vale/entities/proforma-item-create-form.entity.ts deleted file mode 100644 index e1e1c52c..00000000 --- a/modules/customer-invoices/src/web/proformas/create.bak.no-vale/entities/proforma-item-create-form.entity.ts +++ /dev/null @@ -1,9 +0,0 @@ -export interface ProformaItemForm { - id: string; - position: string; - description: string; - quantity: number; - unitAmount: number; - discountPercentage: number; - taxes: string; -} diff --git a/modules/customer-invoices/src/web/proformas/create.bak.no-vale/index.ts b/modules/customer-invoices/src/web/proformas/create.bak.no-vale/index.ts deleted file mode 100644 index 4aedf593..00000000 --- a/modules/customer-invoices/src/web/proformas/create.bak.no-vale/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./ui"; diff --git a/modules/customer-invoices/src/web/proformas/create.bak.no-vale/ui/index.ts b/modules/customer-invoices/src/web/proformas/create.bak.no-vale/ui/index.ts deleted file mode 100644 index c4e34b27..00000000 --- a/modules/customer-invoices/src/web/proformas/create.bak.no-vale/ui/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./pages"; diff --git a/modules/customer-invoices/src/web/proformas/create.bak.no-vale/ui/pages/index.ts b/modules/customer-invoices/src/web/proformas/create.bak.no-vale/ui/pages/index.ts deleted file mode 100644 index 6af8f18e..00000000 --- a/modules/customer-invoices/src/web/proformas/create.bak.no-vale/ui/pages/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from "./proforma-create-page"; diff --git a/modules/customer-invoices/src/web/proformas/create.bak.no-vale/ui/pages/proforma-create-page.tsx b/modules/customer-invoices/src/web/proformas/create.bak.no-vale/ui/pages/proforma-create-page.tsx deleted file mode 100644 index 7d75e5c8..00000000 --- a/modules/customer-invoices/src/web/proformas/create.bak.no-vale/ui/pages/proforma-create-page.tsx +++ /dev/null @@ -1,48 +0,0 @@ -import { PageHeader } from "@erp/core/components"; -import { UnsavedChangesProvider } from "@erp/core/hooks"; -import { AppContent, AppHeader } from "@repo/rdx-ui/components"; -import { Button } from "@repo/shadcn-ui/components"; -import { PlusIcon } from "lucide-react"; -import { useNavigate } from "react-router-dom"; - -import { useTranslation } from "../../../../i18n"; - -export const ProformaCreatePage = () => { - const { t } = useTranslation(); - const navigate = useNavigate(); - - return ( - - - navigate("/proformas/create")} - > - - {t("pages.proformas.create.title")} - - } - title={t("pages.proformas.list.title")} - /> - - - -
-
-

{t("pages.create.title")}

-

{t("pages.create.description")}

-
-
- -
-
-
hola
-
-
- ); -};