From 2cda32f49e9351375f55a3517dc3980087f91781 Mon Sep 17 00:00:00 2001 From: Brent Zundel Date: Fri, 13 Sep 2024 17:45:08 -0600 Subject: [PATCH 1/5] Add FSVP and example Signed-off-by: Brent Zundel --- ...edentials-with-issuer-dependent-terms.json | 4 + .../credentials/FVSPImporterCredential.yml | 309 ++++++++++++++++++ 2 files changed, 313 insertions(+) create mode 100644 docs/openapi/components/schemas/credentials/FVSPImporterCredential.yml diff --git a/docs/credentials-with-issuer-dependent-terms.json b/docs/credentials-with-issuer-dependent-terms.json index 6f27b4815..d0baae42b 100644 --- a/docs/credentials-with-issuer-dependent-terms.json +++ b/docs/credentials-with-issuer-dependent-terms.json @@ -187,6 +187,10 @@ "type": "FoodDefenseInspectionCredential", "count": 0 }, + { + "type": "FVSPImporterCredential", + "count": 2 + } { "type": "FSMATransformingCTECredential", "count": 0 diff --git a/docs/openapi/components/schemas/credentials/FVSPImporterCredential.yml b/docs/openapi/components/schemas/credentials/FVSPImporterCredential.yml new file mode 100644 index 000000000..596433cd6 --- /dev/null +++ b/docs/openapi/components/schemas/credentials/FVSPImporterCredential.yml @@ -0,0 +1,309 @@ +$linkedData: + term: FSVPImporterCredential + '@id': https://w3id.org/traceability#FSVPImporterCredential +title: FSVP Importer Credential +tags: + - Agriculture +description: >- + This credential represents a secure digital record of the KDEs (Key Data Elements) + required by an importer when asserting compliance to the Foreign Supplier + Verification Program (FSVP) to meet the requirements of the Food Safety + Modernization Act (FSMA). + + Additional information about the Foreign Supplier Verification Program: + https://www.fda.gov/food/food-safety-modernization-act-fsma/fsma-final-rule-foreign-supplier-verification-programs-fsvp-importers-food-humans-and-animals + +type: object +properties: + '@context': + type: array + readOnly: true + const: + - https://www.w3.org/2018/credentials/v1 + - https://w3id.org/traceability/v1 + default: + - https://www.w3.org/2018/credentials/v1 + - https://w3id.org/traceability/v1 + items: + type: string + enum: + - https://www.w3.org/2018/credentials/v1 + - https://w3id.org/traceability/v1 + type: + type: array + readOnly: true + const: + - VerifiableCredential + - FSVPImporterCredential + default: + - VerifiableCredential + - FSVPImporterCredential + items: + type: string + enum: + - VerifiableCredential + - FSVPImporterCredential + id: + type: string + name: + type: string + description: + type: string + issuanceDate: + type: string + expirationDate: + type: string + issuer: + $ref: ../common/Organization.yml + credentialSchema: + type: object + properties: + id: + title: Id + description: The url of the schema file to validate the shape of the json object + type: string + format: uri + example: https://w3id.org/traceability/openapi/components/schemas/credentials/FSVPImporterCredential.yml + default: https://w3id.org/traceability/openapi/components/schemas/credentials/FSVPImporterCredential.yml + readOnly: true + type: + title: Type + description: The type of validation to be run against the defined schema + const: OpenApiSpecificationValidator2022 + credentialSubject: + type: object + properties: + importer: + $ref: ../common/Organization.yml + importerDUNS: + type: string + title: DUNS number of importer + shipment: + $ref: ../common/AgricultureParcelDelivery.yml + fsvpAssertion: + title: Importer's assertion of FSVP compliance or exemption + type: string + enum: + - FSVP Compliant + - FSVP Exempt + - FSVP Exempt, product is for research and evaluation (R&E) + additionalProperties: false + required: + - importer + - importerDUNS + - shipment + - fsvpAssertion +additionalProperties: false +required: + - '@context' + - type + - id + - issuanceDate + - issuer + - credentialSubject +example: |- + { + "@context": [ + "https://www.w3.org/2018/credentials/v1", + "https://w3id.org/traceability/v1" + ], + "id": "https://example.com/credential/123", + "type": [ + "VerifiableCredential", + "FSVPImporterCredential" + ], + "name": "FSVP Importer Credential", + "issuanceDate": "2021-12-11T03:50:55Z", + "issuer": { + "id": "did:web:organization.example.com", + "type": [ + "Organization" + ], + }, + "credentialSubject": { + "importer": { + "type": ["Organization"], + "name": "Onwards A/S", + "location": { + "type": ["Place"], + "address": { + "type": ["PostalAddress"], + "streetAddress": "Sludevej 63", + "addressLocality": "Kgs. Lyngby", + "postalCode": "2800", + "addressCountry": "DK" + } + } + }, + "importerDUNS": "00-123-4567", + "shipment": { + "type": ["AgricultureParcelDelivery"], + "deliveryAddress": { + "type": [ + "PostalAddress" + ], + "name": "Bartell - Doyle", + "streetAddress": "84189 Roberts Route", + "addressLocality": "Kautzerstad", + "addressRegion": "Louisiana", + "postalCode": "37950-5855", + "addressCountry": "Mongolia" + }, + "originAddress": { + "type": [ + "PostalAddress" + ], + "name": "Marks, Runte and Bartell", + "streetAddress": "97696 Weissnat Pines", + "addressLocality": "Reynabury", + "addressRegion": "North Dakota", + "postalCode": "51361-9603", + "addressCountry": "Virgin Islands, U.S." + }, + "foreignPortExport": { + "type": [ + "Place" + ], + "globalLocationNumber": "4947538126450", + "geo": { + "type": [ + "GeoCoordinates" + ], + "latitude": "40.5464", + "longitude": "-37.6146" + }, + "address": { + "type": [ + "PostalAddress" + ], + "name": "Moen - Swift", + "streetAddress": "9746 Laron Gardens", + "addressLocality": "Port Flossie", + "addressRegion": "Hawaii", + "postalCode": "64687", + "addressCountry": "Djibouti" + }, + "unLocode": "DKCPH" + }, + "portOfEntry": { + "type": [ + "Place" + ], + "globalLocationNumber": "2184109798407", + "geo": { + "type": [ + "GeoCoordinates" + ], + "latitude": "38.8485", + "longitude": "-34.0883" + }, + "address": { + "type": [ + "PostalAddress" + ], + "name": "Mills, Daugherty and Nader", + "streetAddress": "39514 Kulas Terrace", + "addressLocality": "East Avis", + "addressRegion": "Utah", + "postalCode": "45553", + "addressCountry": "Northern Mariana Islands" + }, + "unLocode": "DKCPH" + }, + "deliveryMethod": "Truck transport", + "trackingNumber": "866440000109", + "expectedArrival": "2021-03-14", + "specialInstructions": "The package is top-heavy so handle with appropriate caution.", + "consignee": { + "type": [ + "Organization" + ], + "name": "Ace Foodstuffs", + "description": "Agricultural goods shipping & distribution", + "email": "Hipolito58@acefoodstuffs.org", + "phoneNumber": "+1-595-555-0996", + "faxNumber": "+1-643-555-2094" + }, + "agriculturePackage": [ + { + "type": [ + "AgriculturePackage" + ], + "packageName": "Avocados, Bulk", + "grade": "AA", + "responsibleParty": { + "type": ["Organization"], + "name": "Example Responsible Party Organization", + "email": "Chadrick_Gibson@example.com", + "phoneNumber": "+1-470-555-7721" + }, + "voicePickCode": "4642", + "harvestDate": "2021-03-14", + "labelImageUrl": "https://img.example.org/640/480/", + "labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "agricultureProduct": [ + { + "type": [ + "AgricultureProduct" + ], + "plu": "94225", + "product": { + "type": [ + "Product" + ], + "manufacturer": { + "type": [ + "Organization" + ], + "email": "Ashlee.Grady@example.net", + "phoneNumber": "+1-300-555-2516" + }, + "name": "Avocados", + "description": "Avocados, 4 pack boxes", + "weight": { + "type": [ + "QuantitativeValue" + ], + "unitCode": "hg/ha", + "value": "6960" + }, + "sku": "81055399441" + }, + "scientificName": "Persea americana", + "labelImageUrl": "https://img.example.org/033383401508/640/480/", + "labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + ] + } + ], + "shipper": { + "type": ["Organization"], + "name": "Green Fields", + "description": "Growing & packaging for high quality produce", + "email": "sales@greenfields.org", + "phoneNumber": "+1-474-555-8033" + }, + "purchaser": { + "type": ["Organization"], + "name": "Ace Foodstuffs", + "description": "Agricultural goods shipping & distribution", + "email": "Hipolito58@acefoodstuffs.org", + "phoneNumber": "+1-351-555-3356", + "faxNumber": "+1-744-555-3782" + }, + "carrier": { + "type": [ + "Organization" + ], + "email": "Adaline29@example.com", + "phoneNumber": "+1-853-555-5644" + }, + "broker": { + "type": ["Organization"], + "name": "Koch LLC", + "leiCode": "54321351219389121979" + } + }, + "fsvpAssertion": "FSVP Compliant" + } + } From 379b1ed8c9acd56a65687ef4ffd64d306937785f Mon Sep 17 00:00:00 2001 From: Brent Zundel Date: Fri, 13 Sep 2024 17:50:03 -0600 Subject: [PATCH 2/5] comma Signed-off-by: Brent Zundel --- docs/credentials-with-issuer-dependent-terms.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/credentials-with-issuer-dependent-terms.json b/docs/credentials-with-issuer-dependent-terms.json index d0baae42b..e618b78a4 100644 --- a/docs/credentials-with-issuer-dependent-terms.json +++ b/docs/credentials-with-issuer-dependent-terms.json @@ -190,7 +190,7 @@ { "type": "FVSPImporterCredential", "count": 2 - } + }, { "type": "FSMATransformingCTECredential", "count": 0 From eb9d92f2377778a97ec779059f45647e3c388d63 Mon Sep 17 00:00:00 2001 From: Brent Zundel Date: Fri, 13 Sep 2024 17:56:02 -0600 Subject: [PATCH 3/5] just importer Signed-off-by: Brent Zundel --- .../credentials/FVSPImporterCredential.yml | 188 +----------------- 1 file changed, 2 insertions(+), 186 deletions(-) diff --git a/docs/openapi/components/schemas/credentials/FVSPImporterCredential.yml b/docs/openapi/components/schemas/credentials/FVSPImporterCredential.yml index 596433cd6..94f05a3af 100644 --- a/docs/openapi/components/schemas/credentials/FVSPImporterCredential.yml +++ b/docs/openapi/components/schemas/credentials/FVSPImporterCredential.yml @@ -75,24 +75,9 @@ properties: properties: importer: $ref: ../common/Organization.yml - importerDUNS: - type: string - title: DUNS number of importer - shipment: - $ref: ../common/AgricultureParcelDelivery.yml - fsvpAssertion: - title: Importer's assertion of FSVP compliance or exemption - type: string - enum: - - FSVP Compliant - - FSVP Exempt - - FSVP Exempt, product is for research and evaluation (R&E) additionalProperties: false required: - importer - - importerDUNS - - shipment - - fsvpAssertion additionalProperties: false required: - '@context' @@ -134,176 +119,7 @@ example: |- "addressCountry": "DK" } } - }, - "importerDUNS": "00-123-4567", - "shipment": { - "type": ["AgricultureParcelDelivery"], - "deliveryAddress": { - "type": [ - "PostalAddress" - ], - "name": "Bartell - Doyle", - "streetAddress": "84189 Roberts Route", - "addressLocality": "Kautzerstad", - "addressRegion": "Louisiana", - "postalCode": "37950-5855", - "addressCountry": "Mongolia" - }, - "originAddress": { - "type": [ - "PostalAddress" - ], - "name": "Marks, Runte and Bartell", - "streetAddress": "97696 Weissnat Pines", - "addressLocality": "Reynabury", - "addressRegion": "North Dakota", - "postalCode": "51361-9603", - "addressCountry": "Virgin Islands, U.S." - }, - "foreignPortExport": { - "type": [ - "Place" - ], - "globalLocationNumber": "4947538126450", - "geo": { - "type": [ - "GeoCoordinates" - ], - "latitude": "40.5464", - "longitude": "-37.6146" - }, - "address": { - "type": [ - "PostalAddress" - ], - "name": "Moen - Swift", - "streetAddress": "9746 Laron Gardens", - "addressLocality": "Port Flossie", - "addressRegion": "Hawaii", - "postalCode": "64687", - "addressCountry": "Djibouti" - }, - "unLocode": "DKCPH" - }, - "portOfEntry": { - "type": [ - "Place" - ], - "globalLocationNumber": "2184109798407", - "geo": { - "type": [ - "GeoCoordinates" - ], - "latitude": "38.8485", - "longitude": "-34.0883" - }, - "address": { - "type": [ - "PostalAddress" - ], - "name": "Mills, Daugherty and Nader", - "streetAddress": "39514 Kulas Terrace", - "addressLocality": "East Avis", - "addressRegion": "Utah", - "postalCode": "45553", - "addressCountry": "Northern Mariana Islands" - }, - "unLocode": "DKCPH" - }, - "deliveryMethod": "Truck transport", - "trackingNumber": "866440000109", - "expectedArrival": "2021-03-14", - "specialInstructions": "The package is top-heavy so handle with appropriate caution.", - "consignee": { - "type": [ - "Organization" - ], - "name": "Ace Foodstuffs", - "description": "Agricultural goods shipping & distribution", - "email": "Hipolito58@acefoodstuffs.org", - "phoneNumber": "+1-595-555-0996", - "faxNumber": "+1-643-555-2094" - }, - "agriculturePackage": [ - { - "type": [ - "AgriculturePackage" - ], - "packageName": "Avocados, Bulk", - "grade": "AA", - "responsibleParty": { - "type": ["Organization"], - "name": "Example Responsible Party Organization", - "email": "Chadrick_Gibson@example.com", - "phoneNumber": "+1-470-555-7721" - }, - "voicePickCode": "4642", - "harvestDate": "2021-03-14", - "labelImageUrl": "https://img.example.org/640/480/", - "labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "agricultureProduct": [ - { - "type": [ - "AgricultureProduct" - ], - "plu": "94225", - "product": { - "type": [ - "Product" - ], - "manufacturer": { - "type": [ - "Organization" - ], - "email": "Ashlee.Grady@example.net", - "phoneNumber": "+1-300-555-2516" - }, - "name": "Avocados", - "description": "Avocados, 4 pack boxes", - "weight": { - "type": [ - "QuantitativeValue" - ], - "unitCode": "hg/ha", - "value": "6960" - }, - "sku": "81055399441" - }, - "scientificName": "Persea americana", - "labelImageUrl": "https://img.example.org/033383401508/640/480/", - "labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" - } - ] - } - ], - "shipper": { - "type": ["Organization"], - "name": "Green Fields", - "description": "Growing & packaging for high quality produce", - "email": "sales@greenfields.org", - "phoneNumber": "+1-474-555-8033" - }, - "purchaser": { - "type": ["Organization"], - "name": "Ace Foodstuffs", - "description": "Agricultural goods shipping & distribution", - "email": "Hipolito58@acefoodstuffs.org", - "phoneNumber": "+1-351-555-3356", - "faxNumber": "+1-744-555-3782" - }, - "carrier": { - "type": [ - "Organization" - ], - "email": "Adaline29@example.com", - "phoneNumber": "+1-853-555-5644" - }, - "broker": { - "type": ["Organization"], - "name": "Koch LLC", - "leiCode": "54321351219389121979" - } - }, - "fsvpAssertion": "FSVP Compliant" + } } } + From 7107ecd0e2957f59c5a6af61e1289654f89c933e Mon Sep 17 00:00:00 2001 From: Brent Zundel Date: Fri, 13 Sep 2024 18:02:32 -0600 Subject: [PATCH 4/5] fix lint Signed-off-by: Brent Zundel --- .../credentials/FVSPImporterCredential.yml | 218 +++++++++++++++++- 1 file changed, 209 insertions(+), 9 deletions(-) diff --git a/docs/openapi/components/schemas/credentials/FVSPImporterCredential.yml b/docs/openapi/components/schemas/credentials/FVSPImporterCredential.yml index 94f05a3af..c50cecd8a 100644 --- a/docs/openapi/components/schemas/credentials/FVSPImporterCredential.yml +++ b/docs/openapi/components/schemas/credentials/FVSPImporterCredential.yml @@ -75,9 +75,24 @@ properties: properties: importer: $ref: ../common/Organization.yml + importerDUNS: + type: string + title: DUNS number of importer + shipment: + $ref: ../common/AgricultureParcelDelivery.yml + fsvpAssertion: + title: Importer's assertion of FSVP compliance or exemption + type: string + enum: + - FSVP Compliant + - FSVP Exempt + - FSVP Exempt, product is for research and evaluation (R&E) additionalProperties: false required: - - importer + - importer + - importerDUNS + - shipment + - fsvpAssertion additionalProperties: false required: - '@context' @@ -103,23 +118,208 @@ example: |- "id": "did:web:organization.example.com", "type": [ "Organization" - ], + ] }, - "credentialSubject": { + "credentialSubject": { "importer": { - "type": ["Organization"], + "type": [ + "Organization" + ], "name": "Onwards A/S", "location": { - "type": ["Place"], + "type": [ + "Place" + ], "address": { - "type": ["PostalAddress"], + "type": [ + "PostalAddress" + ], "streetAddress": "Sludevej 63", "addressLocality": "Kgs. Lyngby", "postalCode": "2800", "addressCountry": "DK" } } - } + }, + "importerDUNS": "00-123-4567", + "shipment": { + "type": [ + "AgricultureParcelDelivery" + ], + "deliveryAddress": { + "type": [ + "PostalAddress" + ], + "name": "Bartell - Doyle", + "streetAddress": "84189 Roberts Route", + "addressLocality": "Kautzerstad", + "addressRegion": "Louisiana", + "postalCode": "37950-5855", + "addressCountry": "Mongolia" + }, + "originAddress": { + "type": [ + "PostalAddress" + ], + "name": "Marks, Runte and Bartell", + "streetAddress": "97696 Weissnat Pines", + "addressLocality": "Reynabury", + "addressRegion": "North Dakota", + "postalCode": "51361-9603", + "addressCountry": "Virgin Islands, U.S." + }, + "foreignPortExport": { + "type": [ + "Place" + ], + "globalLocationNumber": "4947538126450", + "geo": { + "type": [ + "GeoCoordinates" + ], + "latitude": "40.5464", + "longitude": "-37.6146" + }, + "address": { + "type": [ + "PostalAddress" + ], + "name": "Moen - Swift", + "streetAddress": "9746 Laron Gardens", + "addressLocality": "Port Flossie", + "addressRegion": "Hawaii", + "postalCode": "64687", + "addressCountry": "Djibouti" + }, + "unLocode": "DKCPH" + }, + "portOfEntry": { + "type": [ + "Place" + ], + "globalLocationNumber": "2184109798407", + "geo": { + "type": [ + "GeoCoordinates" + ], + "latitude": "38.8485", + "longitude": "-34.0883" + }, + "address": { + "type": [ + "PostalAddress" + ], + "name": "Mills, Daugherty and Nader", + "streetAddress": "39514 Kulas Terrace", + "addressLocality": "East Avis", + "addressRegion": "Utah", + "postalCode": "45553", + "addressCountry": "Northern Mariana Islands" + }, + "unLocode": "DKCPH" + }, + "deliveryMethod": "Truck transport", + "trackingNumber": "866440000109", + "expectedArrival": "2021-03-14", + "specialInstructions": "The package is top-heavy so handle with appropriate caution.", + "consignee": { + "type": [ + "Organization" + ], + "name": "Ace Foodstuffs", + "description": "Agricultural goods shipping & distribution", + "email": "Hipolito58@acefoodstuffs.org", + "phoneNumber": "+1-595-555-0996", + "faxNumber": "+1-643-555-2094" + }, + "agriculturePackage": [ + { + "type": [ + "AgriculturePackage" + ], + "packageName": "Avocados, Bulk", + "grade": "AA", + "responsibleParty": { + "type": [ + "Organization" + ], + "name": "Example Responsible Party Organization", + "email": "Chadrick_Gibson@example.com", + "phoneNumber": "+1-470-555-7721" + }, + "voicePickCode": "4642", + "harvestDate": "2021-03-14", + "labelImageUrl": "https://img.example.org/640/480/", + "labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "agricultureProduct": [ + { + "type": [ + "AgricultureProduct" + ], + "plu": "94225", + "product": { + "type": [ + "Product" + ], + "manufacturer": { + "type": [ + "Organization" + ], + "email": "Ashlee.Grady@example.net", + "phoneNumber": "+1-300-555-2516" + }, + "name": "Avocados", + "description": "Avocados, 4 pack boxes", + "weight": { + "type": [ + "QuantitativeValue" + ], + "unitCode": "hg/ha", + "value": "6960" + }, + "sku": "81055399441" + }, + "scientificName": "Persea americana", + "labelImageUrl": "https://img.example.org/033383401508/640/480/", + "labelImageHash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + ] + } + ], + "shipper": { + "type": [ + "Organization" + ], + "name": "Green Fields", + "description": "Growing & packaging for high quality produce", + "email": "sales@greenfields.org", + "phoneNumber": "+1-474-555-8033" + }, + "purchaser": { + "type": [ + "Organization" + ], + "name": "Ace Foodstuffs", + "description": "Agricultural goods shipping & distribution", + "email": "Hipolito58@acefoodstuffs.org", + "phoneNumber": "+1-351-555-3356", + "faxNumber": "+1-744-555-3782" + }, + "carrier": { + "type": [ + "Organization" + ], + "email": "Adaline29@example.com", + "phoneNumber": "+1-853-555-5644" + }, + "broker": { + "type": [ + "Organization" + ], + "name": "Koch LLC", + "leiCode": "54321351219389121979" + } + }, + "fsvpAssertion": "FSVP Compliant" } - } - + } \ No newline at end of file From f45c1400a785ff4a45d67406116c59ff8ee2e127 Mon Sep 17 00:00:00 2001 From: Brent Zundel Date: Mon, 16 Sep 2024 13:49:08 -0600 Subject: [PATCH 5/5] Apply suggestions from code review Co-authored-by: Ted Thibodeau Jr --- .../components/schemas/credentials/FVSPImporterCredential.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/openapi/components/schemas/credentials/FVSPImporterCredential.yml b/docs/openapi/components/schemas/credentials/FVSPImporterCredential.yml index c50cecd8a..87d83f22b 100644 --- a/docs/openapi/components/schemas/credentials/FVSPImporterCredential.yml +++ b/docs/openapi/components/schemas/credentials/FVSPImporterCredential.yml @@ -60,7 +60,7 @@ properties: properties: id: title: Id - description: The url of the schema file to validate the shape of the json object + description: The URL of the schema file to be used to validate the shape of the JSON object type: string format: uri example: https://w3id.org/traceability/openapi/components/schemas/credentials/FSVPImporterCredential.yml