Recently, we removed validation of milestone.endDate < timeline.endDate, when adding a new milestone to the timeline.
Now, we have to implement functionality to update timeline's endDate accordingly, when we are adding a new milestone. It's already done when we update milestones, see https://github.com/topcoder-platform/tc-project-service/blob/dev/src/routes/milestones/update.js#L301, so we can implement it a similar way.
Note, that there is some issues in this functionality for updating regarding updating timeline in ES, see issue #376