package kr.co.hanwha.hifive.network;

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

import java.util.ArrayList;

import kr.co.hanwha.hifive.data.model.ReqMemberInfo;
import kr.co.hanwha.hifive.data.model.TaskData;
import kr.co.hanwha.hifive.enums.EvaluationType;
import kr.co.hanwha.hifive.enums.TaskStatusType;
import kr.co.hanwha.hifive.network.hanwha.HanwhaNetworkCallback;

/**
 * API Interface
 *
 * @see HFNetworkUtil
 * Created by sanghoonkwon on 2018. 1. 11..
 */

public interface HFNetworkContract {
    /**
     * MAIN - HOME : TASK 목록 - 나의 업무 목록 조회
     * <p>
     * <b>Sample</b><br>
     * Request URL : http://192.168.0.35:38999/a/v2/tasks/get/main/assigned
     * <br>
     * HEADER : {User-Agent=Android-dev/7.0 DCA/0.5.1, Content-Type=application/json}
     * <br>
     * BODY :   {"encryption_member_id":"Oe+Y\/1wLWImqigM+TWXHbQ=="}
     * <br><br><br>
     *
     * @param context              Context
     * @param encryption_member_id 암호화된 멤버 ID
     * @param callback             콜백
     */
    void requestTasksGetMainAssigned(@NonNull Context context, @NonNull String encryption_member_id, @Nullable HanwhaNetworkCallback callback);

    /**
     * MAIN - HOME : TASK 목록 - 요청한 업무 목록 조회
     * <p>
     * <b>Sample</b><br>
     * Request URL : http://192.168.0.35:38999/a/v2/tasks/get/main/request
     * <br>
     * HEADER : {User-Agent=Android-dev/7.0 DCA/0.5.1, Content-Type=application/json}
     * <br>
     * BODY :   {"encryption_member_id":"Oe+Y\/1wLWImqigM+TWXHbQ=="}
     * <br><br><br>
     *
     * @param context              Context
     * @param encryption_member_id 암호화된 멤버 ID
     * @param callback             콜백
     */
    void requestTasksGetMainRequest(@NonNull Context context, @NonNull String encryption_member_id, @Nullable HanwhaNetworkCallback callback);


    /**
     * 업데이트 확인 API
     * <p>
     * <b>Sample</b><br>
     * Request URL : https://qtalk.dreamplus.center/newgw/a/v2/app/update
     * <br>
     * HEADER : {User-Agent=Android-dev/7.0 DCA/0.5.1, Content-Type=application/json}
     * <br>
     * BODY :  {"client_timezone" : "09:00","login_id":"201704014"}
     * <br><br><br>
     *
     * @param context  Context
     * @param login_id 로그인 ID(사번)
     * @param callback 콜백
     */
    void requestCheckUpdate(@NonNull Context context, @Nullable String login_id, @Nullable HanwhaNetworkCallback callback);

    /**
     * 로그인
     * <p>
     * <b>Sample</b><br>
     * Request URL : https://qtalk.dreamplus.center/newgw/a/v2/members/login
     * <br>
     * HEADER : {User-Agent=Android-dev/7.0 DCA/0.5.1, Content-Type=application/json}
     * <br>
     * BODY :  {"client_timezone" : "09:00","password":"201704014","login_id":"201704014"}
     * <br><br><br>
     *
     * @param login_id 로그인 ID(사번)
     * @param password 패스워드
     * @param callback 콜백
     */
    void requestMembersLogin(@NonNull Context context, @NonNull String login_id, @NonNull String password, @Nullable HanwhaNetworkCallback callback);

    /**
     * 간편 로그인
     * <p>
     * <b>Sample</b><br>
     * Request URL : https://qtalk.dreamplus.center/newgw/a/v2/members/simplelogin
     * <br>
     * HEADER : {User-Agent=Android-dev/7.0 DCA/0.5.1, Content-Type=application/json}
     * <br>
     * BODY :   {"client_timezone" : "09:00","login_id":"201704014","authcode":"b6c65dc9505f27eb5dd219fc299f4b5029f834eebfe490ebf8342ab4d3970f7b"}
     * <br><br><br>
     *
     * @param login_id    로그인 ID(사번)
     * @param encAuthcode 암호화된 간편 로그인 패스워드
     * @param callback    콜백
     */
    void requestMembersSimpleLogin(@NonNull Context context, @NonNull String login_id, @NonNull String encAuthcode, @Nullable HanwhaNetworkCallback callback);

