//
//  APMServicesConfigPrivate.h
//  APMServices
//
//  Created by Vincent Ducastel on 21/05/2015.
//  Copyright (c) 2015 Moonmiles. All rights reserved.
//

//Debug
#define APM_DEBUG_LOG_SERVICES false

//Header HTTP request
#define APM_TYPE_OS                 @"ios"
#define APM_K_AUTHORIZATION         @"Authorization"
#define APM_K_BEARER                @"Bearer "
#define APM_K_VERSION               @"version"
#define APM_K_APPID                 @"appID"
#define APM_K_LANG                  @"lang"
#define APM_K_DEFAULT_LANGUAGE      @"defaultLanguage"
#define APM_K_OS                    @"osType"
#define APM_K_DEVICE_NAME           @"device_name"
#define APM_K_DEVICE_VERSION        @"device_version"
#define APM_K_DEVICE_MODEL          @"device_model"
#define APM_K_DEVICE_UDID           @"device_udid"
#define APM_K_APM_VERSION_NAME      @"apmVersionName"
#define APM_K_APM_VERSION_CODE      @"apmVersionCode"
#define APM_K_PARTNER_VERSION_NAME  @"partnerVersionName"
#define APM_K_PARTNER_VERSION_CODE  @"partnerVersionCode"
#define APM_K_USER_TOKEN            @"userToken"
#define APM_K_SERVICES_VERSION_NAME @"serviceVersionName"
#define APM_K_SERVICES_VERSION_CODE @"serviceVersionCode"
#define APM_K_SEGMENTS              @"segments"
#define APM_K_HEADER_PARTNER_ID     @"partnerID"

// Common
#define APM_K_ID       @"id"

// Partner keys
#define APM_K_PARTNER_SECRET       @"partnerSecret"
#define APM_K_PARTNER_ID           @"partnerID"
#define APM_K_PARTNER_SCHM         @"apmScheme"
#define APM_K_PARTNER_LABEL        @"partnerLabel"
#define APM_K_PARTNER_STOREID      @"storeID"
#define APM_K_PARTNER_URL          @"partnerUrl"
#define APM_K_PARTNER_CONTENT      @"content"
#define APM_K_PARTNER_MAXGENE      @"maxGenerosity"
#define APM_K_PARTNER_MEDIA        @"media"
#define APM_K_PARTNER_LEVEL        @"partnerLevel"
#define APM_K_PARTNER_LIST         @"partners"

// User keys
#define APM_K_USER                   @"user"
#define APM_K_USER_BALANCE           @"userBalance"
#define APM_K_USER_OBSOLETE_BALANCE  @"userObsoleteBalance"
#define APM_K_USER_TOTAL_EARN        @"totalEarn"
#define APM_K_USER_STATUS            @"status"
#define APM_K_USER_BIRTHDATE         @"birthdate"
#define APM_K_USER_EMAIL             @"email"
#define APM_K_USER_PWD               @"pwd"
#define APM_K_USER_FIRSTNAME         @"firstName"
#define APM_K_USER_GENDER            @"gender"
#define APM_K_USER_LASTNAME          @"lastName"
#define APM_K_USER_MOBILE            @"mobileNumber"
#define APM_K_USER_TOWN              @"town"
#define APM_K_USER_LOGIN             @"login"
#define APM_K_USER_TOKEN             @"userToken"
#define APM_K_USER_ISADMIN           @"isAdmin"
#define APM_K_USER_FACEBOOK_ID       @"fbID"
#define APM_K_USER_PARTNER_CLIENT_ID @"partnerClientID"
#define APM_K_USER_OLD_CLIENT_ID     @"oldClientID"
#define APM_K_USER_OLDPWD            @"oldPwd"
#define APM_K_USER_NEWPWD            @"newPwd"
#define APM_K_USER_CONFIRMPWD        @"confirmPwd"
#define APM_K_USER_NOTIFSMS          @"isNotifSMS"
#define APM_K_USER_NOTIFMAIL         @"isNotifMail"
#define APM_K_USER_NOTIFPUSH         @"isNotifPush"
#define APM_K_USER_COMMENT           @"comment"
#define APM_K_USER_PUSHTOKEN         @"pushToken"
#define APM_K_USER_NOTE              @"note"
#define APM_K_USER_SEGMENTS          @"segments"
#define APM_K_USER_LOYALTY_ID        @"loyaltyID"
#define APM_K_USER_CUSTOM_PARAMS     @"customParams"

