from django.db import models
from django.contrib.auth.models import User
from core.models.Subscription import Subscription
from core.models.Space import Space
from core.models.AssetBundleRoom import AssetBundleRoom




class Meeting(models.Model):
    name = models.CharField(max_length=255)
    description = models.TextField(blank=True)
    date_time = models.DateTimeField()
    creator_user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='created_meetings')
    space = models.ForeignKey(Space, on_delete=models.SET_NULL, null=True, blank=True)
    asset_bundle = models.ForeignKey(AssetBundleRoom, on_delete=models.SET_NULL, null=True, blank=True)
    use_space = models.BooleanField(default=False)
    code = models.CharField(max_length=255, null=True, blank=True )

    def __str__(self):
        return self.name
    
