from django.db import models
from django.conf import settings
from core.models.AssetBundleRoom import AssetBundleRoom  # Adjust import path if needed

class AssignRoomUser(models.Model):
    user = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.CASCADE)
    assetbundle_room = models.ForeignKey(AssetBundleRoom, on_delete=models.CASCADE)

    class Meta:
        unique_together = ('user', 'assetbundle_room')  # Prevent duplicate assignments

    def __str__(self):
        return f"{self.user.username} assigned to {self.assetbundle_room.name}"
