Fix geo GraphQL schema mismatch: camelCase → snake_case
All checks were successful
Build Docker Image / build (push) Successful in 5m46s

All geo .graphql operations and consuming code updated to match
server schema which uses snake_case field/argument names.
Removed non-existent QuoteCalculations query, using NearestOffers instead.
This commit is contained in:
Ruslan Bakiev
2026-03-09 21:45:57 +07:00
parent 15563991df
commit 25f946b293
34 changed files with 504 additions and 744 deletions

View File

@@ -172,14 +172,14 @@
v-for="(offer, index) in offersWithPrice"
:key="offer.uuid ?? index"
:supplier-name="getOfferSupplierName(offer)"
:location-name="offer.locationName || offer.locationCountry || offer.country || offer.locationName"
:product-name="offer.productName"
:price-per-unit="offer.pricePerUnit ? Number(offer.pricePerUnit) : null"
:location-name="offer.country || ''"
:product-name="offer.product_name"
:price-per-unit="offer.price_per_unit ? Number(offer.price_per_unit) : null"
:quantity="offer.quantity"
:currency="offer.currency"
:unit="offer.unit"
:stages="getOfferStages(offer)"
:total-time-seconds="offer.routes?.[0]?.totalTimeSeconds ?? null"
:total-time-seconds="offer.routes?.[0]?.total_time_seconds ?? null"
@select="onOfferSelect(offer)"
/>
</div>
@@ -315,7 +315,7 @@ import type {
InfoSupplierItem,
InfoOfferItem
} from '~/composables/useCatalogInfo'
import type { RouteStageType } from '~/composables/graphql/public/geo-generated'
import type { RouteStage } from '~/composables/graphql/public/geo-generated'
const props = defineProps<{
entityType: InfoEntityType
@@ -353,7 +353,7 @@ const relatedHubs = computed(() => props.relatedHubs ?? [])
const relatedSuppliers = computed(() => props.relatedSuppliers ?? [])
const relatedOffers = computed(() => props.relatedOffers ?? [])
const offersWithPrice = computed(() =>
relatedOffers.value.filter(o => o?.pricePerUnit != null)
relatedOffers.value.filter(o => o?.price_per_unit != null)
)
const suppliersByUuid = computed(() => {
@@ -370,9 +370,9 @@ const suppliersByUuid = computed(() => {
})
const getOfferSupplierName = (offer: InfoOfferItem) => {
if (offer.supplierName) return offer.supplierName
if (offer.supplierUuid && suppliersByUuid.value.has(offer.supplierUuid)) {
return suppliersByUuid.value.get(offer.supplierUuid)
if (offer.supplier_name) return offer.supplier_name
if (offer.supplier_uuid && suppliersByUuid.value.has(offer.supplier_uuid)) {
return suppliersByUuid.value.get(offer.supplier_uuid)
}
return null
}
@@ -441,11 +441,11 @@ const formatPrice = (price: number | string) => {
}
const railHubs = computed(() =>
relatedHubs.value.filter(h => h.transportTypes?.includes('rail'))
relatedHubs.value.filter(h => h.transport_types?.includes('rail'))
)
const seaHubs = computed(() =>
relatedHubs.value.filter(h => h.transportTypes?.includes('sea'))
relatedHubs.value.filter(h => h.transport_types?.includes('sea'))
)
// Mock KYC teaser data (will be replaced with real data later)
@@ -473,7 +473,7 @@ const onProductSelect = (product: InfoProductItem) => {
const onOfferSelect = (offer: InfoOfferItem) => {
if (offer.uuid) {
emit('select-offer', { uuid: offer.uuid, productUuid: offer.productUuid })
emit('select-offer', { uuid: offer.uuid, productUuid: offer.product_uuid })
}
}
@@ -493,12 +493,12 @@ const getOfferStages = (offer: InfoOfferItem) => {
const route = offer.routes?.[0]
if (!route?.stages) return []
return route.stages
.filter((stage): stage is NonNullable<RouteStageType> => stage !== null)
.filter((stage): stage is NonNullable<RouteStage> => stage !== null)
.map(stage => ({
transportType: stage.transportType,
distanceKm: stage.distanceKm,
travelTimeSeconds: stage.travelTimeSeconds,
fromName: stage.fromName
transportType: stage.transport_type,
distanceKm: stage.distance_km,
travelTimeSeconds: stage.travel_time_seconds,
fromName: stage.from_name
}))
}
</script>