-
Notifications
You must be signed in to change notification settings - Fork 0
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
[EASI-4457] TRB attendees dataloaders #2705
[EASI-4457] TRB attendees dataloaders #2705
Conversation
@@ -438,18 +438,3 @@ func GetTRBRequesterInfo(ctx context.Context, requesterEUA string) (*models.User | |||
|
|||
return requesterInfo, nil | |||
} | |||
|
|||
// GetTRBUserComponent retrieves the component of a TRB user from the TRB attendees table | |||
func GetTRBUserComponent(ctx context.Context, store *storage.Store, euaID *string, trbRequestID uuid.UUID) (*string, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's a resolvers/trb_request_attendee.go
file that I thought was more appropriate for this
return nil, err | ||
} | ||
return attendee.Component, nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is that moved function, I also renamed it.
@@ -2056,7 +2056,7 @@ func (r *tRBRequestResolver) RequesterInfo(ctx context.Context, obj *models.TRBR | |||
// RequesterComponent is the resolver for the requesterComponent field. | |||
func (r *tRBRequestResolver) RequesterComponent(ctx context.Context, obj *models.TRBRequest) (*string, error) { | |||
requester := obj.CreatedBy | |||
return resolvers.GetTRBUserComponent(ctx, r.store, &requester, obj.ID) | |||
return resolvers.GetTRBAttendeeComponent(ctx, r.store, &requester, obj.ID) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's the reason for the rename. The RequesterComponent
resolver passes in the requester EUA, but the store/resolver methods aren't restricted to just the requester and can be used for any attendee EUA (if we ever needed to do that).
// GetAttendeeComponentByEUA attempts to retrieve the component of a given EUA user ID and TRB Request ID | ||
func (s *Store) GetAttendeeComponentByEUA(ctx context.Context, euaID string, trbRequestID uuid.UUID) (*string, error) { | ||
// GetAttendeeByEUAIDAndTRBID attempts to retrieve an attendee of a given EUA user ID and TRB Request ID | ||
func (s *Store) GetAttendeeByEUAIDAndTRBID(ctx context.Context, euaID string, trbRequestID uuid.UUID) (*models.TRBRequestAttendee, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I figured this was more useful and that specific resolver can return the single field.
* [EASI-4457] Funding sources dataloader and mapper refactor (#2692) * add funding source dataloader and refactor helpers.OneToMany and Mapper interface * fix store method, call dataloader version in resolver * [EASI-4457] Add dataloader to TRB request form resolver (#2695) add dataloader to trb request form resolver * [EASI-4457] System intake notes dataloader (#2693) update notes resolver to use dataloader, add tests for notes * [EASI-4457] System Intake Actions dataloader (#2694) add dataloader to system intake actions resolver * [EASI 4457] - TRB Request Feedback dataloaders (#2700) * add dataloaders to TRB Feedback * convert slice to postgres array * use dataloaders in status calls * remove unnecessary no rows error check * [EASI-4457] TRB Advice letter dataloader (#2702) * add dataloaders to TRB Feedback * convert slice to postgres array * use dataloaders in status calls * remove unnecessary no rows error check * add dataloaders to advice letter and finish refactoring statuses * sort mock users * nil check statuses * [EASI-4457] TRB attendees dataloaders (#2705) * add dataloader to trb attendees * add dataloader for attendees by EUA and TRB ID, update requester component resolver * use ptr helper, add to resolver test * [EASI-4457] Add closed requests for testing (#2709) * refactor seed data to allow for closed request generation * remove context value and just use a constant * add regex to LCID test * [EASI-4457] TRB documents dataloaders (#2706) * add a dataloader for trb documents, use dataloaders in other resolvers * semicolons and better error handling * [EASI-4457] TRB Admin Notes dataloader (#2714) add dataloaders for TRB admin notes * [EASI-4457] TRB Request Funding Sources dataloader (#2715) * add dataloader for trb funding sources * fix test to allow for empty slice * add TODO comment * [EASI-4457] TRB Form System Intakes dataloader (#2722) add dataloader for trb request form system intakes * [EASI-4457] Add gov req feedback dataloader (#2731) * add gov req feedback dataloader * run gql gen * [EASI-4457] intake documents dataloader (#2732) * add dataloader for documents * use resolver to create fake documents * update seed script * update seed script to not fetch users multiple times for closed requests * add comments * [EASI-4457] Business Case dataloaders (#2729) * refactor business case legacy code to allow for biz case and cost line dataloaders with less friction * cleanup comments --------- Co-authored-by: samoddball <156127704+samoddball@users.noreply.github.com> --------- Co-authored-by: samoddball <156127704+samoddball@users.noreply.github.com>
EASI-4457
Description
requesterComponent
field on TRB Requests.How to test this change
attendees
on TRB Requests.PR Author Checklist
PR Reviewer Guidelines