/*!
 @header    GAIEcommerceFields.h
 @abstract  Google Analytics iOS SDK Ecommerce Hit Format Header
 @copyright Copyright 2014 Google Inc. All rights reserved.
 */

#import <Foundation/Foundation.h>

/*!
 This class provides several fields and methods useful as wire format parameters for
 Enhanced Ecommerce. See the online developer guides for Enhanced Ecommerce for details
 on how to use the Enhanced Ecommerce features.
 */

// Enhanced Ecommerce Product fields
extern NSString *const kGAIProductId;
extern NSString *const kGAIProductName;
extern NSString *const kGAIProductBrand;
extern NSString *const kGAIProductCategory;
extern NSString *const kGAIProductVariant;
extern NSString *const kGAIProductPrice;
extern NSString *const kGAIProductQuantity;
extern NSString *const kGAIProductCouponCode;
extern NSString *const kGAIProductPosition;

extern NSString *const kGAIProductAction;

// product action values
extern NSString *const kGAIPADetail;
extern NSString *const kGAIPAClick;
extern NSString *const kGAIPAAdd;
extern NSString *const kGAIPARemove;
extern NSString *const kGAIPACheckout;
extern NSString *const kGAIPACheckoutOption;
extern NSString *const kGAIPAPurchase;
extern NSString *const kGAIPARefund;

// product action fields
// used for 'purchase' and 'refund' actions
extern NSString *const kGAIPATransactionId;
extern NSString *const kGAIPAAffiliation;
extern NSString *const kGAIPARevenue;
extern NSString *const kGAIPATax;
extern NSString *const kGAIPAShipping;
extern NSString *const kGAIPACouponCode;
// used for 'checkout' action
extern NSString *const kGAICheckoutStep;
extern NSString *const kGAICheckoutOption;
// used for 'detail' and 'click' actions
extern NSString *const kGAIProductActionList;
extern NSString *const kGAIProductListSource;

// Enhanced Ecommerce Impressions fields
extern NSString *const kGAIImpressionName;
extern NSString *const kGAIImpressionProduct;
extern NSString *const kGAIImpressionProductId;
extern NSString *const kGAIImpressionProductName;
extern NSString *const kGAIImpressionProductBrand;
extern NSString *const kGAIImpressionProductCategory;
extern NSString *const kGAIImpressionProductVariant;
extern NSString *const kGAIImpressionProductPosition;
extern NSString *const kGAIImpressionProductPrice;

// Enhanced Ecommerce Promotions fields
extern NSString *const kGAIPromotionId;
extern NSString *const kGAIPromotionName;
extern NSString *const kGAIPromotionCreative;
extern NSString *const kGAIPromotionPosition;

// Promotion actions
extern NSString *const kGAIPromotionAction;
extern NSString *const kGAIPromotionView;
extern NSString *const kGAIPromotionClick;

@interface GAIEcommerceFields : NSObject

/*!
 Generates an enhanced ecommerce product field.  Note that field names generated by
 customDimensionForIndex and customMetricForIndex can be used as suffixes.

 @param index the index of the product
 @param suffix the product field suffix (such as kGAIProductPrice).

 @return an NSString representing the product field parameter
 */
+ (NSString *)productFieldForIndex:(NSUInteger)index suffix:(NSString *)suffix;

/*!
 Genrates an enhanced ecommerce impression list field name with an index.  The return value of
 this method should also be used as input to the productImpressionForList method below.

 @param index the index of the impression list

 @return an NSString representing the impression list parameter
 */
+ (NSString *)impressionListForIndex:(NSUInteger)index;

/*!
 Generates an enhanced ecommerce product impression field with the impression list, product index
 and product suffix as parameters.  The output of the method impressionListForIndex above should be
 used as the input list for this method.  The output of customDimensionForIndex and
 customMetricForIndex can be used as suffixes.

 @param list the impression list for this product impression
 @param index the index of this product in the impression list
 @param suffix the product impression suffix for this field

 @return an NSString representing this product impression field parameter
 */
+ (NSString *)productImpressionForList:(NSString *)list
                                 index:(NSUInteger)index
                                suffix:(NSString *)Suffix;

/*!
 Generates an enhanced ecommerce promotion field with an index and suffix.

 @param index the index of the promotion
 @param suffix the promotion suffix (such as kGAIPromotionId)

 @return an NSString representing this promotion field paramter
 */
+ (NSString *)promotionForIndex:(NSUInteger)index suffix:(NSString *)suffix;
@end
