//
//  LSGeolocationSurvey+RCTNativeModel.m
//  ReactLightspeedSDK
//
//  Created by marc matta on 12/9/16.
//  Copyright © 2016 com.lightspeed. All rights reserved.
//

#import "LSGeolocationSurvey+RCTNativeModel.h"
#import "LSGeolocationSurveyScheduleSetting+RCTNativeModel.h"
#import "LSGeolocationSurveyLocationCategory+RCTNativeModels.h"
#import "RCTLSUtils.h"

@implementation LSGeolocationSurvey (RCTNativeModel)

- (NSDictionary *)reactNativeRepresentation {
    return @{
             @"surveyId" : @(RCTZeroIfNaN(self.surveyId)),
             @"gtmSurveyId" : @(RCTZeroIfNaN(self.gtmSurveyId)),
             @"surveyName" : RCTNullIfNil(self.surveyName),
             @"surveyDescription": RCTNullIfNil(self.surveyDescription),
             @"surveyLength" : @(RCTZeroIfNaN(self.surveyLength)),
             @"surveyUrl" : RCTNullIfNil(self.surveyUrl),
             @"resultType" : RCTNullIfNil(self.resultType),
             @"awardMessage" : RCTNullIfNil(self.awardMessage),
             @"screenAwardMessage" : RCTNullIfNil(self.screenAwardMessage),
             @"lmSampleId" : @(RCTZeroIfNaN(self.lmSampleId)),
             @"lmQuotaId" : @(RCTZeroIfNaN(self.lmQuotaId)),
             @"isSamSample" : @(self.isSamSample),
             @"activityType": RCTNullIfNil(self.activityType),
             @"surveyAppType": @(RCTZeroIfNaN(self.surveyAppType)),
             @"surveyType": RCTNullIfNil(self.surveyType),
             @"latitude": @(RCTZeroIfNaN(self.latitude)),
             @"longitude": @(RCTZeroIfNaN(self.longitude)),
             @"locationName": RCTNullIfNil(self.locationName),
             @"distance": @(RCTZeroIfNaN(self.distance)),
             @"radius": @(RCTZeroIfNaN(self.radius)),
             @"providerGeoLocationId": @(RCTZeroIfNaN(self.providerGeoLocationId)),
             @"loiterTime": @(RCTZeroIfNaN(self.loiterTime)),

             @"locationId" : @(RCTZeroIfNaN(self.locationId)),
             @"locationDescription" : RCTNullIfNil(self.locationDescription),
             @"surveyType" : RCTNullIfNil(self.surveyType),
             @"minSpeed" : @(RCTZeroIfNaN(self.minSpeed)),
             @"maxSpeed" : @(RCTZeroIfNaN(self.maxSpeed)),
             @"startAtLocation" : @(self.startAtLocation),
             @"quotaType" : RCTNullIfNil(self.quotaType),
             @"quota" : @(RCTZeroIfNaN(self.quota)),
             @"expirationTime" : @(RCTZeroIfNaN(self.expirationTime)),
             @"address" : RCTNullIfNil(self.address),
             @"city" : RCTNullIfNil(self.city),
             @"countryCode" : RCTNullIfNil(self.countryCode),
             @"state" : RCTNullIfNil(self.state),
             @"alertTrigger" : RCTNullIfNil(self.alertTrigger),
             @"scheduleSettings" : [RCTLSUtils LSArrayFromNativeModels:self.scheduleSettings],
             @"locationCategory" : RCTNullIfNil([self.locationCategory reactNativeRepresentation])
             };
}
@end
