mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
Include address in DFC Enterprise endpoint
This commit is contained in:
@@ -9,6 +9,7 @@ module DfcProvider
|
||||
enterprise = EnterpriseBuilder.enterprise(current_enterprise)
|
||||
render json: DfcIo.export(
|
||||
enterprise,
|
||||
*enterprise.localizations,
|
||||
*enterprise.suppliedProducts,
|
||||
*enterprise.catalogItems,
|
||||
)
|
||||
|
||||
@@ -9,7 +9,7 @@ describe "Enterprises", type: :request, swagger_doc: "dfc-v1.7/swagger.yaml", rs
|
||||
:distributor_enterprise,
|
||||
id: 10_000, owner: user, abn: "123 456", name: "Fred's Farm",
|
||||
description: "This is an awesome enterprise",
|
||||
address: build(:address, id: 40_000),
|
||||
address: build(:address, id: 40_000, address1: "42 Doveton Street"),
|
||||
)
|
||||
end
|
||||
let!(:product) {
|
||||
@@ -47,6 +47,7 @@ describe "Enterprises", type: :request, swagger_doc: "dfc-v1.7/swagger.yaml", rs
|
||||
expect(response.body).to include "This is an awesome enterprise"
|
||||
expect(response.body).to include "123 456"
|
||||
expect(response.body).to include "Apple"
|
||||
expect(response.body).to include "42 Doveton Street"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -253,6 +253,12 @@ paths:
|
||||
dfc-b:VATnumber: 123 456
|
||||
dfc-b:supplies: http://test.host/api/dfc-v1.7/enterprises/10000/supplied_products/10001
|
||||
dfc-b:manages: http://test.host/api/dfc-v1.7/enterprises/10000/catalog_items/10001
|
||||
- "@id": http://test.host/api/dfc-v1.7/addresses/40000
|
||||
"@type": dfc-b:Address
|
||||
dfc-b:hasStreet: 42 Doveton Street
|
||||
dfc-b:hasPostalCode: '20170'
|
||||
dfc-b:hasCity: Herndon
|
||||
dfc-b:hasCountry: Australia
|
||||
- "@id": http://test.host/api/dfc-v1.7/enterprises/10000/supplied_products/10001
|
||||
"@type": dfc-b:SuppliedProduct
|
||||
dfc-b:name: Apple
|
||||
|
||||
Reference in New Issue
Block a user