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.CampaignData;
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.SearchTagData;
import kr.co.hanwha.hifive.data.model.TaskData;
import kr.co.hanwha.hifive.data.model.TaskDetailRoot;
import kr.co.hanwha.hifive.enums.TaskEvaluationType;
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 TaskDataSource 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);

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

    /**
     * 해당 프로젝트에 속한 Campaign 목록
     *
     * @param context          Context
     * @param listReqProjectId 받는 사람 목록에 있는 Project Id(Default 내가 속한 프로젝트 추가)
     * @param callback         콜백
     */
    void requestCampaignListByProjectId(@NonNull Context context,
                                        @NonNull ArrayList<Integer> listReqProjectId,
                                        @NonNull HanwhaNetworkCallback callback);

    /**
     * 해당 멤보에 속한 Campaign 목록
     *
     * @param context        Context
     * @param listMemberInfo 받는 사람 목록에 있는 Member Id
     * @param callback       콜백
     */
    void requestCampaignListByMemberId(@NonNull Context context,
                                       @NonNull ArrayList<Integer> listMemberInfo,
                                       @NonNull HanwhaNetworkCallback callback);


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

    /**
     * TASK 수정
     *
     * @param context      Context
     * @param taskData     TASK 데이터
     * @param campaignData Campaign Info
     * @param callback     콜백
     */
    void requestUpdateTask(@NonNull Context context,
                           @NonNull TaskData taskData,
                           @Nullable CampaignData campaignData,
                           @Nullable HanwhaNetworkCallback callback);

    /**
     * TASK 조회(상세조회)
     *
     * @param context    Context
     * @param task_id    TASK ID
     * @param project_id PROJECT ID
     * @param callback   콜백
     */
    void requestGetTaskDetail(@NonNull Context context,
                              @NonNull int task_id,
                              @NonNull int project_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 수락 : STATUS 20
     *
     * @param context  Context
     * @param taskData TASK DATA
     * @param callback 콜백
     */
    void requestTaskAccept(@NonNull Context context,
                           @NonNull TaskData taskData,
                           @Nullable HanwhaNetworkCallback<BaseData> callback);

    /**
     * TASK 반려 : STATUS 40
     *
     * @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);

    /**
     * 댓글 - 댓글 목록 조회
     *
     * @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);

    /**
     * 댓글 삭제
     *
     * @param context  Context
     * @param id       댓글 ID
     * @param callback 콜백
     */
    void requestDeleteMessage(@NonNull Context context,
                              @NonNull int id,
                              @Nullable HanwhaNetworkCallback callback);

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


    /**
     * 반려된 TASK 요청 삭제(취소) : STATUS 80
     *
     * @param context  Context
     * @param taskData Task 데이터
     * @param callback 콜백
     */
    void requestSetTaskDeleteRequest(@NonNull Context context,
                                     @NonNull TaskData taskData,
                                     @Nullable HanwhaNetworkCallback callback);

    /**
     * 반려된 TASK 재 요청 : STATUS 30
     *
     * @param context  Context
     * @param taskData Task 데이터
     * @param callback 콜백
     */
    void requestSetTaskReRequest(@NonNull Context context,
                                 @NonNull TaskData taskData,
                                 @Nullable HanwhaNetworkCallback callback);

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


    /**
     * TASK 평가 - 수락 : STATUS 80
     *
     * @param context  Context
     * @param taskData Task 데이터
     * @param callback 콜백
     */
    void requestSetTaskEvaluationAccept(@NonNull Context context,
                                        @NonNull TaskData taskData,
                                        @Nullable HanwhaNetworkCallback callback);

    /**
     * TASK 평가 - 완료 : STATUS 70
     *
     * @param context  Context
     * @param taskData Task 데이터
     * @param message  메세지
     * @param callback 콜백
     */
    void requestSetTaskEvaluationReject(@NonNull Context context,
                                        @NonNull TaskData taskData,
                                        @NonNull String message,
                                        @Nullable HanwhaNetworkCallback callback);
}
