...
|
...
|
@@ -31,5 +31,22 @@ func (command *UpdatePartnerInfoCommand) ValidateCommand() error { |
|
|
command.PartnerCategory == domain.PARTNER_CATEGORY_3) {
|
|
|
return lib.ThrowError(lib.ARG_ERROR, "合伙类别错误")
|
|
|
}
|
|
|
if command.RegionInfo == nil {
|
|
|
return lib.ThrowError(lib.ARG_ERROR, "区域必填")
|
|
|
}
|
|
|
if len(command.Salesman) == 0 {
|
|
|
return lib.ThrowError(lib.ARG_ERROR, "关联业务员必填")
|
|
|
}
|
|
|
if command.Id == 0 {
|
|
|
return lib.ThrowError(lib.ARG_ERROR, "合伙人id错误")
|
|
|
}
|
|
|
for i := range command.Salesman {
|
|
|
if len(command.Salesman[i].Name) == 0 {
|
|
|
return lib.ThrowError(lib.ARG_ERROR, "关联业务员名称必填")
|
|
|
}
|
|
|
if len(command.Salesman[i].Telephone) == 0 {
|
|
|
return lib.ThrowError(lib.ARG_ERROR, "关联业务员电话必填")
|
|
|
}
|
|
|
}
|
|
|
return nil
|
|
|
} |
...
|
...
|
|