Skip to content

Commit

Permalink
✨ [#51] Track when status was changed on the vernietigingslijst
Browse files Browse the repository at this point in the history
  • Loading branch information
SilviaAmAm committed May 23, 2024
1 parent 6cd2b49 commit abbe10e
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,4 +125,5 @@ class Meta:
"items",
"status",
"created",
"status_changed",
)
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Generated by Django 4.2.11 on 2024-05-23 09:14

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
("destruction", "0002_destructionlistassignee"),
]

operations = [
migrations.AddField(
model_name="destructionlist",
name="status_changed",
field=models.DateTimeField(
blank=True,
help_text="Tracks when the status was changed.",
null=True,
verbose_name="status changed",
),
),
]
11 changes: 11 additions & 0 deletions backend/src/openarchiefbeheer/destruction/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@ class DestructionList(models.Model):
choices=ListStatus.choices,
max_length=80,
)
status_changed = models.DateTimeField(
_("status changed"),
help_text=_("Tracks when the status was changed."),
blank=True,
null=True,
)
zaak_destruction_report_url = models.URLField(
_("zaak destruction report URL"),
help_text=_(
Expand All @@ -75,6 +81,11 @@ def __str__(self):
def assign(assignee: "DestructionListAssignee") -> None:
assignee.assign()

def set_status(self, status: str) -> None:
self.status = status
self.status_changed = timezone.now()
self.save()


class DestructionListItem(models.Model):
destruction_list = models.ForeignKey(
Expand Down

0 comments on commit abbe10e

Please sign in to comment.