//
//  JDJSONModel.h
//  kneet
//
//  Created by Jason Lee on 2/9/15.
//  Copyright (c) 2015 ntels. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>

#import "JDJSONModel.h"
#import "DeviceModel.h"

@protocol InvitationModel;
@interface InvitationModel : JDJSONModel

@property (copy, nonatomic) NSString *homegrpId;
@property (copy, nonatomic) NSString *homegrpName;
@property (copy, nonatomic) NSString *nickname;
@property (copy, nonatomic) NSString *authorizationQuestion;
@property (copy, nonatomic) NSString *imageFileName;

//temp
@property (copy, nonatomic) NSString *sdate;

@end

@interface InvitationListModel : JDJSONModel

@property (copy, nonatomic) NSMutableArray<InvitationModel> *list;

@end

@protocol QuizModel;
@interface QuizModel : JDJSONModel
@property (copy, nonatomic) NSString *quiz;
@property (copy, nonatomic) NSString *quizId;
@property (copy, nonatomic) NSString *statusCode;

-(BOOL)isUserEditQuiz;

@end

@interface QuizListModel : JDJSONModel
@property (copy, nonatomic) NSMutableArray<QuizModel> *quizList;
@end


@protocol HomeMemberModel;
@interface HomeMemberModel : JDJSONModel

@property (copy, nonatomic) NSString *memberTypeCode;
@property (copy, nonatomic) NSString *nickname;
@property (copy, nonatomic) NSString *imageFileName;
@property (copy, nonatomic) NSString *gradeCode;
@property (copy, nonatomic) NSString *memberId;
@property (copy, nonatomic) NSString *permissionTransferFlag;

//temp
@property (strong, nonatomic) NSString *targetEmail;
@property (strong, nonatomic) NSString *targetPhone;

@end

@interface HomeMemberListModel : JDJSONModel

@property (copy, nonatomic) NSString *limitCnt; //멤버 등록 제한 숫자(Default : 10)
@property (copy, nonatomic) NSArray<HomeMemberModel> *ctrtGrpMemberList; //홈그룹 멤버 목록
@property (assign, nonatomic, readonly) BOOL isRemainInvite;

@end

@protocol MemberIconModel;
@interface MemberIconModel : JDJSONModel

@property (copy, nonatomic) NSString *imageFileName;
@property (copy, nonatomic) NSString *imageFilePath;

@end

@interface MemberIconListModel : JDJSONModel

@property (copy, nonatomic) NSArray<MemberIconModel> *iconList;

@end

@interface MobileDeviceListModel : JDJSONModel

@property (strong, nonatomic) NSMutableArray<MobileDeviceModel> *deviceList;

@end

@protocol ContractGroupModel;
@interface ContractGroupModel : JDJSONModel

@property (copy, nonatomic) NSString *deviceExistYn;
@property (copy, nonatomic) NSString *firmwareUpdateYn;
@property (copy, nonatomic) NSString *pushTypeModeChgYn;
@property (copy, nonatomic) NSString *ctrtGrpId;
@property (copy, nonatomic) NSString *ctrtGrpName;
@property (copy, nonatomic) NSString *gradeCode;
@property (copy, nonatomic) NSString *masterTransferPopupYn;


@end
// 회원가입

// 퀴즈 명
// 퀴즈 ID
// 퀴즈 선택입력, 사용자 입력 여부
// 퀴즈 정답
// 휴대폰 번호
// 사용자 ID
// 사용자 PW
// cust_id
// ctrt_grp_id
@protocol signUpModel;
@interface SignUpModel : JDJSONModel

@property (copy, nonatomic) NSString *quiz;
@property (copy, nonatomic) NSString *quizId;
@property (copy, nonatomic) NSString *statusCode;
@property (copy, nonatomic) NSString *answer;
@property (copy, nonatomic) NSString *phone;
@property (copy, nonatomic) NSString *memberId;
@property (copy, nonatomic) NSString *custId;
@property (copy, nonatomic) NSString *ctrtGrpId;

@end

@interface LoginModel : SocketModel

