Details
-
Story
-
Status: Closed (View Workflow)
-
P3
-
Resolution: Done
-
None
-
customfield_11100 32103
-
ACQ Sprint 86
-
2
-
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
- defines
-
UXPROD-2168 Editing orders after they have been opened
-
- Closed
-
- has to be done after
-
MODORDSTOR-119 Migrate orders settings from mod-configuration
-
- Closed
-
- has to be done before
-
MODORDERS-281 Need the ability to change poNumber prefix/suffix on Pending orders
-
- Closed
-
-
UIOR-495 Populate poNumberPrefix & poNumberSuffix fields on order creation
-
- Closed
-
-
UIOR-496 Update edit order form and Template to incorporate poNumberPrefix & poNumberSuffix
-
- Closed
-
-
UIOR-497 Prevent deletion of prefix/suffix values that are in use
-
- Closed
-
- relates to
-
UIOR-138 Allow user to edit prefix and suffix for pending order
-
- Closed
-
-
UIOR-491 Cloning a PO and its POL(s)
-
- Closed
-