IN 1127 - Handle missing fund_distribution entries with empty strings #273
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose and background context
PO lines were pulled from Alma where the
fund_distribution
node in the object contained a fund with empty strings for values likeamount.sum
. This threw an error when attemping to convert to aDecimal
.Example from PO line retrieved from Alma:
Default behavior in other situations is to return
$0.00
when a price cannot be determined from the PO line, which will extend to this scenario.How this addresses that need:
get_total_price_from_fund_distribution()
is updated to handle a fund entry with empty strings, and treat them as$0.00
How can a reviewer manually see the effects of these changes?
1- Set Dev1 admin credentials
2- Set production credentials for
ALMA_API_URL
andALMA_API_READ_KEY
in shell (these were retrieved from SSM paramters and Secrets)3- The following invocation will send a
ccslips
email to[email protected]
(currently the only configured email address in Dev1 this will successfully send to):Formerly this was failing, because one of these entries would throw an exception when
fund_distribution
contained funds with empty strings.Includes new or updated dependencies?
NO
Changes expectations for external applications?
YES: Emails will successfully generate with '$0.00' reported when the fund distribution information is empty strings
What are the relevant tickets?
Developer
Code Reviewer(s)