package kr.co.hanwha.hifive.data.source.contract;

import android.content.Context;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;

import java.util.ArrayList;

import kr.co.hanwha.hifive.base.BaseDataSource;
import kr.co.hanwha.hifive.data.model.BaseData;
import kr.co.hanwha.hifive.data.model.MainHomeAssignedRoot;
import kr.co.hanwha.hifive.data.model.MainHomeRequestRoot;
import kr.co.hanwha.hifive.data.model.MemberInfoData;
import kr.co.hanwha.hifive.data.model.MessageAddData;
import kr.co.hanwha.hifive.data.model.MessageListRoot;
import kr.co.hanwha.hifive.data.model.ProjectInfoData;
import kr.co.hanwha.hifive.data.model.ProjectTaskRoot;
import kr.co.hanwha.hifive.data.model.ReqMemberInfo;
import kr.co.hanwha.hifive.data.model.SearchTagData;
import kr.co.hanwha.hifive.data.model.TaskData;
import kr.co.hanwha.hifive.data.model.TaskDetailRoot;
import kr.co.hanwha.hifive.enums.EvaluationType;
import kr.co.hanwha.hifive.network.hanwha.HanwhaNetworkCallback;

/**
 * TASK 관련 데이터 저장소 인터페이스
 *
 * @see kr.co.hanwha.hifive.data.source.TaskDataRepository
 * Created by sanghoonkwon on 2018. 1. 11..
 */

public interface TaskDataDataSource extends BaseDataSource {
    /**
     * MAIN - HOME : TASK 목록 - 나의 업무 목록 조회
     *
     * @param context  Context
     * @param callback 콜백
     */
    void requestTasksGetMainAssigned(@NonNull Context context, @NonNull HanwhaNetworkCallback<MainHomeAssignedRoot> callback);

    /**
     * MAIN - HOME : TASK 목록 - 요청한 업무 목록 조회
     *
     * @param context  Context
     * @param callback 콜백
     */
    void requestTasksGetMainRequest(@NonNull Context context, @NonNull HanwhaNetworkCallback<MainHomeRequestRoot> callback);

    /**
     * 내 TASK -> 오늘 할일 등록
     *
     * @param context  Context
     * @param taskData Task 데이터
     * @param isToday  TRUE : 오늘할 업무로 추가 / FALSE : 오늘할 업무에서 삭제
     * @param callback 콜백
     */
    void requestSetTaskToday(@NonNull Context context, @NonNull TaskData taskData,
                             @NonNull boolean isToday,
                             @Nullable HanwhaNetworkCallback callback);

    /**
     * TASK 요청(Send Request - Team / Module 찾기)
     *
     * @param context  Context
     * @param callback 콜백
     */
    void requestTeamModuleList(@NonNull Context context, @Nullable HanwhaNetworkCallback<ArrayList<ProjectInfoData>> callback);

    /**
     * 전체 Member 목록
     *
     * @param context  Context
     * @param callback 콜백
     */
    void requestAllMember(@NonNull Context context, @NonNull HanwhaNetworkCallback callback);


    /**
     * TASK 생성
     *
     * @param context        Context
     * @param task_name      TASK 내용
     * @param due_to         기한 설정
     * @param listMemberInfo 받는사람 정보
     * @param callback       콜백
     */
    void requestSendTask(@NonNull Context context,
                         @NonNull String task_name,
                         @NonNull String due_to,
                         @NonNull ArrayList<MemberInfoData> listMemberInfo,
                         @Nullable HanwhaNetworkCallback callback);

    /**
     * TASK 수정
     * @param context Context
     * @param taskData TASK 데이터
     * @param callback 콜백
     */
    void requestUpdateTask(@NonNull Context context,
                           @NonNull TaskData taskData,
                           @Nullable HanwhaNetworkCallback callback);
    /**
     * TASK 조회(상세조회)
     *
     * @param context    Context
     * @param task_id    TASK ID
     * @param project_id PROJECT ID
     * @param track_id   TRACK_ID
     * @param callback   콜백
     */
    void requestGetTaskDetail(@NonNull Context context,
                              @NonNull int task_id,
                              @NonNull int project_id,
                              @NonNull int track_id,
                              @Nullable HanwhaNetworkCallback<TaskDetailRoot> callback);

    /**
     * TASK 삭제
     *
     * @param context  Context
     * @param taskData TASK 데이터
     * @param callback 콜백
     */
    void requestDeleteTask(@NonNull Context context, @NonNull TaskData taskData,
                           @Nullable HanwhaNetworkCallback callback);

    /**
     * TASK 수락
     *
     * @param context  Context
     * @param taskData TASK DATA
     * @param callback 콜백
     */
    void requestTaskAccept(@NonNull Context context,
                           @NonNull TaskData taskData,
                           @Nullable HanwhaNetworkCallback<BaseData> callback);

    /**
     * TASK 반려
     *
     * @param context  Context
     * @param taskData TASK DATA
     * @param message  반려 메세지
     * @param callback 콜백
     */
    void requestTaskReject(@NonNull Context context,
                           @NonNull TaskData taskData,
                           @NonNull String message,
                           @Nullable HanwhaNetworkCallback<BaseData> callback);

    /**
     * TASK 평가(Resolved)
     *
     * @param context        Context
     * @param taskData       TASK DATA
     * @param evaluationType 평가
     * @param callback       콜백
     */
    void requestSetTaskEvaluation(@NonNull Context context,
                                  @NonNull TaskData taskData,
                                  @NonNull EvaluationType evaluationType,
                                  @Nullable HanwhaNetworkCallback<BaseData> callback);

    /**
     * 댓글 - 댓글 목록 조회
     *
     * @param context      Context
     * @param task_id      TASK ID
     * @param current_page 현재 페에지 No
     * @param callback     콜백
     */
    void requestGetMessageList(@NonNull Context context,
                               @NonNull int task_id,
                               @NonNull int current_page,
                               @Nullable HanwhaNetworkCallback<MessageListRoot> callback);

    /**
     * 댓글 - 댓글 등록
     *
     * @param context  Context
     * @param task_id  TASK ID
     * @param contents 댓글 내용
     * @param callback 콜백
     */
    void requestAddMessage(@NonNull Context context,
                           @NonNull int task_id,
                           @NonNull String contents,
                           @Nullable HanwhaNetworkCallback<MessageAddData> callback);

    /**
     * Task 검색(태그)
     *
     * @param context   Context
     * @param searchTag 태그(검색어)
     * @param callback  콜백
     */
    void requestSearchTaskByTag(@NonNull Context context,
                                @NonNull String searchTag,
                                @Nullable HanwhaNetworkCallback<SearchTagData> callback);
}
