diff --git a/engines/dfc_provider/app/services/enterprise_builder.rb b/engines/dfc_provider/app/services/enterprise_builder.rb index 68eb872a96..38efa49415 100644 --- a/engines/dfc_provider/app/services/enterprise_builder.rb +++ b/engines/dfc_provider/app/services/enterprise_builder.rb @@ -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 diff --git a/engines/dfc_provider/spec/requests/enterprises_spec.rb b/engines/dfc_provider/spec/requests/enterprises_spec.rb index a06ee7a2ef..e043610dd8 100644 --- a/engines/dfc_provider/spec/requests/enterprises_spec.rb +++ b/engines/dfc_provider/spec/requests/enterprises_spec.rb @@ -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", diff --git a/swagger/dfc.yaml b/swagger/dfc.yaml index d5136922f1..2de4b0d8ba 100644 --- a/swagger/dfc.yaml +++ b/swagger/dfc.yaml @@ -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: "
Hello, world!
This is a paragraph.
" + 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