// Device keys
#define APM_K_DEVICE                 @"device"
#define APM_K_DEVICE_STATUS          @"deviceStatus"


// Ad
#define APM_K_AD_ID         @"adID"
#define APM_K_AD_CONTENT    @"content"
#define APM_K_AD_MEDIA      @"media"
#define APM_K_AD_LARGEMEDIA @"largeMedia"
#define APM_K_AD_LABEL      @"label"
#define APM_K_AD_TYPE       @"type"
#define APM_K_AD_LIST       @"ads"

// Prog keys
#define APM_K_PROG             @"prog"
#define APM_K_PROG_ISACTIVE    @"isActive"
#define APM_K_PROG_OFFDURATION @"offDuration"
#define APM_K_PROG_INFOMSG     @"progInfoMsg"
#define APM_K_PROG_TTL         @"progTTL"
#define APM_K_PROG_OFFDURATION_END_DATE @"offDurationEndDate"
#define APM_K_PROG_TTL_END_DATE @"progTTLEndDate"
#define APM_K_PROG_DEBUG_MODE   @"debugMode"
#define APM_K_PROG_DEFAULT_LANGUAGE   @"defaultLanguage"

// Generosity keys
#define APM_K_GENEROSITY_MSG                @"generosityMsg"
#define APM_K_GENEROSITY_VALUE              @"generosityValue"
#define APM_K_GENEROSITY_FREQUENCE          @"generosityFrequence"
#define APM_K_GENEROSITY_PLAFOND            @"generosityPlafond"
#define APM_K_GENEROSITY_ID                 @"generosityID"
#define APM_K_GENEROSITY_TAGID              @"tagID"
#define APM_K_GENEROSITY_TAGLABEL           @"tagLabel"
#define APM_K_GENEROSITY_ACTION_NAME        @"actionName"
#define APM_K_GENEROSITY_FREQUENCIES        @"frequencies"
#define APM_K_GENEROSITY_FREQUENCIES_LABEL  @"label"
#define APM_K_GENEROSITY_FREQUENCIES_OFFSET @"offset"
#define APM_K_GENEROSITY_VALUES             @"values"
#define APM_K_GENEROSITY_LIST               @"generosities"
#define APM_K_GENEROSITY_CLASSID            @"classID"
#define APM_K_GENEROSITY_LAT                @"lat"
#define APM_K_GENEROSITY_LNG                @"long"
#define APM_K_GENEROSITY_NEXT               @"generosityNext"
#define APM_K_GENEROSITY_FIRST              @"generosityFirst"
#define APM_K_GENEROSITY_GET_NEXT_TAG       @"getNextTag"
#define APM_K_GENEROSITY_TRIGGED_AT         @"triggedAt"
#define APM_K_GENEROSITY_OFFSET             @"generosityOffset"
#define APM_K_GENEROSITY_TYPE               @"generosityType"
#define APM_K_GENEROSITY_DEEPLINK_URL       @"generosityUrl"

// Generosities
#define APM_K_GENEROSITIES                  @"generosities"

// Gift keys
#define APM_K_GIFT                 @"gift"
#define APM_K_GIFT_AMOUNT          @"amount"
#define APM_K_GIFT_ID              @"giftID"
#define APM_K_GIFT_LABEL           @"giftLabel"
#define APM_K_GIFT_TITLE           @"label"
#define APM_K_GIFT_CONTENT         @"content"
#define APM_K_GIFT_IMAGE           @"media"
#define APM_K_GIFT_VALUE           @"value"
#define APM_K_GIFT_LIST            @"gifts"
#define APM_K_GIFT_CATEGORIES      @"categorie"
#define APM_K_GIFT_CATEGORIE_ID    @"categID"
#define APM_K_GIFT_CATEGORIE_LABEL @"categoryLabel"
#define APM_K_GIFT_TYPE            @"type"
#define APM_K_GIFT_CODE            @"code"
#define APM_K_GIFT_CONDITIONS      @"conditions"
#define APM_K_GIFT_IS_ENOUGH       @"isEnough"
#define APM_K_GIFT_QUANTITY        @"quantity"
#define APM_K_GIFT_TOTAL           @"total"
#define APM_K_GIFT_CONFIRM_MESSAGE @"confirmMessage"
#define APM_K_GIFT_NATURE          @"nature"
#define APM_K_GIFT_ACCESSIBILITY   @"accessibility"

