Laravel course registration queue system
I am currently building a web application in Laravel 5.5 for a school board, and I am working on a feature to enable teachers to register for classes in a live queue. The order of the teachers in the queue is based on seniority, which is already known based on an already existing database table field. I am looking for any tips and input on how to tackle this feature. The way I was planning on doing is the following:
First, I will have a database table that will hold the registry settings. This will include the registration date, the start time and the maximum time that each teacher will have to register (~5 mins).
Secondly, I will have another database table that will act as the teacher queue. At 24 hours before the registration date, the queue will be created and all teachers who are eligible to register will be added to the queue (table) based on seniority.
Thirdly, I will have another database table to hold all the classes offered for the given registration date. This table will reference the main "Courses" table that holds all the courses ever created for the system.
Lastly, I will have a database table to hold the registration status. This will contain data about the queue, like who is up next, who was previous to register, and who is the current teacher registering.
That sums up the database portion of things. I will also be making use of Laravel's scheduling system in order to set up the correct cron jobs that will be executed to first begin the registration process, and then to execute incrementally based on the registry settings.
I know that a queue data structure has two main functions: dequeue and enqueue. I was thinking of building a Queue class that will interact with the Queue database table to mimic this functionality.
That is the design I am aiming for, and I would really appreciate some insight on how to optimize it (or completely redesign it). It just needs to be efficient and accurate.
Thank you.
Please or to participate in this conversation.