fix: migrate geo GraphQL queries and frontend to camelCase
All checks were successful
Build Docker Image / build (push) Successful in 5m0s

Geo backend was migrated to camelCase but frontend .graphql files and
component code still used snake_case, causing 400 errors on all geo API calls.
This commit is contained in:
Ruslan Bakiev
2026-03-10 14:10:23 +07:00
parent 4467d20160
commit 29c34a048a
30 changed files with 349 additions and 349 deletions

View File

@@ -227,7 +227,7 @@ const serverClusteredGeoJson = computed(() => ({
id: point!.id,
name: point!.name,
count: point!.count ?? 1,
expansionZoom: point!.expansion_zoom,
expansionZoom: point!.expansionZoom,
isCluster: (point!.count ?? 1) > 1
},
geometry: {
@@ -246,7 +246,7 @@ const serverClusteredGeoJsonByType = computed(() => {
id: point!.id,
name: point!.name,
count: point!.count ?? 1,
expansionZoom: point!.expansion_zoom,
expansionZoom: point!.expansionZoom,
isCluster: (point!.count ?? 1) > 1,
type
},

View File

@@ -40,7 +40,7 @@
</Text>
</div>
<!-- Transport icons bottom -->
<div v-if="hub.transport_types?.length" class="flex items-center gap-1 pt-1">
<div v-if="hub.transportTypes?.length" class="flex items-center gap-1 pt-1">
<Icon v-if="hasTransport('auto')" name="lucide:truck" size="14" class="text-base-content/50" />
<Icon v-if="hasTransport('rail')" name="lucide:train-front" size="14" class="text-base-content/50" />
<Icon v-if="hasTransport('sea')" name="lucide:ship" size="14" class="text-base-content/50" />
@@ -58,12 +58,12 @@ interface Hub {
uuid?: string | null
name?: string | null
country?: string | null
country_code?: string | null
countryCode?: string | null
latitude?: number | null
longitude?: number | null
distance?: string
distance_km?: number | null
transport_types?: (string | null)[] | null
distanceKm?: number | null
transportTypes?: (string | null)[] | null
}
const props = defineProps<{
@@ -91,16 +91,16 @@ const isoToEmoji = (code: string): string => {
}
const countryFlag = computed(() => {
if (props.hub.country_code) {
return isoToEmoji(props.hub.country_code)
if (props.hub.countryCode) {
return isoToEmoji(props.hub.countryCode)
}
return '🌍'
})
const hasTransport = (type: string) => props.hub.transport_types?.some(t => t === type)
const hasTransport = (type: string) => props.hub.transportTypes?.some(t => t === type)
const distanceLabel = computed(() => {
if (props.hub.distance) return props.hub.distance
if (props.hub.distance_km != null) return `${Math.round(props.hub.distance_km)} km`
if (props.hub.distanceKm != null) return `${Math.round(props.hub.distanceKm)} km`
return ''
})

View File

@@ -173,13 +173,13 @@
:key="offer.uuid ?? index"
:supplier-name="getOfferSupplierName(offer)"
:location-name="offer.country || ''"
:product-name="offer.product_name"
:price-per-unit="offer.price_per_unit ? Number(offer.price_per_unit) : null"
:product-name="offer.productName"
:price-per-unit="offer.pricePerUnit ? Number(offer.pricePerUnit) : null"
:quantity="offer.quantity"
:currency="offer.currency"
:unit="offer.unit"
:stages="getOfferStages(offer)"
:total-time-seconds="offer.routes?.[0]?.total_time_seconds ?? null"
:total-time-seconds="offer.routes?.[0]?.totalTimeSeconds ?? null"
@select="onOfferSelect(offer)"
/>
</div>
@@ -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?.price_per_unit != null)
relatedOffers.value.filter(o => o?.pricePerUnit != null)
)
const suppliersByUuid = computed(() => {
@@ -370,9 +370,9 @@ const suppliersByUuid = computed(() => {
})
const getOfferSupplierName = (offer: InfoOfferItem) => {
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)
if (offer.supplierName) return offer.supplierName
if (offer.supplierUuid && suppliersByUuid.value.has(offer.supplierUuid)) {
return suppliersByUuid.value.get(offer.supplierUuid)
}
return null
}
@@ -441,11 +441,11 @@ const formatPrice = (price: number | string) => {
}
const railHubs = computed(() =>
relatedHubs.value.filter(h => h.transport_types?.includes('rail'))
relatedHubs.value.filter(h => h.transportTypes?.includes('rail'))
)
const seaHubs = computed(() =>
relatedHubs.value.filter(h => h.transport_types?.includes('sea'))
relatedHubs.value.filter(h => h.transportTypes?.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.product_uuid })
emit('select-offer', { uuid: offer.uuid, productUuid: offer.productUuid })
}
}
@@ -495,10 +495,10 @@ const getOfferStages = (offer: InfoOfferItem) => {
return route.stages
.filter((stage): stage is NonNullable<RouteStage> => stage !== null)
.map(stage => ({
transportType: stage.transport_type,
distanceKm: stage.distance_km,
travelTimeSeconds: stage.travel_time_seconds,
fromName: stage.from_name
transportType: stage.transportType,
distanceKm: stage.distanceKm,
travelTimeSeconds: stage.travelTimeSeconds,
fromName: stage.fromName
}))
}
</script>

View File

@@ -37,15 +37,15 @@
>
<OfferResultCard
grouped
:supplier-name="offer.supplier_name"
:supplier-name="offer.supplierName"
:location-name="offer.country || ''"
:product-name="offer.product_name"
:price-per-unit="offer.price_per_unit ? Number(offer.price_per_unit) : null"
:product-name="offer.productName"
:price-per-unit="offer.pricePerUnit ? Number(offer.pricePerUnit) : null"
:quantity="offer.quantity"
:currency="offer.currency"
:unit="offer.unit"
:stages="getOfferStages(offer)"
:total-time-seconds="offer.routes?.[0]?.total_time_seconds ?? null"
:total-time-seconds="offer.routes?.[0]?.totalTimeSeconds ?? null"
/>
</div>
</div>
@@ -58,15 +58,15 @@
@click="emit('select-offer', offer)"
>
<OfferResultCard
:supplier-name="offer.supplier_name"
:supplier-name="offer.supplierName"
:location-name="offer.country || ''"
:product-name="offer.product_name"
:price-per-unit="offer.price_per_unit ? Number(offer.price_per_unit) : null"
:product-name="offer.productName"
:price-per-unit="offer.pricePerUnit ? Number(offer.pricePerUnit) : null"
:quantity="offer.quantity"
:currency="offer.currency"
:unit="offer.unit"
:stages="getOfferStages(offer)"
:total-time-seconds="offer.routes?.[0]?.total_time_seconds ?? null"
:total-time-seconds="offer.routes?.[0]?.totalTimeSeconds ?? null"
/>
</div>
</div>
@@ -78,23 +78,23 @@
<script setup lang="ts">
interface Offer {
uuid: string
product_name?: string | null
product_uuid?: string | null
supplier_name?: string | null
supplier_uuid?: string | null
productName?: string | null
productUuid?: string | null
supplierName?: string | null
supplierUuid?: string | null
quantity?: number | string | null
unit?: string | null
price_per_unit?: number | string | null
pricePerUnit?: number | string | null
currency?: string | null
country?: string | null
country_code?: string | null
countryCode?: string | null
routes?: Array<{
total_time_seconds?: number | null
totalTimeSeconds?: number | null
stages?: Array<{
transport_type?: string | null
distance_km?: number | null
travel_time_seconds?: number | null
from_name?: string | null
transportType?: string | null
distanceKm?: number | null
travelTimeSeconds?: number | null
fromName?: string | null
} | null> | null
} | null> | null
}
@@ -115,7 +115,7 @@ const props = defineProps<{
}>()
const offersWithPrice = computed(() =>
(props.offers || []).filter(o => o?.price_per_unit != null)
(props.offers || []).filter(o => o?.pricePerUnit != null)
)
const totalOffers = computed(() => {
@@ -139,10 +139,10 @@ const getOfferStages = (offer: Offer) => {
return route.stages
.filter((stage): stage is NonNullable<typeof stage> => stage !== null)
.map((stage) => ({
transportType: stage.transport_type,
distanceKm: stage.distance_km,
travelTimeSeconds: stage.travel_time_seconds,
fromName: stage.from_name
transportType: stage.transportType,
distanceKm: stage.distanceKm,
travelTimeSeconds: stage.travelTimeSeconds,
fromName: stage.fromName
}))
}
</script>