Commit Graph

30 Commits

Author SHA1 Message Date
Ruslan Bakiev
9ff7927463 Add hubsList, suppliersList, productsList resolvers and update nearestOffers
All checks were successful
Build Docker Image / build (push) Successful in 1m24s
- Add hubsList resolver for paginated hub list
- Add suppliersList resolver for paginated supplier list
- Add productsList resolver for paginated product list
- Update nearestOffers to support hubUuid parameter with route calculation
- Add OfferWithRouteType for offers with embedded routes
- Add supplier_name to OfferNodeType
2026-01-26 13:55:02 +07:00
Ruslan Bakiev
81f86b6538 Fix nodes_count query bind_vars - only add bounds when present
All checks were successful
Build Docker Image / build (push) Successful in 1m16s
2026-01-25 22:01:54 +07:00
Ruslan Bakiev
2e7f5e7863 Fix nodes query bind_vars - only add bounds when all coordinates present
All checks were successful
Build Docker Image / build (push) Successful in 1m16s
2026-01-25 21:54:22 +07:00
Ruslan Bakiev
64f7e4bdba Fix GraphQL types - add distance_km field
All checks were successful
Build Docker Image / build (push) Successful in 1m17s
- Add distance_km field to NodeType (used by nearestHubs)
- Add distance_km field to OfferNodeType (used by nearestOffers)
- Expand SupplierType with name, latitude, longitude, distance_km
- Fix nearestSuppliers to return full supplier info from nodes collection
- Fix nearestHubs and nearestOffers to pass distance_km to constructors

This fixes 8 failed integration tests for nearest* endpoints.

Resolves: Cannot query field 'distanceKm' on type 'NodeType/OfferNodeType'
2026-01-25 21:33:12 +07:00
Ruslan Bakiev
40f7f66f83 Add comprehensive tests for all geo GraphQL endpoints
All checks were successful
Build Docker Image / build (push) Successful in 1m22s
Created test suite covering all 8 main geo service endpoints:
- Basic: products, nodes (with filters/bounds), clusteredNodes
- Nearest: nearestHubs, nearestOffers, nearestSuppliers (with product filters)
- Routing: routeToCoordinate, autoRoute, railRoute
- Edge cases: invalid coordinates, zero radius, nonexistent UUIDs

Test suite uses real API calls to production GraphQL endpoint.
16 tests total across 4 test classes.

Files:
- tests/test_graphql_endpoints.py: Main test suite (600+ lines)
- tests/README.md: Documentation and usage guide
- pytest.ini: Pytest configuration
- run_tests.sh: Convenience script to run tests
- pyproject.toml: Added pytest and requests as dev dependencies
2026-01-25 21:12:59 +07:00
Ruslan Bakiev
56df2ab37b Fix OfferNodeType initialization error
All checks were successful
Build Docker Image / build (push) Successful in 1m19s
Remove supplier_name field from OfferNodeType constructor in resolve_nearest_offers - this field does not exist in the type definition and causes 400 errors.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-25 20:49:22 +07:00
Ruslan Bakiev
5363b113cf Merge geo-nearest-endpoints - add coordinate-based API endpoints
All checks were successful
Build Docker Image / build (push) Successful in 1m18s
2026-01-25 17:10:55 +07:00
Ruslan Bakiev
46c87c7caa Add coordinate-based nearest endpoints to geo API
- Add nearestHubs(lat, lon, radius, productUuid?) - hubs near coordinates
- Add nearestOffers(lat, lon, radius, productUuid?) - offers near coordinates
- Add nearestSuppliers(lat, lon, radius, productUuid?) - suppliers near coordinates
- Add routeToCoordinate(offerUuid, lat, lon) - route from offer to coordinates

