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

Create cancel 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 99
    • 2
    • 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.

      Cancel doesn't have a "check" endpoint, it is triggered directly.

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

      POST /accounts-bulk/cancel
      

      Request body

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

      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 account is not found:
        Status code: 404
        Response body:
        {
          "accountIds": [
            "e74d50c9-0c69-4f80-9e1b-a819719fc0c9",
            "983d43fc-2fa8-4eb7-b3e7-30e60159f237"
          ],
          "amount": "3.55"
          "errorMessage": "Fee/fine was not found"
        }
        

      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