Uploaded image for project: 'mod-circulation-storage'
  1. mod-circulation-storage

Implement a Loan Rules web service endpoint



    • Template:



      Filip's loan rule designs: https://www.dropbox.com/s/avjfob96epdo0g4/loan-rules-ux-iteration-4.zip?dl=0
      Video - Filip explaining the loan rule design: https://discuss.folio.org/t/loan-rules-ux-iteration-4/834

      What is a loan policy?
      When a patron checks out an item, FOLIO will invoke a given loan policy that defines what the patron in question is allowed to do with the item in question.

      What does a loan policy contain?
      A loan policy contains information about how items circulate: Loan period, grace period, renewability and more. See CIRCSTORE-7

      How are loan policies applied?
      Loan rules define which loan policy (one only) should be invoked when a given patron tries to check out a given item.

      Loan rule criteria
      There are 4 categories of loan rule criteria:

      • patron group (like "undergrad" or "cataloger")
      • item type (like "book" or "dvd" or "umbrella")
      • shelving location (from the 4 level hierarchy: campus/branch/collection/shelf)
      • loan type of the item (like "rare", "special-items", "temporary-collection-k")

      Loan rules file
      The loan rules are described by some text file having a special syntax. Short example:

      # Setup
      fallback-policy : no-circulation
      priority: t, a, b, c, s, m, g
      # All branches
      m newspaper: policy-c
      m streaming-subscription: policy-c
          g visitor: in-house
          g undergrad: in-house
      m book cd dvd + t special-items : in-house
      # General rules for main and music branch
      a cornell
          m newspaper: policy-d
          t special-items
              g !visitor: policy-d
              g visitor: in-house
      # Exceptions across all branches
      g all + t rare + m all + s all : locked

      Meaning of the single letter criteria names

      • t loan type
      • a campus
      • b branch
      • c collection
      • s shelf
      • m item type
      • g patron group

      Multiple values for a single criterion can be listed separated by space ("m book cd dvd"). Use "all" for all values ("m all"). Use exclamation mark for all but those listed ("m !book !cd !dvd").
      Multiple criteria can be combined in a single line separated by plus ("m book + t rare").
      Multiple criteria can also be combined by indenting in a new line. The criteria of the indented line are added to the criteria of the previous line. See loan rules file example above.
      After the colon is the name of the loan policy.

      Multiple rules might be applicable for a given patron/item combination. To resolve conflicts, a 3-tier logic is used:
      1. Priority of criteria in a rule (higher priority wins; "priority: t, a, b, c, s, m, g" lists the criteria in decreasing priority);
      2. Specificy of a rule (more criteria wins);
      3. Line number of a rule (later line number wins).

        TestRail: Results


            Issue Links



                julianladisch Julian Ladisch
                jakub Jakub Skoczen
                0 Vote for this issue
                2 Start watching this issue



                    TestRail: Runs

                      TestRail: Cases