from django.db import models

class InventoryItem(models.Model):
    name = models.CharField(max_length=255)
    description = models.TextField(blank=True)
    cost = models.DecimalField(max_digits=10, decimal_places=2)
    installments_options = models.CharField(max_length=255, help_text="e.g., 12 months interest free")
    features = models.TextField(help_text="Comma separated features")
    store_location = models.CharField(max_length=255)
    store_name = models.CharField(max_length=255)
    lead_time = models.CharField(max_length=100, help_text="e.g., 3-5 days")
    image_url = models.URLField(blank=True, null=True)
    
    created_at = models.DateTimeField(auto_now_add=True)
    updated_at = models.DateTimeField(auto_now=True)

    def __str__(self):
        return f"{self.name} - {self.store_name}"