Skip to content

Commit

Permalink
Merge pull request #863 from mesur-io/feat/product-refactors
Browse files Browse the repository at this point in the history
Refactor AgProduct and Product schemas
  • Loading branch information
nissimsan authored Sep 5, 2023
2 parents 40719da + 0e79364 commit 1c93c45
Show file tree
Hide file tree
Showing 23 changed files with 99 additions and 218 deletions.
2 changes: 1 addition & 1 deletion docs/credentials-with-issuer-dependent-terms.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
},
{
"type": "USMCACertificationOfOrigin",
"count": 10
"count": 7
},
{
"type": "ThingCredential",
Expand Down
14 changes: 2 additions & 12 deletions docs/openapi/components/schemas/common/AgricultureActivity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ example: |-
"type": [
"AgricultureProduct"
],
"upc": "033383401508",
"plu": "94225",
"gtin": "033383401508",
"product": {
"type": [
"Product"
Expand Down Expand Up @@ -165,18 +163,13 @@ example: |-
},
"scientificName": "Persea americana",
"labelImageUrl": "https://img.example.org/033383401508/640/480/",
"labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"name": "Avocados",
"productImageUrl": "https://img.example.org/102934920857/937/903/",
"productImageHash": "8kb47j986hklhde4rfh78okjhgjo08765fgu7tfg4t864fy876rfser45thj87f3"
"labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
},
{
"type": [
"AgricultureProduct"
],
"upc": "033383401508",
"plu": "94225",
"gtin": "033383401508",
"product": {
"type": [
"Product"
Expand Down Expand Up @@ -208,10 +201,7 @@ example: |-
},
"scientificName": "Solanum lycopersicum",
"labelImageUrl": "https://img.example.org/033383401508/640/480/",
"labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"name": "Avocados",
"productImageUrl": "https://img.example.org/102934920857/937/903/",
"productImageHash": "8kb47j986hklhde4rfh78okjhgjo08765fgu7tfg4t864fy876rfser45thj87f3"
"labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
],
"observation": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,7 @@ example: |-
"type": [
"AgricultureProduct"
],
"upc": "033383401508",
"plu": "94225",
"gtin": "033383401508",
"product": {
"type": [
"Product"
Expand Down Expand Up @@ -281,10 +279,7 @@ example: |-
},
"scientificName": "Persea americana",
"labelImageUrl": "https://img.example.org/033383401508/640/480/",
"labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"name": "Avocados",
"productImageUrl": "https://img.example.org/102934920857/937/903/",
"productImageHash": "8kb47j986hklhde4rfh78okjhgjo08765fgu7tfg4t864fy876rfser45thj87f3"
"labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
]
}
Expand Down
14 changes: 2 additions & 12 deletions docs/openapi/components/schemas/common/AgriculturePackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,7 @@ example: |-
"type": [
"AgricultureProduct"
],
"upc": "033383401508",
"plu": "94225",
"gtin": "033383401508",
"product": {
"type": [
"Product"
Expand Down Expand Up @@ -150,18 +148,13 @@ example: |-
},
"scientificName": "Persea americana",
"labelImageUrl": "https://img.example.org/033383401508/640/480/",
"labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"name": "Avocados",
"productImageUrl": "https://img.example.org/102934920857/937/903/",
"productImageHash": "8kb47j986hklhde4rfh78okjhgjo08765fgu7tfg4t864fy876rfser45thj87f3"
"labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
},
{
"type": [
"AgricultureProduct"
],
"upc": "033383401508",
"plu": "94225",
"gtin": "033383401508",
"product": {
"type": [
"Product"
Expand Down Expand Up @@ -193,10 +186,7 @@ example: |-
},
"scientificName": "Persea americana",
"labelImageUrl": "https://img.example.org/033383401508/640/480/",
"labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"name": "Avocados",
"productImageUrl": "https://img.example.org/102934920857/937/903/",
"productImageHash": "8kb47j986hklhde4rfh78okjhgjo08765fgu7tfg4t864fy876rfser45thj87f3"
"labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,7 @@ example: |-
"type": [
"AgricultureProduct"
],
"upc": "033383401508",
"plu": "94225",
"gtin": "033383401508",
"product": {
"type": [
"Product"
Expand Down Expand Up @@ -284,10 +282,7 @@ example: |-
},
"scientificName": "Persea americana",
"labelImageUrl": "https://img.example.org/033383401508/640/480/",
"labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"name": "Avocados",
"productImageUrl": "https://img.example.org/102934920857/937/903/",
"productImageHash": "8kb47j986hklhde4rfh78okjhgjo08765fgu7tfg4t864fy876rfser45thj87f3"
"labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
]
}
Expand Down
115 changes: 43 additions & 72 deletions docs/openapi/components/schemas/common/AgricultureProduct.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,17 +20,6 @@ properties:
type: string
enum:
- AgricultureProduct
upc:
title: UPC Number
description: >-
UPC (aka UPC-A) consists of 12 numeric digits that are uniquely assigned
to each trade item. Along with the related EAN barcode, the UPC is the
barcode mainly used for scanning of trade items at the point of sale, per
GS1 specifications.
type: string
$linkedData:
term: upc
'@id': https://www.gs1.org/standards/barcodes/ean-upc
plu:
title: PLU Number
description: >-
Expand All @@ -40,16 +29,7 @@ properties:
type: string
$linkedData:
term: plu
'@id': https://w3id.org/traceability#plu
gtin:
title: GTIN Code
description: >-
Global Trade Item Number (GTIN) can be used by a company to uniquely
identify all of its trade items.
type: string
$linkedData:
term: gtin
'@id': https://www.gs1.org/voc/gtin
'@id': https://schema.org/identifier
countryOfOrigin:
title: Country of Origin
description: The country in which this product originated.
Expand Down Expand Up @@ -96,73 +76,64 @@ properties:
type: string
$linkedData:
term: labelImageHash
'@id': https://w3id.org/traceability#labelImageHash
name:
title: Name
description: Name of the ag. product.
type: string
$linkedData:
term: name
'@id': https://schema.org/name
productImageUrl:
title: Product Image URL
description: Image of the product.
type: string
$linkedData:
term: productImageUrl
'@id': https://schema.org/url
productImageHash:
title: Product Image Hash
description: >-
Hash value for securely identifying the product image. More information can
be found at the following link: https://cybersecurityglossary.com/hashing
type: string
$linkedData:
term: productImageHash
'@id': https://w3id.org/traceability#productImageHash
'@id': https://schema.org/sha256
additionalProperties: true
required:
- type
example: |-
{
"type": ["AgricultureProduct"],
"upc": "033383401508",
"type": [
"AgricultureProduct"
],
"plu": "94225",
"gtin": "033383401508",
"countryOfOrigin": "United States",
"product": {
"type": ["Product"],
"type": [
"Product"
],
"manufacturer": {
"type": ["Organization"],
"name": "Jimbo's Awesome Farm",
"description": "Organic fruits & vegetables",
"email": "[email protected]",
"phoneNumber": "+1-302-555-6543",
"faxNumber": "+1-436-555-6157"
"type": [
"Organization"
],
"name": "Zemlak - Wyman",
"description": "Progressive fault-tolerant task-force",
"location": {
"type": [
"Place"
],
"address": {
"type": [
"PostalAddress"
],
"streetAddress": "964 Mikayla Viaduct",
"addressLocality": "Runolfsdottirburgh",
"addressRegion": "Florida",
"postalCode": "48442-9522",
"addressCountry": "Barbados"
}
},
"email": "[email protected]",
"phoneNumber": "+1-264-555-5427",
"faxNumber": "+1-597-555-6162"
},
"name": "Avocados",
"description": "Avocados, 4 pack boxes",
"countryOfOrigin": "United States",
"name": "Handmade Fresh Hat",
"description": "The Nagasaki Lander is the trademarked name of several series of Nagasaki sport bikes, that started with the 1984 ABC800J",
"sizeOrAmount": {
"type": [
"QuantitativeValue"
],
"unitCode": "boxes",
"value": "893"
"unitCode": "sqm",
"value": "47"
},
"weight": {
"type": [
"QuantitativeValue"
],
"unitCode": "lbs",
"value": "1784"
"unitCode": "kg",
"value": "4890"
},
"sku": "71266019767"
},
"scientificName": "Persea americana",
"plantParts": "fruit",
"labelImageUrl": "https://img.example.org/033383401508/640/480/",
"labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"name": "Avocados",
"productImageUrl": "https://img.example.org/102934920857/937/903/",
"productImageHash": "8kb47j986hklhde4rfh78okjhgjo08765fgu7tfg4t864fy876rfser45thj87f3"
}
"sku": "712120934258",
"imageUrl": "https://img.example.org/102934920857/937/903/",
"imageHash": "8kb47j986hklhde4rfh78okjhgjo08765fgu7tfg4t864fy876rfser45thj87f3"
}
}
14 changes: 2 additions & 12 deletions docs/openapi/components/schemas/common/FoodGradeInspection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -245,9 +245,7 @@ example: |-
"type": [
"AgricultureProduct"
],
"upc": "033383401508",
"plu": "94225",
"gtin": "033383401508",
"product": {
"type": [
"Product"
Expand Down Expand Up @@ -279,10 +277,7 @@ example: |-
},
"scientificName": "Persea americana",
"labelImageUrl": "https://img.example.org/033383401508/640/480/",
"labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"name": "Avocados",
"productImageUrl": "https://img.example.org/102934920857/937/903/",
"productImageHash": "8kb47j986hklhde4rfh78okjhgjo08765fgu7tfg4t864fy876rfser45thj87f3"
"labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
]
}
Expand Down Expand Up @@ -326,9 +321,7 @@ example: |-
"type": [
"AgricultureProduct"
],
"upc": "033383401508",
"plu": "94225",
"gtin": "033383401508",
"product": {
"type": [
"Product"
Expand Down Expand Up @@ -360,10 +353,7 @@ example: |-
},
"scientificName": "Persea americana",
"labelImageUrl": "https://img.example.org/033383401508/640/480/",
"labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"name": "Avocados",
"productImageUrl": "https://img.example.org/102934920857/937/903/",
"productImageHash": "8kb47j986hklhde4rfh78okjhgjo08765fgu7tfg4t864fy876rfser45thj87f3"
"labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
},
"lotIdentifier": "Main Lot",
"numberContainers": 320,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,7 @@ example: |-
"type": [
"AgricultureProduct"
],
"upc": "033383401508",
"plu": "94225",
"gtin": "033383401508",
"product": {
"type": [
"Product"
Expand Down Expand Up @@ -141,10 +139,7 @@ example: |-
},
"scientificName": "Persea americana",
"labelImageUrl": "https://img.example.org/033383401508/640/480/",
"labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"name": "Avocados",
"productImageUrl": "https://img.example.org/102934920857/937/903/",
"productImageHash": "8kb47j986hklhde4rfh78okjhgjo08765fgu7tfg4t864fy876rfser45thj87f3"
"labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
},
"lotIdentifier": "Main Lot",
"numberContainers": 320,
Expand Down
7 changes: 1 addition & 6 deletions docs/openapi/components/schemas/common/GAPInspection.yml
Original file line number Diff line number Diff line change
Expand Up @@ -312,9 +312,7 @@ example: |-
"type": [
"AgricultureProduct"
],
"upc": "033383401508",
"plu": "94225",
"gtin": "033383401508",
"product": {
"type": [
"Product"
Expand Down Expand Up @@ -346,10 +344,7 @@ example: |-
},
"scientificName": "Solanum lycopersicum",
"labelImageUrl": "https://img.example.org/033383401508/640/480/",
"labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
"name": "Avocados",
"productImageUrl": "https://img.example.org/102934920857/937/903/",
"productImageHash": "8kb47j986hklhde4rfh78okjhgjo08765fgu7tfg4t864fy876rfser45thj87f3"
"labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855"
}
],
"totalArea": {
Expand Down
Loading

0 comments on commit 1c93c45

Please sign in to comment.