Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

_get_balances_for_statement() method in CamtParser crashes when 'Cd' element missing in a 'Bal' element #5

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rsoome
Copy link

@rsoome rsoome commented Oct 12, 2024

ISO20022 specifies that a 'Type' element must contain either a 'Cd' element or a 'Prtry' element. Currently the method only looks for a 'Cd' element and crashes when it's missing. With my changes, the function looks for both 'Cd' and 'Prtry' elements in a 'Bal' element.

Also, when neither of the elements are found, the user is warned about the invalid element in the XML and the function continues. In that case, N/A is assigned as the type of the balance.I am not sure whether this is the best approach but it seemed more reasonable than exiting with an error. I am open to debate about this approach though.

Rasmus Soome added 2 commits October 13, 2024 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant