fix(crm): clean person names; canonical project titles
Strip company annotations from lastName, derive names from email locals, UpdatePerson on apply with companyId. Add persons fix-names, contacts merge, projects create --country/--company (CC | Company | Title). Fix project update (responsibleId) and company-person dedupe grouping.
This commit is contained in:
+17
-7
@@ -193,16 +193,26 @@ func (c *Client) DeleteProject(id int) (*Project, error) {
|
||||
}
|
||||
|
||||
// UpdateProject updates project fields.
|
||||
// OnlyOffice requires responsibleId on PUT; callers should set ResponsibleID
|
||||
// (the CLI fills it from the current project when omitted).
|
||||
func (c *Client) UpdateProject(req ProjectUpdateRequest) (*Project, error) {
|
||||
p := &Project{}
|
||||
return p, c.Query(Request{
|
||||
p := new(Project)
|
||||
body := map[string]any{
|
||||
"title": req.Title,
|
||||
"description": req.Description,
|
||||
"responsibleId": req.ResponsibleID,
|
||||
}
|
||||
err := c.Query(Request{
|
||||
Uri: fmt.Sprintf("/api/2.0/project/%d.json", req.ID),
|
||||
Method: "PUT",
|
||||
Body: req,
|
||||
},
|
||||
&struct {
|
||||
Response *Project `json:"response"`
|
||||
}{p})
|
||||
Body: body,
|
||||
}, &struct {
|
||||
Response *Project `json:"response"`
|
||||
}{Response: p})
|
||||
if err != nil {
|
||||
return p, err
|
||||
}
|
||||
return p, nil
|
||||
}
|
||||
|
||||
// UpdateProjectStatus sets project lifecycle status (open, paused, closed).
|
||||
|
||||
Reference in New Issue
Block a user