Class: SpreeCmCommissioner::WaitingRoom::Guests::List
- Inherits:
-
Object
- Object
- SpreeCmCommissioner::WaitingRoom::Guests::List
- Includes:
- Spree::ServiceModule::Base, FirestoreConnection
- Defined in:
- app/services/spree_cm_commissioner/waiting_room/guests/list.rb
Overview
Raw read of a waiting-guest partition for the admin "Guests" tab — the only place in the
codebase that lists the actual waiting_guests/{date}/records documents rather than
deriving lobby-level aggregates from them (contrast Heartbeat::Sweep/Positions::Stamp/
Admission::CallGuests, which only ever query for docs matching specific eligibility
criteria, never dump the partition itself).
Constant Summary collapse
- MAX_DOCS =
Same ceiling the admin UI paginates over; keeps one read bounded regardless of how many guests are actually queued.
5000
Instance Method Summary collapse
-
#call(date:, in_queue_only: true, firestore: nil) ⇒ Object
in_queue_only: true filters at the Firestore query level (not after fetching) to the same "not yet resolved" criteria Admission::CallGuests uses, and defaults on — without it, a partition with more than MAX_DOCS total docs for the day fills the cap with the OLDEST docs by queued_at, which past a certain volume are entirely already-resolved (Admitted/Left) guests, silently hiding everyone still actually waiting behind them.
Methods included from FirestoreConnection
#firestore, #firestore_available?, #service_account
Instance Method Details
#call(date:, in_queue_only: true, firestore: nil) ⇒ Object
in_queue_only: true filters at the Firestore query level (not after fetching) to the same "not yet resolved" criteria Admission::CallGuests uses, and defaults on — without it, a partition with more than MAX_DOCS total docs for the day fills the cap with the OLDEST docs by queued_at, which past a certain volume are entirely already-resolved (Admitted/Left) guests, silently hiding everyone still actually waiting behind them.
22 23 24 25 26 27 28 29 30 |
# File 'app/services/spree_cm_commissioner/waiting_room/guests/list.rb', line 22 def call(date:, in_queue_only: true, firestore: nil) @firestore = firestore if firestore.present? guests = firestore_available? ? fetch(date, in_queue_only) : [] success(guests: guests) rescue StandardError => e failure(nil, e.) end |