// Burn keys
#define APM_K_BURN_LIST       @"burns"
#define APM_K_BURN_ID         @"burnID"
#define APM_K_BURN_DATE       @"burnDate"
#define APM_K_BURN_VALUE      @"value"
#define APM_K_BURN_LABEL      @"label"
#define APM_K_BURN_URL_SCHEME @"burnUrlScheme"
#define APM_K_BURN_MEDIA      @"media"
#define APM_K_BURN_CONDITION  @"conditions"
#define APM_K_BURN_NATURE     @"nature"

// Earn keys
#define APM_K_EARN       @"earn"
#define APM_K_EARN_LIST  @"earns"
#define APM_K_EARN_ID    @"earnID"
#define APM_K_EARN_DATE  @"earnDate"
#define APM_K_EARN_VALUE @"earnValue"
#define APM_K_EARN_LABEL @"earnLabel"

// Page keys
#define APM_K_PAGE_LIST            @"pages"
#define APM_K_PAGE_CONTENT         @"content"
#define APM_K_PAGE_LABEL           @"label"

// HowWorks keys
#define APM_K_HOW_WORKS_LIST       @"howworks"
#define APM_K_HOW_WORKS_LABEL      @"label"
#define APM_K_HOW_WORKS_CONTENT    @"content"
#define APM_K_HOW_WORKS_TYPE       @"type"
#define APM_K_HOW_WORKS_ACTIONS    @"actions"
#define APM_K_HOW_WORKS_GIFTS      @"gifts"
#define APM_K_HOW_WORKS_TARGET     @"isConnected"

// Walkthrough keys
#define APM_K_WALKTHROUGH_LIST              @"walkthrough"
#define APM_K_WALKTHROUGH_ID                @"pageId"
#define APM_K_WALKTHROUGH_LABEL             @"label"
#define APM_K_WALKTHROUGH_CONTENT           @"content"
#define APM_K_WALKTHROUGH_THRESHOLD         @"threshold"
#define APM_K_WALKTHROUGH_DELAY             @"delay"
#define APM_K_WALKTHROUGH_TARGET            @"isConnected"
#define APM_K_WALKTHROUGH_CLEARABLE         @"isClearable"
#define APM_K_WALKTHROUGH_STATUS            @"status"
#define APM_K_WALKTHROUGH_VIEWED_AT         @"viewedAt"
#define APM_K_WALKTHROUGH_COUNT             @"count"

// User Status keys
#define APM_K_USER_STATUS_LIST              @"statuses"
#define APM_K_USER_STATUS_ID                @"id"
#define APM_K_USER_STATUS_LABEL             @"label"
#define APM_K_USER_STATUS_ILLUS             @"illus"
#define APM_K_USER_STATUS_DESC              @"desc"
#define APM_K_USER_STATUS_COLOR             @"color"
#define APM_K_USER_STATUS_STEP              @"step"

// Versions keys
#define APM_K_VERSIONS              @"versions"

// Theme keys
#define APM_K_THEME              @"theme"

// Traductions keys
#define APM_K_TRADUCTIONS              @"traductions"

// Other keys
#define APM_K_DATE  @"gmtDate"
#define APM_K_PLACE @"localisation"