    /**
     * Project 전체 목록
     * <p>
     * <b>Sample</b><br>
     * Request URL : https://qtalk-dev.dreamplus.center/newgw/mobile/Projects/getProjectsInfo.api
     * <br>
     * HEADER : {User-Agent=Android-dev/7.0 DCA/0.5.1, Content-Type=application/json}
     * <br>
     * BODY : {"encryption_member_id":"Oe+Y\/1wLWImqigM+TWXHbQ=="}
     * <br><br><br>
     *
     * @param context              Context
     * @param encryption_member_id 암호화된 멤버 ID
     * @param callback             콜백
     */
    void requestGetProjectsInfo(@NonNull Context context,
                                @NonNull String encryption_member_id,
                                @Nullable HanwhaNetworkCallback callback);

    /**
     * Project에 속한 Member 목록
     * <p>
     * <b>Sample</b><br>
     * Request URL : https://qtalk-dev.dreamplus.center/newgw/a/v2/members/get/all
     * <br>
     * HEADER : {User-Agent=Android-dev/7.0 DCA/0.5.1, Content-Type=application/json}
     * <br>
     * BODY : {"encryption_member_id":"Oe+Y\/1wLWImqigM+TWXHbQ=="}
     * <br><br><br>
     *
     * @param encryption_member_id
     * @param callback             콜백
     */
    void requestMemberAll(@NonNull Context context, @NonNull String encryption_member_id, @Nullable HanwhaNetworkCallback callback);

    /**
     * 푸쉬(알림) 목록
     * <p>
     * <b>Sample</b><br>
     * Request URL : https://qtalk-dev.dreamplus.center/newgw/mobile/Members/notification/get.api
     * <br>
     * HEADER : {User-Agent=Android-dev/7.0 DCA/0.5.1, Content-Type=application/json}
     * <br>
     * BODY :    {"encryption_member_id":"Oe+Y\/1wLWImqigM+TWXHbQ=="}
     * <br><br><br>
     *
     * @param context              Context
     * @param encryption_member_id 암호화된 멤버 ID
     * @param callback             콜백
     */
    void requestNotificationList(@NonNull Context context, @NonNull String encryption_member_id, @Nullable HanwhaNetworkCallback callback);

    /**
     * 푸쉬 확인
     * <p>
     * <b>Sample</b><br>
     * Request URL : https://qtalk-dev.dreamplus.center/newgw/mobile/Members/notification/update/open.api
     * <br>
     * HEADER : {User-Agent=Android-dev/7.0 DCA/0.5.1, Content-Type=application/json}
     * <br>
     * BODY :   {"encryption_member_id":"Oe+Y\/1wLWImqigM+TWXHbQ==","noti_info_id":793}
     * <br><br><br>
     *
     * @param context              Context
     * @param encryption_member_id 암호화된 멤버 ID
     * @param noti_info_id         노티 아이디
     * @param callback             콜백
     */
    void requestNotificationOpen(@NonNull Context context, @NonNull String encryption_member_id,
                                 @NonNull int noti_info_id, @Nullable HanwhaNetworkCallback callback);

    /**
     * TASK 상세
     * <p>
     * <b>Sample</b><br>
     * Request URL : https://qtalk.dreamplus.center/newgw/a/v2/tasks/get/details
     * <br>
     * HEADER : {User-Agent=Android-dev/7.0 DCA/0.5.1, Content-Type=application/json}
     * <br>
     * BODY :   { "client_timezone" : "09:00", "task_id": 468, "project_id": 32, "track_id":"2", "encryption_member_id": "Oe+Y/1wLWImqigM+TWXHbQ==" }
     * <br><br><br>
     *
     * @param encryption_member_id
     * @param task_id
     * @param project_id
     * @param track_id
     * @param callback
     */
    void requestTasksGetDetails(@NonNull Context context,
                                @NonNull String encryption_member_id,
                                @NonNull int task_id,
                                @NonNull int project_id,
                                @NonNull int track_id,
                                @Nullable HanwhaNetworkCallback callback);

