feat(crm): dedupe duplicates, fix deal titles, and add cleanup CLI
Merge duplicate companies/persons/deals by name, remove duplicate contact info and opportunity members, and rename malformed " @ Company" titles. Applications sync now avoids empty-position titles and duplicate members. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
package applications
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
onlyoffice "github.com/eslider/go-onlyoffice"
|
||||
)
|
||||
|
||||
func TestDealTitleForApplication(t *testing.T) {
|
||||
if got := onlyoffice.DealTitleForApplication("", "711media"); got != "711media" {
|
||||
t.Fatalf("got %q", got)
|
||||
}
|
||||
if got := onlyoffice.DealTitleForApplication("Dev", "Acme"); got != "Dev @ Acme" {
|
||||
t.Fatalf("got %q", got)
|
||||
}
|
||||
}
|
||||
|
||||
func TestHasContactInfoHelper(t *testing.T) {
|
||||
contact := map[string]any{
|
||||
"commonData": []any{
|
||||
map[string]any{"infoType": "Email", "data": "a@b.com"},
|
||||
},
|
||||
}
|
||||
if !onlyoffice.HasContactInfo(contact, "Email", "a@b.com") {
|
||||
t.Fatal("expected match")
|
||||
}
|
||||
if onlyoffice.HasContactInfo(contact, "Email", "other@b.com") {
|
||||
t.Fatal("unexpected match")
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user