Add an /api/event/[event id]/account/ endpoint - #82
Open
willbarton wants to merge 5 commits into
Open
Conversation
This adds an account listing endpoint to an event that serializes the accounts within the event and annotates them with total number of inconsistencies (evaluators hit), and months of data for the account. I've added these annotations to the `AccountActivityQuerySet` object management for `AccountActivity` (which is defined in `evaluate_m2`), so they're available on any `AccountActivity.objects` query.
This also requires a `cons_acct_num` parameter to be given, otherwise no results will be returned.
willbarton
force-pushed
the
feature/account-list-api
branch
from
July 23, 2026 16:00
8528c53 to
d9a7468
Compare
virginiacc
approved these changes
Jul 31, 2026
willbarton
marked this pull request as ready for review
August 5, 2026 15:49
schbetsy
reviewed
Aug 5, 2026
schbetsy
left a comment
Collaborator
There was a problem hiding this comment.
Just a few small comments, otherwise this looks great. I like your implementation using manager methods. I put a question on the original ticket about exactly how we want to calculate months_of_data and total_inconsistencies, so let's wait and see about that before we merge.
Comment on lines
+344
to
+346
| "k2", | ||
| "k4", | ||
| "l1" |
Collaborator
There was a problem hiding this comment.
Is select_related necessary, since we aren't putting any of the extra segment values into the API response?
|
|
||
| class Meta(AccountActivitySerializer.Meta): | ||
| default_fields = [ | ||
| # list(AccountActivitySerializer.Meta.default_fields) + [ |
Collaborator
There was a problem hiding this comment.
Remove this commented line?
| return J2.objects.bulk_create(j_segments) | ||
|
|
||
|
|
||
| def evaluator_result_record( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This adds an endpoint to query accounts that are in an event, returning information about accounts within an event. The API docs would look something like this:
Account list view
/api/events/{event_id}/accounts/?cons_acct_num={comma separated list of account numbers}GET - takes a comma-separated list of account numbers and returns a JSON array of those accounts with their portfolio type, account type, and the total number of inconsistencies and total number of months of data, for a given event.
For example, a query of
/api/events/1/accounts/?cons_acct_num=1234567890,2345678901should return JSON like:[ { "cons_acct_num": "1234567890", "port_type": "I", "acct_type": "00" "total_inconsistencies": 1, "months_of_data": 5, }, { "cons_acct_num": "2345678901", "port_type": "I", "acct_type": "00" "total_inconsistencies": 1, "months_of_data": 5, }, ]Checklist
Testing checklist
Browsers
Accessibility
Other