import { Injectable } from '@angular/core';
import { Headers, Http, RequestOptions, Response } from '@angular/http';

import { Observable } from 'rxjs/Observable';

import 'rxjs/add/observable/throw';
import 'rxjs/add/operator/catch';
import 'rxjs/add/operator/map';

import { IUser, IUserAccounts, IUserCredentials } from '../modules/core/shared/user/user.model';

import { IApiError, IApiResponseError, IApiResponseSuccess, isApiResponseError } from '../modules/core/shared/token/apiresponse.model';

@Injectable()
export class UserServiceMock {
    user: IUser;
    userAccounts: IUserAccounts;
    testParam: string;
    get UserCredentials(): IUserCredentials {
        return this.user || this.userCredentials;
    }
    set UserCredentials(value: IUserCredentials) {
        this.userCredentials = value;
    }
    private userCredentials: IUserCredentials;

    constructor() { }
    createUser(user: IUser): Observable<IUser> {
        return new Observable<IUser>();
    }
    loadUser(): Observable<IUserAccounts> {
        return new Observable<IUserAccounts>();
    }
    updateUser(user: IUser): Observable<IUser> {
        return new  Observable<IUser>();
    }
    private handleError(error: IApiError): Observable<IUser> {
        return Observable.throw(error.msg || error);
    }
}
