//
//  Definitions.h
//  kneet2
//
//  Created by Created by Jason Lee on 10/1/15.
//  Copyright (c) 2015 ntels. All rights reserved.
//

#ifndef kneet2_Definitions_h
#define kneet2_Definitions_h

#ifndef PRODUCT_MODE

static NSString *kAPIServer = @"http://61.40.220.132:5007";
static NSString *kNISCServer = @"http://61.40.220.132:5001";

//static NSString *kAPIServer = @"https://home-api.allofthings.com";
//static NSString *kNISCServer = @"https://home-api.allofthings.com:5003";

//    #define API_SERVER      @"http://61.40.220.132:5008"      //개발서버 old
//    #define API_SERVER      @"http://61.40.220.132:5009"      //개발서버 - 0.6

//    #define API_SERVER      @"http://61.40.220.132:5007"        //개발서버 - 0.7
//    #define NISC_SERVER     @"http://61.40.220.132:5001"        //개발 센서 데이터 등록 (Geofencing)

//상용서버
//    #define API_SERVER      @"https://home-api.allofthings.com"       //상용서버
//    #define NISC_SERVER     @"https://home-api.allofthings.com:5003"  //N-MAS REST (Geofencing)

#else //운영모드

static NSString *kAPIServer = @"https://home-api.allofthings.com";
static NSString *kNISCServer = @"https://home-api.allofthings.com:5003";

//    #define API_SERVER      @"http://61.40.220.132:5008"      //개발서버 old
//    #define API_SERVER      @"http://61.40.220.132:5009"       //개발서버 - 0.6

//개발
//    #define API_SERVER      @"http://61.40.220.132:5007"        //개발서버 - 0.7
//    #define NISC_SERVER     @"http://61.40.220.132:5001"        //개발 센서 데이터 등록 (Geofencing)

//상용서버
//    #define API_SERVER      @"https://home-api.allofthings.com"       //상용서버
//    #define NISC_SERVER     @"https://home-api.allofthings.com:5003"  //N-MAS REST (Geofencing)

#endif


//Network Constants
#define API_ROOT_PATH       @"/v2"

//1 - 공통
#define API_GET_APP_VERSION     @"/app_version"
//#define API_GET_CODE_LIST   @"/getCodeList"

#define API_GET_MOBILE                  @"/mobile_device/%@"
#define API_POST_MOBILE                 @"/mobile_device"
#define API_POST_MOBILE_TOKEN           @"/mobile_device/%@/push_token"

//10 - 회원
#define API_POST_SIGN_IN                @"/member/login"        //로그인 - 변경 - 필드추가
#define API_GET_SIGN_IN_AUTO            @"/member"              //자동로그인 - 변경 - 필드 추가
#define API_POST_SIGN_OUT               @"/member/logout"       //로그아웃

#define API_POST_SIGN_UP                @"/member"              //회원가입
#define API_POST_MEMBER_UPDATE          @"/member/%@/%@"        //회원정보 수정
#define API_POST_AUTH_MAIL              @"/member/auth_mail"    //이메일 인증 재발송
#define API_POST_RESET_PWD              @"/member/password"     //비밀번호 재설정
#define API_GET_MOBILE_DEVICES          @"/member/devices"      //단말 목록
#define API_POST_NEW_MOBILE_DEVICE      @"/member/new_mobile_device" //새 단말 인증
#define API_POST_REPLACE_MOBILE_DEVICE  @"/member/replace_device"   //단말 교체
#define API_DELETE_MOBILE_DEVICE        @"/member/device"           //단말 등록 해제
#define API_POST_PUSH_SETTINGS          @"/member/push_noti"            //푸시 설정 변경
#define API_POST_MEMBER_UPDATE_IMAGE    @"/member/update_image"         //멤버프로필 이미지 수정

#define API_GET_CHECK_PWD               @"/member/%@"               //비밀번호 확인
#define API_DELETE_ACCOUNT              @"/member/%@"               //계정삭제
#define API_GET_MEMBER_ICONS            @"/member/icons"            //멤버아이콘 리스트


