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

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