diff --git a/docs/Attributesheet_IGM.xlsx b/docs/Attributesheet_IGM.xlsx deleted file mode 100755 index 34ae326..0000000 Binary files a/docs/Attributesheet_IGM.xlsx and /dev/null differ diff --git a/docs/Attributesheet_scoring.xlsx b/docs/Attributesheet_scoring.xlsx new file mode 100644 index 0000000..823141b Binary files /dev/null and b/docs/Attributesheet_scoring.xlsx differ diff --git a/docs/api/build/build.yaml b/docs/api/build/build.yaml index b0b85f4..e21209f 100644 --- a/docs/api/build/build.yaml +++ b/docs/api/build/build.yaml @@ -10,7 +10,9 @@ paths: post: tags: - Rating API Server - description: Publish the ratings to the chain, for the given transaction / message ID + description: >- + Publish the ratings to the chain, for the entity with given transaction + / message ID operationId: publishRatings requestBody: description: >- @@ -68,7 +70,7 @@ paths: post: tags: - Rating API Client (NP) - description: Callback of the revise operation on the chain. + description: update the status of the revise operation on the chain. operationId: onReviseRating requestBody: description: update the ratings @@ -230,84 +232,12 @@ components: - text/plain - text/html - application/json - Tag: - description: >- - Describes a tag. This is used to contain extended metadata. This object - can be added as a property to any schema to describe extended - attributes. For BAPs, tags can be sent during search to optimize and - filter search results. BPPs can use tags to index their catalog to allow - better search functionality. Tags are sent by the BPP as part of the - catalog response in the `on_search` callback. Tags are also meant for - display purposes. Upon receiving a tag, BAPs are meant to render them as - name-value pairs. This is particularly useful when rendering tabular - information about a product or service. - type: object - additionalProperties: false - properties: - descriptor: - description: Description of the Tag, can be used to store detailed information. - allOf: - - $ref: '#/components/schemas/Descriptor' - value: - description: >- - The value of the tag. This set by the BPP and rendered as-is by the - BAP. - type: string - display: - description: >- - This value indicates if the tag is intended for display purposes. If - set to `true`, then this tag must be displayed. If it is set to - `false`, it should not be displayed. This value can override the - group display value. - type: boolean - TagGroup: - description: >- - A collection of tag objects with group level attributes. For detailed - documentation on the Tags and Tag Groups schema go to - https://github.com/beckn/protocol-specifications/discussions/316 - type: object - additionalProperties: false - properties: - display: - description: >- - Indicates the display properties of the tag group. If display is set - to false, then the group will not be displayed. If it is set to - true, it should be displayed. However, group-level display - properties can be overridden by individual tag-level display - property. As this schema is purely for catalog display purposes, it - is not recommended to send this value during search. - type: boolean - default: true - descriptor: - description: >- - Description of the TagGroup, can be used to store detailed - information. - allOf: - - $ref: '#/components/schemas/Descriptor' - list: - description: >- - An array of Tag objects listed under this group. This property can - be set by BAPs during search to narrow the `search` and achieve more - relevant results. When received during `on_search`, BAPs must render - this list under the heading described by the `name` property of this - schema. - type: array - items: - $ref: '#/components/schemas/Tag' OnPublishResult_20x: type: object properties: status: type: boolean example: 'true' - did: - type: string - example: did:cord:3vYxCfRTWVJM8WYP39KFs2FMtpfBTmSjMexRnqeLbf5dmVQF - message_id: - type: string - referenceId: - type: string - example: rating:cord:r35tLfL1ouJhXLGqnGM4rK9hCM5RQrpjNN47KZ8cEBQbdoKtn PublishRating: type: object properties: @@ -328,14 +258,6 @@ components: status: type: boolean example: 'true' - did: - type: string - example: did:cord:3vYxCfRTWVJM8WYP39KFs2FMtpfBTmSjMexRnqeLbf5dmVQF - message_id: - type: string - rating_identifier: - type: string - example: rating:cord:r35tLfL1ouJhXLGqnGM4rK9hCM5RQrpjNN47KZ8cEBQbdoKtn ReviseRating: type: object properties: @@ -365,15 +287,12 @@ components: items: type: object properties: - entityUid: + entityId: type: string example: 286cf1b1-3e16-448f-b675-3b232e82174d ratingType: type: string example: Overall - entityType: - type: string - example: Retail OnQueryRating: type: object properties: @@ -387,7 +306,7 @@ components: items: type: object properties: - entityUid: + entityId: type: string example: 286cf1b1-3e16-448f-b675-3b232e82174d entityName: @@ -413,15 +332,18 @@ components: version: type: string example: 0.0.1 - provider_uid: + provider_uri: type: string - example: 446c67bd-9aa7-4aef-8d62-c69e3a669ce0 + example: https://api.provider-example.com/api/v1 provider_id: type: string example: All in One - Market Place - confidex_did: + publisher_uri: + type: string + example: https://api.provider-example.com/api/v1 + publisher_id: type: string - example: did:cord:3vYxCfRTWVJM8WYP39KFs2FMtpfBTmSjMexRnqeLbf5dmVQF + example: All in One - Market Place registry_id: type: string example: Confidex - Rating Provider Registry's ID @@ -436,10 +358,9 @@ components: timestamp: type: string example: '2021-06-29T10:52:01.620Z' - key: - type: string ttl: type: string + exmple: PT30S location: type: object example: >- @@ -467,15 +388,12 @@ components: PublishEntry: type: object properties: - entity_uid: + entity_id: type: string example: 226c67bd-9aa7-4aef-8d62-c69e3a669ce0 - entity_id: + entity_name: type: string example: Gupta Kirana Store - entityType: - type: string - example: Retail ratingType: type: string example: Overall @@ -488,9 +406,12 @@ components: ReviseEntry: type: object properties: - entityType: + entity_id: + type: string + example: 226c67bd-9aa7-4aef-8d62-c69e3a669ce0 + entity_name: type: string - example: Retail + example: Gupta Kirana Store ratingType: type: string example: Overall @@ -505,21 +426,64 @@ servers: url: https://virtserver.swaggerhub.com/ONDC/ONDC-Protocol-Rating/0.0.1 x-enum: publish: - message: &ref_0 + context: + location: &ref_0 + country: + code: + - code: IND + description: Represents the country + reference: + action: + - code: publish + description: Provider app indicate the publish intent + reference: + message: &ref_1 rating: - entityType: + ratingType: - code: Overall description: Overall Experience - reference: - code: Delivery description: Delivery Experience - reference: revise: - message: *ref_0 + context: + location: *ref_0 + action: + - code: revise + description: Provider app indicate the revise intent + reference: + message: *ref_1 query: - message: *ref_0 + context: + location: *ref_0 + action: + - code: query + description: Provider app indicate the query intent + reference: + message: *ref_1 on_query: - message: *ref_0 + context: + location: *ref_0 + action: + - code: on_query + description: Publisher app indicate the on_query intent + reference: + message: *ref_1 + on_publish: + context: + location: *ref_0 + action: + - code: on_publish + description: Publisher app indicate the on_publish intent + reference: + on_revise: + context: + location: *ref_0 + action: + - code: on_revise + description: Publisher app indicate the on_revise intent + reference: x-tags: publish: message: @@ -626,23 +590,24 @@ x-examples: publish: examples: - summary: publish - description: Publish Rating + description: Publish Rating of multiple entities from the provider. value: context: domain: ONDC:NTS12 action: publish version: 1.0.0 provider_id: All in One - Market Place - provider_uri: string - publisher_id: bpp_id - publisher_uri: bpp_uri + provider_uri: https://api.example.com/api/rating/v1 + publisher_id: Rating Publisher on Ledger + publisher_uri: https://api.publisher-example.com/api/rating/v1 registry_id: Confidex - Rating Provider Registry's ID - transaction_id: string - message_id: string + transaction_id: 226c67bd-9aa7-4aef-8d62-c69e3a669ce0 + message_id: 226c67bd-9aa7-4aef-8d62-c69e3a669c10 timestamp: '2021-06-29T10:52:01.620Z' - ttl: string + ttl: PT30S location: - code: IND + country: + code: IND message: rating: - entity_id: >- @@ -654,121 +619,133 @@ x-examples: on_publish: examples: - summary: on_publish - description: On Publish + description: Update the status of rating publish on ledger. value: context: domain: ONDC:NTS12 action: on_publish version: 1.0.0 provider_id: All in One - Market Place - provider_uri: string - publisher_id: bpp_id - publisher_uri: bpp_uri + provider_uri: https://api.example.com/api/rating/v1 + publisher_id: Rating Publisher on Ledger + publisher_uri: https://api.publisher-example.com/api/rating/v1 registry_id: Confidex - Rating Provider Registry's ID - transaction_id: string - message_id: string + transaction_id: 226c67bd-9aa7-4aef-8d62-c69e3a669ce0 + message_id: 226c67bd-9aa7-4aef-8d62-c69e3a669c10 timestamp: '2021-06-29T10:52:01.620Z' - ttl: string + ttl: PT30S location: - code: IND + country: + code: IND message: status: true revise: examples: - summary: revise - description: TBD + description: Revise the previously published rating. value: context: domain: ONDC:NTS12 action: revise version: 1.0.0 provider_id: All in One - Market Place - provider_uri: string - publisher_id: bpp_id - publisher_uri: bpp_uri + provider_uri: https://api.example.com/api/rating/v1 + publisher_id: Rating Publisher on Ledger + publisher_uri: https://api.publisher-example.com/api/rating/v1 registry_id: Confidex - Rating Provider Registry's ID - transaction_id: string - message_id: string + transaction_id: 226c67bd-9aa7-4aef-8d62-c69e3a669ce0 + message_id: 226c67bd-9aa7-4aef-8d62-c69e3a669c11 timestamp: '2021-06-29T10:52:01.620Z' - ttl: string + ttl: PT30S location: - code: IND + country: + code: IND message: rating: - - ratingType: Overall + - entity_id: >- + a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa + ratingType: Overall countOfTxn: 80 totalRating: 280 - transaction_id: string on_revise: examples: - summary: on_revise - description: TBD + description: >- + Callback of Revise call to get to know the status of the revise + call. value: context: domain: ONDC:NTS12 action: on_revise version: 1.0.0 provider_id: All in One - Market Place - provider_uri: string - publisher_id: bpp_id - publisher_uri: bpp_uri + provider_uri: https://api.example.com/api/rating/v1 + publisher_id: Rating Publisher on Ledger + publisher_uri: https://api.publisher-example.com/api/rating/v1 registry_id: Confidex - Rating Provider Registry's ID - transaction_id: string - message_id: string + transaction_id: 226c67bd-9aa7-4aef-8d62-c69e3a669ce0 + message_id: 226c67bd-9aa7-4aef-8d62-c69e3a669c11 timestamp: '2021-06-29T10:52:01.620Z' - ttl: string + ttl: PT30S location: - code: IND + country: + code: IND message: status: true on_query: examples: - summary: on_query - description: TBD + description: >- + Callback of the query, which provides the latest aggregated score + of the entity. value: context: domain: ONDC:NTS12 action: on_query version: 1.0.0 provider_id: All in One - Market Place - provider_uri: string - publisher_id: bpp_id - publisher_uri: bpp_uri + provider_uri: https://api.example.com/api/rating/v1 + publisher_id: Rating Publisher on Ledger + publisher_uri: https://api.publisher-example.com/api/rating/v1 registry_id: Confidex - Rating Provider Registry's ID - transaction_id: string - message_id: string + transaction_id: 226c67bd-9aa7-4aef-8d62-c69e3a669ce1 + message_id: 226c67bd-9aa7-4aef-8d62-c69e3a669d10 timestamp: '2021-06-29T10:52:01.620Z' - ttl: string + ttl: PT30S location: - code: IND + country: + code: IND message: scores: - entity_id: >- a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa - entityName: string + entityName: Gupta Kirana Store score: 3.7 totalRating: 280 countOfTxn: 73 query: examples: - summary: query - description: TBD + description: >- + Initiate the query to get the latest aggregated score of set of + entitites. value: context: domain: ONDC:NTS12 - action: query + action: publish version: 1.0.0 provider_id: All in One - Market Place - provider_uri: string - publisher_id: bpp_id - publisher_uri: bpp_uri + provider_uri: https://api.example.com/api/rating/v1 + publisher_id: Rating Publisher on Ledger + publisher_uri: https://api.publisher-example.com/api/rating/v1 registry_id: Confidex - Rating Provider Registry's ID - transaction_id: string - message_id: string + transaction_id: 226c67bd-9aa7-4aef-8d62-c69e3a669ce1 + message_id: 226c67bd-9aa7-4aef-8d62-c69e3a669d10 timestamp: '2021-06-29T10:52:01.620Z' - ttl: string + ttl: PT30S location: - code: IND + country: + code: IND message: entity_list: - entity_id: >- @@ -783,121 +760,632 @@ x-attributes: " entity_id\n": required: true type: String - owner: BPP + owner: Publisher usage: a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa - description: 'Describes the ID of the seller ' + description: >- + Provides Persistent ID of the seller / entity, where this is + generated based on the below formula. Hash(PREFIX:), + Example: Hash(“GSTIN:22AAAAA0000A1Z5”), Hash(“PAN:XYZRN1234A”), + Hash(“UIDAI:123412341234”) (in this order of availability of + documents. " entity_name\n": - required: true + required: false type: String - owner: BPP + owner: Publisher usage: Gupta krishna Stores - description: Describes the name of the seller + description: >- + Name of the seller (note, uniqueness is determined by + `entity_id` field) " ratingType\n": required: true - type: String - owner: BPP + type: ENUM + owner: Publisher usage: Overall - description: Describes the type of rating like overall or just the delivery + description: >- + What is rated in this event: overall experience or just the + delivery " countOfTxn\n": required: true type: Integer - owner: BPP + owner: Publisher usage: 100 - description: Describes the total number of transactions + description: total number of rating transactions " totalRating\n": required: true - type: Integer - owner: BPP + type: Number + owner: Publisher usage: 200 - description: Describes the total rating + description: >- + total rating value (each rating transaction is done on the scale + of 0-5) + context: + location: + country: + code: + required: mandatory + type: string + owner: Provider + usage: IND + description: Describes country code as per ISO 3166-1 and ISO 3166-2 format + timestamp: + required: mandatory + type: string + owner: Provider + usage: '2023-03-23T04:41:16Z' + description: Describes tme of request generation in RFC3339 format + publisher_id: + required: mandatory + type: string + owner: Provider + usage: api.example-publisher.com + description: Describes subscriber ID of the Publisher + transaction_id: + required: mandatory + type: string + owner: Provider + usage: 6743e9e2 + description: Describes a unique value which persists across all API calls + message_id: + required: mandatory + type: string + owner: Provider + usage: 13ba8018f176 + description: >- + Describes a unique value which persists during a request / + callback cycle. + version: + required: mandatory + type: integer + owner: Provider + usage: 1.0.0 + description: >- + Describes the version of transaction protocol being used by the + sender. + action: + required: mandatory + type: string + owner: Provider + usage: publish + description: >- + Describes the method being called by the sender and executed at + the receiver. + publisher_uri: + required: mandatory + type: string + owner: Provider + usage: https://api.example-publisher.com/pilot/rating/v1 + description: >- + Describes subscriber URL of the Publisher for accepting requests + from Providers. + ttl: + required: mandatory + type: string + owner: Provider + usage: PT30S + description: >- + Describes the duration in ISO8601 format after timestamp for which + this message holds valid + provider_uri: + required: mandatory + type: string + owner: Provider + usage: https://api.example-provider.com/pilot/rating/v1 + description: >- + Describes subscriber URL of the Provider for accepting callbacks + from Publishers. + provider_id: + required: mandatory + type: string + owner: Provider + usage: api.example-provider.com + description: Describes subscriber ID of the Provider on_publish: message: status: required: true type: Boolean - owner: BPP + owner: Publisher usage: true description: Describes the status of the publish + context: + location: + country: + code: + required: mandatory + type: string + owner: Provider + usage: IND + description: Describes country code as per ISO 3166-1 and ISO 3166-2 format + timestamp: + required: mandatory + type: string + owner: Provider + usage: '2023-03-23T04:41:16Z' + description: Describes tme of request generation in RFC3339 format + publisher_id: + required: mandatory + type: string + owner: Provider + usage: api.example-publisher.com + description: Describes subscriber ID of the Publisher + transaction_id: + required: mandatory + type: string + owner: Provider + usage: 6743e9e2 + description: Describes a unique value which persists across all API calls + message_id: + required: mandatory + type: string + owner: Provider + usage: 13ba8018f176 + description: >- + Describes a unique value which persists during a request / + callback cycle. + version: + required: mandatory + type: integer + owner: Provider + usage: 1.0.0 + description: >- + Describes the version of transaction protocol being used by the + sender. + action: + required: mandatory + type: string + owner: Provider + usage: on_publish + description: >- + Describes the method being called by the sender and executed at + the receiver. + publisher_uri: + required: mandatory + type: string + owner: Provider + usage: https://api.example-publisher.com/pilot/rating/v1 + description: >- + Describes subscriber URL of the Publisher for accepting requests + from Providers. + ttl: + required: mandatory + type: string + owner: Provider + usage: PT30S + description: >- + Describes the duration in ISO8601 format after timestamp for which + this message holds valid + provider_uri: + required: mandatory + type: string + owner: Provider + usage: https://api.example-provider.com/pilot/rating/v1 + description: >- + Describes subscriber URL of the Provider for accepting callbacks + from Publishers. + provider_id: + required: mandatory + type: string + owner: Provider + usage: api.example-provider.com + description: Describes subscriber ID of the Provider revise: message: rating: - " ratingType\n": + " entity_id\n": required: true type: String - owner: BPP + owner: Publisher + usage: a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa + description: >- + Provides Persistent ID of the seller / entity, where this is + generated based on the below formula. Hash(PREFIX:), + Example: Hash(“GSTIN:22AAAAA0000A1Z5”), Hash(“PAN:XYZRN1234A”), + Hash(“UIDAI:123412341234”) (in this order of availability of + documents. + " ratingType\n": + required: true + type: ENUM + owner: Publisher usage: Overall - description: Describes the type of rating like overall or just the delivery + description: >- + What is revised in this event: overall experience or just the + delivery " countOfTxn\n": required: true type: Integer - owner: BPP + owner: Publisher usage: 100 - description: Describes the total number of transactions + description: total number of rating transactions " totalRating\n": required: true - type: Integer - owner: BPP - usage: 300 - description: Describes the total rating + type: Number + owner: Publisher + usage: 200 + description: >- + total rating value (each rating transaction is done on the scale + of 0-5) + context: + location: + country: + code: + required: mandatory + type: string + owner: Provider + usage: IND + description: Describes country code as per ISO 3166-1 and ISO 3166-2 format + timestamp: + required: mandatory + type: string + owner: Provider + usage: '2023-03-23T04:41:16Z' + description: Describes tme of request generation in RFC3339 format + publisher_id: + required: mandatory + type: string + owner: Provider + usage: api.example-publisher.com + description: Describes subscriber ID of the Publisher transaction_id: - required: true - type: String - owner: BPP - usage: 30222f89-383f-42af-bde0-6150a4f146a2 - description: Describes the transaction ID + required: mandatory + type: string + owner: Provider + usage: 6743e9e2 + description: Describes a unique value which persists across all API calls + message_id: + required: mandatory + type: string + owner: Provider + usage: 13ba8018f176 + description: >- + Describes a unique value which persists during a request / + callback cycle. + version: + required: mandatory + type: integer + owner: Provider + usage: 1.0.0 + description: >- + Describes the version of transaction protocol being used by the + sender. + action: + required: mandatory + type: string + owner: Provider + usage: revise + description: >- + Describes the method being called by the sender and executed at + the receiver. + publisher_uri: + required: mandatory + type: string + owner: Provider + usage: https://api.example-publisher.com/pilot/rating/v1 + description: >- + Describes subscriber URL of the Publisher for accepting requests + from Providers. + ttl: + required: mandatory + type: string + owner: Provider + usage: PT30S + description: >- + Describes the duration in ISO8601 format after timestamp for which + this message holds valid + provider_uri: + required: mandatory + type: string + owner: Provider + usage: https://api.example-provider.com/pilot/rating/v1 + description: >- + Describes subscriber URL of the Provider for accepting callbacks + from Publishers. + provider_id: + required: mandatory + type: string + owner: Provider + usage: api.example-provider.com + description: Describes subscriber ID of the Provider on_revise: message: status: required: true type: Boolean - owner: BPP + owner: Publisher usage: true description: Describes the status of the publish + context: + location: + country: + code: + required: mandatory + type: string + owner: Provider + usage: IND + description: Describes country code as per ISO 3166-1 and ISO 3166-2 format + timestamp: + required: mandatory + type: string + owner: Provider + usage: '2023-03-23T04:41:16Z' + description: Describes tme of request generation in RFC3339 format + publisher_id: + required: mandatory + type: string + owner: Provider + usage: api.example-publisher.com + description: Describes subscriber ID of the Publisher + transaction_id: + required: mandatory + type: string + owner: Provider + usage: 6743e9e2 + description: Describes a unique value which persists across all API calls + message_id: + required: mandatory + type: string + owner: Provider + usage: 13ba8018f176 + description: >- + Describes a unique value which persists during a request / + callback cycle. + version: + required: mandatory + type: integer + owner: Provider + usage: 1.0.0 + description: >- + Describes the version of transaction protocol being used by the + sender. + action: + required: mandatory + type: string + owner: Provider + usage: on_revise + description: >- + Describes the method being called by the sender and executed at + the receiver. + publisher_uri: + required: mandatory + type: string + owner: Provider + usage: https://api.example-publisher.com/pilot/rating/v1 + description: >- + Describes subscriber URL of the Publisher for accepting requests + from Providers. + ttl: + required: mandatory + type: string + owner: Provider + usage: PT30S + description: >- + Describes the duration in ISO8601 format after timestamp for which + this message holds valid + provider_uri: + required: mandatory + type: string + owner: Provider + usage: https://api.example-provider.com/pilot/rating/v1 + description: >- + Describes subscriber URL of the Provider for accepting callbacks + from Publishers. + provider_id: + required: mandatory + type: string + owner: Provider + usage: api.example-provider.com + description: Describes subscriber ID of the Provider query: message: ' entity_list': "entity_id\n": required: true type: String - owner: BPP + owner: Publisher usage: a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa - description: Describes the entity ID + description: >- + Provides Persistent ID of the seller / entity, where this is + generated based on the below formula. Hash(PREFIX:), + Example: Hash(“GSTIN:22AAAAA0000A1Z5”), Hash(“PAN:XYZRN1234A”), + Hash(“UIDAI:123412341234”) (in this order of availability of + documents. " ratingType\n\n": required: true - type: String - owner: BPP + type: Enum + owner: Publisher usage: Overall description: Describes the type of rating like overall or just the delivery + context: + location: + country: + code: + required: mandatory + type: string + owner: Provider + usage: IND + description: Describes country code as per ISO 3166-1 and ISO 3166-2 format + timestamp: + required: mandatory + type: string + owner: Provider + usage: '2023-03-23T04:41:16Z' + description: Describes tme of request generation in RFC3339 format + publisher_id: + required: mandatory + type: string + owner: Provider + usage: api.example-publisher.com + description: Describes subscriber ID of the Publisher + transaction_id: + required: mandatory + type: string + owner: Provider + usage: 6743e9e2 + description: Describes a unique value which persists across all API calls + message_id: + required: mandatory + type: string + owner: Provider + usage: 13ba8018f176 + description: >- + Describes a unique value which persists during a request / + callback cycle. + version: + required: mandatory + type: integer + owner: Provider + usage: 1.0.0 + description: >- + Describes the version of transaction protocol being used by the + sender. + action: + required: mandatory + type: string + owner: Provider + usage: query + description: >- + Describes the method being called by the sender and executed at + the receiver. + publisher_uri: + required: mandatory + type: string + owner: Provider + usage: https://api.example-publisher.com/pilot/rating/v1 + description: >- + Describes subscriber URL of the Publisher for accepting requests + from Providers. + ttl: + required: mandatory + type: string + owner: Provider + usage: PT30S + description: >- + Describes the duration in ISO8601 format after timestamp for which + this message holds valid + provider_uri: + required: mandatory + type: string + owner: Provider + usage: https://api.example-provider.com/pilot/rating/v1 + description: >- + Describes subscriber URL of the Provider for accepting callbacks + from Publishers. + provider_id: + required: mandatory + type: string + owner: Provider + usage: api.example-provider.com + description: Describes subscriber ID of the Provider on_query: message: ' scores': " entity_id\n\n": required: true type: String - owner: BPP + owner: Publisher usage: a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa description: 'Describes the ID of the seller ' " entityName\n": required: true type: String - owner: BPP + owner: Publisher usage: Gupta Krishna Store description: Describes the name of the seller " score\n": required: true type: Number - owner: BPP + owner: Publisher usage: 1.5 description: Describes the aggregate score " totalRating\n": required: true - type: Integer - owner: BPP + type: Number + owner: Publisher usage: 200 description: Describes the total rating " countOfTxn\n": required: true type: Integer - owner: BPP + owner: Publisher usage: 150 description: Describes the total number of transactions + context: + location: + country: + code: + required: mandatory + type: string + owner: Provider + usage: IND + description: Describes country code as per ISO 3166-1 and ISO 3166-2 format + timestamp: + required: mandatory + type: string + owner: Provider + usage: '2023-03-23T04:41:16Z' + description: Describes tme of request generation in RFC3339 format + publisher_id: + required: mandatory + type: string + owner: Provider + usage: api.example-publisher.com + description: Describes subscriber ID of the Publisher + transaction_id: + required: mandatory + type: string + owner: Provider + usage: 6743e9e2 + description: Describes a unique value which persists across all API calls + message_id: + required: mandatory + type: string + owner: Provider + usage: 13ba8018f176 + description: >- + Describes a unique value which persists during a request / + callback cycle. + version: + required: mandatory + type: integer + owner: Provider + usage: 1.0.0 + description: >- + Describes the version of transaction protocol being used by the + sender. + action: + required: mandatory + type: string + owner: Provider + usage: on_query + description: >- + Describes the method being called by the sender and executed at + the receiver. + publisher_uri: + required: mandatory + type: string + owner: Provider + usage: https://api.example-publisher.com/pilot/rating/v1 + description: >- + Describes subscriber URL of the Publisher for accepting requests + from Providers. + ttl: + required: mandatory + type: string + owner: Provider + usage: PT30S + description: >- + Describes the duration in ISO8601 format after timestamp for which + this message holds valid + provider_uri: + required: mandatory + type: string + owner: Provider + usage: https://api.example-provider.com/pilot/rating/v1 + description: >- + Describes subscriber URL of the Provider for accepting callbacks + from Publishers. + provider_id: + required: mandatory + type: string + owner: Provider + usage: api.example-provider.com + description: Describes subscriber ID of the Provider diff --git a/docs/api/components/attributes/score/index.yaml b/docs/api/components/attributes/score/index.yaml index e2dbaa4..6b855b8 100644 --- a/docs/api/components/attributes/score/index.yaml +++ b/docs/api/components/attributes/score/index.yaml @@ -4,121 +4,616 @@ publish: " entity_id\n": required: true type: String - owner: BPP + owner: Publisher usage: a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa - description: 'Describes the ID of the seller ' + description: >- + Provides Persistent ID of the seller / entity, where this is generated + based on the below formula. Hash(PREFIX:), Example: + Hash(“GSTIN:22AAAAA0000A1Z5”), Hash(“PAN:XYZRN1234A”), + Hash(“UIDAI:123412341234”) (in this order of availability of + documents. " entity_name\n": - required: true + required: false type: String - owner: BPP + owner: Publisher usage: Gupta krishna Stores - description: Describes the name of the seller + description: >- + Name of the seller (note, uniqueness is determined by `entity_id` + field) " ratingType\n": required: true - type: String - owner: BPP + type: ENUM + owner: Publisher usage: Overall - description: Describes the type of rating like overall or just the delivery + description: 'What is rated in this event: overall experience or just the delivery' " countOfTxn\n": required: true type: Integer - owner: BPP + owner: Publisher usage: 100 - description: Describes the total number of transactions + description: total number of rating transactions " totalRating\n": required: true - type: Integer - owner: BPP + type: Number + owner: Publisher usage: 200 - description: Describes the total rating + description: >- + total rating value (each rating transaction is done on the scale of + 0-5) + context: + location: + country: + code: + required: mandatory + type: string + owner: Provider + usage: IND + description: Describes country code as per ISO 3166-1 and ISO 3166-2 format + timestamp: + required: mandatory + type: string + owner: Provider + usage: '2023-03-23T04:41:16Z' + description: Describes tme of request generation in RFC3339 format + publisher_id: + required: mandatory + type: string + owner: Provider + usage: api.example-publisher.com + description: Describes subscriber ID of the Publisher + transaction_id: + required: mandatory + type: string + owner: Provider + usage: 6743e9e2 + description: Describes a unique value which persists across all API calls + message_id: + required: mandatory + type: string + owner: Provider + usage: 13ba8018f176 + description: >- + Describes a unique value which persists during a request / callback + cycle. + version: + required: mandatory + type: integer + owner: Provider + usage: 1.0.0 + description: Describes the version of transaction protocol being used by the sender. + action: + required: mandatory + type: string + owner: Provider + usage: publish + description: >- + Describes the method being called by the sender and executed at the + receiver. + publisher_uri: + required: mandatory + type: string + owner: Provider + usage: https://api.example-publisher.com/pilot/rating/v1 + description: >- + Describes subscriber URL of the Publisher for accepting requests from + Providers. + ttl: + required: mandatory + type: string + owner: Provider + usage: PT30S + description: >- + Describes the duration in ISO8601 format after timestamp for which this + message holds valid + provider_uri: + required: mandatory + type: string + owner: Provider + usage: https://api.example-provider.com/pilot/rating/v1 + description: >- + Describes subscriber URL of the Provider for accepting callbacks from + Publishers. + provider_id: + required: mandatory + type: string + owner: Provider + usage: api.example-provider.com + description: Describes subscriber ID of the Provider on_publish: message: status: required: true type: Boolean - owner: BPP + owner: Publisher usage: true description: Describes the status of the publish + context: + location: + country: + code: + required: mandatory + type: string + owner: Provider + usage: IND + description: Describes country code as per ISO 3166-1 and ISO 3166-2 format + timestamp: + required: mandatory + type: string + owner: Provider + usage: '2023-03-23T04:41:16Z' + description: Describes tme of request generation in RFC3339 format + publisher_id: + required: mandatory + type: string + owner: Provider + usage: api.example-publisher.com + description: Describes subscriber ID of the Publisher + transaction_id: + required: mandatory + type: string + owner: Provider + usage: 6743e9e2 + description: Describes a unique value which persists across all API calls + message_id: + required: mandatory + type: string + owner: Provider + usage: 13ba8018f176 + description: >- + Describes a unique value which persists during a request / callback + cycle. + version: + required: mandatory + type: integer + owner: Provider + usage: 1.0.0 + description: Describes the version of transaction protocol being used by the sender. + action: + required: mandatory + type: string + owner: Provider + usage: on_publish + description: >- + Describes the method being called by the sender and executed at the + receiver. + publisher_uri: + required: mandatory + type: string + owner: Provider + usage: https://api.example-publisher.com/pilot/rating/v1 + description: >- + Describes subscriber URL of the Publisher for accepting requests from + Providers. + ttl: + required: mandatory + type: string + owner: Provider + usage: PT30S + description: >- + Describes the duration in ISO8601 format after timestamp for which this + message holds valid + provider_uri: + required: mandatory + type: string + owner: Provider + usage: https://api.example-provider.com/pilot/rating/v1 + description: >- + Describes subscriber URL of the Provider for accepting callbacks from + Publishers. + provider_id: + required: mandatory + type: string + owner: Provider + usage: api.example-provider.com + description: Describes subscriber ID of the Provider revise: message: rating: - " ratingType\n": + " entity_id\n": required: true type: String - owner: BPP + owner: Publisher + usage: a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa + description: >- + Provides Persistent ID of the seller / entity, where this is generated + based on the below formula. Hash(PREFIX:), Example: + Hash(“GSTIN:22AAAAA0000A1Z5”), Hash(“PAN:XYZRN1234A”), + Hash(“UIDAI:123412341234”) (in this order of availability of + documents. + " ratingType\n": + required: true + type: ENUM + owner: Publisher usage: Overall - description: Describes the type of rating like overall or just the delivery + description: 'What is revised in this event: overall experience or just the delivery' " countOfTxn\n": required: true type: Integer - owner: BPP + owner: Publisher usage: 100 - description: Describes the total number of transactions + description: total number of rating transactions " totalRating\n": required: true - type: Integer - owner: BPP - usage: 300 - description: Describes the total rating + type: Number + owner: Publisher + usage: 200 + description: >- + total rating value (each rating transaction is done on the scale of + 0-5) + context: + location: + country: + code: + required: mandatory + type: string + owner: Provider + usage: IND + description: Describes country code as per ISO 3166-1 and ISO 3166-2 format + timestamp: + required: mandatory + type: string + owner: Provider + usage: '2023-03-23T04:41:16Z' + description: Describes tme of request generation in RFC3339 format + publisher_id: + required: mandatory + type: string + owner: Provider + usage: api.example-publisher.com + description: Describes subscriber ID of the Publisher transaction_id: - required: true - type: String - owner: BPP - usage: 30222f89-383f-42af-bde0-6150a4f146a2 - description: Describes the transaction ID + required: mandatory + type: string + owner: Provider + usage: 6743e9e2 + description: Describes a unique value which persists across all API calls + message_id: + required: mandatory + type: string + owner: Provider + usage: 13ba8018f176 + description: >- + Describes a unique value which persists during a request / callback + cycle. + version: + required: mandatory + type: integer + owner: Provider + usage: 1.0.0 + description: Describes the version of transaction protocol being used by the sender. + action: + required: mandatory + type: string + owner: Provider + usage: revise + description: >- + Describes the method being called by the sender and executed at the + receiver. + publisher_uri: + required: mandatory + type: string + owner: Provider + usage: https://api.example-publisher.com/pilot/rating/v1 + description: >- + Describes subscriber URL of the Publisher for accepting requests from + Providers. + ttl: + required: mandatory + type: string + owner: Provider + usage: PT30S + description: >- + Describes the duration in ISO8601 format after timestamp for which this + message holds valid + provider_uri: + required: mandatory + type: string + owner: Provider + usage: https://api.example-provider.com/pilot/rating/v1 + description: >- + Describes subscriber URL of the Provider for accepting callbacks from + Publishers. + provider_id: + required: mandatory + type: string + owner: Provider + usage: api.example-provider.com + description: Describes subscriber ID of the Provider on_revise: message: status: required: true type: Boolean - owner: BPP + owner: Publisher usage: true description: Describes the status of the publish + context: + location: + country: + code: + required: mandatory + type: string + owner: Provider + usage: IND + description: Describes country code as per ISO 3166-1 and ISO 3166-2 format + timestamp: + required: mandatory + type: string + owner: Provider + usage: '2023-03-23T04:41:16Z' + description: Describes tme of request generation in RFC3339 format + publisher_id: + required: mandatory + type: string + owner: Provider + usage: api.example-publisher.com + description: Describes subscriber ID of the Publisher + transaction_id: + required: mandatory + type: string + owner: Provider + usage: 6743e9e2 + description: Describes a unique value which persists across all API calls + message_id: + required: mandatory + type: string + owner: Provider + usage: 13ba8018f176 + description: >- + Describes a unique value which persists during a request / callback + cycle. + version: + required: mandatory + type: integer + owner: Provider + usage: 1.0.0 + description: Describes the version of transaction protocol being used by the sender. + action: + required: mandatory + type: string + owner: Provider + usage: on_revise + description: >- + Describes the method being called by the sender and executed at the + receiver. + publisher_uri: + required: mandatory + type: string + owner: Provider + usage: https://api.example-publisher.com/pilot/rating/v1 + description: >- + Describes subscriber URL of the Publisher for accepting requests from + Providers. + ttl: + required: mandatory + type: string + owner: Provider + usage: PT30S + description: >- + Describes the duration in ISO8601 format after timestamp for which this + message holds valid + provider_uri: + required: mandatory + type: string + owner: Provider + usage: https://api.example-provider.com/pilot/rating/v1 + description: >- + Describes subscriber URL of the Provider for accepting callbacks from + Publishers. + provider_id: + required: mandatory + type: string + owner: Provider + usage: api.example-provider.com + description: Describes subscriber ID of the Provider query: message: ' entity_list': "entity_id\n": required: true type: String - owner: BPP + owner: Publisher usage: a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa - description: Describes the entity ID + description: >- + Provides Persistent ID of the seller / entity, where this is generated + based on the below formula. Hash(PREFIX:), Example: + Hash(“GSTIN:22AAAAA0000A1Z5”), Hash(“PAN:XYZRN1234A”), + Hash(“UIDAI:123412341234”) (in this order of availability of + documents. " ratingType\n\n": required: true - type: String - owner: BPP + type: Enum + owner: Publisher usage: Overall description: Describes the type of rating like overall or just the delivery + context: + location: + country: + code: + required: mandatory + type: string + owner: Provider + usage: IND + description: Describes country code as per ISO 3166-1 and ISO 3166-2 format + timestamp: + required: mandatory + type: string + owner: Provider + usage: '2023-03-23T04:41:16Z' + description: Describes tme of request generation in RFC3339 format + publisher_id: + required: mandatory + type: string + owner: Provider + usage: api.example-publisher.com + description: Describes subscriber ID of the Publisher + transaction_id: + required: mandatory + type: string + owner: Provider + usage: 6743e9e2 + description: Describes a unique value which persists across all API calls + message_id: + required: mandatory + type: string + owner: Provider + usage: 13ba8018f176 + description: >- + Describes a unique value which persists during a request / callback + cycle. + version: + required: mandatory + type: integer + owner: Provider + usage: 1.0.0 + description: Describes the version of transaction protocol being used by the sender. + action: + required: mandatory + type: string + owner: Provider + usage: query + description: >- + Describes the method being called by the sender and executed at the + receiver. + publisher_uri: + required: mandatory + type: string + owner: Provider + usage: https://api.example-publisher.com/pilot/rating/v1 + description: >- + Describes subscriber URL of the Publisher for accepting requests from + Providers. + ttl: + required: mandatory + type: string + owner: Provider + usage: PT30S + description: >- + Describes the duration in ISO8601 format after timestamp for which this + message holds valid + provider_uri: + required: mandatory + type: string + owner: Provider + usage: https://api.example-provider.com/pilot/rating/v1 + description: >- + Describes subscriber URL of the Provider for accepting callbacks from + Publishers. + provider_id: + required: mandatory + type: string + owner: Provider + usage: api.example-provider.com + description: Describes subscriber ID of the Provider on_query: message: ' scores': " entity_id\n\n": required: true type: String - owner: BPP + owner: Publisher usage: a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa description: 'Describes the ID of the seller ' " entityName\n": required: true type: String - owner: BPP + owner: Publisher usage: Gupta Krishna Store description: Describes the name of the seller " score\n": required: true type: Number - owner: BPP + owner: Publisher usage: 1.5 description: Describes the aggregate score " totalRating\n": required: true - type: Integer - owner: BPP + type: Number + owner: Publisher usage: 200 description: Describes the total rating " countOfTxn\n": required: true type: Integer - owner: BPP + owner: Publisher usage: 150 description: Describes the total number of transactions + context: + location: + country: + code: + required: mandatory + type: string + owner: Provider + usage: IND + description: Describes country code as per ISO 3166-1 and ISO 3166-2 format + timestamp: + required: mandatory + type: string + owner: Provider + usage: '2023-03-23T04:41:16Z' + description: Describes tme of request generation in RFC3339 format + publisher_id: + required: mandatory + type: string + owner: Provider + usage: api.example-publisher.com + description: Describes subscriber ID of the Publisher + transaction_id: + required: mandatory + type: string + owner: Provider + usage: 6743e9e2 + description: Describes a unique value which persists across all API calls + message_id: + required: mandatory + type: string + owner: Provider + usage: 13ba8018f176 + description: >- + Describes a unique value which persists during a request / callback + cycle. + version: + required: mandatory + type: integer + owner: Provider + usage: 1.0.0 + description: Describes the version of transaction protocol being used by the sender. + action: + required: mandatory + type: string + owner: Provider + usage: on_query + description: >- + Describes the method being called by the sender and executed at the + receiver. + publisher_uri: + required: mandatory + type: string + owner: Provider + usage: https://api.example-publisher.com/pilot/rating/v1 + description: >- + Describes subscriber URL of the Publisher for accepting requests from + Providers. + ttl: + required: mandatory + type: string + owner: Provider + usage: PT30S + description: >- + Describes the duration in ISO8601 format after timestamp for which this + message holds valid + provider_uri: + required: mandatory + type: string + owner: Provider + usage: https://api.example-provider.com/pilot/rating/v1 + description: >- + Describes subscriber URL of the Provider for accepting callbacks from + Publishers. + provider_id: + required: mandatory + type: string + owner: Provider + usage: api.example-provider.com + description: Describes subscriber ID of the Provider diff --git a/docs/api/components/build-attributes.js b/docs/api/components/build-attributes.js index f8d94ec..45177cf 100644 --- a/docs/api/components/build-attributes.js +++ b/docs/api/components/build-attributes.js @@ -4,7 +4,7 @@ const fs = require("fs"); async function buildAttribiutes() { let attributes = {}; - const workSheetsFromBuffer = xlsx.parse(`../../Attributesheet_IGM.xlsx`); + const workSheetsFromBuffer = xlsx.parse(`../../Attributesheet_scoring.xlsx`); for (let i = 0; i < workSheetsFromBuffer.length; i++) { const array = workSheetsFromBuffer[i]; console.log("array",array) diff --git a/docs/api/components/enums/index.yaml b/docs/api/components/enums/index.yaml index 8f454a2..5ce8a2c 100644 --- a/docs/api/components/enums/index.yaml +++ b/docs/api/components/enums/index.yaml @@ -1,21 +1,64 @@ publish: + context: &context + location: + country: + code: + - code: IND + description: Represents the country + reference: + action: + - code: publish + description: Provider app indicate the publish intent + reference: message: &message rating: - entityType: + ratingType: - code: Overall description: Overall Experience - reference: - code: Delivery description: Delivery Experience - reference: revise: + context: + <<: *context + action: + - code: revise + description: Provider app indicate the revise intent + reference: message: *message query: + context: + <<: *context + action: + - code: query + description: Provider app indicate the query intent + reference: message: *message on_query: + context: + <<: *context + action: + - code: on_query + description: Publisher app indicate the on_query intent + reference: message: *message - - \ No newline at end of file + +on_publish: + context: + <<: *context + action: + - code: on_publish + description: Publisher app indicate the on_publish intent + reference: + +on_revise: + context: + <<: *context + action: + - code: on_revise + description: Publisher app indicate the on_revise intent + reference: diff --git a/docs/api/components/examples/score/index.yaml b/docs/api/components/examples/score/index.yaml index dab5251..1e920e9 100644 --- a/docs/api/components/examples/score/index.yaml +++ b/docs/api/components/examples/score/index.yaml @@ -1,37 +1,37 @@ publish: examples: - summary: publish - description: Publish Rating + description: Publish Rating of multiple entities from the provider. value: $ref: "./publish/publish.yaml" on_publish: examples: - summary: on_publish - description: On Publish + description: Update the status of rating publish on ledger. value: $ref: "./on_publish/on_publish.yaml" revise: examples: - summary: revise - description: TBD + description: Revise the previously published rating. value: $ref: "./revise/revise.yaml" on_revise: examples: - summary: on_revise - description: TBD + description: Callback of Revise call to get to know the status of the revise call. value: $ref: "./on_revise/on_revise.yaml" on_query: examples: - summary: on_query - description: TBD + description: Callback of the query, which provides the latest aggregated score of the entity. value: $ref: "./on_query/on_query.yaml" query: examples: - summary: query - description: TBD + description: Initiate the query to get the latest aggregated score of set of entitites. value: $ref: "./query/query.yaml" diff --git a/docs/api/components/examples/score/on_publish/on_publish.yaml b/docs/api/components/examples/score/on_publish/on_publish.yaml index fac8a4c..4edfae9 100644 --- a/docs/api/components/examples/score/on_publish/on_publish.yaml +++ b/docs/api/components/examples/score/on_publish/on_publish.yaml @@ -1,20 +1,18 @@ -{ - "context": { - "domain": "ONDC:NTS12", - "action": "on_publish", - "version": "1.0.0", - "provider_id": "All in One - Market Place", - "provider_uri": "string", - "publisher_id": "bpp_id", - "publisher_uri": "bpp_uri", - "registry_id": "Confidex - Rating Provider Registry's ID", - "transaction_id": "string", - "message_id": "string", - "timestamp": "2021-06-29T10:52:01.620Z", - "ttl": "string", - "location": {"code":"IND"} - }, - "message": { - "status": true - } -} \ No newline at end of file +context: + domain: "ONDC:NTS12" + action: "on_publish" + version: "1.0.0" + provider_id: "All in One - Market Place" + provider_uri: "https://api.example.com/api/rating/v1" + publisher_id: "Rating Publisher on Ledger" + publisher_uri: "https://api.publisher-example.com/api/rating/v1" + registry_id: "Confidex - Rating Provider Registry's ID" + transaction_id: "226c67bd-9aa7-4aef-8d62-c69e3a669ce0" + message_id: "226c67bd-9aa7-4aef-8d62-c69e3a669c10" + timestamp: "2021-06-29T10:52:01.620Z" + ttl: "PT30S" + location: + country: + code: "IND" +message: + status: true diff --git a/docs/api/components/examples/score/on_query/on_query.yaml b/docs/api/components/examples/score/on_query/on_query.yaml index f92d78c..74184d4 100644 --- a/docs/api/components/examples/score/on_query/on_query.yaml +++ b/docs/api/components/examples/score/on_query/on_query.yaml @@ -3,19 +3,21 @@ context: action: "on_query" version: "1.0.0" provider_id: "All in One - Market Place" - provider_uri: "string" - publisher_id: "bpp_id" - publisher_uri: "bpp_uri" + provider_uri: "https://api.example.com/api/rating/v1" + publisher_id: "Rating Publisher on Ledger" + publisher_uri: "https://api.publisher-example.com/api/rating/v1" registry_id: "Confidex - Rating Provider Registry's ID" - transaction_id: "string" - message_id: "string" + transaction_id: "226c67bd-9aa7-4aef-8d62-c69e3a669ce1" + message_id: "226c67bd-9aa7-4aef-8d62-c69e3a669d10" timestamp: "2021-06-29T10:52:01.620Z" - ttl: "string" - location: {"code":"IND"} + ttl: "PT30S" + location: + country: + code: "IND" message: scores: - entity_id: "a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa" - entityName: "string" + entityName: "Gupta Kirana Store" score: 3.7 totalRating: 280 countOfTxn: 73 diff --git a/docs/api/components/examples/score/on_revise/on_revise.yaml b/docs/api/components/examples/score/on_revise/on_revise.yaml index c814ea3..483f53d 100644 --- a/docs/api/components/examples/score/on_revise/on_revise.yaml +++ b/docs/api/components/examples/score/on_revise/on_revise.yaml @@ -3,15 +3,16 @@ context: action: "on_revise" version: "1.0.0" provider_id: "All in One - Market Place" - provider_uri: "string" - publisher_id: "bpp_id" - publisher_uri: "bpp_uri" + provider_uri: "https://api.example.com/api/rating/v1" + publisher_id: "Rating Publisher on Ledger" + publisher_uri: "https://api.publisher-example.com/api/rating/v1" registry_id: "Confidex - Rating Provider Registry's ID" - transaction_id: "string" - message_id: "string" + transaction_id: "226c67bd-9aa7-4aef-8d62-c69e3a669ce0" + message_id: "226c67bd-9aa7-4aef-8d62-c69e3a669c11" timestamp: "2021-06-29T10:52:01.620Z" - ttl: "string" - location: {"code":"IND"} + ttl: "PT30S" + location: + country: + code: "IND" message: status: true - diff --git a/docs/api/components/examples/score/publish/publish.yaml b/docs/api/components/examples/score/publish/publish.yaml index 0717563..1b5a287 100644 --- a/docs/api/components/examples/score/publish/publish.yaml +++ b/docs/api/components/examples/score/publish/publish.yaml @@ -3,15 +3,17 @@ context: action: "publish" version: "1.0.0" provider_id: "All in One - Market Place" - provider_uri: "string" - publisher_id: "bpp_id" - publisher_uri: "bpp_uri" + provider_uri: "https://api.example.com/api/rating/v1" + publisher_id: "Rating Publisher on Ledger" + publisher_uri: "https://api.publisher-example.com/api/rating/v1" registry_id: "Confidex - Rating Provider Registry's ID" - transaction_id: "string" - message_id: "string" + transaction_id: "226c67bd-9aa7-4aef-8d62-c69e3a669ce0" + message_id: "226c67bd-9aa7-4aef-8d62-c69e3a669c10" timestamp: "2021-06-29T10:52:01.620Z" - ttl: "string" - location: { "code":"IND" } + ttl: "PT30S" + location: + country: + code: "IND" message: rating: - entity_id: "a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa" diff --git a/docs/api/components/examples/score/query/query.yaml b/docs/api/components/examples/score/query/query.yaml index c264315..43a0413 100644 --- a/docs/api/components/examples/score/query/query.yaml +++ b/docs/api/components/examples/score/query/query.yaml @@ -1,17 +1,19 @@ context: domain: "ONDC:NTS12" - action: "query" + action: "publish" version: "1.0.0" provider_id: "All in One - Market Place" - provider_uri: "string" - publisher_id: "bpp_id" - publisher_uri: "bpp_uri" + provider_uri: "https://api.example.com/api/rating/v1" + publisher_id: "Rating Publisher on Ledger" + publisher_uri: "https://api.publisher-example.com/api/rating/v1" registry_id: "Confidex - Rating Provider Registry's ID" - transaction_id: "string" - message_id: "string" + transaction_id: "226c67bd-9aa7-4aef-8d62-c69e3a669ce1" + message_id: "226c67bd-9aa7-4aef-8d62-c69e3a669d10" timestamp: "2021-06-29T10:52:01.620Z" - ttl: "string" - location: {"code":"IND"} + ttl: "PT30S" + location: + country: + code: "IND" message: entity_list: - entity_id: "a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa" diff --git a/docs/api/components/examples/score/revise/revise.yaml b/docs/api/components/examples/score/revise/revise.yaml index 69df408..aea6e86 100644 --- a/docs/api/components/examples/score/revise/revise.yaml +++ b/docs/api/components/examples/score/revise/revise.yaml @@ -3,19 +3,20 @@ context: action: "revise" version: "1.0.0" provider_id: "All in One - Market Place" - provider_uri: "string" - publisher_id: "bpp_id" - publisher_uri: "bpp_uri" + provider_uri: "https://api.example.com/api/rating/v1" + publisher_id: "Rating Publisher on Ledger" + publisher_uri: "https://api.publisher-example.com/api/rating/v1" registry_id: "Confidex - Rating Provider Registry's ID" - transaction_id: "string" - message_id: "string" + transaction_id: "226c67bd-9aa7-4aef-8d62-c69e3a669ce0" + message_id: "226c67bd-9aa7-4aef-8d62-c69e3a669c11" timestamp: "2021-06-29T10:52:01.620Z" - ttl: "string" - location: {"code":"IND"} - + ttl: "PT30S" + location: + country: + code: "IND" message: rating: - - ratingType: "Overall" + - entity_id: "a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa" + ratingType: "Overall" countOfTxn: 80 totalRating: 280 - transaction_id: "string" diff --git a/docs/api/components/rating_yaml.yaml b/docs/api/components/rating_yaml.yaml index 20befc7..c43be07 100644 --- a/docs/api/components/rating_yaml.yaml +++ b/docs/api/components/rating_yaml.yaml @@ -10,7 +10,7 @@ paths: post: tags: - "Rating API Server" - description: "Publish the ratings to the chain, for the given transaction / message ID" + description: "Publish the ratings to the chain, for the entity with given transaction / message ID " operationId: "publishRatings" requestBody: description: "Write the ratings to the chain. Notice that this can take 1 or more entries from the NP (Network Participant) and submit it to the API (which inturn will write to the chain)." @@ -61,7 +61,7 @@ paths: post: tags: - "Rating API Client (NP)" - description: "Callback of the revise operation on the chain." + description: "update the status of the revise operation on the chain." operationId: "onReviseRating" requestBody: description: "update the ratings" @@ -218,70 +218,6 @@ components: - text/plain - text/html - application/json - Tag: - description: >- - Describes a tag. This is used to contain extended metadata. This object - can be added as a property to any schema to describe extended - attributes. For BAPs, tags can be sent during search to optimize and - filter search results. BPPs can use tags to index their catalog to allow - better search functionality. Tags are sent by the BPP as part of the - catalog response in the `on_search` callback. Tags are also meant for - display purposes. Upon receiving a tag, BAPs are meant to render them as - name-value pairs. This is particularly useful when rendering tabular - information about a product or service. - type: object - additionalProperties: false - properties: - descriptor: - description: Description of the Tag, can be used to store detailed information. - allOf: - - $ref: '#/components/schemas/Descriptor' - value: - description: >- - The value of the tag. This set by the BPP and rendered as-is by the - BAP. - type: string - display: - description: >- - This value indicates if the tag is intended for display purposes. If - set to `true`, then this tag must be displayed. If it is set to - `false`, it should not be displayed. This value can override the - group display value. - type: boolean - TagGroup: - description: >- - A collection of tag objects with group level attributes. For detailed - documentation on the Tags and Tag Groups schema go to - https://github.com/beckn/protocol-specifications/discussions/316 - type: object - additionalProperties: false - properties: - display: - description: >- - Indicates the display properties of the tag group. If display is set - to false, then the group will not be displayed. If it is set to - true, it should be displayed. However, group-level display - properties can be overridden by individual tag-level display - property. As this schema is purely for catalog display purposes, it - is not recommended to send this value during search. - type: boolean - default: true - descriptor: - description: >- - Description of the TagGroup, can be used to store detailed - information. - allOf: - - $ref: '#/components/schemas/Descriptor' - list: - description: >- - An array of Tag objects listed under this group. This property can - be set by BAPs during search to narrow the `search` and achieve more - relevant results. When received during `on_search`, BAPs must render - this list under the heading described by the `name` property of this - schema. - type: array - items: - $ref: '#/components/schemas/Tag' OnPublishResult_20x: type: "object" @@ -289,14 +225,6 @@ components: status: type: "boolean" example: "true" - did: - type: "string" - example: "did:cord:3vYxCfRTWVJM8WYP39KFs2FMtpfBTmSjMexRnqeLbf5dmVQF" - message_id: - type: "string" - referenceId: - type: "string" - example: "rating:cord:r35tLfL1ouJhXLGqnGM4rK9hCM5RQrpjNN47KZ8cEBQbdoKtn" PublishRating: type: "object" @@ -318,14 +246,6 @@ components: status: type: "boolean" example: "true" - did: - type: "string" - example: "did:cord:3vYxCfRTWVJM8WYP39KFs2FMtpfBTmSjMexRnqeLbf5dmVQF" - message_id: - type: "string" - rating_identifier: - type: "string" - example: "rating:cord:r35tLfL1ouJhXLGqnGM4rK9hCM5RQrpjNN47KZ8cEBQbdoKtn" ReviseRating: type: "object" properties: @@ -356,15 +276,12 @@ components: items: type: "object" properties: - entityUid: + entityId: type: "string" example: "286cf1b1-3e16-448f-b675-3b232e82174d" ratingType: type: "string" example: "Overall" - entityType: - type: "string" - example: "Retail" OnQueryRating: type: "object" properties: @@ -378,7 +295,7 @@ components: items: type: "object" properties: - entityUid: + entityId: type: "string" example: "286cf1b1-3e16-448f-b675-3b232e82174d" entityName: @@ -405,15 +322,18 @@ components: version: type: "string" example: "0.0.1" - provider_uid: + provider_uri: type: "string" - example: "446c67bd-9aa7-4aef-8d62-c69e3a669ce0" + example: "https://api.provider-example.com/api/v1" provider_id: type: "string" example: "All in One - Market Place" - confidex_did: + publisher_uri: + type: "string" + example: "https://api.provider-example.com/api/v1" + publisher_id: type: "string" - example: "did:cord:3vYxCfRTWVJM8WYP39KFs2FMtpfBTmSjMexRnqeLbf5dmVQF" + example: "All in One - Market Place" registry_id: type: "string" example: "Confidex - Rating Provider Registry's ID" @@ -426,10 +346,9 @@ components: timestamp: type: "string" example: "2021-06-29T10:52:01.620Z" - key: - type: "string" ttl: type: "string" + exmple: "PT30S" location: type: "object" example: "currently empty, but can be used in future for different contexts of network" @@ -455,15 +374,12 @@ components: PublishEntry: type: "object" properties: - entity_uid: + entity_id: type: "string" example: "226c67bd-9aa7-4aef-8d62-c69e3a669ce0" - entity_id: + entity_name: type: "string" example: "Gupta Kirana Store" - entityType: - type: "string" - example: "Retail" ratingType: type: "string" example: "Overall" @@ -476,9 +392,12 @@ components: ReviseEntry: type: "object" properties: - entityType: + entity_id: + type: "string" + example: "226c67bd-9aa7-4aef-8d62-c69e3a669ce0" + entity_name: type: "string" - example: "Retail" + example: "Gupta Kirana Store" ratingType: type: "string" example: "Overall" diff --git a/docs/ui/build.js b/docs/ui/build.js index 5225b6f..c4aa1a8 100644 --- a/docs/ui/build.js +++ b/docs/ui/build.js @@ -1 +1 @@ -let build_spec = {"openapi":"3.0.0","info":{"title":"Issue and Grievance Management (IGM) for ONDC","description":"ONDC Issue and Grievance Management (IGM) API Specification","version":"1.0.0"},"security":[{"SubscriberAuth":[]}],"paths":{"/publish":{"post":{"tags":["Rating API Server"],"description":"Publish the ratings to the chain, for the given transaction / message ID","operationId":"publishRatings","requestBody":{"description":"Write the ratings to the chain. Notice that this can take 1 or more entries from the NP (Network Participant) and submit it to the API (which inturn will write to the chain).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishRating"}}},"required":"true"},"responses":{"default":{"$ref":"#/components/schemas/DefaultResponse"}}}},"/on_publish":{"post":{"tags":["Rating API Client (NP)"],"description":"Inform the client about success or failure of the publish rating","operationId":"onPublishRating","requestBody":{"description":"Callback of publish rating operation to the chain. Considering the /publish call will have multiple entries, this can collate all the entries and send the response, upon completion.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnPublishRating"}}},"required":"true"},"responses":{"default":{"$ref":"#/components/schemas/DefaultResponse"}}}},"/revise":{"post":{"tags":["Rating API Server"],"description":"Revise ratings in the chain. This can happen due to 2 reasons. 1 is when the user themself changes the given rating over the period (possible for seller to settle bad rating with the buyer), or some discrepancies are found during the auditing.","operationId":"reviseRatings","requestBody":{"description":"revise the ratings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviseRating"}}},"required":"true"},"responses":{"default":{"$ref":"#/components/schemas/DefaultResponse"}}}},"/on_revise":{"post":{"tags":["Rating API Client (NP)"],"description":"Callback of the revise operation on the chain.","operationId":"onReviseRating","requestBody":{"description":"update the ratings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnReviseRating"}}},"required":"true"},"responses":{"default":{"$ref":"#/components/schemas/DefaultResponse"}}}},"/query":{"post":{"tags":["Rating API Server"],"description":"Read aggregate score, read all given entities ratings, more details based on parameters","operationId":"Query","requestBody":{"description":"query the score","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryRating"}}},"required":"true"},"responses":{"default":{"$ref":"#/components/schemas/DefaultResponse"}}}},"/on_query":{"post":{"tags":["Rating API Client (NP)"],"description":"Response / Callback to the query call","operationId":"onQuery","requestBody":{"description":"query the ratings / score","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnQueryRating"}}},"required":"true"},"responses":{"200":{"description":"Aggregated Score details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/200_Res"}}}},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"SubscriberAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Signature of message body using Collector or Receiver subscriber's signing public key.

