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

Add poNumberPrefix and poNumberSuffix fields

    XMLWordPrintable

    Details

    • Template:
    • Sprint:
      ACQ Sprint 86
    • Story Points:
      2
    • Development Team:
      Thunderjet

      Description

      Overview

      Several things have surfaced recently that require us to capture and store the poNumber prefix/suffix in the purchase order independent of the poNumber field. This story covers the necessary schema changes.

      • Add "poNumberPrefix" and "poNumberSuffix"
        • String
        • Optional
        • No default

      N.B. Don't forget to update composite_purchase_order.json too

      Data Migration Script Considerations

      In the case of existing orders which were built w/ a prefix/suffix, we need to try and determine the appropriate values and populate the new fields. The ability to do this largely depends on moving the prefix/suffix controlled vocabularies into mod-orders-storage (see MODORDSTOR-119) so that they're accessible from the migration script. Even with this it might not be possible to ALWAYS successfully determine the prefix/suffix. While not ideal it's not a catastrophe. If filters are implemented for prefix/suffix they won't work for these orders, but other aspects of orders will continue to work.

      Here's a rough swag at one possible solution (not tested - pseudo code):

      UPDATE purchase_order SET jsonb->poNumberPrefix = (SELECT jsonb->value FROM prefix p JOIN purchase_order.jsonb ON purchase_order.jsonb->poNumber LIKE (p.jsonb->value || '%') LIMIT 1)

      and similar for suffix...

       ... SET jsonb->poNumberSuffix ... FROM suffix s ... LIKE ('%' || s.jsonb->value) ... 

      While not used above, it might also be helpful to glean information from the poNumber sequence (start and current value).

      Acceptance Criteria

      • schemas and examples are updated
      • unit tests are updated
      • sample data is updated as needed
      • data migration scripts are added

        TestRail: Results

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                siarhei_hrabko Siarhei Hrabko
                Reporter:
                cmcnally Craig McNally
                Tester Assignee:
                Siarhei Hrabko Siarhei Hrabko
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    TestRail: Runs

                      TestRail: Cases