//#define API_POST_HOMEGROUP          @"/member/homegrp"      //홈 생성 - 폐기
//#define API_POST_HOMEGROUP_RENAME   @"/homegrp/name"        //홈 이름 변경 - 폐기
//#define API_POST_HOMEGROUP_LOCATION @"/homegrp/location"    //홈 위치 변경 - 폐기
//#define API_DELETE_HOMEGROUP        @"/homegrp/%@"          //홈그룹 삭제 - 폐기
//#define API_GET_HOMEGROUP           @"/homegrps"            //홈그룹 리스트 - 폐기


//#define API_POST_HOMEGROUP_LOCATION @"/member/homegrp/location" //홈 위치 등록

//12 - 초대
#define API_GET_HOMEGROUP_MEMBERS           @"/homegrp_members"         //홈그룹 멤버 목록
#define API_POST_HOMEGROUP_MEMBER_INVITE    @"/homegrp_members"         //홈멤버 초대
//#define API_POST_HOMEGROUP_MEMBER_UPDATE    @"/homegrp_members/%@"      //홈멤버 업데이트 - 폐기
//#define API_POST_HOMEGROUP_MEMBER_VALIDATE  @"/homegrp_members/email_validation"    //홈그룹 멤버 유효성체크 - 폐기
#define API_DELETE_HOMEGROUP_MEMBERS        @"/homegrp_members"         //홈멤버 삭제 - 추가
#define API_POST_HOMEGROUP_MEMBER_VALIDATE  @"/homegrp_members/validation"  //홈그룹 멤버 초대 유효성 체크
#define API_POST_HOMEGROUP_UPDATE_IMAGE     @"/homegrp/update_image"        //홈그룹 이미지 수정
#define API_GET_HOMEGROUP_MEMBER_INVITATIONS    @"/homegrp_members/invitations" //홈그룹 초대 목록 조회
#define API_POST_HOMEGROUP_MEMBER_INVITATIONS   @"/homegrp_members/invitations" //홈그룹 초대 수락/거절

//20 - dashboard
#define API_GET_DASHBOARD                   @"/dashboard"       //대시보드
#define API_GET_DASHBOARD_MODE_LIST         @"/modes"                   //대시보드 모드 조회
#define API_POST_DASHBOARD_MODE_CHANGE      @"/modes/%@/current_mode"   //대시보드 모드 변경
//#define API_GET_HOMELOG                     @"/homelog"         //홈로그 - 폐기
#define API_GET_NOTICE_COUNT                @"/notices/count"       //공지 및 알림 카운트
#define API_GET_NOTICE                      @"/notices"             //공지 목록 조회
#define API_GET_NOTICE_PERSONAL             @"/notices/personal"    //알림 목록 조회

//30 - Things
#define API_GET_HOMEHUB_STATUS              @"/devices/homehub/status"  //홈허브 상태 조회

//#define API_GET_GROUPS_DEVICES  @"/groups/devices"      //그룹 리스트 조회
//#define API_POST_GROUP          @"/groups"              //그룹 생성
//#define API_POST_GROUP_ADD      @"/groups/devices/%@"   //그룹에 장치 추가
//#define API_POST_GROUP_UPDATE   @"/groups/%@"           //그룹 수정
//#define API_DELETE_GROUP        @"/groups/%@"           //그룹 삭제
//#define API_POST_GROUP_DELETE   @"/groups/devices/%@"   //그룹 내 디바이스 삭제

#define API_PARAM_PAGING        @"?paging_datetime=%@&paging_type=%@"
#define API_GET_DEVICE_LIST     @"/devices"
#define API_GET_DEVICE_DETAIL   @"/devices/%@"
#define API_POST_NODE_COMMAND   @"/devices/%@/nodes/%@/commands"
#define API_GET_DEVICE_ICONS    @"/devices/icons/%@"       //디바이스 아이콘
#define API_GET_DEVICE_UPDATE   @"/devices/property/%@" //디바이스 수정
#define API_DELETE_DEVICE       @"/devices/%@"            //디바이스 삭제
#define API_GET_DEVICE_HOMEHUB_STATUS @"/devices/homehub/status"    //홈허브 장치 상태 정보 조회


#define API_GET_PARTNER_QR      @"/devices/partner_device/ownership"    //장치 유효성 검사
#define API_POST_PARTNER_QR     @"/devices/partner_device/ownership"    //장치 소유권 등록/이전