    /**
     * TASK 생성
     * <p>
     * <b>Sample</b><br>
     * Request URL : https://qtalk-dev.dreamplus.center/newgw/a/v2/tasks/add/list
     * <br>
     * HEADER : {User-Agent=Android-dev/7.0 DCA/0.5.1, Content-Type=application/json}
     * <br>
     * BODY : {"due_to":"2017-11-17","author_member_id":256,"task_name":"태그 테스트 - 3","encryption_member_id":"ABUUnFHYCFfDHoFuxo7EwQ==","listReqTasksMemberInfo" : [{"member_id" : 263,"project_id" : 32,"track_id" : 2}],"description" : "안녕하세요 #Hi #반갑()하하하 #허허!"}
     * <br><br><br>
     *
     * @param context              Context
     * @param author_member_id     멤버 ID
     * @param encryption_member_id 암호화된 멤버 ID
     * @param task_name            TASK 명
     * @param due_to               기한 설정
     * @param listMemberId         받는 사람 정보
     * @param callback             콜백
     */
    void requestSendTask(@NonNull Context context,
                         @NonNull int author_member_id,
                         @NonNull String encryption_member_id,
                         @NonNull String task_name,
                         @NonNull String due_to,
                         @NonNull ArrayList<ReqMemberInfo> listMemberId,
                         @Nullable HanwhaNetworkCallback callback);

    /**
     * 댓글 - 댓글 목록 조회
     * <p>
     * <b>Sample</b><br>
     * Request URL : https://qtalk.dreamplus.center/newgw/a/v2/messages/get/page
     * <br>
     * HEADER : {User-Agent=Android-dev/7.0 DCA/0.5.1, Content-Type=application/json}
     * <br>
     * BODY : {"client_timezone" : "09:00", "current_page_no": 1, "task_id": 468, "records_per_page": 10, "encryption_member_id": "Oe+Y/1wLWImqigM+TWXHbQ==", "is_pinned": false}
     * <br><br><br>
     *
     * @param context              Context
     * @param encryption_member_id 암호화된 멤버 ID
     * @param task_id              TASK ID
     * @param current_page         현재 페이지
     * @param callback             콜백
     */
    void requestGetMessageList(@NonNull Context context,
                               @NonNull String encryption_member_id,
                               @NonNull int task_id,
                               @NonNull int current_page,
                               @Nullable HanwhaNetworkCallback callback);

    /**
     * 댓글 - 댓글 등록
     * <p>
     * <b>Sample</b><br>
     * Request URL : https://qtalk-dev.dreamplus.center/newgw/mobile/Messages/messages/add.api
     * <br>
     * HEADER : {User-Agent=Android-dev/7.0 DCA/0.5.1, Content-Type=application/json}
     * <br>
     * BODY : {"encryption_member_id":"Oe+Y\/1wLWImqigM+TWXHbQ==","is_pinned":false,"task_id":468,"type":1,"contents":"댓글 입력"}
     * <br><br><br>
     *
     * @param context              Context
     * @param encryption_member_id 암호화된 멤버 ID
     * @param task_id              TASK ID
     * @param contents             댓글 내용
     * @param callback             콜백
     */
    void requestAddMessage(@NonNull Context context,
                           @NonNull String encryption_member_id,
                           @NonNull int task_id,
                           @NonNull String contents,
                           @Nullable HanwhaNetworkCallback callback);

