new migrations in apps.epic app; new models, urls, views handle the founder of a New Game inviting a friend via email to a game gatekeeper; ea. may drop coin in any of up to 6 avail. slots; FTs & ITs passing
This commit is contained in:
@@ -41,6 +41,7 @@ class Room(models.Model):
|
||||
board_state = models.JSONField(default=dict)
|
||||
seed_count = models.IntegerField(default=12)
|
||||
|
||||
|
||||
class GateSlot(models.Model):
|
||||
EMPTY = "EMPTY"
|
||||
RESERVED = "RESERVED"
|
||||
@@ -66,6 +67,25 @@ class GateSlot(models.Model):
|
||||
filled_at = models.DateTimeField(null=True, blank=True)
|
||||
|
||||
|
||||
class RoomInvite(models.Model):
|
||||
PENDING = "PENDING"
|
||||
ACCEPTED = "ACCEPTED"
|
||||
DECLINED = "DECLINED"
|
||||
STATUS_CHOICES = [
|
||||
(PENDING, "Pending"),
|
||||
(ACCEPTED, "Accepted"),
|
||||
(DECLINED, "Declined"),
|
||||
]
|
||||
|
||||
room = models.ForeignKey(Room, on_delete=models.CASCADE, related_name="invites")
|
||||
inviter = models.ForeignKey(
|
||||
settings.AUTH_USER_MODEL, on_delete=models.CASCADE, related_name="sent_invites"
|
||||
)
|
||||
invitee_email = models.EmailField()
|
||||
status = models.CharField(max_length=10, choices=STATUS_CHOICES, default=PENDING)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
|
||||
@receiver(post_save, sender=Room)
|
||||
def create_gate_slots(sender, instance, created, **kwargs):
|
||||
if created:
|
||||
|
||||
Reference in New Issue
Block a user