Uploaded image for project: 'mod-orders-storage'
  1. mod-orders-storage
  2. MODORDSTOR-31

Create receiving_history API and schema

    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 53, ACQ Sprint 54
    • Story Points:
      5

      Description

      An API is required for querying receiving history. This is a read-only API that only supports GET by CQL query. The API queries a view that combines piece and parts of the po_line tables.

      Schema Fields:
      (string) id – UUID of this piece
      (string) caption – Volume/enumeration information
      (string) comment – Free form commentary
      (string) item_id – UUID of the item record; Used to obtain barcode, and locationId (via holdingId)
      (string) po_line_id – UUID of po_line
      (string) po_line_number – Human readable identifier for this po_line
      (date-time) received_date – Date received
      (string) receiving_note – A note at the po_line level pertaining to receiving/check-in
      (string) status – [Received | Expected]
      (boolean) supplement – Whether or not this is supplementary material
      (string) title – Title of the instance this po_line is associated with

      View creation (via script to be executed as part of _/tenant endpoint (e.g. similar to the scripts used to insert reference data, etc.

      SELECT pieces.id as id,
             pieces.jsonb ||
             json_build_object(
                    'id', pieces.jsonb->>'id',
                    'po_line_number', po_line->>'po_line_number',
                    'title', po_line.jsonb->>'title',
                    'receiving_note', po_line.jsonb->>'receiving_note'
             ) AS jsonb
      FROM diku_mod_orders_storage.pieces
             LEFT OUTER JOIN diku_mod_orders_storage.po_line 
                    ON (pieces.jsonb -> 'po_line_id') = (po_line.jsonb -> 'id')
      

      Gives: | id (piece) | jsonb | where jsonb looks like the schema defined above.

      Acceptance Criteria:

      • The schema, view and API exist as described above.
      • 80% unit test coverage - may need to call pieces/po_line apis as part of test setup

        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