Format:

Authorization : Signature keyId=\"{subscriber_id}|{unique_key_id}|{algorithm}\",algorithm=\"ed25519\",created=\"1606970629\",expires=\"1607030629\",headers=\"(created) (expires) digest\",signature=\"Base64(signing string)\""}},"schemas":{"Error":{"description":"Describes an error object","type":"object","properties":{"type":{"type":"string","enum":["CONTEXT-ERROR","CORE-ERROR","DOMAIN-ERROR","POLICY-ERROR","JSON-SCHEMA-ERROR"]}}},"DefaultResponse":{"description":"Acknowledgement of message received after successful validation of schema and signature","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"object","properties":{"ack":{"allOf":[{"$ref":"#/components/schemas/Ack"},{"type":"object"},{"properties":{"status":{"enum":["ACK","NACK"]}}}]}},"required":["ack"]},"error":{"$ref":"#/components/schemas/Error"}},"required":["message"]}}}},"200_Res":{"type":"object","properties":{"ack":{"$ref":"#/components/schemas/Ack"}}},"Ack":{"description":"Describes the acknowledgement sent in response to an API call. If the implementation uses HTTP/S, then Ack must be returned in the same session. Every API call to a BPP must be responded to with an Ack whether the BPP intends to respond with a callback or not. This has one property called `status` that indicates the status of the Acknowledgement.","type":"object","additionalProperties":false,"properties":{"status":{"type":"string","description":"The status of the acknowledgement. If the request passes the validation criteria of the BPP, then this is set to ACK. If a BPP responds with status = `ACK` to a request, it is required to respond with a callback. If the request fails the validation criteria, then this is set to NACK. Additionally, if a BPP does not intend to respond with a callback even after the request meets the validation criteria, it should set this value to `NACK`.","enum":["ACK","NACK"]}}},"Descriptor":{"description":"Physical description of something.","type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"code":{"type":"string"},"short_desc":{"type":"string"},"long_desc":{"type":"string"},"additional_desc":{"type":"object","additionalProperties":false,"properties":{"url":{"type":"string"},"content_type":{"type":"string","enum":["text/plain","text/html","application/json"]}}}}},"Tag":{"description":"Describes a tag. This is used to contain extended metadata. This object can be added as a property to any schema to describe extended attributes. For BAPs, tags can be sent during search to optimize and filter search results. BPPs can use tags to index their catalog to allow better search functionality. Tags are sent by the BPP as part of the catalog response in the `on_search` callback. Tags are also meant for display purposes. Upon receiving a tag, BAPs are meant to render them as name-value pairs. This is particularly useful when rendering tabular information about a product or service.","type":"object","additionalProperties":false,"properties":{"descriptor":{"description":"Description of the Tag, can be used to store detailed information.","allOf":[{"$ref":"#/components/schemas/Descriptor"}]},"value":{"description":"The value of the tag. This set by the BPP and rendered as-is by the BAP.","type":"string"},"display":{"description":"This value indicates if the tag is intended for display purposes. If set to `true`, then this tag must be displayed. If it is set to `false`, it should not be displayed. This value can override the group display value.","type":"boolean"}}},"TagGroup":{"description":"A collection of tag objects with group level attributes. For detailed documentation on the Tags and Tag Groups schema go to https://github.com/beckn/protocol-specifications/discussions/316","type":"object","additionalProperties":false,"properties":{"display":{"description":"Indicates the display properties of the tag group. If display is set to false, then the group will not be displayed. If it is set to true, it should be displayed. However, group-level display properties can be overridden by individual tag-level display property. As this schema is purely for catalog display purposes, it is not recommended to send this value during search.","type":"boolean","default":true},"descriptor":{"description":"Description of the TagGroup, can be used to store detailed information.","allOf":[{"$ref":"#/components/schemas/Descriptor"}]},"list":{"description":"An array of Tag objects listed under this group. This property can be set by BAPs during search to narrow the `search` and achieve more relevant results. When received during `on_search`, BAPs must render this list under the heading described by the `name` property of this schema.","type":"array","items":{"$ref":"#/components/schemas/Tag"}}}},"OnPublishResult_20x":{"type":"object","properties":{"status":{"type":"boolean","example":"true"},"did":{"type":"string","example":"did:cord:3vYxCfRTWVJM8WYP39KFs2FMtpfBTmSjMexRnqeLbf5dmVQF"},"message_id":{"type":"string"},"referenceId":{"type":"string","example":"rating:cord:r35tLfL1ouJhXLGqnGM4rK9hCM5RQrpjNN47KZ8cEBQbdoKtn"}}},"PublishRating":{"type":"object","properties":{"context":{"$ref":"#/components/schemas/Context"},"message":{"$ref":"#/components/schemas/PublishMessage"}}},"OnPublishRating":{"type":"object","properties":{"context":{"$ref":"#/components/schemas/Context"},"message":{"$ref":"#/components/schemas/OnPublishResult_20x"}}},"OnReviseResult_20x":{"type":"object","properties":{"status":{"type":"boolean","example":"true"},"did":{"type":"string","example":"did:cord:3vYxCfRTWVJM8WYP39KFs2FMtpfBTmSjMexRnqeLbf5dmVQF"},"message_id":{"type":"string"},"rating_identifier":{"type":"string","example":"rating:cord:r35tLfL1ouJhXLGqnGM4rK9hCM5RQrpjNN47KZ8cEBQbdoKtn"}}},"ReviseRating":{"type":"object","properties":{"context":{"$ref":"#/components/schemas/Context"},"message":{"$ref":"#/components/schemas/ReviseMessage"}}},"OnReviseRating":{"type":"object","properties":{"context":{"$ref":"#/components/schemas/Context"},"message":{"$ref":"#/components/schemas/OnReviseResult_20x"}}},"QueryRating":{"type":"object","properties":{"context":{"$ref":"#/components/schemas/Context"},"message":{"$ref":"#/components/schemas/QueryMessage"}}},"QueryMessage":{"type":"object","properties":{"entity_list":{"type":"array","items":{"type":"object","properties":{"entityUid":{"type":"string","example":"286cf1b1-3e16-448f-b675-3b232e82174d"},"ratingType":{"type":"string","example":"Overall"},"entityType":{"type":"string","example":"Retail"}}}}}},"OnQueryRating":{"type":"object","properties":{"context":{"$ref":"#/components/schemas/Context"},"message":{"type":"object","properties":{"scores":{"type":"array","items":{"type":"object","properties":{"entityUid":{"type":"string","example":"286cf1b1-3e16-448f-b675-3b232e82174d"},"entityName":{"type":"string"},"score":{"type":"number","example":3.7},"totalRating":{"type":"number","example":280},"countOfTxn":{"type":"number","example":73}}}}}}}},"Context":{"type":"object","properties":{"domain":{"type":"string","example":"seller-rating"},"action":{"type":"string","example":"/on_publish"},"version":{"type":"string","example":"0.0.1"},"provider_uid":{"type":"string","example":"446c67bd-9aa7-4aef-8d62-c69e3a669ce0"},"provider_id":{"type":"string","example":"All in One - Market Place"},"confidex_did":{"type":"string","example":"did:cord:3vYxCfRTWVJM8WYP39KFs2FMtpfBTmSjMexRnqeLbf5dmVQF"},"registry_id":{"type":"string","example":"Confidex - Rating Provider Registry's ID"},"transaction_id":{"description":"The transaction ID to be kept same across revisions","type":"string"},"message_id":{"description":"The message ID is unique to every call, and should be used to match the callback","type":"string"},"timestamp":{"type":"string","example":"2021-06-29T10:52:01.620Z"},"key":{"type":"string"},"ttl":{"type":"string"},"location":{"type":"object","example":"currently empty, but can be used in future for different contexts of network"}}},"PublishMessage":{"type":"object","properties":{"rating":{"description":"List of entity ratings","type":"array","items":{"$ref":"#/components/schemas/PublishEntry"}}}},"ReviseMessage":{"type":"object","properties":{"rating":{"description":"List of entity rating to be revised","type":"array","items":{"$ref":"#/components/schemas/ReviseEntry"}},"referenceId":{"type":"string","example":"rating:cord:r35tLfL1ouJhXLGqnGM4rK9hCM5RQrpjNN47KZ8cEBQbdoKtn"}}},"PublishEntry":{"type":"object","properties":{"entity_uid":{"type":"string","example":"226c67bd-9aa7-4aef-8d62-c69e3a669ce0"},"entity_id":{"type":"string","example":"Gupta Kirana Store"},"entityType":{"type":"string","example":"Retail"},"ratingType":{"type":"string","example":"Overall"},"countOfTxn":{"type":"number","example":"100"},"totalRating":{"type":"number","example":"320"}}},"ReviseEntry":{"type":"object","properties":{"entityType":{"type":"string","example":"Retail"},"ratingType":{"type":"string","example":"Overall"},"countOfTxn":{"type":"number","example":"80"},"totalRating":{"type":"number","example":"280"}}}}},"servers":[{"description":"Staging Network","url":"https://virtserver.swaggerhub.com/ONDC/ONDC-Protocol-Rating/0.0.1"}],"x-enum":{"publish":{"message":{"rating":{"entityType":[{"code":"Overall","description":"Overall Experience","reference":"","list":[{"code":"RATING_COUNT","description":"Number of ratings received for an entity","reference":""}]}]}}}},"x-flows":[{"summary":"Rating Flow","details":[{"description":"Detailed process of Market Place publishing the entry","mermaid":"sequenceDiagram\n participant MARKET PLACE\n participant API\n participant CORD.JS\n participant CONFIDEX\n MARKET PLACE->>API: /publish\n note over MARKET PLACE,API: Sign and send the rating entry\n API->>MARKET PLACE: Ack\n API->>CORD.JS: Signed entry\n CORD.JS->>CORD.JS: Verify and transform entry\n CORD.JS->>API: transformedEntry\n API->>CORD.JS:Call Cord.Score.buildFromRatingProperties\n note over API, CORD.JS: Input: transformedEntry\n CORD.JS->>CONFIDEX: Call register_rating method\n CONFIDEX->>CORD.JS: Extrinsic\n CORD.JS->>API: Extrinsic\n API->>CORD.JS: Cord.Score.dispatchRatingToChain\n note over API,CORD.JS: Input: Extrinsic\n CORD.JS->>CONFIDEX: Anchors the extrinsic to the chain\n CONFIDEX->>CORD.JS: Rating Identifier\n CORD.JS->>API: Rating Identifier\n API->>MARKET PLACE: (/on_publish)Rating Identifier \n MARKET PLACE->>API: ACK"},{"description":"Detailed process of Market Place revising the entry","mermaid":"sequenceDiagram\n participant MARKET PLACE\n participant API\n participant CORD.JS\n participant CONFIDEX\n MARKET PLACE ->> API: /revise \n note over MARKET PLACE, API: Sign and send RatingEntry, Revised Entry\n API->>MARKET PLACE: Ack\n API->>CORD.JS: RatingEntry\n CORD.JS->>CORD.JS: verify and transform entry\n CORD.JS ->> API: transformedEntry\n note over API,CORD.JS: Input: transformedEntry\n API->>CORD.JS: Call Cord.Score.buildFromRevokeRatingProperties\n CORD.JS->>CONFIDEX: Call revoke_rating method\n CONFIDEX->>CORD.JS: Extrinsic\n CORD.JS->>API: Extrinsic\n API->>CORD.JS: Call Cord.Score.dispatchRevokeRatingToChain\n note over API,CORD.JS: Input: Extrinsic\n CORD.JS->>CONFIDEX: Anchors the extrinsic to the chain\n CONFIDEX->>CORD.JS: Rating Identifier\n CORD.JS->>API: Rating Identifier\n\n API->>CORD.JS: revisedEntry\n CORD.JS->>CORD.JS: verify and transform entry\n CORD.JS ->> API: transformedEntry\n\n API->>CORD.JS: Call Cord.Score.buildFromRatingProperties\n note over API,CORD.JS: Input: transformedEntry\n CORD.JS->>CONFIDEX: Call revise_rating method\n CONFIDEX->>CORD.JS: Extrinsic\n CORD.JS->>API: Extrinsic\n API->>CORD.JS: Call Cord.Score.dispatchReviseRatingToChain\n note over API,CORD.JS: Input: Extrinsic\n CORD.JS->>CONFIDEX: Anchors the extrinsic to the chain\n CONFIDEX->>CORD.JS: Rating Identifier\n CORD.JS->>API: Rating Identifier\n API->>MARKET PLACE: (/on_revise) Rating Identifier\n MARKET PLACE->>API: ACK"},{"description":"Detailed process of Market Place querying the entry","mermaid":"sequenceDiagram\n participant MARKET PLACE\n participant API\n participant CORD.JS\n participant CONFIDEX\n MARKET PLACE->>API:/query\n note over MARKET PLACE,API: Input: rating identifier, ScoreRatingTypeOf\n API->>CORD.JS: Call Cord.Score.fetchFromChain()\n CORD.JS->>CONFIDEX: Call api.query.score.aggregateScore()\n CONFIDEX->>CORD.JS: Encoded score\n CORD.JS->>CORD.JS: Decode the encoded score\n CORD.JS->>API: Decoded Score\n API->>MARKET PLACE: (/on_query) Decoded Score\n MARKET PLACE->>API: ACK"}]}],"x-examples":{"score":{"summary":"Rating API Implementation","description":"Rating Example","example_set":{"publish":{"examples":[{"summary":"publish","description":"Publish Rating","value":{"context":{"domain":"ONDC:NTS12","action":"publish","version":"1.0.0","provider_id":"All in One - Market Place","provider_uri":"string","publisher_id":"bpp_id","publisher_uri":"bpp_uri","registry_id":"Confidex - Rating Provider Registry's ID","transaction_id":"string","message_id":"string","timestamp":"2021-06-29T10:52:01.620Z","ttl":"string","location":{"code":"IND"}},"message":{"rating":[{"entity_id":"a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa","entity_name":"Gupta Kirana Store","ratingType":"Overall","countOfTxn":100,"totalRating":320}]}}}]},"on_publish":{"examples":[{"summary":"on_publish","description":"On Publish","value":{"context":{"domain":"ONDC:NTS12","action":"on_publish","version":"1.0.0","provider_id":"All in One - Market Place","provider_uri":"string","publisher_id":"bpp_id","publisher_uri":"bpp_uri","registry_id":"Confidex - Rating Provider Registry's ID","transaction_id":"string","message_id":"string","timestamp":"2021-06-29T10:52:01.620Z","ttl":"string","location":{"code":"IND"}},"message":{"status":true}}}]},"revise":{"examples":[{"summary":"revise","description":"TBD","value":{"context":{"domain":"ONDC:NTS12","action":"revise","version":"1.0.0","provider_id":"All in One - Market Place","provider_uri":"string","publisher_id":"bpp_id","publisher_uri":"bpp_uri","registry_id":"Confidex - Rating Provider Registry's ID","transaction_id":"string","message_id":"string","timestamp":"2021-06-29T10:52:01.620Z","ttl":"string","location":{"code":"IND"}},"message":{"rating":[{"ratingType":"Overall","countOfTxn":80,"totalRating":280}],"transaction_id":"string"}}}]},"on_revise":{"examples":[{"summary":"on_revise","description":"TBD","value":{"context":{"domain":"ONDC:NTS12","action":"on_revise","version":"1.0.0","provider_id":"All in One - Market Place","provider_uri":"string","publisher_id":"bpp_id","publisher_uri":"bpp_uri","registry_id":"Confidex - Rating Provider Registry's ID","transaction_id":"string","message_id":"string","timestamp":"2021-06-29T10:52:01.620Z","ttl":"string","location":{"code":"IND"}},"message":{"status":true}}}]},"on_query":{"examples":[{"summary":"on_query","description":"TBD","value":{"context":{"domain":"ONDC:NTS12","action":"on_query","version":"1.0.0","provider_id":"All in One - Market Place","provider_uri":"string","publisher_id":"bpp_id","publisher_uri":"bpp_uri","registry_id":"Confidex - Rating Provider Registry's ID","transaction_id":"string","message_id":"string","timestamp":"2021-06-29T10:52:01.620Z","ttl":"string","location":{"code":"IND"}},"message":{"scores":[{"entity_id":"a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa","entityName":"string","score":3.7,"totalRating":280,"countOfTxn":73}]}}}]},"query":{"examples":[{"summary":"query","description":"TBD","value":{"context":{"domain":"ONDC:NTS12","action":"query","version":"1.0.0","provider_id":"All in One - Market Place","provider_uri":"string","publisher_id":"bpp_id","publisher_uri":"bpp_uri","registry_id":"Confidex - Rating Provider Registry's ID","transaction_id":"string","message_id":"string","timestamp":"2021-06-29T10:52:01.620Z","ttl":"string","location":{"code":"IND"}},"message":{"entity_list":[{"entity_id":"a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa","ratingType":"Overall"}]}}}]}}}},"x-attributes":{"rating":{"attribute_set":{"publish":{"message":{"rating":{" entity_id\n":{"required":true,"type":"String","owner":"BPP","usage":"a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa","description":"Describes the ID of the seller "}," entity_name\n":{"required":true,"type":"String","owner":"BPP","usage":"Gupta krishna Stores","description":"Describes the name of the seller"}," ratingType\n":{"required":true,"type":"String","owner":"BPP","usage":"Overall","description":"Describes the type of rating like overall or just the delivery"}," countOfTxn\n":{"required":true,"type":"Integer","owner":"BPP","usage":100,"description":"Describes the total number of transactions"}," totalRating\n":{"required":true,"type":"Integer","owner":"BPP","usage":200,"description":"Describes the total rating"}}}},"on_publish":{"message":{"status":{"required":true,"type":"Boolean","owner":"BPP","usage":true,"description":"Describes the status of the publish"}}},"revise":{"message":{"rating":{" ratingType\n":{"required":true,"type":"String","owner":"BPP","usage":"Overall","description":"Describes the type of rating like overall or just the delivery"}," countOfTxn\n":{"required":true,"type":"Integer","owner":"BPP","usage":100,"description":"Describes the total number of transactions"}," totalRating\n":{"required":true,"type":"Integer","owner":"BPP","usage":300,"description":"Describes the total rating"}},"transaction_id":{"required":true,"type":"String","owner":"BPP","usage":"30222f89-383f-42af-bde0-6150a4f146a2","description":"Describes the transaction ID"}}},"on_revise":{"message":{"status":{"required":true,"type":"Boolean","owner":"BPP","usage":true,"description":"Describes the status of the publish"}}},"query":{"message":{" entity_list":{"entity_id\n":{"required":true,"type":"String","owner":"BPP","usage":"a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa","description":"Describes the entity ID"}," ratingType\n\n":{"required":true,"type":"String","owner":"BPP","usage":"Overall","description":"Describes the type of rating like overall or just the delivery"}}}},"on_query":{"message":{" scores":{" entity_id\n\n":{"required":true,"type":"String","owner":"BPP","usage":"a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa","description":"Describes the ID of the seller "}," entityName\n":{"required":true,"type":"String","owner":"BPP","usage":"Gupta Krishna Store","description":"Describes the name of the seller"}," score\n":{"required":true,"type":"Number","owner":"BPP","usage":1.5,"description":"Describes the aggregate score"}," totalRating\n":{"required":true,"type":"Integer","owner":"BPP","usage":200,"description":"Describes the total rating"}," countOfTxn\n":{"required":true,"type":"Integer","owner":"BPP","usage":150,"description":"Describes the total number of transactions"}}}}}}}} \ No newline at end of file +let build_spec = {"openapi":"3.0.0","info":{"title":"Issue and Grievance Management (IGM) for ONDC","description":"ONDC Issue and Grievance Management (IGM) API Specification","version":"1.0.0"},"security":[{"SubscriberAuth":[]}],"paths":{"/publish":{"post":{"tags":["Rating API Server"],"description":"Publish the ratings to the chain, for the entity with given transaction / message ID ","operationId":"publishRatings","requestBody":{"description":"Write the ratings to the chain. Notice that this can take 1 or more entries from the NP (Network Participant) and submit it to the API (which inturn will write to the chain).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishRating"}}},"required":"true"},"responses":{"default":{"$ref":"#/components/schemas/DefaultResponse"}}}},"/on_publish":{"post":{"tags":["Rating API Client (NP)"],"description":"Inform the client about success or failure of the publish rating","operationId":"onPublishRating","requestBody":{"description":"Callback of publish rating operation to the chain. Considering the /publish call will have multiple entries, this can collate all the entries and send the response, upon completion.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnPublishRating"}}},"required":"true"},"responses":{"default":{"$ref":"#/components/schemas/DefaultResponse"}}}},"/revise":{"post":{"tags":["Rating API Server"],"description":"Revise ratings in the chain. This can happen due to 2 reasons. 1 is when the user themself changes the given rating over the period (possible for seller to settle bad rating with the buyer), or some discrepancies are found during the auditing.","operationId":"reviseRatings","requestBody":{"description":"revise the ratings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviseRating"}}},"required":"true"},"responses":{"default":{"$ref":"#/components/schemas/DefaultResponse"}}}},"/on_revise":{"post":{"tags":["Rating API Client (NP)"],"description":"update the status of the revise operation on the chain.","operationId":"onReviseRating","requestBody":{"description":"update the ratings","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnReviseRating"}}},"required":"true"},"responses":{"default":{"$ref":"#/components/schemas/DefaultResponse"}}}},"/query":{"post":{"tags":["Rating API Server"],"description":"Read aggregate score, read all given entities ratings, more details based on parameters","operationId":"Query","requestBody":{"description":"query the score","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryRating"}}},"required":"true"},"responses":{"default":{"$ref":"#/components/schemas/DefaultResponse"}}}},"/on_query":{"post":{"tags":["Rating API Client (NP)"],"description":"Response / Callback to the query call","operationId":"onQuery","requestBody":{"description":"query the ratings / score","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnQueryRating"}}},"required":"true"},"responses":{"200":{"description":"Aggregated Score details","content":{"application/json":{"schema":{"$ref":"#/components/schemas/200_Res"}}}},"400":{"description":"Invalid parameters","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"SubscriberAuth":{"type":"apiKey","in":"header","name":"Authorization","description":"Signature of message body using Collector or Receiver subscriber's signing public key.

Format:

Authorization : Signature keyId=\"{subscriber_id}|{unique_key_id}|{algorithm}\",algorithm=\"ed25519\",created=\"1606970629\",expires=\"1607030629\",headers=\"(created) (expires) digest\",signature=\"Base64(signing string)\""}},"schemas":{"Error":{"description":"Describes an error object","type":"object","properties":{"type":{"type":"string","enum":["CONTEXT-ERROR","CORE-ERROR","DOMAIN-ERROR","POLICY-ERROR","JSON-SCHEMA-ERROR"]}}},"DefaultResponse":{"description":"Acknowledgement of message received after successful validation of schema and signature","content":{"application/json":{"schema":{"type":"object","properties":{"message":{"type":"object","properties":{"ack":{"allOf":[{"$ref":"#/components/schemas/Ack"},{"type":"object"},{"properties":{"status":{"enum":["ACK","NACK"]}}}]}},"required":["ack"]},"error":{"$ref":"#/components/schemas/Error"}},"required":["message"]}}}},"200_Res":{"type":"object","properties":{"ack":{"$ref":"#/components/schemas/Ack"}}},"Ack":{"description":"Describes the acknowledgement sent in response to an API call. If the implementation uses HTTP/S, then Ack must be returned in the same session. Every API call to a BPP must be responded to with an Ack whether the BPP intends to respond with a callback or not. This has one property called `status` that indicates the status of the Acknowledgement.","type":"object","additionalProperties":false,"properties":{"status":{"type":"string","description":"The status of the acknowledgement. If the request passes the validation criteria of the BPP, then this is set to ACK. If a BPP responds with status = `ACK` to a request, it is required to respond with a callback. If the request fails the validation criteria, then this is set to NACK. Additionally, if a BPP does not intend to respond with a callback even after the request meets the validation criteria, it should set this value to `NACK`.","enum":["ACK","NACK"]}}},"Descriptor":{"description":"Physical description of something.","type":"object","additionalProperties":false,"properties":{"name":{"type":"string"},"code":{"type":"string"},"short_desc":{"type":"string"},"long_desc":{"type":"string"},"additional_desc":{"type":"object","additionalProperties":false,"properties":{"url":{"type":"string"},"content_type":{"type":"string","enum":["text/plain","text/html","application/json"]}}}}},"OnPublishResult_20x":{"type":"object","properties":{"status":{"type":"boolean","example":"true"}}},"PublishRating":{"type":"object","properties":{"context":{"$ref":"#/components/schemas/Context"},"message":{"$ref":"#/components/schemas/PublishMessage"}}},"OnPublishRating":{"type":"object","properties":{"context":{"$ref":"#/components/schemas/Context"},"message":{"$ref":"#/components/schemas/OnPublishResult_20x"}}},"OnReviseResult_20x":{"type":"object","properties":{"status":{"type":"boolean","example":"true"}}},"ReviseRating":{"type":"object","properties":{"context":{"$ref":"#/components/schemas/Context"},"message":{"$ref":"#/components/schemas/ReviseMessage"}}},"OnReviseRating":{"type":"object","properties":{"context":{"$ref":"#/components/schemas/Context"},"message":{"$ref":"#/components/schemas/OnReviseResult_20x"}}},"QueryRating":{"type":"object","properties":{"context":{"$ref":"#/components/schemas/Context"},"message":{"$ref":"#/components/schemas/QueryMessage"}}},"QueryMessage":{"type":"object","properties":{"entity_list":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","example":"286cf1b1-3e16-448f-b675-3b232e82174d"},"ratingType":{"type":"string","example":"Overall"}}}}}},"OnQueryRating":{"type":"object","properties":{"context":{"$ref":"#/components/schemas/Context"},"message":{"type":"object","properties":{"scores":{"type":"array","items":{"type":"object","properties":{"entityId":{"type":"string","example":"286cf1b1-3e16-448f-b675-3b232e82174d"},"entityName":{"type":"string"},"score":{"type":"number","example":3.7},"totalRating":{"type":"number","example":280},"countOfTxn":{"type":"number","example":73}}}}}}}},"Context":{"type":"object","properties":{"domain":{"type":"string","example":"seller-rating"},"action":{"type":"string","example":"/on_publish"},"version":{"type":"string","example":"0.0.1"},"provider_uri":{"type":"string","example":"https://api.provider-example.com/api/v1"},"provider_id":{"type":"string","example":"All in One - Market Place"},"publisher_uri":{"type":"string","example":"https://api.provider-example.com/api/v1"},"publisher_id":{"type":"string","example":"All in One - Market Place"},"registry_id":{"type":"string","example":"Confidex - Rating Provider Registry's ID"},"transaction_id":{"description":"The transaction ID to be kept same across revisions","type":"string"},"message_id":{"description":"The message ID is unique to every call, and should be used to match the callback","type":"string"},"timestamp":{"type":"string","example":"2021-06-29T10:52:01.620Z"},"ttl":{"type":"string","exmple":"PT30S"},"location":{"type":"object","example":"currently empty, but can be used in future for different contexts of network"}}},"PublishMessage":{"type":"object","properties":{"rating":{"description":"List of entity ratings","type":"array","items":{"$ref":"#/components/schemas/PublishEntry"}}}},"ReviseMessage":{"type":"object","properties":{"rating":{"description":"List of entity rating to be revised","type":"array","items":{"$ref":"#/components/schemas/ReviseEntry"}},"referenceId":{"type":"string","example":"rating:cord:r35tLfL1ouJhXLGqnGM4rK9hCM5RQrpjNN47KZ8cEBQbdoKtn"}}},"PublishEntry":{"type":"object","properties":{"entity_id":{"type":"string","example":"226c67bd-9aa7-4aef-8d62-c69e3a669ce0"},"entity_name":{"type":"string","example":"Gupta Kirana Store"},"ratingType":{"type":"string","example":"Overall"},"countOfTxn":{"type":"number","example":"100"},"totalRating":{"type":"number","example":"320"}}},"ReviseEntry":{"type":"object","properties":{"entity_id":{"type":"string","example":"226c67bd-9aa7-4aef-8d62-c69e3a669ce0"},"entity_name":{"type":"string","example":"Gupta Kirana Store"},"ratingType":{"type":"string","example":"Overall"},"countOfTxn":{"type":"number","example":"80"},"totalRating":{"type":"number","example":"280"}}}}},"servers":[{"description":"Staging Network","url":"https://virtserver.swaggerhub.com/ONDC/ONDC-Protocol-Rating/0.0.1"}],"x-enum":{"publish":{"context":{"location":{"country":{"code":[{"code":"IND","description":"Represents the country","reference":""}]}},"action":[{"code":"publish","description":"Provider app indicate the publish intent","reference":""}]},"message":{"rating":{"ratingType":[{"code":"Overall","description":"Overall Experience","reference":""},{"code":"Delivery","description":"Delivery Experience","reference":""}]}}},"revise":{"context":{"location":{"country":{"code":[{"code":"IND","description":"Represents the country","reference":""}]}},"action":[{"code":"revise","description":"Provider app indicate the revise intent","reference":""}]},"message":{"rating":{"ratingType":[{"code":"Overall","description":"Overall Experience","reference":""},{"code":"Delivery","description":"Delivery Experience","reference":""}]}}},"query":{"context":{"location":{"country":{"code":[{"code":"IND","description":"Represents the country","reference":""}]}},"action":[{"code":"query","description":"Provider app indicate the query intent","reference":""}]},"message":{"rating":{"ratingType":[{"code":"Overall","description":"Overall Experience","reference":""},{"code":"Delivery","description":"Delivery Experience","reference":""}]}}},"on_query":{"context":{"location":{"country":{"code":[{"code":"IND","description":"Represents the country","reference":""}]}},"action":[{"code":"on_query","description":"Publisher app indicate the on_query intent","reference":""}]},"message":{"rating":{"ratingType":[{"code":"Overall","description":"Overall Experience","reference":""},{"code":"Delivery","description":"Delivery Experience","reference":""}]}}},"on_publish":{"context":{"location":{"country":{"code":[{"code":"IND","description":"Represents the country","reference":""}]}},"action":[{"code":"on_publish","description":"Publisher app indicate the on_publish intent","reference":""}]}},"on_revise":{"context":{"location":{"country":{"code":[{"code":"IND","description":"Represents the country","reference":""}]}},"action":[{"code":"on_revise","description":"Publisher app indicate the on_revise intent","reference":""}]}}},"x-tags":{"publish":{"message":{"rating":{"tags":[{"code":"GENERAL_INFO","description":"Describes the general information of the rating like rating, count, entity name","reference":"","list":[{"code":"RATING_COUNT","description":"Number of ratings received for an entity","reference":""}]}]}}}},"x-flows":[{"summary":"Rating Flow","details":[{"description":"Detailed process of Market Place publishing the entry","mermaid":"sequenceDiagram\n participant MARKET PLACE\n participant API\n participant CORD.JS\n participant CONFIDEX\n MARKET PLACE->>API: /publish\n note over MARKET PLACE,API: Sign and send the rating entry\n API->>MARKET PLACE: Ack\n API->>CORD.JS: Signed entry\n CORD.JS->>CORD.JS: Verify and transform entry\n CORD.JS->>API: transformedEntry\n API->>CORD.JS:Call Cord.Score.buildFromRatingProperties\n note over API, CORD.JS: Input: transformedEntry\n CORD.JS->>CONFIDEX: Call register_rating method\n CONFIDEX->>CORD.JS: Extrinsic\n CORD.JS->>API: Extrinsic\n API->>CORD.JS: Cord.Score.dispatchRatingToChain\n note over API,CORD.JS: Input: Extrinsic\n CORD.JS->>CONFIDEX: Anchors the extrinsic to the chain\n CONFIDEX->>CORD.JS: Rating Identifier\n CORD.JS->>API: Rating Identifier\n API->>MARKET PLACE: (/on_publish)Rating Identifier \n MARKET PLACE->>API: ACK"},{"description":"Detailed process of Market Place revising the entry","mermaid":"sequenceDiagram\n participant MARKET PLACE\n participant API\n participant CORD.JS\n participant CONFIDEX\n MARKET PLACE ->> API: /revise \n note over MARKET PLACE, API: Sign and send RatingEntry, Revised Entry\n API->>MARKET PLACE: Ack\n API->>CORD.JS: RatingEntry\n CORD.JS->>CORD.JS: verify and transform entry\n CORD.JS ->> API: transformedEntry\n note over API,CORD.JS: Input: transformedEntry\n API->>CORD.JS: Call Cord.Score.buildFromRevokeRatingProperties\n CORD.JS->>CONFIDEX: Call revoke_rating method\n CONFIDEX->>CORD.JS: Extrinsic\n CORD.JS->>API: Extrinsic\n API->>CORD.JS: Call Cord.Score.dispatchRevokeRatingToChain\n note over API,CORD.JS: Input: Extrinsic\n CORD.JS->>CONFIDEX: Anchors the extrinsic to the chain\n CONFIDEX->>CORD.JS: Rating Identifier\n CORD.JS->>API: Rating Identifier\n\n API->>CORD.JS: revisedEntry\n CORD.JS->>CORD.JS: verify and transform entry\n CORD.JS ->> API: transformedEntry\n\n API->>CORD.JS: Call Cord.Score.buildFromRatingProperties\n note over API,CORD.JS: Input: transformedEntry\n CORD.JS->>CONFIDEX: Call revise_rating method\n CONFIDEX->>CORD.JS: Extrinsic\n CORD.JS->>API: Extrinsic\n API->>CORD.JS: Call Cord.Score.dispatchReviseRatingToChain\n note over API,CORD.JS: Input: Extrinsic\n CORD.JS->>CONFIDEX: Anchors the extrinsic to the chain\n CONFIDEX->>CORD.JS: Rating Identifier\n CORD.JS->>API: Rating Identifier\n API->>MARKET PLACE: (/on_revise) Rating Identifier\n MARKET PLACE->>API: ACK"},{"description":"Detailed process of Market Place querying the entry","mermaid":"sequenceDiagram\n participant MARKET PLACE\n participant API\n participant CORD.JS\n participant CONFIDEX\n MARKET PLACE->>API:/query\n note over MARKET PLACE,API: Input: rating identifier, ScoreRatingTypeOf\n API->>CORD.JS: Call Cord.Score.fetchFromChain()\n CORD.JS->>CONFIDEX: Call api.query.score.aggregateScore()\n CONFIDEX->>CORD.JS: Encoded score\n CORD.JS->>CORD.JS: Decode the encoded score\n CORD.JS->>API: Decoded Score\n API->>MARKET PLACE: (/on_query) Decoded Score\n MARKET PLACE->>API: ACK"}]}],"x-examples":{"score":{"summary":"Rating API Implementation","description":"Rating Example","example_set":{"publish":{"examples":[{"summary":"publish","description":"Publish Rating of multiple entities from the provider.","value":{"context":{"domain":"ONDC:NTS12","action":"publish","version":"1.0.0","provider_id":"All in One - Market Place","provider_uri":"https://api.example.com/api/rating/v1","publisher_id":"Rating Publisher on Ledger","publisher_uri":"https://api.publisher-example.com/api/rating/v1","registry_id":"Confidex - Rating Provider Registry's ID","transaction_id":"226c67bd-9aa7-4aef-8d62-c69e3a669ce0","message_id":"226c67bd-9aa7-4aef-8d62-c69e3a669c10","timestamp":"2021-06-29T10:52:01.620Z","ttl":"PT30S","location":{"country":{"code":"IND"}}},"message":{"rating":[{"entity_id":"a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa","entity_name":"Gupta Kirana Store","ratingType":"Overall","countOfTxn":100,"totalRating":320}]}}}]},"on_publish":{"examples":[{"summary":"on_publish","description":"Update the status of rating publish on ledger.","value":{"context":{"domain":"ONDC:NTS12","action":"on_publish","version":"1.0.0","provider_id":"All in One - Market Place","provider_uri":"https://api.example.com/api/rating/v1","publisher_id":"Rating Publisher on Ledger","publisher_uri":"https://api.publisher-example.com/api/rating/v1","registry_id":"Confidex - Rating Provider Registry's ID","transaction_id":"226c67bd-9aa7-4aef-8d62-c69e3a669ce0","message_id":"226c67bd-9aa7-4aef-8d62-c69e3a669c10","timestamp":"2021-06-29T10:52:01.620Z","ttl":"PT30S","location":{"country":{"code":"IND"}}},"message":{"status":true}}}]},"revise":{"examples":[{"summary":"revise","description":"Revise the previously published rating.","value":{"context":{"domain":"ONDC:NTS12","action":"revise","version":"1.0.0","provider_id":"All in One - Market Place","provider_uri":"https://api.example.com/api/rating/v1","publisher_id":"Rating Publisher on Ledger","publisher_uri":"https://api.publisher-example.com/api/rating/v1","registry_id":"Confidex - Rating Provider Registry's ID","transaction_id":"226c67bd-9aa7-4aef-8d62-c69e3a669ce0","message_id":"226c67bd-9aa7-4aef-8d62-c69e3a669c11","timestamp":"2021-06-29T10:52:01.620Z","ttl":"PT30S","location":{"country":{"code":"IND"}}},"message":{"rating":[{"entity_id":"a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa","ratingType":"Overall","countOfTxn":80,"totalRating":280}]}}}]},"on_revise":{"examples":[{"summary":"on_revise","description":"Callback of Revise call to get to know the status of the revise call.","value":{"context":{"domain":"ONDC:NTS12","action":"on_revise","version":"1.0.0","provider_id":"All in One - Market Place","provider_uri":"https://api.example.com/api/rating/v1","publisher_id":"Rating Publisher on Ledger","publisher_uri":"https://api.publisher-example.com/api/rating/v1","registry_id":"Confidex - Rating Provider Registry's ID","transaction_id":"226c67bd-9aa7-4aef-8d62-c69e3a669ce0","message_id":"226c67bd-9aa7-4aef-8d62-c69e3a669c11","timestamp":"2021-06-29T10:52:01.620Z","ttl":"PT30S","location":{"country":{"code":"IND"}}},"message":{"status":true}}}]},"on_query":{"examples":[{"summary":"on_query","description":"Callback of the query, which provides the latest aggregated score of the entity.","value":{"context":{"domain":"ONDC:NTS12","action":"on_query","version":"1.0.0","provider_id":"All in One - Market Place","provider_uri":"https://api.example.com/api/rating/v1","publisher_id":"Rating Publisher on Ledger","publisher_uri":"https://api.publisher-example.com/api/rating/v1","registry_id":"Confidex - Rating Provider Registry's ID","transaction_id":"226c67bd-9aa7-4aef-8d62-c69e3a669ce1","message_id":"226c67bd-9aa7-4aef-8d62-c69e3a669d10","timestamp":"2021-06-29T10:52:01.620Z","ttl":"PT30S","location":{"country":{"code":"IND"}}},"message":{"scores":[{"entity_id":"a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa","entityName":"Gupta Kirana Store","score":3.7,"totalRating":280,"countOfTxn":73}]}}}]},"query":{"examples":[{"summary":"query","description":"Initiate the query to get the latest aggregated score of set of entitites.","value":{"context":{"domain":"ONDC:NTS12","action":"publish","version":"1.0.0","provider_id":"All in One - Market Place","provider_uri":"https://api.example.com/api/rating/v1","publisher_id":"Rating Publisher on Ledger","publisher_uri":"https://api.publisher-example.com/api/rating/v1","registry_id":"Confidex - Rating Provider Registry's ID","transaction_id":"226c67bd-9aa7-4aef-8d62-c69e3a669ce1","message_id":"226c67bd-9aa7-4aef-8d62-c69e3a669d10","timestamp":"2021-06-29T10:52:01.620Z","ttl":"PT30S","location":{"country":{"code":"IND"}}},"message":{"entity_list":[{"entity_id":"a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa","ratingType":"Overall"}]}}}]}}}},"x-attributes":{"rating":{"attribute_set":{"publish":{"message":{"rating":{" entity_id\n":{"required":true,"type":"String","owner":"Publisher","usage":"a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa","description":"Provides Persistent ID of the seller / entity, where this is generated based on the below formula. Hash(PREFIX:), Example: Hash(“GSTIN:22AAAAA0000A1Z5”), Hash(“PAN:XYZRN1234A”), Hash(“UIDAI:123412341234”) (in this order of availability of documents."}," entity_name\n":{"required":false,"type":"String","owner":"Publisher","usage":"Gupta krishna Stores","description":"Name of the seller (note, uniqueness is determined by `entity_id` field)"}," ratingType\n":{"required":true,"type":"ENUM","owner":"Publisher","usage":"Overall","description":"What is rated in this event: overall experience or just the delivery"}," countOfTxn\n":{"required":true,"type":"Integer","owner":"Publisher","usage":100,"description":"total number of rating transactions"}," totalRating\n":{"required":true,"type":"Number","owner":"Publisher","usage":200,"description":"total rating value (each rating transaction is done on the scale of 0-5)"}}},"context":{"location":{"country":{"code":{"required":"mandatory","type":"string","owner":"Provider","usage":"IND","description":"Describes country code as per ISO 3166-1 and ISO 3166-2 format"}}},"timestamp":{"required":"mandatory","type":"string","owner":"Provider","usage":"2023-03-23T04:41:16Z","description":"Describes tme of request generation in RFC3339 format"},"publisher_id":{"required":"mandatory","type":"string","owner":"Provider","usage":"api.example-publisher.com","description":"Describes subscriber ID of the Publisher"},"transaction_id":{"required":"mandatory","type":"string","owner":"Provider","usage":"6743e9e2","description":"Describes a unique value which persists across all API calls"},"message_id":{"required":"mandatory","type":"string","owner":"Provider","usage":"13ba8018f176","description":"Describes a unique value which persists during a request / callback cycle."},"version":{"required":"mandatory","type":"integer","owner":"Provider","usage":"1.0.0","description":"Describes the version of transaction protocol being used by the sender."},"action":{"required":"mandatory","type":"string","owner":"Provider","usage":"publish","description":"Describes the method being called by the sender and executed at the receiver."},"publisher_uri":{"required":"mandatory","type":"string","owner":"Provider","usage":"https://api.example-publisher.com/pilot/rating/v1","description":"Describes subscriber URL of the Publisher for accepting requests from Providers."},"ttl":{"required":"mandatory","type":"string","owner":"Provider","usage":"PT30S","description":"Describes the duration in ISO8601 format after timestamp for which this message holds valid"},"provider_uri":{"required":"mandatory","type":"string","owner":"Provider","usage":"https://api.example-provider.com/pilot/rating/v1","description":"Describes subscriber URL of the Provider for accepting callbacks from Publishers."},"provider_id":{"required":"mandatory","type":"string","owner":"Provider","usage":"api.example-provider.com","description":"Describes subscriber ID of the Provider"}}},"on_publish":{"message":{"status":{"required":true,"type":"Boolean","owner":"Publisher","usage":true,"description":"Describes the status of the publish"}},"context":{"location":{"country":{"code":{"required":"mandatory","type":"string","owner":"Provider","usage":"IND","description":"Describes country code as per ISO 3166-1 and ISO 3166-2 format"}}},"timestamp":{"required":"mandatory","type":"string","owner":"Provider","usage":"2023-03-23T04:41:16Z","description":"Describes tme of request generation in RFC3339 format"},"publisher_id":{"required":"mandatory","type":"string","owner":"Provider","usage":"api.example-publisher.com","description":"Describes subscriber ID of the Publisher"},"transaction_id":{"required":"mandatory","type":"string","owner":"Provider","usage":"6743e9e2","description":"Describes a unique value which persists across all API calls"},"message_id":{"required":"mandatory","type":"string","owner":"Provider","usage":"13ba8018f176","description":"Describes a unique value which persists during a request / callback cycle."},"version":{"required":"mandatory","type":"integer","owner":"Provider","usage":"1.0.0","description":"Describes the version of transaction protocol being used by the sender."},"action":{"required":"mandatory","type":"string","owner":"Provider","usage":"on_publish","description":"Describes the method being called by the sender and executed at the receiver."},"publisher_uri":{"required":"mandatory","type":"string","owner":"Provider","usage":"https://api.example-publisher.com/pilot/rating/v1","description":"Describes subscriber URL of the Publisher for accepting requests from Providers."},"ttl":{"required":"mandatory","type":"string","owner":"Provider","usage":"PT30S","description":"Describes the duration in ISO8601 format after timestamp for which this message holds valid"},"provider_uri":{"required":"mandatory","type":"string","owner":"Provider","usage":"https://api.example-provider.com/pilot/rating/v1","description":"Describes subscriber URL of the Provider for accepting callbacks from Publishers."},"provider_id":{"required":"mandatory","type":"string","owner":"Provider","usage":"api.example-provider.com","description":"Describes subscriber ID of the Provider"}}},"revise":{"message":{"rating":{" entity_id\n":{"required":true,"type":"String","owner":"Publisher","usage":"a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa","description":"Provides Persistent ID of the seller / entity, where this is generated based on the below formula. Hash(PREFIX:), Example: Hash(“GSTIN:22AAAAA0000A1Z5”), Hash(“PAN:XYZRN1234A”), Hash(“UIDAI:123412341234”) (in this order of availability of documents."}," ratingType\n":{"required":true,"type":"ENUM","owner":"Publisher","usage":"Overall","description":"What is revised in this event: overall experience or just the delivery"}," countOfTxn\n":{"required":true,"type":"Integer","owner":"Publisher","usage":100,"description":"total number of rating transactions"}," totalRating\n":{"required":true,"type":"Number","owner":"Publisher","usage":200,"description":"total rating value (each rating transaction is done on the scale of 0-5)"}}},"context":{"location":{"country":{"code":{"required":"mandatory","type":"string","owner":"Provider","usage":"IND","description":"Describes country code as per ISO 3166-1 and ISO 3166-2 format"}}},"timestamp":{"required":"mandatory","type":"string","owner":"Provider","usage":"2023-03-23T04:41:16Z","description":"Describes tme of request generation in RFC3339 format"},"publisher_id":{"required":"mandatory","type":"string","owner":"Provider","usage":"api.example-publisher.com","description":"Describes subscriber ID of the Publisher"},"transaction_id":{"required":"mandatory","type":"string","owner":"Provider","usage":"6743e9e2","description":"Describes a unique value which persists across all API calls"},"message_id":{"required":"mandatory","type":"string","owner":"Provider","usage":"13ba8018f176","description":"Describes a unique value which persists during a request / callback cycle."},"version":{"required":"mandatory","type":"integer","owner":"Provider","usage":"1.0.0","description":"Describes the version of transaction protocol being used by the sender."},"action":{"required":"mandatory","type":"string","owner":"Provider","usage":"revise","description":"Describes the method being called by the sender and executed at the receiver."},"publisher_uri":{"required":"mandatory","type":"string","owner":"Provider","usage":"https://api.example-publisher.com/pilot/rating/v1","description":"Describes subscriber URL of the Publisher for accepting requests from Providers."},"ttl":{"required":"mandatory","type":"string","owner":"Provider","usage":"PT30S","description":"Describes the duration in ISO8601 format after timestamp for which this message holds valid"},"provider_uri":{"required":"mandatory","type":"string","owner":"Provider","usage":"https://api.example-provider.com/pilot/rating/v1","description":"Describes subscriber URL of the Provider for accepting callbacks from Publishers."},"provider_id":{"required":"mandatory","type":"string","owner":"Provider","usage":"api.example-provider.com","description":"Describes subscriber ID of the Provider"}}},"on_revise":{"message":{"status":{"required":true,"type":"Boolean","owner":"Publisher","usage":true,"description":"Describes the status of the publish"}},"context":{"location":{"country":{"code":{"required":"mandatory","type":"string","owner":"Provider","usage":"IND","description":"Describes country code as per ISO 3166-1 and ISO 3166-2 format"}}},"timestamp":{"required":"mandatory","type":"string","owner":"Provider","usage":"2023-03-23T04:41:16Z","description":"Describes tme of request generation in RFC3339 format"},"publisher_id":{"required":"mandatory","type":"string","owner":"Provider","usage":"api.example-publisher.com","description":"Describes subscriber ID of the Publisher"},"transaction_id":{"required":"mandatory","type":"string","owner":"Provider","usage":"6743e9e2","description":"Describes a unique value which persists across all API calls"},"message_id":{"required":"mandatory","type":"string","owner":"Provider","usage":"13ba8018f176","description":"Describes a unique value which persists during a request / callback cycle."},"version":{"required":"mandatory","type":"integer","owner":"Provider","usage":"1.0.0","description":"Describes the version of transaction protocol being used by the sender."},"action":{"required":"mandatory","type":"string","owner":"Provider","usage":"on_revise","description":"Describes the method being called by the sender and executed at the receiver."},"publisher_uri":{"required":"mandatory","type":"string","owner":"Provider","usage":"https://api.example-publisher.com/pilot/rating/v1","description":"Describes subscriber URL of the Publisher for accepting requests from Providers."},"ttl":{"required":"mandatory","type":"string","owner":"Provider","usage":"PT30S","description":"Describes the duration in ISO8601 format after timestamp for which this message holds valid"},"provider_uri":{"required":"mandatory","type":"string","owner":"Provider","usage":"https://api.example-provider.com/pilot/rating/v1","description":"Describes subscriber URL of the Provider for accepting callbacks from Publishers."},"provider_id":{"required":"mandatory","type":"string","owner":"Provider","usage":"api.example-provider.com","description":"Describes subscriber ID of the Provider"}}},"query":{"message":{" entity_list":{"entity_id\n":{"required":true,"type":"String","owner":"Publisher","usage":"a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa","description":"Provides Persistent ID of the seller / entity, where this is generated based on the below formula. Hash(PREFIX:), Example: Hash(“GSTIN:22AAAAA0000A1Z5”), Hash(“PAN:XYZRN1234A”), Hash(“UIDAI:123412341234”) (in this order of availability of documents."}," ratingType\n\n":{"required":true,"type":"Enum","owner":"Publisher","usage":"Overall","description":"Describes the type of rating like overall or just the delivery"}}},"context":{"location":{"country":{"code":{"required":"mandatory","type":"string","owner":"Provider","usage":"IND","description":"Describes country code as per ISO 3166-1 and ISO 3166-2 format"}}},"timestamp":{"required":"mandatory","type":"string","owner":"Provider","usage":"2023-03-23T04:41:16Z","description":"Describes tme of request generation in RFC3339 format"},"publisher_id":{"required":"mandatory","type":"string","owner":"Provider","usage":"api.example-publisher.com","description":"Describes subscriber ID of the Publisher"},"transaction_id":{"required":"mandatory","type":"string","owner":"Provider","usage":"6743e9e2","description":"Describes a unique value which persists across all API calls"},"message_id":{"required":"mandatory","type":"string","owner":"Provider","usage":"13ba8018f176","description":"Describes a unique value which persists during a request / callback cycle."},"version":{"required":"mandatory","type":"integer","owner":"Provider","usage":"1.0.0","description":"Describes the version of transaction protocol being used by the sender."},"action":{"required":"mandatory","type":"string","owner":"Provider","usage":"query","description":"Describes the method being called by the sender and executed at the receiver."},"publisher_uri":{"required":"mandatory","type":"string","owner":"Provider","usage":"https://api.example-publisher.com/pilot/rating/v1","description":"Describes subscriber URL of the Publisher for accepting requests from Providers."},"ttl":{"required":"mandatory","type":"string","owner":"Provider","usage":"PT30S","description":"Describes the duration in ISO8601 format after timestamp for which this message holds valid"},"provider_uri":{"required":"mandatory","type":"string","owner":"Provider","usage":"https://api.example-provider.com/pilot/rating/v1","description":"Describes subscriber URL of the Provider for accepting callbacks from Publishers."},"provider_id":{"required":"mandatory","type":"string","owner":"Provider","usage":"api.example-provider.com","description":"Describes subscriber ID of the Provider"}}},"on_query":{"message":{" scores":{" entity_id\n\n":{"required":true,"type":"String","owner":"Publisher","usage":"a250a6db99213211f333db7f328085ae277c680d2c7178c4bc65cab9cdab78aa","description":"Describes the ID of the seller "}," entityName\n":{"required":true,"type":"String","owner":"Publisher","usage":"Gupta Krishna Store","description":"Describes the name of the seller"}," score\n":{"required":true,"type":"Number","owner":"Publisher","usage":1.5,"description":"Describes the aggregate score"}," totalRating\n":{"required":true,"type":"Number","owner":"Publisher","usage":200,"description":"Describes the total rating"}," countOfTxn\n":{"required":true,"type":"Integer","owner":"Publisher","usage":150,"description":"Describes the total number of transactions"}}},"context":{"location":{"country":{"code":{"required":"mandatory","type":"string","owner":"Provider","usage":"IND","description":"Describes country code as per ISO 3166-1 and ISO 3166-2 format"}}},"timestamp":{"required":"mandatory","type":"string","owner":"Provider","usage":"2023-03-23T04:41:16Z","description":"Describes tme of request generation in RFC3339 format"},"publisher_id":{"required":"mandatory","type":"string","owner":"Provider","usage":"api.example-publisher.com","description":"Describes subscriber ID of the Publisher"},"transaction_id":{"required":"mandatory","type":"string","owner":"Provider","usage":"6743e9e2","description":"Describes a unique value which persists across all API calls"},"message_id":{"required":"mandatory","type":"string","owner":"Provider","usage":"13ba8018f176","description":"Describes a unique value which persists during a request / callback cycle."},"version":{"required":"mandatory","type":"integer","owner":"Provider","usage":"1.0.0","description":"Describes the version of transaction protocol being used by the sender."},"action":{"required":"mandatory","type":"string","owner":"Provider","usage":"on_query","description":"Describes the method being called by the sender and executed at the receiver."},"publisher_uri":{"required":"mandatory","type":"string","owner":"Provider","usage":"https://api.example-publisher.com/pilot/rating/v1","description":"Describes subscriber URL of the Publisher for accepting requests from Providers."},"ttl":{"required":"mandatory","type":"string","owner":"Provider","usage":"PT30S","description":"Describes the duration in ISO8601 format after timestamp for which this message holds valid"},"provider_uri":{"required":"mandatory","type":"string","owner":"Provider","usage":"https://api.example-provider.com/pilot/rating/v1","description":"Describes subscriber URL of the Provider for accepting callbacks from Publishers."},"provider_id":{"required":"mandatory","type":"string","owner":"Provider","usage":"api.example-provider.com","description":"Describes subscriber ID of the Provider"}}}}}}} \ No newline at end of file