package br.com.deputadosemfoco.data.remote;

import java.util.ArrayList;
import java.util.List;

import br.com.deputadosemfoco.data.model.Mocks;
import br.com.deputadosemfoco.data.model.Project;
import br.com.deputadosemfoco.data.model.ProjectReference;
import br.com.deputadosemfoco.data.remote.messages.SignInRequest;
import br.com.deputadosemfoco.data.remote.messages.SignInResponse;
import retrofit2.http.Body;
import retrofit2.http.Query;
import rx.Observable;

public class MockDataApi implements DataApi {
    @Override
    public Observable<Boolean> isUp() {
        return Observable.just(true);
    }

    @Override
    public Observable<SignInResponse> signIn(@Body SignInRequest request) {
        return Observable.just(new SignInResponse("token", Mocks.user()));
    }

    @Override
    public Observable<List<ProjectReference>> getProjectsReferences(@Query("year") List<String> year) {
        List<ProjectReference> a = new ArrayList<>();
        a.add(new ProjectReference(100L, 2016));
        a.add(new ProjectReference(200L, 2016));
        a.add(new ProjectReference(300L, 2015));
        a.add(new ProjectReference(400L, 2016));

        return Observable.just(a);
    }

    @Override
    public Observable<List<Project>> getProjects(List<Long> ids) {
        List<Project> list = new ArrayList<>();

        list.add(new Project(100L, "PL 100", "DESCRICAO 1", 2016, "10/10/2016", "explanation 1", 10, "PT", "PARADO"));
        list.add(new Project(200L, "PL 200", "DESCRICAO 2", 2016, "11/10/2016", "explanation 2", 20, "PSDB", "EM ANDAMENTO"));
        list.add(new Project(300L, "PL 300", "DESCRICAO 3", 2016, "12/10/2016", "explanation 3", 30, "PMDB", "PLENARIO"));

        return Observable.just(list);
    }
}