#define API_POST_DEVICE_INCLUSION   @"/devices/%@/commands/status"   //하위 장치 추가 제어 명령 실행 (인클루전)
#define API_GET_DEVICE_COMMAND      @"/devices/%@/commands/status"   //장치 상태(Polling) 제어 명령 조회
#define API_DELETE_DEVICE_EXCLUSION @"/devices/%@/commands/status"   //하위 장치 삭제 제어 명령 실행 (익스클루전)
#define API_GET_DEVICE_TYPES        @"/devices/device_class/%@"  //장치 유형 조회(Device Class)
#define API_POST_DEVICE_TYPES       @"/devices/device_class/%@"  //장치 유형 변경(Device Class)

//40 - Rules
#define API_GET_RULE            @"/rules"
#define API_GET_RULE_DETAIL     @"/rules/%@"
#define API_POST_RULE_STATUS    @"/rules/%@/status"
#define API_POST_RULE           @"/rules"
#define API_DELETE_RULE         @"/rules/%@"
#define API_POST_RULE_MODIFY    @"/rules/%@"
#define API_GET_RULE_CMDCLS     @"/rules/cmdcls/%@"
#define API_GET_RULE_MOBILE     @"/rules/mobile_devices"
#define API_GET_RULE_MEMBERS    @"/rules/mobile_members"
#define API_GET_ITEM_DEVICES    @"/rules/item_devices/%@"


#define API_GET_PRERULE_LIST    @"/predefined_rules"
#define API_GET_PRERULE_DETAIL  @"/predefined_rules/%@"
#define API_GET_PRERULE_DEVICES @"/predefined_rules/%@/devices/%@"

//50 - Scenes
#define API_GET_SCENE           @"/scenes"
#define API_GET_SCENE_DETAIL_HOMEMODE   @"/mode_scenes/%@"
#define API_POST_SCENE_HOMEMODE @"/mode_scenes/%@"

#define API_POST_SCENE_EXECUTE  @"/scenes/%@/execution"
#define API_POST_SCENE          @"/scenes"
#define API_DELETE_SCENE        @"/scenes/%@"
#define API_POST_SCENE_MODIFY   @"/scenes/%@"
#define API_GET_SCENE_CMDCLS    @"/scenes/cmdcls"

#define API_GET_PRESCENE_LIST    @"/predefined_scenes"
#define API_GET_PRESCENE_DETAIL  @"/predefined_scenes/%@"
#define API_GET_PRESCENE_DEVICES @"/predefined_scenes/%@/devices/%@"


//60 - 기타
#define API_GET_LOCATION_CODES   @"/common/weather_location_codes"

#define URL_PATH_POLICY         @"/html/page_app/app_personal_policy.html"
#define URL_PATH_TERMS          @"/html/page_app/app_user_terms.html"

//도움말 URL
#define URL_HELP_MAIL           @"mailto:help@allofthings.com"
#define URL_PATH_HELP           @"/html/page_app/app_help_01.html"

//앱스토어 링크
#define URL_APP_UPDATE          @"https://itunes.apple.com/kr/app/kneet/id1042171198?mt=8"
#define URL_DAWON_UPDATE        @"https://itunes.apple.com/kr/app/pm-b300w/id698046076?l=en&mt=8"

//Global Menu Id
//메뉴 이름, 메뉴 아이디, 부모-자식,
typedef NS_ENUM(NSInteger, KNMenuId) {
    KNMenuIdNone = -1,
    KNMenuIdLogin = 0,
    KNMenuIdDashboard,
    KNMenuIdThings,
    KNMenuIdScenes,
    KNMenuIdRules,
    KNMenuIdHomeLog,
    KNMenuIdHomeMember,
    KNMenuIdLogout,
    KNMenuIdSettings,
    KNMenuIdHelp,
    KNMenuIdTutorial
};

#define HOME_MODE_HOME      @"HOME"
#define HOME_MODE_AWAY      @"AWAY"
#define HOME_MODE_MORNING   @"MORNING"
#define HOME_MODE_NIGHT     @"NIGHT"

#define MOBILE_SERVICE_ID       @"20001"     //for kneet
#define MOBILE_DEVICE_TYPE      @"MI"        //디바이스 타입

