 public enum TeamRepositoryError: Error {
     case notAuthenticated
     case teamNotFound
+    case notInTeam
 }
 
 public protocol TeamRepository {

        }
    }
    
    public func join(to teamID: String) -> Completable {
        guard let currentUser = Auth.auth().currentUser else {
            return Completable.error(TeamRepositoryError.notAuthenticated)
        }

        let memberID = currentUser.uid
        let memberName = currentUser.displayName ?? "no name"   // FIXME:
        
        return team(for: teamID)
            .take(1)

        return memberTeamsRef.createChildCollectionObservable()
    }
    
    public func createTeam(named name: String, by memberName: String) -> Single<String> {
        return Single.create { observer in
            guard let currentUser = Auth.auth().currentUser else {
                observer(.error(TeamRepositoryError.notAuthenticated))
