type routine_id = string type workout_id = string let routine_id s = s let workout_id s = s (* Fields are reached through the module type, not from here. *) type record = { id : workout_id; workout : Evidence.Workout.t } [@@warning "-69"] type app_feedback_id = string let app_feedback_id s = s let app_feedback_id_to_string id = id type app_feedback = { feedback_id : app_feedback_id; author : string; contributions : int; submitted_at : Recovery.timestamp; message : string; upvotes : int; viewer_upvoted : bool; viewer_owns : bool; } module type S = sig type t val create_trainee : t -> username:Trainee.username -> credential:Trainee.credential -> (Trainee.t, [ `Username_taken ]) result Lwt.t val find_trainee_by_username : t -> Trainee.username -> Trainee.t option Lwt.t val find_trainee : t -> Trainee.id -> Trainee.t option Lwt.t val update_username : t -> Trainee.id -> Trainee.username -> (Trainee.t, [ `Username_taken ]) result Lwt.t val update_credential : t -> Trainee.id -> Trainee.credential -> Trainee.t option Lwt.t val list_routines : t -> (routine_id * Prescription.Routine.t) list val find_routine : t -> routine_id -> Prescription.Routine.t option val active_routine : t -> Trainee.id -> routine_id option Lwt.t val set_active_routine : t -> Trainee.id -> routine_id -> unit Lwt.t val in_progress : t -> Trainee.id -> Evidence.Workout.t option Lwt.t val set_in_progress : t -> Trainee.id -> Evidence.Workout.t option -> unit Lwt.t val finish_workout : t -> Trainee.id -> Evidence.Workout.t -> record Lwt.t val find : t -> Trainee.id -> workout_id -> record option Lwt.t val replace : t -> Trainee.id -> record -> bool Lwt.t val log : t -> Trainee.id -> Evidence.Log.t Lwt.t val history : t -> Trainee.id -> record list Lwt.t val save_feedback : t -> Trainee.id -> Evidence.Feedback.t -> unit Lwt.t val feedback : t -> Trainee.id -> Evidence.Feedback.t list Lwt.t val save_app_feedback : t -> Trainee.id -> submitted_at:Recovery.timestamp -> message:string -> app_feedback Lwt.t val app_feedback : t -> viewer:Trainee.id -> app_feedback list Lwt.t val upvote_app_feedback : t -> voter:Trainee.id -> app_feedback_id -> bool Lwt.t val update_app_feedback : t -> author:Trainee.id -> app_feedback_id -> message:string -> bool Lwt.t val delete_app_feedback : t -> author:Trainee.id -> app_feedback_id -> bool Lwt.t end