from django.db import models
from django.contrib.auth.models import User

class UserProfile(models.Model):
    user = models.OneToOneField(User, on_delete=models.CASCADE, related_name='profile')
    phone_number = models.CharField(max_length=15, blank=True, null=True)
    address = models.TextField(blank=True, null=True)
    date_of_birth = models.DateField(blank=True, null=True)
    idcard_no = models.CharField(max_length=20, blank=True, null=True)
    photos = models.ImageField(upload_to='user_photos/', blank=True, null=True)
    upload_documents = models.FileField(upload_to='user_documents/', blank=True, null=True)
    geolocation = models.CharField(max_length=255, blank=True, null=True)
    business_type = models.CharField(max_length=100, blank=True, null=True)

    def __str__(self):
        return self.user.username
