Uploaded image for project: 'mod-orders'
  1. mod-orders
  2. MODORDERS-141

Refactor business logic helpers structure to improve code maintainability

    XMLWordPrintable

Details

    • ACQ Sprint 59
    • 3
    • Thunderjet

    Description

      Currently, the business logic is split between endpoint specific helpers which makes it hard to maintain and reuse.

      The agreed solution is to have less granular helpers per business entity/area, for example:

      • PurchaseOrderHelper - contains the logic related to Purchase orders
      • POLineHelper - contains the logic related to PO lines
      • InventoryHelper - contains the logic related to communication with Inventory

      Also, error handling methods which present in each endpoint specific helper look the same.
      This is because of different Response classes per endpoint on which we invoke static methods such as "respond400WithTextPlain" to build the response.
      Possible way to avoid this - by working with Response class directly instead of calling those static methods in which case we may end up with one generic error handling method shared between all endpoints which can reside in the Impl class.

      Acceptance criteria:

      • All business logic is moved to the helpers outlined above
      • Make error handling logic reusable for all endpoints (if possible)
      • If 2nd point is achieved, get rid of endpoint specific helpers. Otherwise keep them for handing of error responses and invoking new helpers

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                siarhei_hrabko Siarhei Hrabko
                pavelk-epam Pavel Korolenok
                Siarhei Hrabko Siarhei Hrabko
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases