Allow moving tickets between projects with P.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Skruecken
2026-10-19 14:19:10 +02:00
co-authored by Cursor
parent c5920ffd54
commit 7666715f6c
13 changed files with 369 additions and 6 deletions
+28
View File
@@ -153,6 +153,34 @@ func (s *JSONTimeStore) Delete(id string) error {
return s.writeUnlocked(out)
}
// RetargetTicket sets ProjectID on all entries for a ticket.
func (s *JSONTimeStore) RetargetTicket(ticketID, projectID string) error {
s.mu.Lock()
defer s.mu.Unlock()
if ticketID == "" {
return fmt.Errorf("ticketId is required")
}
if projectID == "" {
return fmt.Errorf("projectId is required")
}
entries, err := s.readUnlocked()
if err != nil {
return err
}
changed := false
for i := range entries {
if entries[i].TicketID == ticketID {
entries[i].ProjectID = projectID
changed = true
}
}
if !changed {
return nil
}
return s.writeUnlocked(entries)
}
// DeleteByProject removes all time entries for a project.
func (s *JSONTimeStore) DeleteByProject(projectID string) error {
s.mu.Lock()