from django.db import models

class EmailAgent(models.Model):
    agent_id = models.AutoField(primary_key=True)
    agent_name = models.CharField(max_length=255)

    class Meta:
        managed = False
        db_table = 'tbl_agent'
        app_label = 'email_reports'

class EmailCampaign(models.Model):
    id = models.AutoField(primary_key=True)
    camp_name = models.CharField(max_length=255)

    class Meta:
        managed = False
        db_table = 'tbl_camp'
        app_label = 'email_reports'

class EmailType(models.Model):
    id = models.AutoField(primary_key=True)
    type_name = models.CharField(max_length=255)

    class Meta:
        managed = False
        db_table = 'tbl_type'
        app_label = 'email_reports'

class EmailRecord(models.Model):
    id = models.AutoField(primary_key=True)
    thread = models.CharField(max_length=10, default='NO')
    campaign = models.CharField(max_length=255)
    agent_name = models.CharField(max_length=255)
    email_type = models.CharField(max_length=255)
    order_number = models.CharField(max_length=255)
    refund = models.DecimalField(max_digits=10, decimal_places=2, default=0)
    comment = models.TextField(blank=True)
    created_1 = models.CharField(max_length=50, blank=True)
    created_2 = models.DateTimeField(auto_now_add=True)

    class Meta:
        managed = False
        db_table = 'tbl_email'
        app_label = 'email_reports'
        ordering = ['-id']
