Add website to DFC Enterprise API

This commit is contained in:
Maikel Linke
2023-11-15 16:48:44 +11:00
parent 1fb87bc497
commit 80c0df9d1e
3 changed files with 3 additions and 0 deletions

View File

@@ -16,6 +16,7 @@ class EnterpriseBuilder < DfcBuilder
catalogItems: catalog_items,
localizations: [address],
socialMedias: SocialMediaBuilder.social_medias(enterprise),
websites: [enterprise.website].compact,
).tap do |e|
e.registerSemanticProperty("ofn:long_description") do
enterprise.long_description

View File

@@ -10,6 +10,7 @@ describe "Enterprises", type: :request, swagger_doc: "dfc.yaml", rswag_autodoc:
id: 10_000, owner: user, abn: "123 456", name: "Fred's Farm",
description: "This is an awesome enterprise",
facebook: "https://facebook.com/user",
website: "https://openfoodnetwork.org",
address: build(:address, id: 40_000, address1: "42 Doveton Street"),
)
end

View File

@@ -318,6 +318,7 @@ paths:
- "@id": http://test.host/api/dfc/enterprises/10000
"@type": dfc-b:Enterprise
dfc-b:hasAddress: http://test.host/api/dfc/addresses/40000
dfc-b:websitePage: openfoodnetwork.org
dfc-b:hasSocialMedia: http://test.host/api/dfc/enterprises/10000/social_medias/facebook
dfc-b:name: Fred's Farm
dfc-b:hasDescription: This is an awesome enterprise