// Functions
#define APM_FUNC_USER_CHECK_CREDENTIALS        1
#define APM_FUNC_USER_CREATE                   2
#define APM_FUNC_USER_SETPARTNERCLIENTID       3
#define APM_FUNC_USER_SETADHESION              4
#define APM_FUNC_USER_EVALUATE                 5
#define APM_FUNC_USER_SAVEPUSHTOKEN            6
#define APM_FUNC_USER_CHECK_FB_CREDENTIALS     7
#define APM_FUNC_USER_EDIT                     8
#define APM_FUNC_USER_SAVE                     9
#define APM_FUNC_USER_HISTORYEARNS             10
#define APM_FUNC_USER_HISTORYBURNS             11
#define APM_FUNC_USER_SAVEPWD                  12
#define APM_FUNC_USER_RENEWPWD                 13
#define APM_FUNC_USER_CHECK_TOKEN              14
#define APM_FUNC_USER_LOGOUT                   15
#define APM_FUNC_USER_HISTORY                  16
#define APM_FUNC_USER_GETSETTINGS              17
#define APM_FUNC_USER_SAVESETTINGS             18
#define APM_FUNC_USER_CONTACT                  19
#define APM_FUNC_PARTNER_GET_PROG              20
#define APM_FUNC_PARTNER_LIST                  21
#define APM_FUNC_GENEROSITY_STORE              22
#define APM_FUNC_GENEROSITY_LIST               23
#define APM_FUNC_GENEROSITY_LIST_PARAMS        24
#define APM_FUNC_GENEROSITY_SAVE               25
#define APM_FUNC_GENEROSITY_REMOVE             26
#define APM_FUNC_GIFT_GETOBJECT                28
#define APM_FUNC_GIFT_NOTIFICATION             29
#define APM_FUNC_GIFT_LIST                     30
#define APM_FUNC_GIFT_CHECKAVAILABILITY        31
#define APM_FUNC_GIFT_CATEGORYLIST             32
#define APM_FUNC_GIFT_VIEW                     33
#define APM_FUNC_INIT_CHECK_STORE              34
#define APM_FUNC_AD_LIST                       35
#define APM_FUNC_PAGE_CNIL                     36
#define APM_FUNC_PAGE_CGU                      37
#define APM_FUNC_PAGE_MENTIONS                 38
#define APM_FUNC_PAGE_HELPER                   39
#define APM_FUNC_PAGE_TUTO                     40
#define APM_FUNC_PAGE_INTERSTITIAL             41
#define APM_FUNC_USER_CLIENT_CHECK_CREDENTIALS 42
#define APM_FUNC_USER_CLIENT_SAVE              43
#define APM_FUNC_DEMO_SPECIALS                 44
#define APM_FUNC_USER_UNSUBSCRIBE              45
#define APM_FUNC_STORE_LIST                    46
#define APM_FUNC_PAGE_APP_ONBOARDING           47
#define APM_FUNC_PAGE_APP_MENTION              48
#define APM_FUNC_PAGE_APP_TUTORIAL             49
#define APM_FUNC_PAGE_APP_INTERSTITIAL         50

// Url WS
#define APM_INIT_CHECK_STORE              @"partner/initialcheckstore"
#define APM_PARTNER_GETPROG               @"partner/getprog"
#define APM_PARTNER_LIST                  @"partner/list"
#define APM_AD_LIST                       @"ad/bonus"
#define APM_USER_SETADHESION              @"user/setadhesion"
#define APM_USER_SETPARTNERCLIENTID       @"user/setpartnerclientid"
#define APM_USER_CHECKCREDENTIALS         @"user/checkcredentials"
#define APM_USER_CREATE                   @"user/create"
#define APM_USER_EDIT                     @"user/edit"
#define APM_USER_SAVE                     @"user/save"
#define APM_USER_HISTORYEARNS             @"user/historyearns"
#define APM_USER_HISTORYBURNS             @"user/historyburns"
#define APM_USER_SAVEPWD                  @"user/savepwd"
#define APM_USER_RENEWPWD                 @"user/renewpwd"
#define APM_USER_CHECKTOKEN               @"user/checktoken"
#define APM_USER_CHECK_FB_CREDENTIALS     @"user/checkfbcredentials"
#define APM_USER_HISTORY                  @"user/history"
#define APM_USER_LOGOUT                   @"user/logout"
#define APM_USER_CONTACT                  @"user/contact"
#define APM_USER_SAVEPUSHTOKEN            @"user/savepushtoken"
#define APM_USER_EVALUATE                 @"user/evaluate"
#define APM_USER_GETSETTINGS              @"user/displaysettings"
#define APM_USER_SAVESETTINGS             @"user/savesettings"
#define APM_USER_CLIENT_CHECK_CREDENTIALS @"user/clientcheckcredentials"
#define APM_USER_CLIENT_SAVE              @"user/clientsave"
#define APM_USER_UNSUBSCRIBE              @"user/unsubscribe"
#define APM_GENEROSITY_LIST               @"generosity/list"
#define APM_GENEROSITY_SAVE               @"generosity/save"
#define APM_GENEROSITY_STORE              @"generosity/store"
#define APM_GENEROSITY_LIST_PARAMS        @"generosity/listparam"
#define APM_GENEROSITY_REMOVE             @"generosity/remove"
#define APM_GIFT_GETOBJECT                @"gift/getobject"
#define APM_GIFT_NOTIFICATION             @"gift/notification"
#define APM_GIFT_LIST                     @"gift/list"
#define APM_GIFT_CHECKAVAILABILITY        @"gift/checkavailability"
#define APM_GIFT_VIEW                     @"gift/view"
#define APM_GIFT_CATEGORYLIST             @"gift/categorylist"
#define APM_PAGE_CNIL                     @"page/cnil"
#define APM_PAGE_CGU                      @"page/cgu"
#define APM_PAGE_MENTIONS                 @"page/mention"
#define APM_PAGE_HELPER                   @"page/helper"
#define APM_PAGE_TUTO                     @"page/tutorial"
#define APM_PAGE_INTERSTITIAL             @"page/interstitial"
#define APM_PAGE_APP_ONBOARDING           @"page/apponboarding"
#define APM_PAGE_APP_MENTION              @"page/appmention"
#define APM_PAGE_APP_TUTORIAL             @"page/apptutorial"
#define APM_PAGE_APP_INTERSTITIAL         @"page/appinterstitial"
#define APM_DEMO_SPECIALS                 @"demo/specials"
#define APM_STATISTIC_GENEROSITY_DISPLAY  @"statistic/generositydisplay"
#define APM_STATISTIC_GIFT_DISPLAY        @"statistic/giftdisplay"
#define APM_LOG_SAVE                      @"log/save"
#define APM_STORE_LIST                    @"store/list"

