from django.db import models

class Testimonial(models.Model):
    client_name = models.CharField(max_length=150)
    client_title = models.CharField(max_length=150, default="Managing Director")
    company_name = models.CharField(max_length=150, default="Client Organization")
    avatar_url = models.URLField(default="https://images.unsplash.com/photo-1507003211169-0a1dd7228f2d?auto=format&fit=crop&w=200&q=80")
    quote = models.TextField()
    rating = models.PositiveSmallIntegerField(default=5)
    project_delivered = models.CharField(max_length=150, blank=True, default="Custom ERP System")
    is_featured = models.BooleanField(default=True)
    is_active = models.BooleanField(default=True)
    order = models.PositiveIntegerField(default=0)

    class Meta:
        ordering = ['order', '-id']
        verbose_name = "Client Testimonial"
        verbose_name_plural = "Client Testimonials"

    def __str__(self):
        return f"{self.client_name} ({self.company_name})"