    /**
     * Task 검색
     * <p>
     * <b>Sample</b><br>
     * Request URL : https://qtalk.dreamplus.center/newgw/a/v2/tags/get/tasks
     * <br>
     * HEADER : {User-Agent=Android-dev/7.0 DCA/0.5.1, Content-Type=application/json}
     * <br>
     * BODY : {"client_timezone" : "09:00", "encryption_member_id": "Oe+Y/1wLWImqigM+TWXHbQ==", "searchTag": "테스트"}
     * <br><br><br>
     *
     * @param context              Context
     * @param encryption_member_id 암호화된 멤버 ID
     * @param searchTag            검색어(태그)
     * @param callback             콜백
     */
    void requestSearchTaskByTag(@NonNull Context context,
                                @NonNull String encryption_member_id,
                                @NonNull String searchTag,
                                @Nullable HanwhaNetworkCallback callback);

    /**
     * TASK 수정
     * <p>
     * <b>Sample</b><br>
     * Request URL : https://qtalk.dreamplus.center/newgw/a/v2/tasks/update
     * <br>
     * HEADER : {User-Agent=Android-dev/7.0 DCA/0.5.1, Content-Type=application/json}
     * <br>
     * BODY : {"author_member_id": 262, "encryption_member_id": "Oe+Y/1wLWImqigM+TWXHbQ==", "task_id": 249, "project_id": 32, "track_id":"2",
     * "due_to": "2017-11-18 08:59:59.0", "description": "안녕하세요 #Hi #반갑()하하하 #허허!", "status": 20, "task_name": "태그 테스트 - 1 : 수정", "evaluation": 0, "client_timezone" : "09:00"}
     * <br><br><br>
     *
     * @param encryption_member_id 암호화된 멤버 ID
     * @param author_member_id     작성자 Member ID
     * @param task_id              TASK ID
     * @param project_id           프로젝트 ID
     * @param task_name            제목
     * @param description          설명
     * @param due_to               기한설정
     * @param taskStatusCode       상태값
     * @param evaluationCode       평가
     * @param callback             콜백
     */
    void requestUpdateTask(@NonNull Context context,
                           @NonNull String encryption_member_id,
                           @NonNull int author_member_id,
                           @NonNull int task_id,
                           @NonNull int project_id,
                           @NonNull int track_id,
                           @NonNull String task_name,
                           @NonNull String description,
                           @NonNull String due_to,
                           @NonNull int taskStatusCode,
                           @NonNull int evaluationCode,
                           @Nullable HanwhaNetworkCallback callback);

    /**
     * TASK 수정
     * <p>
     * <b>Sample</b><br>
     * Request URL : https://qtalk.dreamplus.center/newgw/a/v2/tasks/update
     * <br>
     * HEADER : {User-Agent=Android-dev/7.0 DCA/0.5.1, Content-Type=application/json}
     * <br>
     * BODY : {"author_member_id": 262, "encryption_member_id": "Oe+Y/1wLWImqigM+TWXHbQ==", "task_id": 249, "project_id": 32, "track_id":"2",
     * "due_to": "2017-11-18 08:59:59.0", "description": "안녕하세요 #Hi #반갑()하하하 #허허!", "status": 20, "task_name": "태그 테스트 - 1 : 수정", "evaluation": 0, "client_timezone" : "09:00"}
     * <br><br><br>
     *
     * @param context              Context
     * @param encryption_member_id 암호화된 멤버 ID
     * @param taskData             TASK 데이터
     * @param callback             콜백
     */
    void requestUpdateTask(@NonNull Context context,
                           @NonNull String encryption_member_id,
                           @NonNull TaskData taskData,
                           @Nullable HanwhaNetworkCallback callback);

    /**
     * TASK 삭제
     * <p>
     * <b>Sample</b><br>
     * Request URL : https://qtalk.dreamplus.center/newgw/a/v2/tasks/delete
     * <br>
     * HEADER : {User-Agent=Android-dev/7.0 DCA/0.5.1, Content-Type=application/json}
     * <br>
     * BODY : {"client_timezone" : "+09:00", "encryption_member_id": "Oe+Y/1wLWImqigM+TWXHbQ==", "author_member_id": 256, "task_id": 삭제할 task_id 를 입력해주세요, "project_id": 32, "track_id":"2", "member_id": 256}
     * <br><br><br>
     *
     * @param context              Context
     * @param data                 TASK 상세 데이터
     * @param encryption_member_id 암호화된 멤버 ID
     * @param callback             콜백
     */
    void requestTaskDelete(@NonNull Context context,
                           @NonNull TaskData data,
                           @NonNull String encryption_member_id,
                           @Nullable HanwhaNetworkCallback callback);

