from django.db import models


class Room(models.Model):

    BUILDING_CHOICES = [
        ('gate', 'Perly Gate Residence'),
        ('comfort', 'Perly Comfort'),
    ]

    TYPE_CHOICES = [
        ('accommodation', 'Accommodation'),
        ('event_space', 'Event Space'),
    ]

    building = models.CharField(
        max_length=20,
        choices=BUILDING_CHOICES
    )

    name = models.CharField(max_length=150)

    price = models.DecimalField(
        max_digits=12,
        decimal_places=2
    )

    room_type = models.CharField(
        max_length=30,
        choices=TYPE_CHOICES,
        default='accommodation'
    )

    description = models.TextField(blank=True)

    image = models.URLField(blank=True)

    is_active = models.BooleanField(default=True)

    created_at = models.DateTimeField(auto_now_add=True)

    def __str__(self):
        return f"{self.name} - ₦{self.price}"