mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-02 21:57:17 +00:00
Add contact name to DFC Enterprise API
This commit is contained in:
@@ -23,6 +23,11 @@ class EnterpriseBuilder < DfcBuilder
|
||||
e.registerSemanticProperty("ofn:long_description") do
|
||||
enterprise.long_description
|
||||
end
|
||||
e.registerSemanticProperty("ofn:contact_name") do
|
||||
# This could be expressed as dfc-b:hasMainContact Person with name.
|
||||
# But that would require a new endpoint for a single string.
|
||||
enterprise.contact_name
|
||||
end
|
||||
e.registerSemanticProperty("ofn:logo_url") do
|
||||
enterprise.logo.url
|
||||
end
|
||||
|
||||
@@ -9,6 +9,7 @@ describe "Enterprises", type: :request, swagger_doc: "dfc.yaml", rswag_autodoc:
|
||||
:distributor_enterprise, :with_logo_image,
|
||||
id: 10_000, owner: user, abn: "123 456", name: "Fred's Farm",
|
||||
description: "This is an awesome enterprise",
|
||||
contact_name: "Fred Farmer",
|
||||
facebook: "https://facebook.com/user",
|
||||
email_address: "hello@example.org",
|
||||
phone: "0404 444 000 200",
|
||||
|
||||
@@ -328,6 +328,7 @@ paths:
|
||||
dfc-b:manages: http://test.host/api/dfc/enterprises/10000/catalog_items/10001
|
||||
dfc-b:supplies: http://test.host/api/dfc/enterprises/10000/supplied_products/10001
|
||||
ofn:long_description: "<p>Hello, world!</p><p>This is a paragraph.</p>"
|
||||
ofn:contact_name: Fred Farmer
|
||||
ofn:logo_url: http://www.example.com/rails/active_storage/url/logo.png
|
||||
dfc-b:affiliates: http://test.host/api/dfc/enterprise_groups/60000
|
||||
- "@id": http://test.host/api/dfc/addresses/40000
|
||||
|
||||
Reference in New Issue
Block a user