    /**
     * TASK 수락
     *
     * @param context              Context
     * @param encryption_member_id 암호화된 멤버 ID
     * @param taskData             TASK DATA
     * @param callback             콜백
     */
    void requestTaskAccept(@NonNull Context context,
                           @NonNull String encryption_member_id,
                           @NonNull TaskData taskData,
                           @Nullable HanwhaNetworkCallback callback);

    /**
     * TASK 반려
     * <p>
     * <b>Sample</b><br>
     * Request URL : https://qtalk.dreamplus.center/newgw/a/v2/tasks/update/rejection
     * <br>
     * HEADER : {User-Agent=Android-dev/7.0 DCA/0.5.1, Content-Type=application/json}
     * <br>
     * BODY : {"client_timezone" : "09:00", "author_member_id": 262, "status": 40, "encryption_member_id": "Oe+Y/1wLWImqigM+TWXHbQ==", "task_id": 249, "project_id": 32, "track_id":"2" ,
     * "reqTasksMessageInfo": {"contents": "요청반려입니다", "is_pinned": false, "ref_message_id": 0, "type": 10}}
     * <br><br><br>
     *
     * @param context              Context
     * @param encryption_member_id 암호화된 멤버 ID
     * @param taskData             TASK DATA
     * @param message              반려 메세지
     * @param callback             콜백
     */
    void requestTasksUpdateRejection(@NonNull Context context,
                                     @NonNull String encryption_member_id,
                                     @NonNull TaskData taskData,
                                     @NonNull String message,
                                     @Nullable HanwhaNetworkCallback callback);

    /**
     * TASK - 오늘 할일 등록 / 취소
     * <p>
     * <b>Sample</b><br>
     * Request URL : https://qtalk.dreamplus.center/newgw/a/v2/tasks/update/today
     * <br>
     * HEADER : {User-Agent=Android-dev/7.0 DCA/0.5.1, Content-Type=application/json}
     * <br>
     * BODY : {"client_timezone" : "09:00", "is_today": true, "encryption_member_id": "Oe+Y/1wLWImqigM+TWXHbQ==", "author_member_id": 256, "task_id": 315, "project_id": 32, "track_id":"2"}
     * <br><br><br>
     *
     * @param data                 Task 데이터
     * @param encryption_member_id 암호화된 멤버 ID
     * @param callback             콜백
     */
    void requestTasksUpdateToday(@NonNull Context context,
                                 @NonNull TaskData data,
                                 @NonNull String encryption_member_id,
                                 @Nullable HanwhaNetworkCallback callback);

    /**
     * TASK 평가(Resolved)
     * <p>
     * <b>Sample</b><br>
     * Request URL : https://qtalk.dreamplus.center/newgw/a/v2/tasks/update
     * <br>
     * HEADER : {User-Agent=Android-dev/7.0 DCA/0.5.1, Content-Type=application/json}
     * <br>
     * BODY : {"author_member_id": 262, "encryption_member_id": "Oe+Y/1wLWImqigM+TWXHbQ==", "task_id": 249, "project_id": 32, "track_id":"2",
     * "due_to": "2017-11-18 08:59:59.0", "description": "안녕하세요 #Hi #반갑()하하하 #허허!", "status": 20, "task_name": "태그 테스트 - 1 : 수정", "evaluation": 0, "client_timezone" : "09:00"}
     * <br><br><br>
     *
     * @param context              Context
     * @param encryption_member_id 암호화된 멤버 ID
     * @param taskData             TASK DATA
     * @param evaluationType       평가
     * @param callback             콜백
     */
    void requestSetTaskEvaluation(@NonNull Context context,
                                  @NonNull String encryption_member_id,
                                  @NonNull TaskData taskData,
                                  @NonNull EvaluationType evaluationType,
                                  @Nullable HanwhaNetworkCallback callback);
}
