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

What should happen when an activity has both 2 countries AND 2 regions with %'s defined? #6

Open
odscjames opened this issue Dec 10, 2024 · 3 comments

Comments

@odscjames
Copy link
Contributor

odscjames commented Dec 10, 2024

A basic algorithm would then result in 4 split transactions:

  • Country A, Region A
  • Country A, Region B
  • Country B, Region A
  • Country B, Region B

But should we be taking into account anything about those regions? Maybe region A and B only exist in country A for instance? Is this bad input data?

I'm sure I remember reading something about this in one of the other writeups but now I can't find it.

@odscjames
Copy link
Contributor Author

See test test_split_by_everything which currently doesn't actually do that - but it shouldn't till this Q is resolved.

@Bjwebb
Copy link

Bjwebb commented Dec 11, 2024

Both the country and region percentages should sum together to make 100%.

https://iatistandard.org/en/iati-standard/203/activity-standard/iati-activities/iati-activity/recipient-country/#example-usage

When both the recipient-region and recipient-country are declared, then the @percentage values should sum to 100% per region vocabulary for the specific iati-activity.

<recipient-country code="AF" percentage="50" />
<recipient-region code="489" vocabulary="1" percentage="50" />
<recipient-region code="A1" vocabulary="99" percentage="50" vocabulary-uri="http://example.com/vocab.html" />

@odscjames
Copy link
Contributor Author

Ah, I had heard that but didn't understand the significance.

So, when an activity has both 2 countries AND 2 regions with %'s defined you should get:

  • Country A
  • Country B
  • Region A
  • Region B

And the sum value of those 4 transactions should be the same as the value on the original transaction?

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

No branches or pull requests

2 participants