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

Create pay endpoint for multiple selected accounts

    XMLWordPrintable

Details

    • Story
    • Status: Closed (View Workflow)
    • TBD
    • Resolution: Done
    • None
    • 15.9.0
    • EPAM-Veg Sprint 95, EPAM-Veg Sprint 96, EPAM-Veg Sprint 98, EPAM-Veg Sprint 99
    • 3
    • Vega
    • Q3 2020

    Description

      Feature overview:
      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 "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. After receiving a positive response from BE ("allowed": true), when a user proceeds with the fee/fine action, instead of updating Account and creating FeeFineAction objects directly UI needs to call the new endpoint with the same body.

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

      POST /accounts/multiple/pay
      

      Request body

      {
        "accountIds": [
          "e74d50c9-0c69-4f80-9e1b-a819719fc0c9",
          "983d43fc-2fa8-4eb7-b3e7-30e60159f237"
        ],
        "amount": "3.55",
        "comments": "STAFF : comment for staff \n PATRON : comment for patron",
        "transactionInfo": "check #3456",
        "notifyPatron": true,
        "servicePointId": "7c5abc9f-f3d7-4856-b8d7-6712462ca007",
        "userName": "Folio, James",
        "paymentMethod": "Cash"
      }
      

      BE should take care of updating Account objects and creating new FeeFineAction objects.
      Reponse

      • In case of success:
        Status code: 201
        Response body:
        {
          "accountIds": [
            "e74d50c9-0c69-4f80-9e1b-a819719fc0c9",
            "983d43fc-2fa8-4eb7-b3e7-30e60159f237"
          ],
          "feefineactions": [
            //A list of fee/fine actions created by a bulk action
          ],
          "amount": "3.55"
        }
        
      • 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"
          "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",
          "errorMessage": "Invalid amount entered"
        }
        

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases