import json

from django.contrib.contenttypes.fields import GenericRelation
from django.db import models

class EmxTtActivityLast(models.Model):
    activity_id = models.CharField(max_length=255,db_comment="will have 'MV' as prefix, so cant used integer",null=True)
    code = models.CharField(max_length=150)
    name = models.CharField(max_length=255)
    desc = models.TextField(null=True)
    department_code = models.CharField(max_length=255,null=True)
    activity_type_code = models.CharField(max_length=255,null=True)
    group_id = models.IntegerField(null=True, db_comment="follow activity name the last number eg. Activity/1, will get the 1")
    module_code = models.CharField(max_length=255,null=True)
    scheduled_day = models.CharField(max_length=100,null=True,db_comment="Client request send by String 'Monday'")
    duration = models.IntegerField(null=True,db_comment="in minute")
    start_time = models.TextField(null=True, db_comment="client request in datetime format(6/6/2026 12:00:00 PM) so using text field, date just put today date")
    end_time = models.TextField(null=True,db_comment="client request in datetime format(6/6/2026 12:00:00 PM) so using text field, date just put today date")
    planned_size = models.IntegerField(null=True)
    is_jta = models.IntegerField(null=True)
    is_variant = models.IntegerField(null=True)
    check_sum = models.TextField(null=True, db_comment="used to compare see got update or not")

    class Meta:
        db_table = "emx_tt_activity_last"

    def __str__(self):
        return self.name