summaryrefslogtreecommitdiff
path: root/config.scm
blob: 46d0bf255c42e6336aa7c27bd9db3c189e5bcb42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
;;; SPDX-FileCopyrightText: 2026 Matthew Fennell <matthew@fennell.dev>
;;;
;;; SPDX-License-Identifier: AGPL-3.0-or-later

(include "secrets.scm")
(include "util.scm")

(define default-venues '(botwell-green-leisure-centre))
(define default-activities '(badminton-40min badminton-60min))
(define default-dates '(sat sun))
(define default-checkout #t)
(define default-user matthew)

(define (default-scorer booking)
  (let ((score (lambda (cond amount) (if cond amount 0))))
    (+
     (score (rob-friendly? booking) 4)
     (score (badminton-60min? booking) 2)
     (score (sat? booking) 1)
     (score (unreasonable-time? booking) -8)
     )))

(define (rob-friendly? booking)
  (between-hours? booking "13:00" "18:00"))

(define (unreasonable-time? booking)
  (not (between-hours? booking "10:00" "22:00")))