fix: preserve legacy channel parent names
This commit is contained in:
@@ -61,12 +61,6 @@ func (c *Channel) BusinessDisplayName() string {
|
||||
}
|
||||
|
||||
func (c *Channel) ParentDisplayName() string {
|
||||
if c.Level != nil && *c.Level == 1 {
|
||||
if len(c.BusinessPath) > 0 {
|
||||
return c.BusinessPath[len(c.BusinessPath)-1]
|
||||
}
|
||||
return c.BusinessDisplayName()
|
||||
}
|
||||
return c.ParentName
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ func TestChannelPortraitKeepsContactAndCooperationStatusSeparateFromAudit(t *tes
|
||||
t.Fatal(err)
|
||||
}
|
||||
b := result.Basic
|
||||
if b.LockStatusLabel != sample.label || b.StatusLabel != "正常" || b.Phone != channel.Phone || b.SettlementDays == nil || *b.SettlementDays != 7 || b.BusierDisplayName != "SDK商务(所属商务)" || b.ParentPromoteName == nil || *b.ParentPromoteName != "所属商务" {
|
||||
if b.LockStatusLabel != sample.label || b.StatusLabel != "正常" || b.Phone != channel.Phone || b.SettlementDays == nil || *b.SettlementDays != 7 || b.BusierDisplayName != "SDK商务(所属商务)" || b.ParentPromoteName != nil {
|
||||
t.Fatalf("portrait metadata or status mismatch: %+v", b)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user