//
//  CfLogLoyalty.m
//  ReactNativeCfLoyalty
//
//  Created by MOIZ HASSAN KHAN on 2/5/24.
//  Copyright © 2024 Facebook. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <React/RCTBridgeModule.h>

@interface RCT_EXTERN_MODULE(CfLogLoyalty, NSObject)

//RCT_EXTERN_METHOD(multiply:(float)a withB:(float)b
//                 withResolver:(RCTPromiseResolveBlock)resolve
//                 withRejecter:(RCTPromiseRejectBlock)reject)

// Expose Swift method 1
RCT_EXTERN_METHOD(logLevelEvent:(NSString *)prevLevel
                  newLevel:(NSString *)newLevel
                  moduleId:(NSString *)moduleId
                  updateImmediately:(BOOL)updateImmediately)


RCT_EXTERN_METHOD(logMilestoneEvent:(NSString *)milestoneId
                  action:(NSString *)action
                  updateImmediately:(BOOL)updateImmediately)


RCT_EXTERN_METHOD(logPromoEvent:(NSString *)promoId
                  action:(NSString *)action
                  promoTitle:(NSString *)promoTitle
                  promoType:(NSString *)promoType
                  itemList:(NSString *)itemList
                  updateImmediately:(BOOL)updateImmediately)


RCT_EXTERN_METHOD(logSurveyEvent:(NSString *)action
                  survey:(NSString *)survey
                  responseList:(NSString *)responseList
                  updateImmediately:(BOOL)updateImmediately)


RCT_EXTERN_METHOD(logRewardEvent:(NSString *)rewardId
                  action:(NSString *)action
                  totalPoints:(nonnull NSNumber *)totalPoints
                  accPoints:(nonnull NSNumber *)accPoints
                  redeemObject:(nullable NSString *)redeemObject
                  updateImmediately:(BOOL)updateImmediately)


RCT_EXTERN_METHOD(updateSurveyCatalog:(NSString *)surveyId
                  surveyCatalogModel:(NSString *)surveyCatalogModel)


RCT_EXTERN_METHOD(updateRewardCatalog:(NSString *)rewardId
                  rewardCatalogModel:(NSString *)rewardCatalogModel)


+ (BOOL)requiresMainQueueSetup
{
  return YES;
}

@end