#define APPSTORE_TYPE           @"A"
#define KNEET_DEVICE_CHECKIN    @"TRUE"
#define KNEET_DEVICE_CHECKOUT   @"FALSE"

#define KNEET_DEVICE_INCLUSION  @"INC"
#define KNEET_DEVICE_EXCLUSION  @"EXC"
#define KNEET_DEVICE_WAITING    @"WAT"


#define KNEET_MEMBER_MASTER     @"MAS"
#define KNEET_MEMBER_SIMPLE     @"SIM"

#define KNEET_MEMBER_TYPE_HOME  @"01"   //멤버
#define KNEET_MEMBER_TYPE_INV   @"02"   //초대중


#define API_RESPONSE_UNAUTHORIZED_TOKEN     @"401"
#define API_RESPONSE_UNAUTHORIZED_EMAIL     @"401-101"
#define API_RESPONSE_UNAUTHORIZED_DEVICE    @"401-103"
#define API_RESPONSE_UNAUTHORIZED_HOME      @"400-104"
#define API_RESPONSE_MOBILES_OVER           @"401-105"

//UserDefaults - for app
#define USDEF_APP_APPINIT       @"KneetAppInit"
#define USDEF_APP_AUTO_LOGIN    @"KneetAppAutoLogin"

#define USDEF_APP_USERID_LIST   @"KneetAppUserIdList"
//#define USER_DEF_MOBILE_ID      @"KneetMobileDeviceId"
//#define USER_DEF_MOBILE_AUTHOR  @"KneetMobileDeviceAuthorization"
//#define USER_DEF_GEOFENCE       @"KneetMobileDeviceGeoFence"
//#define USER_DEF_GEOFENCE_SENSORS  @"KneetMobileDeviceGeoFence"

//#define USER_DEF_POPUP_URL      @"KneetIntroPopUpURL"
//#define USER_DEF_POPUP_SHOW     @"KneetIntroPopUpShow"
#define USDEF_APP_TMP_EMAIL     @"KneetAppTempUserEmail"

//UserDefaults - for session
#define USDEF_SESSION_NEW_EMAIL     @"KneetNewUserEmail"
#define USDEF_SESSION_MODE_CHANGE   @"KneetModeChange"
#define USDEF_SESSION_AUTOTOKEN     @"KneetSessionLoginAuthToken"
#define USDEF_SESSION_NOTICE_READ_DATE  @"KneetSessionNoticeReadDatetime"


//Constants
#define ksKneetRulesDisable     @"X"

#define ksYES               @"Y"
#define ksNO                @"N"
#define ksRetire            @"R"
#define ksTrue              @"true"
#define ksFalse             @"false"
#define ksControlLeft       @"L"
#define ksControlRight      @"R"
#define ksControlUp         @"U"
#define ksControlDown       @"D"
#define ksTimezoneKorea     @"0024"

#define ksDataTypeCodeInteger   @"01"	//  integer
#define ksDataTypeCodeFloat     @"02"	//	float
#define ksDataTypeCodeString    @"03"	//	string
#define ksDataTypeCodeBoolean   @"04"	//	boolean
#define ksDataTypeCodeDateTime  @"05"	//	datetime
#define ksDataTypeCodeTime      @"06"	//	time

#define ksDayOfWeekMON      @"MON"
#define ksDayOfWeekTUE      @"TUE"
#define ksDayOfWeekWED      @"WED"
#define ksDayOfWeekTHU      @"THU"
#define ksDayOfWeekFRI      @"FRI"
#define ksDayOfWeekSAT      @"SAT"
#define ksDayOfWeekSUN      @"SUN"

#define kdListPagginSize            20
#define ksListPagingTypeUpward      @"U"
#define ksListPagingTypeDownward    @"D"

//Color Definition
#define kUIBodyColor        RGBCOLOR(243.0f, 243.0f, 243.0f)    //전체 배경컬러

