//
 /***************************************************************
 * Copyright © 2017 HERE Global B.V. All rights reserved. *
 **************************************************************/

#import "HereSDKDemandRideStatusUpdate+Dictionary.h"
#import "NSString+Utilities.h"
#import "NSDate+NSNumber.h"

@implementation HereSDKDemandRideStatusUpdate (Dictionary)

+ (NSString*)updateStatusToString:(HereSDKDemandRideStatusUpdateStatus)status {
  switch (status) {
    case HereSDKDemandRideStatusLogRecordUnknown:
      return @"UNRECOGNIZED";
      break;
    case HereSDKDemandRideStatusLogRecordProcessing:
      return @"PROCESSING";
      break;
    case HereSDKDemandRideStatusLogRecordRejected:
      return @"REJECTED";
      break;
    case HereSDKDemandRideStatusLogRecordAccepted:
      return @"ACCEPTED";
      break;
    case HereSDKDemandRideStatusLogRecordDriverAssigned:
      return @"DRIVER_ASSIGNED";
      break;
    case HereSDKDemandRideStatusLogRecordDriverEnRoute:
      return @"DRIVER_EN_ROUTE";
      break;
    case HereSDKDemandRideStatusLogRecordDriverAtPickup:
      return @"AT_PICKUP";
      break;
    case HereSDKDemandRideStatusLogRecordPassengerOnBoard:
      return @"PASSENGER_ON_BOARD";
      break;
    case HereSDKDemandRideStatusLogRecordDriverAtDropoff:
      return @"AT_DROP_OFF";
      break;
    case HereSDKDemandRideStatusLogRecordCompleted:
      return @"COMPLETED";
      break;
    case HereSDKDemandRideStatusLogRecordCancelled:
      return @"CANCELLED";
      break;
    default:
      return @"UNRECOGNIZED";
  }
}

- (NSDictionary *)dictionary
{
    return @{ @"status": [HereSDKDemandRideStatusUpdate updateStatusToString:self.status],
              @"timestamp": self.timestamp.hereSdk_toNumber,
              };
}

@end
