mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
12890: remove city from response
This commit is contained in:
@@ -14,7 +14,6 @@ class AffiliateSalesDataRowBuilder < DfcBuilder
|
||||
nil,
|
||||
localizations: [build_address(
|
||||
item[:supplier_postcode],
|
||||
item[:supplier_city],
|
||||
item[:supplier_country]
|
||||
)],
|
||||
suppliedProducts: [build_product],
|
||||
@@ -26,7 +25,6 @@ class AffiliateSalesDataRowBuilder < DfcBuilder
|
||||
nil,
|
||||
localizations: [build_address(
|
||||
item[:distributor_postcode],
|
||||
item[:distributor_city],
|
||||
item[:distributor_country]
|
||||
)],
|
||||
)
|
||||
@@ -97,10 +95,9 @@ class AffiliateSalesDataRowBuilder < DfcBuilder
|
||||
)
|
||||
end
|
||||
|
||||
def build_address(postcode, city, country)
|
||||
def build_address(postcode, country)
|
||||
DataFoodConsortium::Connector::Address.new(
|
||||
nil,
|
||||
city:,
|
||||
country:,
|
||||
postalCode: postcode,
|
||||
)
|
||||
|
||||
@@ -55,10 +55,8 @@ class AffiliateSalesQuery
|
||||
spree_variants.unit_presentation,
|
||||
spree_line_items.price,
|
||||
distributor_addresses.zipcode AS distributor_postcode,
|
||||
distributor_addresses.city AS distributor_city,
|
||||
distributor_countries.name AS distributor_country,
|
||||
supplier_addresses.zipcode AS supplier_postcode,
|
||||
supplier_addresses.city AS supplier_city,
|
||||
supplier_countries.name AS supplier_country,
|
||||
|
||||
SUM(spree_line_items.quantity) AS quantity_sold
|
||||
@@ -75,8 +73,6 @@ class AffiliateSalesQuery
|
||||
spree_line_items.price,
|
||||
distributor_postcode,
|
||||
supplier_postcode,
|
||||
distributor_city,
|
||||
supplier_city,
|
||||
distributor_country,
|
||||
supplier_country
|
||||
SQL
|
||||
@@ -92,10 +88,8 @@ class AffiliateSalesQuery
|
||||
unit_presentation
|
||||
price
|
||||
distributor_postcode
|
||||
distributor_city
|
||||
distributor_country
|
||||
supplier_postcode
|
||||
supplier_city
|
||||
supplier_country
|
||||
quantity_sold
|
||||
]
|
||||
|
||||
@@ -59,10 +59,8 @@ RSpec.describe AffiliateSalesQuery do
|
||||
nil,
|
||||
15.50,
|
||||
"3210",
|
||||
"city1",
|
||||
"country1",
|
||||
"3211",
|
||||
"city2",
|
||||
"country2",
|
||||
3,
|
||||
]
|
||||
@@ -75,10 +73,8 @@ RSpec.describe AffiliateSalesQuery do
|
||||
unit_presentation: nil,
|
||||
price: 15.50,
|
||||
distributor_postcode: "3210",
|
||||
distributor_city: "city1",
|
||||
distributor_country: "country1",
|
||||
supplier_postcode: "3211",
|
||||
supplier_city: "city2",
|
||||
supplier_country: "country2",
|
||||
quantity_sold: 3,
|
||||
}
|
||||
|
||||
@@ -97,7 +97,6 @@ paths:
|
||||
dfc-b:hasAddress:
|
||||
"@type": dfc-b:Address
|
||||
dfc-b:hasPostalCode: '20170'
|
||||
dfc-b:hasCity: Herndon
|
||||
dfc-b:hasCountry: Australia
|
||||
dfc-b:supplies:
|
||||
"@type": dfc-b:SuppliedProduct
|
||||
@@ -126,7 +125,6 @@ paths:
|
||||
dfc-b:hasAddress:
|
||||
"@type": dfc-b:Address
|
||||
dfc-b:hasPostalCode: '20170'
|
||||
dfc-b:hasCity: Herndon
|
||||
dfc-b:hasCountry: Australia
|
||||
'400':
|
||||
description: bad request
|
||||
|
||||
Reference in New Issue
Block a user