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

Create POST /orders/po-number/validate endpoint for validating a po_number

    XMLWordPrintable

Details

    • Story
    • Status: Closed (View Workflow)
    • P3
    • Resolution: Done
    • None
    • 2.0.0
    • None
    • ACQ Sprint 54
    • 3

    Description

      Since it is a requirement that users must be able to specify a po_number, we need a way to verify that the value they specify is both valid and unique.

      A valid po_number matches the following regular expression:

      ^[a-zA-Z0-9]{5,16}$
      

      Checking for uniqueness requires making a request to mod-orders-storage. This code will likely be called from elsewhere in mod-orders, so must be visible.

      Acceptance Criteria:

      • POST /orders/po_number/validate is defined (e.g. in RAML/ModuleDescriptor) and implemented (code and schemas)
        • takes an application/json request with a single field "po_number"
        • returns a 204 if valid
        • returns a text/plain response indicating the reason it's not valid (e.g. malformed or not unique) with status 400.
        • returns a 500 if the call to mod-orders-storage failed, along with a text/plain "internal server error" response body.
      • Unit tests
      • Api Tests (positive and negative test cases)

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                cmcnally Craig McNally
                cmcnally Craig McNally
                Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases