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"
- No default
N.B. Don't forget to update composite_purchase_order.json too
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):
and similar for suffix...
While not used above, it might also be helpful to glean information from the poNumber sequence (start and current value).
- schemas and examples are updated
- unit tests are updated
- sample data is updated as needed
- data migration scripts are added