from django.db import models

class MembershipApplication(models.Model):
    ROLE_CHOICES = [
        ('FARMER', 'Farmer'),
        ('DRIVER', 'Driver'),
        ('COMMUNITY', 'Community Member'),
    ]
    name = models.CharField(max_length=100)
    email = models.EmailField(unique=True)
    desired_role = models.CharField(max_length=20, choices=ROLE_CHOICES)
    statement = models.TextField()
    created_at = models.DateTimeField(auto_now_add=True)
    status = models.CharField(max_length=20, default='PENDING') # PENDING, APPROVED, REJECTED

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