Add contact name to DFC Enterprise API

This commit is contained in:
Maikel Linke
2023-11-16 09:10:43 +11:00
parent fc8f0ec4f2
commit e5f5f3922c
3 changed files with 7 additions and 0 deletions

View File

@@ -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

View File

@@ -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",

View File

@@ -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