Simplify GEO API - use new list endpoints and routes in nearestOffers
All checks were successful
Build Docker Image / build (push) Successful in 4m11s

- Replace GetNodesDocument with HubsListDocument in useCatalogHubs.ts
- Replace GetSupplierProfilesDocument with SuppliersListDocument in useCatalogSuppliers.ts
- Replace manual grouping with ProductsListDocument in useCatalogProducts.ts
- Update nearestOffers to pass hubUuid for server-side route calculation
- Remove RouteToCoordinate calls - routes now included in nearestOffers response
- Delete 15 obsolete GraphQL files
- Add 3 new list endpoints: HubsList, SuppliersList, ProductsList
- Fix TypeScript errors in CalcResultContent, LocationsContent, hubs page, location store
This commit is contained in:
Ruslan Bakiev
2026-01-26 14:08:21 +07:00
parent 6d916d65a0
commit 65b07271d9
28 changed files with 190 additions and 504 deletions

View File

@@ -1,11 +0,0 @@
query GetHubsForProduct($productUuid: String!, $radiusKm: Float) {
hubsForProduct(productUuid: $productUuid, radiusKm: $radiusKm) {
uuid
name
latitude
longitude
country
countryCode
transportTypes
}
}

View File

@@ -1,11 +0,0 @@
query GetHubsNearOffer($offerUuid: String!, $limit: Int) {
hubsNearOffer(offerUuid: $offerUuid, limit: $limit) {
uuid
name
latitude
longitude
country
countryCode
transportTypes
}
}

View File

@@ -6,15 +6,6 @@ query GetNode($uuid: String!) {
longitude
country
countryCode
syncedAt
edges {
toUuid
toName
toLatitude
toLongitude
distanceKm
travelTimeSeconds
transportType
}
transportTypes
}
}

View File

@@ -1,40 +0,0 @@
query GetNodeConnections($uuid: String!, $limitAuto: Int, $limitRail: Int) {
nodeConnections(uuid: $uuid, limitAuto: $limitAuto, limitRail: $limitRail) {
hub {
uuid
name
latitude
longitude
country
countryCode
syncedAt
}
railNode {
uuid
name
latitude
longitude
country
countryCode
syncedAt
}
autoEdges {
toUuid
toName
toLatitude
toLongitude
distanceKm
travelTimeSeconds
transportType
}
railEdges {
toUuid
toName
toLatitude
toLongitude
distanceKm
travelTimeSeconds
transportType
}
}
}

View File

@@ -1,13 +0,0 @@
query GetNodes($limit: Int, $offset: Int, $transportType: String, $country: String, $west: Float, $south: Float, $east: Float, $north: Float) {
nodes(limit: $limit, offset: $offset, transportType: $transportType, country: $country, west: $west, south: $south, east: $east, north: $north) {
uuid
name
latitude
longitude
country
countryCode
syncedAt
transportTypes
}
nodesCount(transportType: $transportType, country: $country, west: $west, south: $south, east: $east, north: $north)
}

View File

@@ -1,26 +0,0 @@
query GetOfferToHub($offerUuid: String!, $hubUuid: String!) {
offerToHub(offerUuid: $offerUuid, hubUuid: $hubUuid) {
sourceUuid
sourceName
sourceLat
sourceLon
distanceKm
routes {
totalDistanceKm
totalTimeSeconds
stages {
fromUuid
fromName
fromLat
fromLon
toUuid
toName
toLat
toLon
distanceKm
travelTimeSeconds
transportType
}
}
}
}

View File

@@ -1,26 +0,0 @@
query GetOffersByHub($hubUuid: String!, $productUuid: String!, $limit: Int) {
offersByHub(hubUuid: $hubUuid, productUuid: $productUuid, limit: $limit) {
sourceUuid
sourceName
sourceLat
sourceLon
distanceKm
routes {
totalDistanceKm
totalTimeSeconds
stages {
fromUuid
fromName
fromLat
fromLon
toUuid
toName
toLat
toLon
distanceKm
travelTimeSeconds
transportType
}
}
}
}

