from django.db import models


class ContactRequest(models.Model):
    first_name = models.CharField('Prénom', max_length=100)
    last_name  = models.CharField('Nom', max_length=100)
    email      = models.EmailField('Email')
    phone      = models.CharField('Téléphone', max_length=20, blank=True)
    message    = models.TextField('Demande')
    created_at = models.DateTimeField('Reçu le', auto_now_add=True)
    is_read    = models.BooleanField('Lu', default=False)

    class Meta:
        verbose_name        = 'Demande de contact'
        verbose_name_plural = 'Demandes de contact'
        ordering            = ['-created_at']

    def __str__(self):
        return f"{self.first_name} {self.last_name} — {self.email}"
