From c5bf21efda417cb892ed6a657544e05bba72ca01 Mon Sep 17 00:00:00 2001 From: AlexSserb Date: Sun, 19 Jan 2025 19:44:41 +0400 Subject: [PATCH] feat: factory article for product --- src/client/models/ProductCreateRequest.ts | 1 + src/client/models/ProductSchema.ts | 1 + src/client/models/UserCreate.ts | 2 +- src/client/models/UserSchema.ts | 2 +- src/client/models/UserUpdate.ts | 2 +- .../components/ProductsTable/columns.tsx | 15 +++++++++++++++ .../CreateProductModal/CreateProductModal.tsx | 5 +++++ 7 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/client/models/ProductCreateRequest.ts b/src/client/models/ProductCreateRequest.ts index 814904c..3c0bb22 100644 --- a/src/client/models/ProductCreateRequest.ts +++ b/src/client/models/ProductCreateRequest.ts @@ -7,6 +7,7 @@ import type { ProductImageSchema } from './ProductImageSchema'; export type ProductCreateRequest = { name: string; article?: (string | null); + factoryArticle?: (string | null); clientId: number; barcodes: Array; barcodeTemplate?: (BarcodeTemplateSchema | null); diff --git a/src/client/models/ProductSchema.ts b/src/client/models/ProductSchema.ts index f2308ff..d60d01a 100644 --- a/src/client/models/ProductSchema.ts +++ b/src/client/models/ProductSchema.ts @@ -7,6 +7,7 @@ import type { ProductImageSchema } from './ProductImageSchema'; export type ProductSchema = { name: string; article?: (string | null); + factoryArticle?: (string | null); clientId: number; barcodes: Array; barcodeTemplate?: (BarcodeTemplateSchema | null); diff --git a/src/client/models/UserCreate.ts b/src/client/models/UserCreate.ts index 99180e9..6baf93e 100644 --- a/src/client/models/UserCreate.ts +++ b/src/client/models/UserCreate.ts @@ -9,7 +9,7 @@ export type UserCreate = { phoneNumber?: (string | null); firstName: string; secondName: string; - patronymic: string; + patronymic?: string; comment: string; passportData?: (string | null); isAdmin: boolean; diff --git a/src/client/models/UserSchema.ts b/src/client/models/UserSchema.ts index 37fab64..a171ecf 100644 --- a/src/client/models/UserSchema.ts +++ b/src/client/models/UserSchema.ts @@ -12,7 +12,7 @@ export type UserSchema = { phoneNumber?: (string | null); firstName: string; secondName: string; - patronymic: string; + patronymic?: string; comment: string; passportData?: (string | null); isAdmin: boolean; diff --git a/src/client/models/UserUpdate.ts b/src/client/models/UserUpdate.ts index 89941bf..8608de3 100644 --- a/src/client/models/UserUpdate.ts +++ b/src/client/models/UserUpdate.ts @@ -9,7 +9,7 @@ export type UserUpdate = { phoneNumber?: (string | null); firstName: string; secondName: string; - patronymic: string; + patronymic?: string; comment: string; passportData?: (string | null); isAdmin: boolean; diff --git a/src/pages/ProductsPage/components/ProductsTable/columns.tsx b/src/pages/ProductsPage/components/ProductsTable/columns.tsx index 68c6685..0b2a0dc 100644 --- a/src/pages/ProductsPage/components/ProductsTable/columns.tsx +++ b/src/pages/ProductsPage/components/ProductsTable/columns.tsx @@ -11,11 +11,19 @@ export const useProductsTableColumns = () => { accessorKey: "article", header: "Артикул", enableSorting: false, + size: 100, + }, + { + accessorKey: "factoryArticle", + header: "Складской артикул", + enableSorting: false, + size: 100, }, { accessorKey: "name", header: "Название", enableSorting: false, + size: 150, }, { accessorKey: "barcodes", @@ -39,36 +47,43 @@ export const useProductsTableColumns = () => { ); }, enableSorting: false, + size: 50, }, { accessorKey: "barcodeTemplate.name", header: "Шаблон штрихкода", enableSorting: false, + size: 50, }, { accessorKey: "brand", header: "Бренд", enableSorting: false, + size: 50, }, { accessorKey: "composition", header: "Состав", enableSorting: false, + size: 50, }, { accessorKey: "color", header: "Цвет", enableSorting: false, + size: 50, }, { accessorKey: "size", header: "Размер", enableSorting: false, + size: 50, }, { accessorKey: "additionalInfo", header: "Доп. информация", enableSorting: false, + size: 120, }, ], [] diff --git a/src/pages/ProductsPage/modals/CreateProductModal/CreateProductModal.tsx b/src/pages/ProductsPage/modals/CreateProductModal/CreateProductModal.tsx index 95b495f..e3fb9b5 100644 --- a/src/pages/ProductsPage/modals/CreateProductModal/CreateProductModal.tsx +++ b/src/pages/ProductsPage/modals/CreateProductModal/CreateProductModal.tsx @@ -70,6 +70,11 @@ const CreateProductModal = ({ label={"Артикул"} {...form.getInputProps("article")} /> +