from django.db import models

# Create your models here.
class Machine(models.Model):
    mac_address = models.CharField(max_length=20) # MAC Address of Arduino device
    name = models.CharField(max_length=25) # Friendly name
    description = models.TextField()
    lat = models.DecimalField(max_digits=9, decimal_places=6)
    lng = models.DecimalField(max_digits=9, decimal_places=6)
    
class ProcessedImage(models.Model):
    machine = models.ForeignKey(Machine, on_delete=models.CASCADE)
    image = models.ImageField()
    detected_objects = models.TextField()
    processed_at = models.DateTimeField(auto_now_add=True)

    
class QueuedImage(models.Model):
    image = models.ImageField(upload_to='queued/%Y/%m/%d')
    machine_mac_address = models.CharField(max_length=20)
    uploaded_at = models.DateTimeField(auto_now_add=True)
