snapshot: preserve dashboard redesign and live protocol workflow state

This commit is contained in:
Md Bayazid Bostame
2026-03-19 16:10:30 +01:00
parent 3bf43921ff
commit 1cb92682cf
14 changed files with 1948 additions and 121 deletions

View File

@@ -78,6 +78,7 @@ class OnboardingRequest(models.Model):
)
generated_pdf_path = models.CharField(max_length=500, blank=True)
intro_pdf_path = models.CharField(max_length=500, blank=True)
created_at = models.DateTimeField(auto_now_add=True)
def __str__(self) -> str:
@@ -231,6 +232,56 @@ class ScheduledWelcomeEmail(models.Model):
return f'Welcome #{self.id} | {self.recipient_email} | {self.status}'
class IntroChecklistItem(models.Model):
SECTION_CHOICES = [
('workplace', 'Geräte und Arbeitsplatz'),
('accounts', 'Konten und Berechtigungen'),
('software', 'Software und Tools'),
('process', 'Prozesse und Hinweise'),
]
OPERATOR_CHOICES = [
('always', 'Immer anzeigen'),
('contains', 'Enthält'),
('equals', 'Ist gleich'),
('is_true', 'Ist Ja / aktiv'),
('is_false', 'Ist Nein / inaktiv'),
]
section = models.CharField(max_length=30, choices=SECTION_CHOICES)
label = models.CharField(max_length=255)
sort_order = models.PositiveIntegerField(default=0)
is_active = models.BooleanField(default=True)
condition_field = models.CharField(max_length=80, blank=True)
condition_operator = models.CharField(max_length=20, choices=OPERATOR_CHOICES, default='always')
condition_value = models.CharField(max_length=255, blank=True)
class Meta:
ordering = ['section', 'sort_order', 'label']
def __str__(self) -> str:
return f'{self.get_section_display()}: {self.label}'
class OnboardingIntroductionSession(models.Model):
STATUS_CHOICES = [
('draft', 'Entwurf'),
('completed', 'Abgeschlossen'),
]
onboarding_request = models.OneToOneField(OnboardingRequest, on_delete=models.CASCADE)
checklist_state = models.JSONField(default=dict, blank=True)
notes = models.TextField(blank=True)
status = models.CharField(max_length=20, choices=STATUS_CHOICES, default='draft')
completed_at = models.DateTimeField(null=True, blank=True)
completed_by_name = models.CharField(max_length=255, blank=True)
exported_pdf_path = models.CharField(max_length=500, blank=True)
updated_at = models.DateTimeField(auto_now=True)
created_at = models.DateTimeField(auto_now_add=True)
def __str__(self) -> str:
return f'Einweisung #{self.id} | {self.onboarding_request.full_name} | {self.status}'
class WorkflowConfig(models.Model):
name = models.CharField(max_length=120, default='Default', unique=True)
it_onboarding_email = models.EmailField(blank=True)