Skip to content
This repository has been archived by the owner on May 22, 2024. It is now read-only.

Commit

Permalink
Cancel only monitored bookings
Browse files Browse the repository at this point in the history
  • Loading branch information
zdevaty committed May 9, 2024
1 parent cd81757 commit aab4dc0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion conf/conf.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,13 +387,20 @@ func GetNoShowBookings(ctx context.Context) ([]*appdb.Event, error) {
WHERE end_time > NOW()
AND start_time <= NOW() - INTERVAL '%d MINUTES'
AND cancelled_at IS NULL
AND id IN (
-- Include only those events that have presence monitored.
SELECT DISTINCT event_id
FROM booking.presence_logs
WHERE check_time > NOW() - INTERVAL '%d MINUTES'
)
AND id NOT IN (
-- Exclude events that have been visited.
SELECT DISTINCT event_id
FROM booking.presence_logs
WHERE occupied = true
AND check_time > NOW() - INTERVAL '%d MINUTES'
);
`, cfg.NoShowMins, cfg.NoShowMins)).
`, cfg.NoShowMins, cfg.NoShowMins, cfg.NoShowMins)).
BindG(ctx, &bookings)
if err != nil {
return nil, fmt.Errorf("querying no show bookings: %v", err)
Expand Down

0 comments on commit aab4dc0

Please sign in to comment.