Uploaded image for project: 'mod-feesfines'
  1. mod-feesfines
  2. MODFEE-98

Add UUID regular expression pattern to all id properties in JSON schemas

    XMLWordPrintable

    Details

    • Template:
    • Sprint:
      EPAM-Veg Sprint 121
    • Story Points:
      5
    • Development Team:
      Vega
    • Release:
      R3 2021

      Description

      Please add the standard UUID regular expression pattern to all the id fields in the Fees/Fines module JSON schemas. For example, accountdata.json is defined as the following. There are several id fields, but, none of them have a pattern property.

      {
        "$schema" : "http://json-schema.org/draft-04/schema#",
        "title": "Account schema",
        "description": "User fines/fees account",
        "type": "object",
        "properties": {
          "amount": {
            "description": "Amount of the fine/fee",
            "type": "number"
          },
          "remaining": {
            "description": "Remaining of the fine/fee",
            "type": "number"
          },
          "dateCreated": {
            "description": "Date and time the account of the fine/fee was created",
            "type": "string",
            "format": "date-time"
          },
          "dateUpdated": {
            "description": "Date and time the account of the fine/fee was updated",
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "description": "Overall status of the fee/fine",
            "type": "object",
            "properties": {
              "name": {
                "description": "Name of the status (values used are Open and Closed)",
                "type": "string"
              }
            },
            "required": [
              "name"
            ]
          },
          "paymentStatus": {
            "description": "Overall status of the payment/waive/transfer/refund/cancel",
            "type": "object",
            "properties": {
              "name": {
                "description": "Name of the status (values used are Outstanding, Paid partially, Paid fully, Waived partially, Waived fully, Transferred partially, Transferred fully, Refunded partially, Refunded fully, Cancelled as error)",
                "type": "string"
              }
            },
            "required": [
              "name"
            ]
          },
          "feeFineType": {
            "description": "Fee/fine that is up to the desecration of the user",
            "type": "string"
          },
          "feeFineOwner": {
            "description": "Owner of the fee/fine defined by the library and is associated with specific fees/fines",
            "type": "string"
          },
          "title": {
            "description": "The title associated with the item",
            "type": "string"
          },
          "callNumber": {
            "description": "Identifier (Call number) assigned to an item",
            "type": "string"
          },
          "barcode": {
            "description": "Text, with input likely validated by the barcode scanner",
            "type": "string"
          },
          "materialType": {
            "description": "Material type what define what type of thing the item is",
            "type": "string"
          },
          "itemStatus": {
            "description": "The status of the item",
            "type": "object",
            "properties": {
              "name": {
                "description": "Name of the item state",
                "type": "string"
              }
            },
            "required": [
              "name"
            ]
          },
          "location": {
            "description": "Effective location is used to know the current home location for the item",
            "type": "string"
          },
          "metadata": {
            "description": "Metadata about creation to user fine/fee account, provided by the server",
            "type": "object",
            "$ref" : "raml-util/schemas/metadata.schema"
          },
          "dueDate": {
            "description": "Date time when the item is due to be returned",
            "type": "string",
            "format": "date-time"
          },
          "returnedDate": {
            "description": "Date time when the item is returned and the loan ends, if the user does not have a loan associated, hyphen (-) is added as default",
            "type": "string",
            "format": "date-time"
          },
          "loanId": {
            "description": "ID of the loan",
            "type": "string"
          },
          "userId": {
            "description": "ID of the user",
            "type": "string"
          },
          "itemId": {
            "description": "ID of the item",
            "type": "string"
          },
          "materialTypeId": {
            "description": "ID of the materialType",
            "type": "string"
          },
          "feeFineId": {
            "description": "ID of the feefines",
            "type": "string"
          },
          "ownerId": {
            "description": "ID of the owner",
            "type": "string"
          },
          "id": {
            "description": "User fine/fee account id, UUID",
            "type": "string"
          },
          "holdingsRecordId": {
            "description": "Item field: item.holdingsRecordId",
            "type": "string",
            "readonly": true
          },
          "instanceId": {
            "description": "Holdings record field: holdingsRecord.instanceId",
            "type": "string",
            "readonly": true
          }
        },
        "additionalProperties": false,
        "required": [
          "userId",
          "itemId",
          "materialTypeId",
          "feeFineId",
          "ownerId",
          "id"
         ]
      }
      

      loanId is defined as:

          "loanId": {
            "description": "ID of the loan",
            "type": "string"
          },
      

      It should be defined as:

          "loanId": {
            "description": "ID of the loan",
            "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}$"
          },
      


      Please note that that is not the recommended UUID pattern for FOLIO
      https://dev.folio.org/guides/uuids/
      and note that that document refers to the uuid.schema in the shared raml (i.e. ram-util) repository.

        TestRail: Results

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                mykyta_varenyk Mykyta Varenyk
                Reporter:
                jemiller Jon Miller
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    TestRail: Runs

                      TestRail: Cases