momentumfrc / attendance-manager

Keep track of the attendence of our team members by allowing mentors to check students in and out.
0 stars 0 forks source link

Disallow simultaneous attendance events for a given student #41

Closed lost1227 closed 1 year ago

lost1227 commented 1 year ago

It is not likely for two valid attendance events to be registered for a given student within a certain timeframe (say, 10 seconds).

If an attendance event is registered, and another attendance event exists for that student within the configurable "simultaneous" timeframe, the following should occur:

  1. If the two events have the same type, the new event is ignored as it is likely a duplicate of the other event (likely, two different clients attempted to register the check-in at the same time)
  2. If the two events have different type, the previous event is removed and the new event is ignored as the new event is likely an attempt to "undo" the old event.

This validation should also be added to the validate:attendance console command.