automate-sales / automate-commerce

next js ecommerce
MIT License
0 stars 0 forks source link

Add join leads function #95

Open gkpty opened 2 months ago

gkpty commented 2 months ago

The joinLeads function will receive 2 lead Ids, the first is the websiteLead Id from the ecommerce visitor, and the second leadId is an external lead id, or some other ecommerce leadId that is a duplicate.

The first leadId always has precedence and all properties from the second leadId will be passed to the first.

Any keys that have values in lead2 will be added to lead1. All carts in lead2 will be changed to inactive, and there leadId will be changed to Lead1.

Same with orders and any other relations.