From 50375f2a74aa4891987f027f9e1eef8c99d3121e Mon Sep 17 00:00:00 2001 From: Ruslan Bakiev Date: Sun, 25 Jan 2026 17:39:33 +0700 Subject: [PATCH] Refactor catalog to use coordinate-based GraphQL endpoints Replace entity-specific queries (GetProductsNearHub, GetOffersByHub, GetHubsForProduct, GetSuppliersForProduct) with unified coordinate-based endpoints (NearestHubs, NearestOffers, NearestSuppliers, RouteToCoordinate). This simplifies backend architecture from 18 to 8 core endpoints while maintaining identical UI/UX behavior. All composables and pages now use coordinates + client-side grouping instead of specialized backend queries. For global product filtering, uses center point (0,0) with 20000km radius. Co-Authored-By: Claude Sonnet 4.5 --- app/components/CalcResultContent.vue | 69 ++++++-- app/composables/useCatalogHubs.ts | 17 +- app/composables/useCatalogInfo.ts | 209 ++++++++++++++++++++----- app/composables/useCatalogProducts.ts | 93 +++++++++-- app/composables/useCatalogSuppliers.ts | 31 ++-- app/pages/catalog/hubs/[id]/index.vue | 46 ++++-- 6 files changed, 372 insertions(+), 93 deletions(-) diff --git a/app/components/CalcResultContent.vue b/app/components/CalcResultContent.vue index a1beb89..97fadff 100644 --- a/app/components/CalcResultContent.vue +++ b/app/components/CalcResultContent.vue @@ -64,7 +64,7 @@