Added Create, Update & Delete for Enterprise
This commit is contained in:
236
dfc.yaml
236
dfc.yaml
@@ -14,7 +14,6 @@ info:
|
|||||||
This API implements the Data Food Consortium (DFC) specifications.
|
This API implements the Data Food Consortium (DFC) specifications.
|
||||||
It serves and reads semantic data encoded in JSON-LD.
|
It serves and reads semantic data encoded in JSON-LD.
|
||||||
<p>
|
<p>
|
||||||
Unfortunately, this description does not appear in the Swagger UI. :-(
|
|
||||||
components:
|
components:
|
||||||
securitySchemes:
|
securitySchemes:
|
||||||
oidc_token:
|
oidc_token:
|
||||||
@@ -213,14 +212,15 @@ paths:
|
|||||||
dfc-b:stockLimitation: '3'
|
dfc-b:stockLimitation: '3'
|
||||||
dfc-b:sku: new-sku
|
dfc-b:sku: new-sku
|
||||||
"/api/dfc/Enterprises/{enterprise_id}/customerCategories":
|
"/api/dfc/Enterprises/{enterprise_id}/customerCategories":
|
||||||
|
parameters:
|
||||||
|
- name: enterprise_id
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
get:
|
get:
|
||||||
summary: Return a list of Customer Categories for an Enterprise
|
summary: Return a list of Customer Categories for an Enterprise
|
||||||
parameters:
|
parameters: []
|
||||||
- name: enterprise_id
|
|
||||||
in: path
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
tags:
|
tags:
|
||||||
- CustomerCategory
|
- CustomerCategory
|
||||||
responses:
|
responses:
|
||||||
@@ -240,12 +240,9 @@ paths:
|
|||||||
dfc-b:definedBy: http://test.host/api/dfc/Enterprises/10000
|
dfc-b:definedBy: http://test.host/api/dfc/Enterprises/10000
|
||||||
post:
|
post:
|
||||||
summary: create a new Customer Category for a given Enterprise
|
summary: create a new Customer Category for a given Enterprise
|
||||||
parameters:
|
parameters: []
|
||||||
- name: enterprise_id
|
tags:
|
||||||
in: path
|
- CustomerCategory
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
responses:
|
responses:
|
||||||
'201':
|
'201':
|
||||||
description: created
|
description: created
|
||||||
@@ -261,19 +258,20 @@ paths:
|
|||||||
"@id": http://test.host/api/dfc/Enterprises/10000/customerCategories/10006
|
"@id": http://test.host/api/dfc/Enterprises/10000/customerCategories/10006
|
||||||
|
|
||||||
"/api/dfc/Enterprises/{enterprise_id}/customerCategories/{id}":
|
"/api/dfc/Enterprises/{enterprise_id}/customerCategories/{id}":
|
||||||
|
parameters:
|
||||||
|
- name: enterprise_id
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- name: id
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
get:
|
get:
|
||||||
summary: Return a specific Customer Category for an Enterprise
|
summary: Return a specific Customer Category for an Enterprise
|
||||||
parameters:
|
parameters: []
|
||||||
- name: enterprise_id
|
|
||||||
in: path
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
- name: id
|
|
||||||
in: path
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
tags:
|
tags:
|
||||||
- CustomerCategory
|
- CustomerCategory
|
||||||
responses:
|
responses:
|
||||||
@@ -291,17 +289,9 @@ paths:
|
|||||||
dfc-b:definedBy: http://test.host/api/dfc/Enterprises/10000
|
dfc-b:definedBy: http://test.host/api/dfc/Enterprises/10000
|
||||||
delete:
|
delete:
|
||||||
summary: remove a Customer Category for a given Enterprise
|
summary: remove a Customer Category for a given Enterprise
|
||||||
parameters:
|
parameters: []
|
||||||
- name: enterprise_id
|
tags:
|
||||||
in: path
|
- CustomerCategory
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
- name: id
|
|
||||||
in: path
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
responses:
|
responses:
|
||||||
'204':
|
'204':
|
||||||
description: no content
|
description: no content
|
||||||
@@ -356,14 +346,15 @@ paths:
|
|||||||
description: unauthorized
|
description: unauthorized
|
||||||
|
|
||||||
"/api/dfc/Enterprises/{id}":
|
"/api/dfc/Enterprises/{id}":
|
||||||
|
parameters:
|
||||||
|
- name: id
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
get:
|
get:
|
||||||
summary: Show enterprise
|
summary: Show enterprise
|
||||||
parameters:
|
parameters: []
|
||||||
- name: id
|
|
||||||
in: path
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
tags:
|
tags:
|
||||||
- Enterprises
|
- Enterprises
|
||||||
responses:
|
responses:
|
||||||
@@ -379,9 +370,9 @@ paths:
|
|||||||
- "@id": http://test.host/api/dfc/Enterprises/10000
|
- "@id": http://test.host/api/dfc/Enterprises/10000
|
||||||
"@type": dfc-b:Enterprise
|
"@type": dfc-b:Enterprise
|
||||||
dfc-b:hasAddress: http://test.host/api/dfc/Addresses/40000
|
dfc-b:hasAddress: http://test.host/api/dfc/Addresses/40000
|
||||||
dfc-b:hasPhoneNumber: 0404 444 000 200
|
dfc-b:hasPhoneNumber: http://test.host/api/dfc/PhoneNumbers/444000200
|
||||||
dfc-b:email: hello@example.org
|
dfc-b:email: hello@example.org
|
||||||
dfc-b:websitePage: openfoodnetwork.org
|
dfc-b:websitePage: https://test.host/
|
||||||
dfc-b:hasSocialMedia: http://test.host/api/dfc/Enterprises/10000/SocialMedias/facebook
|
dfc-b:hasSocialMedia: http://test.host/api/dfc/Enterprises/10000/SocialMedias/facebook
|
||||||
dfc-b:name: Fred's Farm
|
dfc-b:name: Fred's Farm
|
||||||
dfc-b:hasDescription: This is an awesome enterprise
|
dfc-b:hasDescription: This is an awesome enterprise
|
||||||
@@ -424,6 +415,129 @@ paths:
|
|||||||
dfc-b:URL: https://facebook.com/user
|
dfc-b:URL: https://facebook.com/user
|
||||||
'404':
|
'404':
|
||||||
description: not found
|
description: not found
|
||||||
|
'post':
|
||||||
|
summary: Create an Enterprise
|
||||||
|
tags:
|
||||||
|
- Enterprises
|
||||||
|
responses:
|
||||||
|
'201':
|
||||||
|
description: created
|
||||||
|
'400':
|
||||||
|
description: bad request
|
||||||
|
'401':
|
||||||
|
description: unauthorized
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
example:
|
||||||
|
test_example:
|
||||||
|
value:
|
||||||
|
"@context": https://www.datafoodconsortium.org
|
||||||
|
"@type": dfc-b:Enterprise
|
||||||
|
dfc-b:hasAddress: http://test.host/api/dfc/Addresses/40000
|
||||||
|
dfc-b:hasPhoneNumber: http://test.host/api/dfc/PhoneNumbers/444000200
|
||||||
|
dfc-b:email: hello@example.org
|
||||||
|
dfc-b:websitePage: https://test.host/
|
||||||
|
dfc-b:hasSocialMedia: http://test.host/api/dfc/Enterprises/10000/SocialMedias/facebook
|
||||||
|
dfc-b:name: Fred's Farm
|
||||||
|
dfc-b:hasDescription: This is an awesome enterprise
|
||||||
|
dfc-b:VATnumber: 123 456
|
||||||
|
dfc-b:manages: http://test.host/api/dfc/Enterprises/10000/CatalogItems/10001
|
||||||
|
dfc-b:supplies: http://test.host/api/dfc/Enterprises/10000/SuppliedProducts/10001
|
||||||
|
dfc-b:hasMainContact: http://test.host/api/dfc/Persons/10000
|
||||||
|
dfc-b:logo: http://test.host/active-storage/url/logo.png
|
||||||
|
dfc-b:affiliates: http://test.host/api/dfc/Enterprises/60000
|
||||||
|
'put':
|
||||||
|
summary: Update an Enterprise
|
||||||
|
parameters: []
|
||||||
|
tags:
|
||||||
|
- Enterprises
|
||||||
|
responses:
|
||||||
|
'204':
|
||||||
|
description: no content
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
example:
|
||||||
|
"@context": https://www.datafoodconsortium.org
|
||||||
|
"@id": http://test.host/api/dfc/Enterprises/10000
|
||||||
|
"@type": dfc-b:Enterprise
|
||||||
|
dfc-b:hasAddress: http://test.host/api/dfc/Addresses/40000
|
||||||
|
dfc-b:hasPhoneNumber: http://test.host/api/dfc/PhoneNumbers/444000245
|
||||||
|
dfc-b:email: support@example.org
|
||||||
|
dfc-b:websitePage: https://www.test.host
|
||||||
|
dfc-b:hasSocialMedia: http://test.host/api/dfc/Enterprises/10000/SocialMedias/facebook
|
||||||
|
dfc-b:name: Fred's New & Improved Farm
|
||||||
|
dfc-b:hasDescription: This is now an even more awesome enterprise
|
||||||
|
dfc-b:VATnumber: 123 456
|
||||||
|
dfc-b:manages: http://test.host/api/dfc/Enterprises/10000/CatalogItems/10001
|
||||||
|
dfc-b:supplies: http://test.host/api/dfc/Enterprises/10000/SuppliedProducts/10001
|
||||||
|
dfc-b:hasMainContact: http://test.host/api/dfc/Persons/10000
|
||||||
|
dfc-b:logo: http://test.host/active-storage/url/logo.png
|
||||||
|
dfc-b:affiliates: http://test.host/api/dfc/Enterprises/60000
|
||||||
|
delete:
|
||||||
|
summary: remove an Enterprise
|
||||||
|
parameters: []
|
||||||
|
tags:
|
||||||
|
- Enterprises
|
||||||
|
responses:
|
||||||
|
'204':
|
||||||
|
description: no content
|
||||||
|
'401':
|
||||||
|
description: unauthorized
|
||||||
|
|
||||||
|
|
||||||
|
"/api/dfc/Enterprises/{enterprise_id}/affiliatedTo":
|
||||||
|
post:
|
||||||
|
summary: Affilate 2 Enterprises (1 in path, 1 in requestBody)
|
||||||
|
parameters:
|
||||||
|
- name: enterprise_id
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
tags:
|
||||||
|
- Enterprises::affiliatedTo
|
||||||
|
responses:
|
||||||
|
'201':
|
||||||
|
description: created
|
||||||
|
'400':
|
||||||
|
description: bad request
|
||||||
|
'401':
|
||||||
|
description: unauthorized
|
||||||
|
requestBody:
|
||||||
|
content:
|
||||||
|
application/json:
|
||||||
|
schema:
|
||||||
|
example:
|
||||||
|
"@id": http://test.host/api/dfc/Enterprises/10001
|
||||||
|
|
||||||
|
"/api/dfc/Enterprises/{enterprise_id}/affiliatedTo/{id}":
|
||||||
|
delete:
|
||||||
|
summary: Remove an Enterprise affiliatedTo link
|
||||||
|
parameters:
|
||||||
|
- name: enterprise_id
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- name: id
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
tags:
|
||||||
|
- Enterprises::affiliatedTo
|
||||||
|
responses:
|
||||||
|
'204':
|
||||||
|
description: no content
|
||||||
|
'401':
|
||||||
|
description: unauthorized
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
"/api/dfc/Enterprises/{enterprise_id}/Offers/{id}":
|
"/api/dfc/Enterprises/{enterprise_id}/Offers/{id}":
|
||||||
parameters:
|
parameters:
|
||||||
- name: enterprise_id
|
- name: enterprise_id
|
||||||
@@ -477,14 +591,15 @@ paths:
|
|||||||
dfc-b:offersTo: https://test.host/api/dfc/enterprises/10000/customerCategories/10005
|
dfc-b:offersTo: https://test.host/api/dfc/enterprises/10000/customerCategories/10005
|
||||||
|
|
||||||
"/api/dfc/persons/{id}":
|
"/api/dfc/persons/{id}":
|
||||||
|
parameters:
|
||||||
|
- name: id
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
get:
|
get:
|
||||||
summary: Show person
|
summary: Show person
|
||||||
parameters:
|
parameters: []
|
||||||
- name: id
|
|
||||||
in: path
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
tags:
|
tags:
|
||||||
- Persons
|
- Persons
|
||||||
responses:
|
responses:
|
||||||
@@ -501,19 +616,20 @@ paths:
|
|||||||
'404':
|
'404':
|
||||||
description: not found
|
description: not found
|
||||||
"/api/dfc/Enterprises/{enterprise_id}/SocialMedias/{name}":
|
"/api/dfc/Enterprises/{enterprise_id}/SocialMedias/{name}":
|
||||||
|
parameters:
|
||||||
|
- name: enterprise_id
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
|
- name: name
|
||||||
|
in: path
|
||||||
|
required: true
|
||||||
|
schema:
|
||||||
|
type: string
|
||||||
get:
|
get:
|
||||||
summary: Show social media
|
summary: Show social media
|
||||||
parameters:
|
parameters: []
|
||||||
- name: enterprise_id
|
|
||||||
in: path
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
- name: name
|
|
||||||
in: path
|
|
||||||
required: true
|
|
||||||
schema:
|
|
||||||
type: string
|
|
||||||
tags:
|
tags:
|
||||||
- SocialMedias
|
- SocialMedias
|
||||||
responses:
|
responses:
|
||||||
|
|||||||
Reference in New Issue
Block a user