innoq/spacy

create domain/move-session function

Closed this issue · 0 comments

A rough sketch of the spacy.domain/move-session function:

(defn move-session [state _current-user {:keys [id room time]}]
  {:post [(s/valid? ::outcome %)]}
  {::facts [#_(could use ::session-scheduled to begin with, or create ::session-moved identical to ::session-scheduled )]
   ::event (-> state
               #_(update function which moves session from one slot in the schedule to another ))}))

move-session should probably produce an error if:

  • the session is not in ::schedule
  • the target slot is not open

Tests probably wouldn't be a bad idea.