#define kUIBgColor01        RGBCOLOR(32, 32, 32)                //기본 버튼 배경컬러
#define kUIBgColor02        RGBCOLOR(39.0f, 63.0f, 135.0f)      //기본 버튼 press컬러
#define kUIBgColor03        RGBCOLOR(116.0f, 147.0f, 204.0f)    //슬라이드 인 메뉴 상단 컬러
#define kUIBgColor04        [UIColor whiteColor]                //화이트 배경
#define kUIBgColor05        RGBCOLOR(187.0f, 187.0f, 187.0f)    //취소 버튼 등 그레이컬러
#define kUIBgColor06        RGBCOLOR(150.0f, 150.0f, 150.0f)    //취소 버튼 press 컬러
#define kUIBgColor07        RGBCOLOR(248.0f, 248.0f, 248.0f)    //리스트 그레이 컬러

#define kUILineColor        RGBCOLOR(255.0f, 110.0f, 43.0f)     //구분라인 1 - orange
#define kUILineColor2       RGBCOLOR(112.0f, 112.0f, 112.0f)    //구분라인 2 - 박스 내,

#define kUITextColor01      [UIColor whiteColor]                //화이트 컬러
#define kUITextColor02      RGBCOLOR(255.0f, 110.0f, 43.0f)     //포인트 컬러
#define kUITextColor03      RGBCOLOR(204.0f, 204.0f, 204.0f)    //연한 컬러
#define kUITextColor04      [UIColor blackColor]                //블랙 컬러

//Size Definition
#define kUIFontSize01       14.0f   //기본사이즈
#define kUIFontSize02       15.0f   //리스트 타이틀 / input text
#define kUIFontSize03       20.0f   //head size
#define kUIFontSize04       13.0f   //설명 등 작은 사이즈
#define kUIFontSize05       18.0f   //기본 버튼 / 팝업 타이틀 / things list value
#define kUIFontSize06       12.0f   //예외 매우 작은 사이즈
#define kUIFontSize07       27.0f   //things detail value 아주 큰 글씨


//UI Constants
#define kfNavigationBarHeight   60.0f
#define kfMainTabBarHeight      70.0f
#define kfBoxCap                1.0f
#define kfPageBottomMargin      20.0f
#define kfTransitionRightDur    0.3f

//#define kfLabelSizeFont01   18.0f
//#define kfLabelSizeFont03   15.0f
//
//#define kfScrollHeightForOlder 70.0f    //스크롤뷰의 이전 조회 시 추가값.



//메시지 정의
#define MSG_ALERT_APP_UPDATE            NSLocalizedString(@"새로운 업데이트 버전이 출시되었습니다.\n확인을 누르시면 업데이트 페이지로\n이동합니다.", @"새로운 업데이트 버전이 출시되었습니다.\n확인을 누르시면 업데이트 페이지로\n이동합니다.")
#define MSG_ALERT_ERROR_CRITICAL        NSLocalizedString(@"사용할수 없습니다.\n앱 종료 후 다시 시도하세요.", @"사용할수 없습니다.\n앱 종료 후 다시 시도하세요.")
#define MSG_ALERT_SERVER_FAIL           NSLocalizedString(@"서버에 연결할 수 없습니다.\n다시 시도하세요.", @"서버에 연결할 수 없습니다.\n다시 시도하세요.")
#define MSG_LOCATION_DISABLE            NSLocalizedString(@"[설정 > 개인정보보호 > 위치서비스]에서\nAoT@Home앱이 활성화되어\n있을 때에만 위치센서가 동작합니다", @"[설정 > 개인정보보호 > 위치서비스]에서\nAoT@Home앱이 활성화되어\n있을 때에만 위치센서가 동작합니다")
#define MSG_CAMERA_DISABLE            NSLocalizedString(@"[설정 > 개인정보보호 > 카메라]에서\nAoT@Home앱이 활성화되어\n있을 때에만 QR등록이 동작합니다", @"[설정 > 개인정보보호 > 카메라]에서\nAoT@Home앱이 활성화되어\n있을 때에만 QR등록이 동작합니다")

#define MSG_NOT_WIFI_STREAM             NSLocalizedString(@"WiFi 미연결 상태에서는\n데이터 통화료가 과도하게\n부과될 수 있으니 주의하세요", @"WiFi 미연결 상태에서는\n데이터 통화료가 과도하게\n부과될 수 있으니 주의하세요")


//kneet2_Definitions_h
#endif
