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

    • Type: Story
    • Status: Closed (View Workflow)
    • Priority: P3
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2.0.0
    • Labels:
      None
    • Template:
    • Sprint:
      ACQ Sprint 54
    • Story Points:
      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

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

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    TestRail: Runs

                      TestRail: Cases