fix: prevent duplicate customer addresses when selling appliances#1370
Open
Zhey-on wants to merge 1 commit intoEnAccess:mainfrom
Open
fix: prevent duplicate customer addresses when selling appliances#1370Zhey-on wants to merge 1 commit intoEnAccess:mainfrom
Zhey-on wants to merge 1 commit intoEnAccess:mainfrom
Conversation
3 tasks
Contributor
|
Hi @Zhey-on, thanks for the contribution! I'd like to review your PR, but a few updates are needed in the description first:
Once these updates are made, I'll proceed with the review. Thanks! |
Author
|
Hi @beesaferoot, I don't see any clear reference to the aforementioned PR template in the contributing guide.
|
Contributor
While some details such as issue structure or PR description are not specified in detail, we provide these templates as a guide in our repositories to improve the contribution process. I encourage you to look at other PRs created on this repo. |
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
This PR fixes issue #1367 where selling an appliance to an existing customer via UI could create an additional non-primary customer address.
Closes #1367.
Root Cause
During appliance sale flows, backend logic was creating and assigning a new record to the customer when a device serial was provided. The sale operation should only bind the sold device and update device geolocation, not mutate customer address records.
The same pattern existed in both:
What Was Changed
1.
2.
Expected Behavior After Fix
Selling an appliance to an existing customer no longer inserts extra customer address rows. Customer address data remains unchanged; only device ownership and device geolocation are updated by sale operations.
Validation
Performed local syntax/error checks on modified backend files:
Notes
This PR is intentionally scoped to the backend sale logic required for #1367 and does not include unrelated local workspace changes.