Files
boxofficefantasy/draft/constants.py
Anthony Correa c9ce7a36d0 Integrate draft session support with phase handling and real-time updates
- Added user authentication UI in the base template for navbar.
- Expanded `league.dj.html` to include a new "Draft Sessions" tab showing active drafts.
- Refactored Django views and models to support `DraftSession` with participants and movies.
- Replaced deprecated models like `DraftParticipant` and `DraftMoviePool` with a new schema using `DraftSessionParticipant`.
- Introduced WebSocket consumers (`DraftAdminConsumer`, `DraftParticipantConsumer`) with structured phase logic and caching.
- Added `DraftStateManager` for managing draft state in Django cache.
- Created frontend UI components in React for draft admin and participants, including phase control and WebSocket message logging.
- Updated SCSS styles for improved UI structure and messaging area.
2025-08-02 08:56:41 -05:00

59 lines
1.5 KiB
Python

from enum import IntEnum
class DraftMessage:
# Server
INFORM_PHASE_CHANGE = "inform.phase.change"
CONFIRM_PHASE_CHANGE = "confirm.phase.change"
INFORM_PHASE = "inform.phase"
# Client
REQUEST_PHASE_CHANGE = "request.phase.change"
REQUEST_INFORM_STATUS = "request.inform.status"
# Waiting Phase
## Server
INFORM_JOIN_USER = "inform.join.user"
REQUEST_JOIN_PARTICIPANT = "request.join.participant"
REQUEST_JOIN_ADMIN = "request.join.admin"
INFORM_LEAVE_PARTICIPANT = "inform.leave.participant"
## Client
NOTIFY_JOIN_USER = "notify.join.user"
CONFIRM_JOIN_PARTICIPANT = "confirm.join.participant"
REJECT_JOIN_PARTICIPANT = "reject.join.participant"
CONFIRM_JOIN_ADMIN = "confirm.join.admin"
# Determine Order
## Server
CONFIRM_DETERMINE_DRAFT_ORDER = "confirm.determine.draft_order"
## Client
REQUEST_DETERMINE_DRAFT_ORDER = "request.determine.draft_order"
class DraftPhase(IntEnum):
WAITING = 0
DETERMINE_ORDER = 10
NOMINATION = 20
BIDDING = 30
AWARD = 40
FINALIZE = 50
def __str__(self):
return self.name.lower()
class DraftGroupChannelNames:
def __init__(self, id):
self.prefix = f"draft.{id}"
@property
def session(self):
return f"{self.prefix}.session"
@property
def admin(self):
return f"{self.prefix}.admin"
@property
def participant(self):
return f"{self.prefix}.participant"