Skip to content

Commit 2df1cc4

Browse files
committed
Add v2 username lookup for meeting RSVP data
- Add Username field to inviteResponseInput struct for v2 system - Implement username lookup using UserID (v1 platform ID) via lookupV1User - Map username to Auth0 "sub" format using mapUsernameToAuthSub helper - Add debug logging for successful lookups and warning for failures - Follows same pattern as invitee and attendee username resolution This allows the v2 system to associate RSVP responses with the correct user accounts. Generated with [Claude Code](https://claude.com/claude-code) Signed-off-by: Andres Tobon <andrest2455@gmail.com>
1 parent 7baa82a commit 2df1cc4

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

cmd/lfx-v1-sync-helper/handlers_meetings.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,18 @@ func handleZoomMeetingInviteResponseUpdate(ctx context.Context, key string, v1Da
686686
return
687687
}
688688

689+
// If username is blank but we have a v1 Platform ID (user_id), lookup the username.
690+
if inviteResponse.Username == "" && inviteResponse.UserID != "" {
691+
if v1User, lookupErr := lookupV1User(ctx, inviteResponse.UserID); lookupErr == nil && v1User != nil && v1User.Username != "" {
692+
inviteResponse.Username = mapUsernameToAuthSub(v1User.Username)
693+
logger.With("user_id", inviteResponse.UserID, "username", v1User.Username).DebugContext(ctx, "looked up username for invite response")
694+
} else {
695+
if lookupErr != nil {
696+
logger.With(errKey, lookupErr, "user_id", inviteResponse.UserID).WarnContext(ctx, "failed to lookup v1 user for invite response")
697+
}
698+
}
699+
}
700+
689701
// Extract the invite response ID
690702
inviteResponseID := inviteResponse.ID
691703
if inviteResponseID == "" {

cmd/lfx-v1-sync-helper/models_meetings.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -506,6 +506,10 @@ type inviteResponseInput struct {
506506
// UserID is the ID of the user that the invite response is associated with.
507507
UserID string `json:"user_id" dynamodbav:"user_id"`
508508

509+
// Username is the LF username of the registrant that the invite response is associated with.
510+
// This is a v2 only attribute, meaning the username is for an LF user in the v2 system.
511+
Username string `json:"username"`
512+
509513
// Org is the organization of the registrant that the invite response is associated with.
510514
Org string `json:"org" dynamodbav:"org"`
511515

0 commit comments

Comments
 (0)