//회원 번호
//이메일 ID
//서비스 ID
//국가 코드 (ex: KR)
//타임존 ID
//타임존 시간 (ex: +09:00)
//언어 코드 (ex: en)
//인증 토큰
//회원 여부
//회원 이미지
//회원 닉네임
@property (copy, nonatomic) NSString *memberId;
@property (copy, nonatomic) NSString *phone;
@property (copy, nonatomic) NSString *emailId;
@property (copy, nonatomic) NSString *serviceId;
@property (copy, nonatomic) NSString *authToken; //인증 토큰
@property (copy, nonatomic) NSString *profileImage; //(회원) 이미지 파일 명
@property (copy, nonatomic) NSString *msoImageUrl; //(회원) 이미지 파일 명
@property (copy, nonatomic) NSString *imageFile;
@property (copy, nonatomic) NSString *member;
@property (copy, nonatomic) NSString *quiz;
@property (copy, nonatomic) NSString *nickname; //(회원) 닉네임
@property (copy, nonatomic) NSString *tempPasswordYn; //임시 비밀번호 여부 (Y : 임시 비밀번호, N : 기존 비밀번호)
@property (copy, nonatomic) NSString *pushTypeModeChgYn; //모드가 바뀔 때 알림 설정 여부 (Y : 사용, N : 미사용)
@property (copy, nonatomic) NSString *pushTypePrsncChgYn;
@property (copy, nonatomic) NSString *phoneAuthYn;

@property (copy, nonatomic) NSString *custId; //고객 ID
@property (copy, nonatomic) NSString *ctrtGrpId; //계약그룹ID(고객 ID와 동일)
@property (copy, nonatomic) NSString *selectCtrtGrpId; //가장 마지막 선택된 계약그룹 ID
@property (assign, nonatomic, readonly) ContractGroupModel *ctrtGrp; //선택된 계약그룹

@property (copy, nonatomic) NSString *homegrpId;
@property (copy, nonatomic) NSString *homegrpName;
@property (copy, nonatomic) NSString *homegrpImageFileName;
@property (copy, nonatomic) NSString *hoemgrpName;

@property (copy, nonatomic) NSString *gradeCode;
@property (copy, nonatomic) NSString *homehubDeviceId;
@property (copy, nonatomic) NSString *homehubOnlineState;
@property (copy, nonatomic) NSString *homehubCreateDatetime;

@property (copy, nonatomic) NSString *invitationsCount;

@property (copy, nonatomic) NSString *servicehubApplicationId;

@property (strong, nonatomic) NSMutableArray<ContractGroupModel> *ctrtGrpList; //계약그룹 목록

@property (copy, nonatomic) NSMutableArray *deviceList; //디바이스 목록
@property (strong, nonatomic) NSString *selectedHomeHubID;
@property (weak, nonatomic) DeviceModel *modifyHomeHub;
//@property (copy, nonatomic) NSString *deviceOnline;
//@property (copy, nonatomic) NSString *deviceOnlineLastDatetime;
//@property (copy, nonatomic) NSString *deviceConn;

//local store
@property (strong, nonatomic) NSMutableDictionary *localStorage;
@property (strong, nonatomic) NSString *newEmailId; //로컬에 저장 - 임시 이메일
@property (strong, nonatomic) NSString *modeChange; //로컬에 저장 - 모드 최초 실행 여부
@property (strong, nonatomic) NSString *noticeReadTime; //로컬에 저장 - 세션 공지 읽음 날짜
@property (strong, nonatomic) NSString *personalNoticeReadTime; //로컬에 저장 - 세션 알림 읽음 날짜


//권한
@property (assign, nonatomic) NSInteger level;

//local transition
@property (assign, nonatomic, readonly) BOOL isHomehubOnline;
@property (assign, nonatomic, readonly) BOOL hasHomeHub;

@property (assign, nonatomic, readonly) NSString *authorization;


-(void)setHomeHubID:(NSString *)homeHubID;
-(NSString *)getHomeHubID;
-(DeviceModel *)getHomeHub:(NSString*)homeHubId;
-(DeviceModel *)getHomeHub;
- (BOOL)onlineHomeHubFromSelectedHub:(DeviceModel*)selectedHub ;
- (BOOL)connectedHomeHubFromSelectedHub:(DeviceModel*)selectedHub ;
- (BOOL)isMultiHomeHub;

@end


//아이디찾기
@interface FindIdPwModel : JDJSONModel

@property (copy, nonatomic) NSString *memberId;
@property (copy, nonatomic) NSString *nickname;

@end

