Skip to end of banner
Go to start of banner

Spike: MODKBEKBJ-330 - Associate institution with a user

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

MODKBEKBJ-330 - Getting issue details... STATUS

IN PROGRESS

Goal: Investigate if there is an association between a logged-in user and the institution the user belongs to.



To understand the link between the institution and user, let's visualize table connections 


This tool can not analyze the `jsonb` column, unfortunately, so the next steps require a manual review of schemas.


So, the schema  for `location` contains following properties:

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "A (shelf) location, the forth-level location unit below institution, campus, and library.",
  "type": "object",
  "properties": {
    "id": {
      "description": "id of this (shelf) location record as UUID.",
      "type": "string"
    },
    "name": {
      "description": "Name of the (shelf) location",
      "type": "string"
    },
    "code": {
      "description": "Code of the (shelf) location, usually an abbreviation of the name.",
      "type": "string"
    },
    "description": {
      "description": "Description of the (shelf) location.",
      "type": "string"
    },
    "discoveryDisplayName": {
      "description": "Name of the (shelf) location to be shown in the discovery.",
      "type": "string"
    },
    "isActive": {
      "description": "Whether this (shelf) location is active. Inactive (shelf) locations can no longer been used.",
      "type": "boolean"
    },
    "institutionId": {
      "description": "The UUID of the institution, the first-level location unit, this (shelf) location belongs to.",
      "type": "string"
    },
    "campusId": {
      "description": "The UUID of the campus, the second-level location unit, this (shelf) location belongs to.",
      "type": "string"
    },
    "libraryId": {
      "description": "The UUID of the library, the third-level location unit, this (shelf) location belongs to.",
      "type": "string"
    },
    "details": {
      "description": "Details about this (shelf) location.",
      "type": "object"
    },
    "primaryServicePoint": {
      "description": "The UUID of the primary service point of this (shelf) location.",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
      "type": "string"
    },
    "servicePointIds": {
      "description": "All service points that this (shelf) location has.",
      "type": "array",
      "items": {
        "description": "The UUID of a service point that belongs to this (shelf) location.",
        "type": "string",
        "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$",
        "not": {
          "type": "null"
        }
      }
    },
    "metadata": {
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "name",
    "code",
    "institutionId",
    "campusId",
    "libraryId",
    "primaryServicePoint"
  ]
}

Let's see `servicepointsuser.json`And as we see  the most interesting part from the spike point is `servicePointIds` property, which leads us to two other schemas : `service-point` and `service-point-user`

{
  "$schema": "http://json-schema.org/draft-04/schema#",
  "description": "The list of service points a user is allowed to work at, and the default service point for that user.",
  "type": "object",
  "properties": {
    "id": {
      "description": "The id of record as a UUID.",
      "type": "string"
    },
    "userId": {
      "description": "Id of the user as a UUID.",
      "type": "string"
    },
    "servicePointsIds": {
      "description": "The list of service points a user is allowed to work at.",
      "type": "array",
      "items": {
        "description": "The id of a service point as UUID.",
        "type": "string",
        "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
      }
    },
    "defaultServicePointId": {
      "description": "The id of the user's default service point as UUID.",
      "type": "string",
      "pattern": "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$"
    },
    "metadata": {
      "type": "object",
      "$ref": "raml-util/schemas/metadata.schema",
      "readonly": true
    }
  },
  "additionalProperties": false,
  "required": [
    "userId"
  ]
}

and here we can find an `userId` of user and can say that connection is following:

  • No labels