[DEV-12873] Add recipient_id to spending_by_transaction #4438
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.
Description:
Add the
recipient_idfield to/api/v2/search/spending_by_transactionto support linking to the Recipient Profile page. Additionally, this limits what a user is allowed to provide for thefieldsandsortof the request body to only those supported values in order to create a better UX.Technical Details:
Along with adding the
recipient_idthis PR breaks out and renames the endpoints defined in thesearch_elasticsearch.pyfile since that name is out of date with how much we now use Elasticsearch.Additionally, the change to limit user input for
fieldsandsortimplemented a new pattern using Enums. This pattern isn't something we have to adapt, but I felt it fit better than the current dictionary / lookup approach and only impacts this single endpoint currently.Requirements for PR Merge:
Explain N/A in above checklist: