-
Notifications
You must be signed in to change notification settings - Fork 8
Ticket Alert Mechanism
Jack Li edited this page Oct 15, 2022
·
3 revisions
- Follow the Ticket Storage design at wiki page.
- Alert handling is asynchronous action and is triggered when updating the
best_available_seats
andbest_history_seats
collections. A queue is constructed to schedule the alert handlers.
- Let
A
be the list of current best available seats andB
the list of new best available seats. - Query list
A
andB
by scraping_id from the database. - Compute
A-B
which is the seats based on the comparator should check for (sec, row?, seat?, price). - Compute
B-A
which is the new seats. - Remove
A-B
frombest_available_seats
and insertB-A
tobest_available_seats
. - Save
A-B
tobest_history_seats
. - Use
B-A
to invoke a handler to analyze them against thebest_history_seats
asynchronously.
- Query the database and get the sorted list of
best_history_seats
. - Use binary search to find the seat and get the percentile of the seat based on the rank.
- If found the exact same seat based on (sec, row?, seat?), get the history price(s) of the seat.
- Alert the user based on alert conditions
TBD
TBD
Precondition:
- Similar tickets (roughly the same rank) have been found and the new ticket price is lower than those of the closest history rank match.
- i.e. Found a lower price of seats than those of the same viewing experience (rank).
Main Success Scenario:
- Alert user of a
price drop
with alternative seat (new) price, old prices in the neighborhood of the spot located from the binary search, and the percentile.
Precondition:
- The exact same ticket has been found in
best_history_seats
and the price is higher than the most recent history price.
Main Success Scenario:
- Alert user of a
price increase
with the old and new price and the percentile.
Precondition:
- The exact same ticket has been found in
best_history_seats
and the price is lower than the most recent history price.
Main Success Scenario:
- Alert user of a
price drop
with the old and new price and the percentile.