from django.db import models

class Case(models.Model):
    full_name = models.CharField(max_length=255)
    email = models.EmailField()
    phone_number = models.CharField(max_length=20, blank=True)
    description = models.TextField()
    submitted_at = models.DateTimeField(auto_now_add=True)
    status = models.CharField(max_length=20, choices=[('new', 'New'), ('in_review', 'In Review'), ('closed', 'Closed')], default='new')

    def __str__(self):
        return f"Case for {self.full_name} submitted at {self.submitted_at.strftime('%Y-%m-%d %H:%M')}"