Skip to content

Commit

Permalink
12890: remove city from response
Browse files Browse the repository at this point in the history
  • Loading branch information
chahmedejaz committed Nov 25, 2024
1 parent 7ca5445 commit c0887b1
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ def build_supplier
nil,
localizations: [build_address(
item[:supplier_postcode],
item[:supplier_city],
item[:supplier_country]
)],
suppliedProducts: [build_product],
Expand All @@ -26,7 +25,6 @@ def build_distributor
nil,
localizations: [build_address(
item[:distributor_postcode],
item[:distributor_city],
item[:distributor_country]
)],
)
Expand Down Expand Up @@ -97,10 +95,9 @@ def build_price
)
end

def build_address(postcode, city, country)
def build_address(postcode, country)
DataFoodConsortium::Connector::Address.new(
nil,
city:,
country:,
postalCode: postcode,
)
Expand Down
6 changes: 0 additions & 6 deletions engines/dfc_provider/app/services/affiliate_sales_query.rb
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,8 @@ def fields
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
Expand All @@ -75,8 +73,6 @@ def key_fields
spree_line_items.price,
distributor_postcode,
supplier_postcode,
distributor_city,
supplier_city,
distributor_country,
supplier_country
SQL
Expand All @@ -92,10 +88,8 @@ def labels
unit_presentation
price
distributor_postcode
distributor_city
distributor_country
supplier_postcode
supplier_city
supplier_country
quantity_sold
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,8 @@
nil,
15.50,
"3210",
"city1",
"country1",
"3211",
"city2",
"country2",
3,
]
Expand All @@ -75,10 +73,8 @@
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,
}
Expand Down
2 changes: 0 additions & 2 deletions swagger/dfc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c0887b1

Please sign in to comment.