Uploaded image for project: 'mod-kb-ebsco-java'
  1. mod-kb-ebsco-java
  2. MODKBEKBJ-391

Update schema for provider/package/resource to include accessTypeId

    XMLWordPrintable

    Details

    • Template:
    • Story Points:
      3
    • Development Team:
      Spitfire

      Description

      Currently, back-end return 'accessType' id property in the "relationships" section like in the following example for resources

      {
        "data": {
          "id": "72-1811932-89054",
          "type": "resources",
          "attributes": {
            "description": "Presents business marketing news, strategy & tactics; emphasizes techniques & methods of advertising & selling products & services to business & industry. All aspects of tools & business marketing are explored, such as audio-visual, video etc.",
            "isPeerReviewed": false,
            "isTitleCustom": false,
            "publisherName": "Crain Communications Incorporated",
            "titleId": 89054,
            "contributors": [],
            "identifiers": [
              {
                "id": "1530-2369",
                "subtype": "Print",
                "type": "ISSN"
              },
              {
                "id": "1944-7752",
                "subtype": "Online",
                "type": "ISSN"
              }
            ],
            "name": "B to B",
            "publicationType": "Journal",
            "subjects": [
              {
                "subject": "Marketing",
                "type": "TLI"
              }
            ],
            "customEmbargoPeriod": {
              "embargoValue": 0
            },
            "isPackageCustom": false,
            "isSelected": false,
            "isTokenNeeded": false,
            "locationId": 15491085,
            "managedEmbargoPeriod": {
              "embargoValue": 0
            },
            "packageId": "72-1811932",
            "packageName": "Access Business News",
            "url": "https://infoweb.newsbank.com/?db=CRUS",
            "providerId": 72,
            "providerName": "NewsBank",
            "visibilityData": {
              "isHidden": false,
              "reason": ""
            },
            "managedCoverages": [
              {
                "beginCoverage": "2003-01-13",
                "endCoverage": "2013-11-18"
              }
            ],
            "customCoverages": [],
            "proxy": {
              "id": "ezproxy",
              "inherited": true
            },
            "tags": {
              "tagList": []
            }
          },
          "relationships": {
            "provider": {
              "data": {
                "type": "providers",
                "id": "72"
              }
            },
            "title": {
              "meta": {
                "included": false
              }
            },
            "package": {
              "data": {
                "type": "packages",
                "id": "72-1811932"
              }
            },
            "accessType": {
              "data": {
                "type": "accessTypes",
                "id": "53628caa-9da6-4876-95e7-3ea484de2248"
              },
              "meta": {
                "included": true
              }
            }
          }
        },
        "included": [
          {
            "id": "72",
            "type": "providers",
            "attributes": {
              "name": "NewsBank",
              "packagesTotal": 91,
              "packagesSelected": 8,
              "supportsCustomPackages": false,
              "proxy": {
                "id": "ezproxy",
                "inherited": true
              }
            },
            "relationships": {
              "packages": {
                "meta": {
                  "included": false
                }
              }
            }
          },
          {
            "id": "72-1811932",
            "type": "packages",
            "attributes": {
              "contentType": "Aggregated Full Text",
              "customCoverage": {
                "beginCoverage": "",
                "endCoverage": ""
              },
              "isCustom": false,
              "isSelected": false,
              "name": "Access Business News",
              "packageId": 1811932,
              "packageType": "Complete",
              "providerId": 72,
              "providerName": "NewsBank",
              "selectedCount": 0,
              "titleCount": 294,
              "visibilityData": {
                "isHidden": false,
                "reason": ""
              },
              "allowKbToAddTitles": false,
              "proxy": {
                "id": "ezproxy",
                "inherited": true
              }
            },
            "relationships": {
              "resources": {
                "data": [],
                "meta": {
                  "included": false
                }
              },
              "provider": {
                "meta": {
                  "included": false
                }
              }
            }
          },
          {
            "id": "53628caa-9da6-4876-95e7-3ea484de2248",
            "type": "accessTypes",
            "attributes": {
              "name": "my local type",
              "description": "ddd"
            },
            "creator": {
              "lastName": "ADMINISTRATOR",
              "firstName": "DIKU"
            },
            "metadata": {
              "createdDate": "2020-03-02T14:48:49.282+0000",
              "createdByUserId": "b7a8b4fb-a641-55b7-98e9-abb1d872fd4f",
              "createdByUsername": "diku_admin",
              "updatedDate": "2020-03-02T14:48:49.282+0000",
              "updatedByUserId": "b7a8b4fb-a641-55b7-98e9-abb1d872fd4f"
            }
          }
        ],
        "jsonapi": {
          "version": "1.0"
        }
      }

      the story is intended to extend existing schema by adding additional property "accessTypeId" into "attributes" section, see the example below

      {
        "data": {
          "id": "72-1811932-89054",
          "type": "resources",
          "attributes": {
            "description": "Presents business marketing news, strategy & tactics; emphasizes techniques & methods of advertising & selling products & services to business & industry. All aspects of tools & business marketing are explored, such as audio-visual, video etc.",
            "isPeerReviewed": false,
            "isTitleCustom": false,
            "publisherName": "Crain Communications Incorporated",
            "titleId": 89054,
            "contributors": [],
            "identifiers": [
              {
                "id": "1530-2369",
                "subtype": "Print",
                "type": "ISSN"
              },
              {
                "id": "1944-7752",
                "subtype": "Online",
                "type": "ISSN"
              }
            ],
            "name": "B to B",
            "publicationType": "Journal",
            "subjects": [
              {
                "subject": "Marketing",
                "type": "TLI"
              }
            ],
            "customEmbargoPeriod": {
              "embargoValue": 0
            },
            "isPackageCustom": false,
            "isSelected": false,
            "isTokenNeeded": false,
            "locationId": 15491085,
            "managedEmbargoPeriod": {
              "embargoValue": 0
            },
            "packageId": "72-1811932",
            "accessTypeId" : "<some_uuid>",
            "packageName": "Access Business News",
            "url": "https://infoweb.newsbank.com/?db=CRUS",
            "providerId": 72,
            "providerName": "NewsBank",
            "visibilityData": {
              "isHidden": false,
              "reason": ""
            },
            "managedCoverages": [
              {
                "beginCoverage": "2003-01-13",
                "endCoverage": "2013-11-18"
              }
            ],
            "customCoverages": [],
            "proxy": {
              "id": "ezproxy",
              "inherited": true
            },
            "tags": {
              "tagList": []
            }
          },
          "relationships": {
            "provider": {
              "data": {
                "type": "providers",
                "id": "72"
              }
            },
            "title": {
              "meta": {
                "included": false
              }
            },
            "package": {
              "data": {
                "type": "packages",
                "id": "72-1811932"
              }
            },
            "accessType": {
              "data": {
                "type": "accessTypes",
                "id": "53628caa-9da6-4876-95e7-3ea484de2248"
              }
            }
          }
        },
        "included": [
          {
            "id": "72",
            "type": "providers",
            "attributes": {
              "name": "NewsBank",
              "packagesTotal": 91,
              "packagesSelected": 8,
              "supportsCustomPackages": false,
              "proxy": {
                "id": "ezproxy",
                "inherited": true
              }
            },
            "relationships": {
              "packages": {
                "meta": {
                  "included": false
                }
              }
            }
          },
          {
            "id": "72-1811932",
            "type": "packages",
            "attributes": {
              "contentType": "Aggregated Full Text",
              "customCoverage": {
                "beginCoverage": "",
                "endCoverage": ""
              },
              "isCustom": false,
              "isSelected": false,
              "name": "Access Business News",
              "packageId": 1811932,
              "packageType": "Complete",
              "providerId": 72,
              "providerName": "NewsBank",
              "selectedCount": 0,
              "titleCount": 294,
              "visibilityData": {
                "isHidden": false,
                "reason": ""
              },
              "allowKbToAddTitles": false,
              "proxy": {
                "id": "ezproxy",
                "inherited": true
              }
            },
            "relationships": {
              "resources": {
                "data": [],
                "meta": {
                  "included": false
                }
              },
              "provider": {
                "meta": {
                  "included": false
                }
              }
            }
          },
          {
            "id": "53628caa-9da6-4876-95e7-3ea484de2248",
            "type": "accessTypes",
            "attributes": {
              "name": "my local type",
              "description": "ddd"
            },
            "creator": {
              "lastName": "ADMINISTRATOR",
              "firstName": "DIKU"
            },
            "metadata": {
              "createdDate": "2020-03-02T14:48:49.282+0000",
              "createdByUserId": "b7a8b4fb-a641-55b7-98e9-abb1d872fd4f",
              "createdByUsername": "diku_admin",
              "updatedDate": "2020-03-02T14:48:49.282+0000",
              "updatedByUserId": "b7a8b4fb-a641-55b7-98e9-abb1d872fd4f"
            }
          }
        ],
        "jsonapi": {
          "version": "1.0"
        }
      }

      please note

      "accessTypeId" : "<some_uuid>",

      added

      Acceptance criteria:

      • modified needed schema(s) for provider
      • modified needed schema(s) for package
      • modified needed schema(s) for resource
      • modified unit tests for entities mentioned above
      • modified API tests for entities mentioned above

      Note:
      please note that, if data exists for "relationships" section, then it is no need to have

      "meta": {
                "included": true
              }
      

        TestRail: Results

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                Unassigned Unassigned
                Reporter:
                Natalia Zaitseva Natalia Zaitseva
                Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    TestRail: Runs

                      TestRail: Cases