View File

@@ -1,16 +0,0 @@
query GetOffersByProduct($productUuid: String!) {
offersByProduct(productUuid: $productUuid) {
uuid
productUuid
productName
supplierUuid
latitude
longitude
country
countryCode
pricePerUnit
currency
quantity
unit
}
}

View File

@@ -1,16 +0,0 @@
query GetOffersBySupplierProduct($supplierUuid: String!, $productUuid: String!) {
offersBySupplierProduct(supplierUuid: $supplierUuid, productUuid: $productUuid) {
uuid
productUuid
productName
supplierUuid
latitude
longitude
country
countryCode
pricePerUnit
currency
quantity
unit
}
}

View File

@@ -1,7 +0,0 @@
query GetProducts {
products {
uuid
name
offersCount
}
}

View File

@@ -1,7 +0,0 @@
query GetProductsBySupplier($supplierUuid: String!) {
productsBySupplier(supplierUuid: $supplierUuid) {
uuid
name
offersCount
}
}

View File

@@ -1,7 +0,0 @@
query GetProductsNearHub($hubUuid: String!, $radiusKm: Float) {
productsNearHub(hubUuid: $hubUuid, radiusKm: $radiusKm) {
uuid
name
offersCount
}
}

View File

@@ -1,5 +0,0 @@
query GetSuppliers {
suppliers {
uuid
}
}

View File

@@ -1,5 +0,0 @@
query GetSuppliersForProduct($productUuid: String!) {
suppliersForProduct(productUuid: $productUuid) {
uuid
}
}

View File

@@ -0,0 +1,11 @@
query HubsList($limit: Int, $offset: Int, $country: String, $transportType: String) {
hubsList(limit: $limit, offset: $offset, country: $country, transportType: $transportType) {
uuid
name
latitude
longitude
country
countryCode
transportTypes
}
}

View File

@@ -1,9 +1,10 @@
query NearestOffers($lat: Float!, $lon: Float!, $radius: Float, $productUuid: String, $limit: Int) {
nearestOffers(lat: $lat, lon: $lon, radius: $radius, productUuid: $productUuid, limit: $limit) {
query NearestOffers($lat: Float!, $lon: Float!, $radius: Float, $productUuid: String, $hubUuid: String, $limit: Int) {
nearestOffers(lat: $lat, lon: $lon, radius: $radius, productUuid: $productUuid, hubUuid: $hubUuid, limit: $limit) {
uuid
productUuid
productName
supplierUuid
supplierName
latitude
longitude
country
@@ -12,5 +13,23 @@ query NearestOffers($lat: Float!, $lon: Float!, $radius: Float, $productUuid: St
currency
quantity
unit
distanceKm
routes {
totalDistanceKm
totalTimeSeconds
stages {
fromUuid
fromName
fromLat
fromLon
toUuid
toName
toLat
toLon
distanceKm
travelTimeSeconds
transportType
}
}
}
}

View File

@@ -0,0 +1,7 @@
query ProductsList($limit: Int, $offset: Int) {
productsList(limit: $limit, offset: $offset) {
uuid
name
offersCount
}
}

View File

@@ -1,26 +0,0 @@
query RouteToCoordinate($offerUuid: String!, $lat: Float!, $lon: Float!) {
routeToCoordinate(offerUuid: $offerUuid, lat: $lat, lon: $lon) {
sourceUuid
sourceName
sourceLat
sourceLon
distanceKm
routes {
totalDistanceKm
totalTimeSeconds
stages {
fromUuid
fromName
fromLat
fromLon
toUuid
toName
toLat
toLon
distanceKm
travelTimeSeconds
transportType
}
}
}
}

View File

@@ -0,0 +1,8 @@
query SuppliersList($limit: Int, $offset: Int, $country: String) {
suppliersList(limit: $limit, offset: $offset, country: $country) {
uuid
name
latitude
longitude
}
}