From 7ed5fbd66d2a4a94678d1b7984570c4c799bd28e Mon Sep 17 00:00:00 2001 From: Ruslan Bakiev <572431+veikab@users.noreply.github.com> Date: Thu, 9 Apr 2026 16:03:32 +0700 Subject: [PATCH] Add catalog settings management --- app/app.vue | 8 + .../catalog/CatalogConfigurator.vue | 86 +++++- app/composables/graphql/generated.ts | 114 +++++++- app/pages/catalog-settings.vue | 257 ++++++++++++++++++ .../catalog-product-type-settings.graphql | 12 + ...psert-catalog-product-type-setting.graphql | 12 + graphql/schema.graphql | 24 ++ 7 files changed, 504 insertions(+), 9 deletions(-) create mode 100644 app/pages/catalog-settings.vue create mode 100644 graphql/operations/settings/catalog-product-type-settings.graphql create mode 100644 graphql/operations/settings/upsert-catalog-product-type-setting.graphql diff --git a/app/app.vue b/app/app.vue index 606f38a..43b9cac 100644 --- a/app/app.vue +++ b/app/app.vue @@ -83,6 +83,14 @@ const managerPageTabs = computed(() => { if (route.path.startsWith('/admin/settings')) { return [ + { + key: 'catalog', + label: 'Каталог', + active: route.path === '/admin/settings/catalog', + to: { + path: '/admin/settings/catalog', + }, + }, { key: 'messages', label: 'Сообщения', diff --git a/app/components/catalog/CatalogConfigurator.vue b/app/components/catalog/CatalogConfigurator.vue index c6a9d56..1309dff 100644 --- a/app/components/catalog/CatalogConfigurator.vue +++ b/app/components/catalog/CatalogConfigurator.vue @@ -1,9 +1,15 @@ + + diff --git a/graphql/operations/settings/catalog-product-type-settings.graphql b/graphql/operations/settings/catalog-product-type-settings.graphql new file mode 100644 index 0000000..01e8946 --- /dev/null +++ b/graphql/operations/settings/catalog-product-type-settings.graphql @@ -0,0 +1,12 @@ +query CatalogProductTypeSettings { + catalogProductTypeSettings { + productType + showQuantityPerBox + allowCustomLength + customLengthMinM + customLengthMaxM + customLengthStepM + allowCustomSleeveBrand + allowCustomLabel + } +} diff --git a/graphql/operations/settings/upsert-catalog-product-type-setting.graphql b/graphql/operations/settings/upsert-catalog-product-type-setting.graphql new file mode 100644 index 0000000..d976373 --- /dev/null +++ b/graphql/operations/settings/upsert-catalog-product-type-setting.graphql @@ -0,0 +1,12 @@ +mutation UpsertCatalogProductTypeSetting($input: UpsertCatalogProductTypeSettingInput!) { + upsertCatalogProductTypeSetting(input: $input) { + productType + showQuantityPerBox + allowCustomLength + customLengthMinM + customLengthMaxM + customLengthStepM + allowCustomSleeveBrand + allowCustomLabel + } +} diff --git a/graphql/schema.graphql b/graphql/schema.graphql index e1b6d96..38bb0bd 100644 --- a/graphql/schema.graphql +++ b/graphql/schema.graphql @@ -248,6 +248,17 @@ type Product { availableInWarehouses: [ProductWarehouseBalance!]! } +type CatalogProductTypeSetting { + productType: String! + showQuantityPerBox: Boolean! + allowCustomLength: Boolean! + customLengthMinM: Int + customLengthMaxM: Int + customLengthStepM: Int + allowCustomSleeveBrand: Boolean! + allowCustomLabel: Boolean! +} + type CartItem { id: ID! productId: ID! @@ -411,6 +422,7 @@ type Query { integrationSyncDashboard: IntegrationSyncDashboard! managerNotificationHistory(userId: ID!, channel: MessengerType!, limit: Int = 50): [NotificationHistoryItem!]! clientProducts: [Product!]! + catalogProductTypeSettings: [CatalogProductTypeSetting!]! order(id: ID!): Order myOrders: [Order!]! myCurrentOrders: [Order!]! @@ -491,6 +503,17 @@ input UpdateCartItemQuantityInput { quantity: Float! } +input UpsertCatalogProductTypeSettingInput { + productType: String! + showQuantityPerBox: Boolean! + allowCustomLength: Boolean! + customLengthMinM: Int + customLengthMaxM: Int + customLengthStepM: Int + allowCustomSleeveBrand: Boolean! + allowCustomLabel: Boolean! +} + input ReadyOrderItemInput { productId: ID! quantity: Float! @@ -554,6 +577,7 @@ type Mutation { connectMessenger(input: ConnectMessengerInput!): MessengerConnection! deleteMyMessengerConnection(connectionId: ID!): Boolean! upsertMyCounterpartyProfile(input: UpsertMyCounterpartyProfileInput!): CounterpartyProfile! + upsertCatalogProductTypeSetting(input: UpsertCatalogProductTypeSettingInput!): CatalogProductTypeSetting! addProductToCart(productId: ID!): Cart! updateCartItemQuantity(input: UpdateCartItemQuantityInput!): Cart! removeCartItem(productId: ID!): Cart!