Link opportunity contact person to agent_person on legacy form submit#665
Open
nadavosa wants to merge 5 commits into
Open
Link opportunity contact person to agent_person on legacy form submit#665nadavosa wants to merge 5 commits into
nadavosa wants to merge 5 commits into
Conversation
When a legacy form submission creates an opportunity, the contact person is now also inserted into agent_person (VOLUNTEER_COORDINATOR) for the matched/created agent. This builds up the full list of known persons per agent over time without touching the existing representative. The submitter was already linked via getOrCreateSubmitterPerson; this covers the contact person which was previously only linked to the opportunity. Resolves #664 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
|
||
| if (opportunity.agent?.id) { | ||
| const agentPersonRepository = getRepository(dataSource, AgentPerson); | ||
| await agentPersonRepository.save( |
Collaborator
There was a problem hiding this comment.
it might throw violation of constraint:
"IDX_f15c4b743ddfba08409b99f797" UNIQUE, btree (agent_id, person_id, role)
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.
Summary
agent_personrow (roleVOLUNTEER_COORDINATOR) linking them to the matched/created agentagent_personrows — only adds a new link if neededgetOrCreateSubmitterPerson; this covers the contact person which was previously only attached to the opportunityWhy
agent_personshould accumulate all persons known to be associated with a center. The FE currently shows one contact, but the backend should already build the full list for future use.Resolves #664
Test plan
agent_personfor that agent withVOLUNTEER_COORDINATORroleagent_personrows (representative etc.) are not changed🤖 Generated with Claude Code