feat: added ticket history

This commit is contained in:
2025-05-05 18:33:23 +02:00
parent e0ff4dde70
commit afa44011d0
3 changed files with 54 additions and 1 deletions

View File

@@ -36,3 +36,16 @@ class Comment(models.Model):
def __str__(self):
return f"Kommentar von {self.author} zu Ticket #{self.ticket.id}"
class TicketHistory(models.Model):
ticket = models.ForeignKey("Ticket", on_delete=models.CASCADE, related_name="history")
changed_by = models.ForeignKey(User, on_delete=models.SET_NULL, null=True)
changed_at = models.DateTimeField(auto_now_add=True)
field = models.CharField(max_length=100) # z.B. "status" oder "description"
old_value = models.TextField(null=True, blank=True)
new_value = models.TextField(null=True, blank=True)
class Meta:
ordering = ["-changed_at"]