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

#import "LSSweepsWinners+RCTNativeModel.h"
#import "LSWinnersCampaign+RCTNativeModel.h"
#import <React/RCTUtils.h>

@implementation LSSweepsWinners (RCTNativeModel)
- (NSDictionary *)reactNativeRepresentation {
    NSMutableArray *campaigns;
    for (LSWinnersCampaign *campaign in self.campaigns) {
        if (!campaigns)
            campaigns = [NSMutableArray array];
        
        [campaigns addObject:[campaign reactNativeRepresentation]];
    }
    
    return @{
             @"nextDrawDate":RCTNullIfNil(self.nextDrawDateString),
             @"campaigns":RCTNullIfNil(campaigns)
             };
}

@end
