Appeals and AppealHistory #2179
szabozoltan69
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The AppealHistory is used with the purpose so that we can query appeal contribution amounts for any specific date in the past, via the valid-from and valid-to arguments in the api requests.
Some basic view of the data tables can be obtained here.
If we set valid_to to greater than the today's date, it gives the actual appeal's value.
It was on purpose that in AppealViewset we hide the real appeal table from the users, but let them see data only through the AppealHistory.
In https://github.com/IFRCGo/go-api/blob/develop/api/receivers.py#L200 you can find a django receiver to keep entities updated at any moment.
This appealhistory-aggregating function can also be useful: https://github.com/IFRCGo/go-api/blob/develop/api/views.py#L616
If you want to get the modification date of the data, please rather use the real_data_update attribute instead of modified_at.
Some example data in the database:
Beta Was this translation helpful? Give feedback.
All reactions