These unified endpoints work with coordinates instead of UUIDs, simplifying
the frontend logic by removing the need for entity-specific queries like
GetProductsNearHub, GetHubsNearOffer, etc.
2026-01-25 17:10:32 +07:00
Ruslan Bakiev
27b05cf362 Add bounds filtering to nodes query for map-based selection
All checks were successful
Build Docker Image / build (push) Successful in 1m10s
2026-01-24 12:13:29 +07:00
Ruslan Bakiev
e342d68197 Add suppliersForProduct and hubsForProduct queries for cascading filters
All checks were successful
Build Docker Image / build (push) Successful in 1m14s
2026-01-24 11:54:24 +07:00
Ruslan Bakiev
3a24f4a9cd Fix supplier query - aggregate through offers
All checks were successful
Build Docker Image / build (push) Successful in 1m21s
Only show suppliers that have active offers.
2026-01-23 11:23:54 +07:00
Ruslan Bakiev
0106c84daf Add offers_count field to ProductType
All checks were successful
Build Docker Image / build (push) Successful in 1m16s
2026-01-22 17:22:05 +07:00
Ruslan Bakiev
596bdbf1c5 Add node_type parameter to clusteredNodes for unified server-side clustering
All checks were successful
Build Docker Image / build (push) Successful in 1m31s
2026-01-16 17:29:42 +07:00
Ruslan Bakiev
07f89ba5fb refactor(geo): Clean up queries - rename offers_to_hub to offers_by_hub, add offer_to_hub
All checks were successful
Build Docker Image / build (push) Successful in 1m24s
- Remove find_routes, find_product_routes, delivery_to_hub queries
- Rename offers_to_hub → offers_by_hub with proper phase-based routing (auto → rail* → auto)
- Add offer_to_hub query for single offer to hub connection
- Both new queries use Dijkstra-like search with transport phases
2026-01-16 16:54:00 +07:00
Ruslan Bakiev
5112f52722 Fix _build_routes call in deliveryToHub
All checks were successful
Build Docker Image / build (push) Successful in 1m18s
2026-01-16 16:03:26 +07:00
Ruslan Bakiev
339db65514 Fix resolve_offers_to_hub to use DISTANCE() instead of graph traversal
All checks were successful
Build Docker Image / build (push) Successful in 1m23s
2026-01-16 15:56:25 +07:00
Ruslan Bakiev
b6f9b2d70b Replace graph traversal queries with DISTANCE() queries
All checks were successful
Build Docker Image / build (push) Successful in 1m53s
- Add new resolvers: products, offersByProduct, hubsNearOffer, suppliers,
  productsBySupplier, offersBySupplierProduct, productsNearHub, offersToHub, deliveryToHub
- Remove broken queries that caused OOM on 234k edges
- Use DISTANCE() for geographic proximity instead of graph traversal
2026-01-16 15:39:55 +07:00
Ruslan Bakiev
a3b0b5ff79 Use supplier_uuid instead of team_uuid in findSupplierProductHubs
All checks were successful
Build Docker Image / build (push) Successful in 1m27s
2026-01-16 10:50:16 +07:00
Ruslan Bakiev
6084333704 Fix findSupplierProductHubs: use team_uuid instead of supplier_uuid
All checks were successful
Build Docker Image / build (push) Successful in 1m39s
2026-01-16 10:35:17 +07:00
Ruslan Bakiev
8f1e3be129 Trigger deploy for catalog navigation queries
All checks were successful
Build Docker Image / build (push) Successful in 1m26s
2026-01-16 10:13:40 +07:00
Ruslan Bakiev
b510dd54d6 feat: add catalog navigation queries
All checks were successful
Build Docker Image / build (push) Successful in 1m34s
- findProductsForHub: find products deliverable to a hub
- findHubsForProduct: find hubs where product can be delivered
- findSupplierProductHubs: find hubs for supplier's product
- findOffersForHubByProduct: find offers with routes (wrapper for findProductRoutes)
2026-01-16 01:32:55 +07:00
Ruslan Bakiev
fd7e10c193 Filter offer edges from route stages
All checks were successful
Build Docker Image / build (push) Successful in 1m42s
Offer edges connect offer nodes to locations and are not
transport stages. Filter them out in _build_route_from_edges()
to avoid showing 0km "offer" steps in the route stepper.
2026-01-15 00:32:57 +07:00
Ruslan Bakiev
0330203a58 Replace pysupercluster with h3 for clustering
All checks were successful
Build Docker Image / build (push) Successful in 1m38s
2026-01-14 10:24:40 +07:00
Ruslan Bakiev
7efa753092 Add server-side clustering with pysupercluster
Some checks failed
Build Docker Image / build (push) Failing after 2m14s
2026-01-14 10:12:39 +07:00
Ruslan Bakiev
e15976382e Add hubCountries query and country filter for nodes
All checks were successful
Build Docker Image / build (push) Successful in 1m45s
2026-01-08 10:42:34 +07:00
Ruslan Bakiev
5d5e0fa4b5 Add nearestNodes query for coordinate-based search
All checks were successful
Build Docker Image / build (push) Successful in 1m39s
2026-01-08 00:36:16 +07:00
Ruslan Bakiev
5f040426a2 feat: add search parameter to nodes query
All checks were successful
Build Docker Image / build (push) Successful in 1m43s
2026-01-07 22:01:31 +07:00
Ruslan Bakiev
c5c6428328 Update webhook URL
All checks were successful
Build Docker Image / build (push) Successful in 1m40s
2026-01-07 09:45:26 +07:00
Ruslan Bakiev
af046892ba Add Gitea Actions CI/CD workflow
Some checks failed
Build Docker Image / build (push) Failing after 13s
2026-01-07 09:26:38 +07:00
Ruslan Bakiev
eb2ffd50f2 Initial commit from monorepo 2026-01-07 09:17:51 +07:00