// Error
#define APM_K_ERROR_CODE    @"errorCode"
#define APM_K_ERROR_MESSAGE @"errorMsg"

//Error message
#define APM_ERROR_MESSAGE_UNKNOWN @"an unknown error occured"
#define APM_ERROR_MESSAGE_NO_INTERNET @"no internet connection"
#define APM_ERROR_MESSAGE_LOADING @"function is already loading..."
#define APM_ERROR_MESSAGE_SERVICE_NOT_ACTIVE @"services not active..."
#define APM_ERROR_MESSAGE_CONFIG @"error on partnerID, partnerSecret, appID or schemeUrl..."
#define APM_ERROR_MESSAGE_ACCOUNT_NOT_CONNECTED @"user not connected..."
#define APM_ERROR_MESSAGE_ERROR_IMAGE @"error image..."
#define APM_ERROR_MESSAGE_HTTP_REQUEST_ERROR @"http request error..."
#define APM_ERROR_MESSAGE_URL_HTTP_INVALID @"url http invalid..."

#define APM_BOUNDARY @"#$#"

//Files
#define APM_FILE_USER_SDK @"fr.moonmiles.appsmiles:userObject"
#define APM_FILE_PROG_SDK @"fr.moonmiles.appsmiles:prog"
#define APM_FILE_GENEROSITY_SDK @"fr.moonmiles.appsmiles:generosity"
#define APM_FILE_GIFT_SDK @"fr.moonmiles.appsmiles:gift"
#define APM_FILE_DEVICE_SDK @"fr.moonmiles.appsmiles:device"
#define APM_FILE_WALKTHROUGHS_SDK @"fr.moonmiles.appsmiles:walkthroughs"
#define APM_FILE_HOW_WORKS_SDK @"fr.moonmiles.appsmiles:howWorks"
#define APM_FILE_STATUS_SDK @"fr.moonmiles.appsmiles:status"
#define APM_FILE_GENEROSITIES_SDK @"fr.moonmiles.appsmiles:generosities"
#define APM_FILE_VERSIONS_SDK @"fr.moonmiles.appsmiles:versions"
#define APM_FILE_THEME_SDK @"fr.moonmiles.appsmiles:theme"
#define APM_FILE_TRADUCTIONS_SDK @"fr.moonmiles.appsmiles:traductions"

//Other
#define APM_CLASS_ID_AUTO @"auto"
#define APM_ACTION_NAME_LAUNCH @"launch" //Lancement
#define APM_ACTION_NAME_CREATE @"create" //Creation
#define APM_ACTION_NAME_JOIN @"join" //Connexion

//Scheme url
#define APM_APPSMILES_APP_STORE @"https://itunes.apple.com/us/app/apple-store/id882790868?mt=8" //Url app's miles : App Store

#define APM_SCHM @"appsmiles://"
#define APM_SCHM_SANDBOX @"sandbox-appsmiles://"

//Application App's Miles
#define APM_PACKAGE_NAME_APPLICATION @"fr.moonmiles.appsmiles"

//Scheme actions
#define APM_SCHEME_URL_GET_TOKEN @"gettoken"
#define APM_SCHEME_URL_LIST_GIFT @"listgift"
#define APM_SCHEME_URL_LAST_BURNS @"lastburns"
#define APM_SCHEME_URL_LAST_EARNS @"lastearns"
#define APM_SCHEME_URL_CONVERT_GIFT @"convertgift"
#define APM_SCHEME_URL_LIST_BONUS @"listbonus"
#define APM_SCHEME_URL_LIST_PARTNER @"listpartner"

//Nb tentative to try to retrieve image from server
#define APM_COUNT_LOADING_IMAGE 3

