from django.db import models
from django.utils import timezone

class Farm(models.Model):
    STATUS_CHOICES = [
        ('active', 'Active'),
        ('pending', 'Pending Inspection'),
        ('suspended', 'Suspended'),
    ]

    name = models.CharField(max_length=200, verbose_name="Farm Name")
    owner_name = models.CharField(max_length=200, verbose_name="Owner Name")
    location = models.CharField(max_length=300, verbose_name="Location/Address")
    size_hectares = models.DecimalField(max_digits=10, decimal_places=2, verbose_name="Size (Hectares)")
    registration_date = models.DateTimeField(default=timezone.now)
    status = models.CharField(max_length=20, choices=STATUS_CHOICES, default='pending')
    
    # Placeholder for future relation to User
    # owner = models.ForeignKey(User, on_delete=models.CASCADE) 

    def __str__(self):
        return self.name