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

Create check-waive endpoint for multiple selected accounts

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Closed (View Workflow)
    • Priority: TBD
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 15.9.0
    • Labels:
    • Template:
    • Sprint:
      EPAM-Veg Sprint 95, EPAM-Veg Sprint 98, EPAM-Veg Sprint 99
    • Story Points:
      1
    • Development Team:
      Vega
    • Release:
      Q3 2020

      Description

      This story is part of the fees/fines refactoring feature. Design doc: https://wiki.folio.org/pages/viewpage.action?pageId=36576978

      Currently, calculations for fee/fine actions are happening on FE without any checks on the BE side.

      Instead, when a value is entered in the amount field, an additional call to the new "check" endpoint needs to be made prior to the action in order to check if this value is valid and if the action is allowed.

      New endpoint to be added to the mod-feesfines module:

      POST /accounts-bulk/check-waive
      

      Request body

      {
        "accountIds": [
          "e74d50c9-0c69-4f80-9e1b-a819719fc0c9",
          "983d43fc-2fa8-4eb7-b3e7-30e60159f237"
        ],
        "amount": "3.55"
      }
      

      Reponse

      • In case of success:
        Status code: 200
        Response body:
        {
          "amounts": [
            {
              "accountId": "e74d50c9-0c69-4f80-9e1b-a819719fc0c9",
              "amount": "1.0"
            },
            {
              "accountId": "983d43fc-2fa8-4eb7-b3e7-30e60159f237",
              "amount": "2.55"
            }
          ],
          "allowed": true,
          "amount": "3.55",
          "remainingAmount": "6.45"
        }
        
      • In case if the amount is too high:
        Status code: 422
        Response body:
        {
          "accountIds": [
            "e74d50c9-0c69-4f80-9e1b-a819719fc0c9",
            "983d43fc-2fa8-4eb7-b3e7-30e60159f237"
          ],
          "amount": "3.55",
          "allowed": false,
          "errorMessage": "Requested amount exceeds remaining amount"
        }
        
      • In case of invalid amount value (e.g. negative or not parsable):
        Status code: 422
        Response body:
        {
          "accountIds": [
            "e74d50c9-0c69-4f80-9e1b-a819719fc0c9",
            "983d43fc-2fa8-4eb7-b3e7-30e60159f237"
          ],
          "amount": "abcdefg",
          "allowed": false,
          "errorMessage": "Invalid amount entered"
        }
        

        TestRail: Results

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                hollyolepm Holly Mistlebauer
                Reporter:
                oleksandrkurash Alexander Kurash
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    TestRail: Runs

                      TestRail: Cases