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

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

@implementation LSWinnersCampaign (RCTNativeModel)
- (NSDictionary *)reactNativeRepresentation {
    NSMutableArray *winners;
    for (LSSweepsWinner *winner in self.winners) {
        if (!winners)
            winners = [NSMutableArray array];
        
        [winners addObject:[winner reactNativeRepresentation]];
    }
    
    return @{
             @"campaignName":RCTNullIfNil(self.campaignName),
             @"winners":RCTNullIfNil(winners)
             };
}

@end
