-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
finish #1 - Show Spots to everyone ;; As a conference attendee, I want to see how many spots are still available - Only show attendees to organizer ;; As an organizer, I want to see who the participants are
- Loading branch information
Showing
3 changed files
with
42 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,12 +14,29 @@ | |
(db/transact [[:db/retractEntity 17592186045468]])) | ||
(user/conn) | ||
|
||
(db/transact [{:user/email "[email protected]" | ||
:user/handle "laurence.chen" | ||
:user/name "Laurence"}]) | ||
|
||
(db/q | ||
'[:find | ||
[(pull ?e [*]) ...] | ||
:where | ||
[?e :user/email]] | ||
(db/db)) | ||
|
||
(def session-eid 17592186045438) | ||
|
||
(db/transact [{:db/id session-eid | ||
:session/participants 17592186045458}]) | ||
|
||
(first (:session/participants (db/entity session-eid))) | ||
;; Test transact participants | ||
|
||
(def req {:identity {:user/email "ddd"} | ||
:path-params {:id "17592186045455"}}) | ||
:path-params {:id "17592186045438"}}) | ||
|
||
(def session-eid 17592186045455) | ||
(def session-eid 17592186045438) | ||
|
||
@(db/transact [[:db/add session-eid :session/capacity 14] | ||
[:db/add session-eid :session/signup 0]]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,15 @@ | ||
(ns co.gaiwan.compass.model.session) | ||
(ns co.gaiwan.compass.model.session | ||
(:require | ||
[co.gaiwan.compass.db :as db])) | ||
|
||
(defn participating? [session user] | ||
(some (comp #{(:db/id user)} :db/id) | ||
(:session/participants session))) | ||
|
||
(defn organizing? [organized user] | ||
(and | ||
(some? organized) | ||
(= (:db/id user) (:db/id organized)))) | ||
|
||
(defn attendee [id] | ||
(db/entity id)) |