@gofynd/fdk-client-javascript 3.17.0 → 3.17.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/sdk/application/Cart/CartApplicationClient.d.ts +40 -0
- package/sdk/application/Cart/CartApplicationClient.js +176 -0
- package/sdk/application/Catalog/CatalogApplicationClient.d.ts +18 -4
- package/sdk/application/Catalog/CatalogApplicationClient.js +47 -4
- package/sdk/application/Content/ContentApplicationClient.d.ts +11 -1
- package/sdk/application/Content/ContentApplicationClient.js +40 -2
- package/sdk/application/Payment/PaymentApplicationClient.d.ts +1 -1
- package/sdk/application/Payment/PaymentApplicationClient.js +2 -0
- package/sdk/common/Constant.d.ts +9 -0
- package/sdk/common/Constant.js +11 -0
- package/sdk/partner/Theme/ThemePartnerModel.d.ts +3 -2
- package/sdk/partner/Theme/ThemePartnerModel.js +5 -2
- package/sdk/platform/Cart/CartPlatformApplicationClient.d.ts +72 -10
- package/sdk/platform/Cart/CartPlatformApplicationClient.js +634 -33
- package/sdk/platform/Cart/CartPlatformApplicationValidator.d.ts +225 -1
- package/sdk/platform/Cart/CartPlatformApplicationValidator.js +147 -0
- package/sdk/platform/Cart/CartPlatformModel.d.ts +951 -1
- package/sdk/platform/Cart/CartPlatformModel.js +597 -1
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.d.ts +123 -3
- package/sdk/platform/Catalog/CatalogPlatformApplicationClient.js +829 -39
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.d.ts +205 -7
- package/sdk/platform/Catalog/CatalogPlatformApplicationValidator.js +154 -3
- package/sdk/platform/Catalog/CatalogPlatformClient.d.ts +5 -5
- package/sdk/platform/Catalog/CatalogPlatformClient.js +8 -5
- package/sdk/platform/Catalog/CatalogPlatformModel.d.ts +1023 -31
- package/sdk/platform/Catalog/CatalogPlatformModel.js +841 -26
- package/sdk/platform/Catalog/CatalogPlatformValidator.d.ts +7 -0
- package/sdk/platform/Catalog/CatalogPlatformValidator.js +3 -0
- package/sdk/platform/Communication/CommunicationPlatformModel.d.ts +7 -0
- package/sdk/platform/Communication/CommunicationPlatformModel.js +3 -0
- package/sdk/platform/Configuration/ConfigurationPlatformModel.d.ts +92 -1
- package/sdk/platform/Configuration/ConfigurationPlatformModel.js +54 -0
- package/sdk/platform/Content/ContentPlatformApplicationValidator.d.ts +5 -5
- package/sdk/platform/Content/ContentPlatformApplicationValidator.js +3 -3
- package/sdk/platform/Content/ContentPlatformModel.d.ts +9 -8
- package/sdk/platform/Content/ContentPlatformModel.js +11 -8
- package/sdk/platform/Discount/DiscountPlatformModel.d.ts +21 -0
- package/sdk/platform/Discount/DiscountPlatformModel.js +9 -0
- package/sdk/platform/Order/OrderPlatformClient.d.ts +2 -2
- package/sdk/platform/Order/OrderPlatformClient.js +2 -2
- package/sdk/platform/Order/OrderPlatformModel.d.ts +20 -2
- package/sdk/platform/Order/OrderPlatformModel.js +9 -1
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.d.ts +14 -3
- package/sdk/platform/Payment/PaymentPlatformApplicationClient.js +88 -6
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.d.ts +28 -3
- package/sdk/platform/Payment/PaymentPlatformApplicationValidator.js +22 -2
- package/sdk/platform/Payment/PaymentPlatformModel.d.ts +356 -1
- package/sdk/platform/Payment/PaymentPlatformModel.js +229 -0
- package/sdk/platform/Theme/ThemePlatformModel.d.ts +3 -2
- package/sdk/platform/Theme/ThemePlatformModel.js +5 -2
- package/sdk/platform/Webhook/WebhookPlatformModel.d.ts +29 -0
- package/sdk/platform/Webhook/WebhookPlatformModel.js +13 -0
- package/sdk/public/Webhook/WebhookPublicModel.d.ts +29 -0
- package/sdk/public/Webhook/WebhookPublicModel.js +13 -0
|
@@ -1381,6 +1381,28 @@ const Joi = require("joi");
|
|
|
1381
1381
|
* loyalty points and applied and how much left with the user
|
|
1382
1382
|
*/
|
|
1383
1383
|
|
|
1384
|
+
/**
|
|
1385
|
+
* @typedef CurrencyValue
|
|
1386
|
+
* @property {string} [currency] - Currency code.
|
|
1387
|
+
* @property {number} [value] - Numeric amount value.
|
|
1388
|
+
*/
|
|
1389
|
+
|
|
1390
|
+
/**
|
|
1391
|
+
* @typedef ChargesAmount
|
|
1392
|
+
* @property {CurrencyValue} [base_currency]
|
|
1393
|
+
* @property {CurrencyValue} [ordering_currency]
|
|
1394
|
+
*/
|
|
1395
|
+
|
|
1396
|
+
/**
|
|
1397
|
+
* @typedef ArticleCharges
|
|
1398
|
+
* @property {Object} [meta] - Meta data realted to charges price adjustment.
|
|
1399
|
+
* @property {ChargesAmount} [amount]
|
|
1400
|
+
* @property {string} [name] - Name of the charge applied.
|
|
1401
|
+
* @property {boolean} [allow_refund] - Whether refund is allowed or not for the charge.
|
|
1402
|
+
* @property {string} [code] - Code of the charge applied.
|
|
1403
|
+
* @property {string} [type] - Type of the charge applied.
|
|
1404
|
+
*/
|
|
1405
|
+
|
|
1384
1406
|
/**
|
|
1385
1407
|
* @typedef CartProductInfo
|
|
1386
1408
|
* @property {number} [quantity] - Quantity of the product added in cart
|
|
@@ -1413,6 +1435,8 @@ const Joi = require("joi");
|
|
|
1413
1435
|
* @property {PromoMeta} [promo_meta]
|
|
1414
1436
|
* @property {Object} [custom_order] - Whether MTO (Make to Order) is enabled or not.
|
|
1415
1437
|
* @property {string} [item_type] - Type of the item in cart.
|
|
1438
|
+
* @property {ArticleCharges[]} [charges] - Charges information which denotes
|
|
1439
|
+
* types of charges and amount of charge applied to that product in cart.
|
|
1416
1440
|
*/
|
|
1417
1441
|
|
|
1418
1442
|
/**
|
|
@@ -2769,6 +2793,297 @@ const Joi = require("joi");
|
|
|
2769
2793
|
* @property {string} field - The field in the request that caused the error.
|
|
2770
2794
|
*/
|
|
2771
2795
|
|
|
2796
|
+
/**
|
|
2797
|
+
* @typedef OfferUser
|
|
2798
|
+
* @property {number[]} [groups] - List of user group on which offer is allowed
|
|
2799
|
+
* @property {string} [type] - User type of the cart user who places the order
|
|
2800
|
+
* @property {boolean} [anonymous] - Set true, if offer is applicable for guest user
|
|
2801
|
+
* @property {string[]} [id] - List of user id on which offer is applicable
|
|
2802
|
+
* @property {UserRegistered} [registered]
|
|
2803
|
+
* @property {string[]} [email_domain] - List of email domain available for offer
|
|
2804
|
+
*/
|
|
2805
|
+
|
|
2806
|
+
/**
|
|
2807
|
+
* @typedef OfferItemCriteria
|
|
2808
|
+
* @property {number[]} [category_id] - List of category id available for offer
|
|
2809
|
+
* @property {string[]} [collection_id] - List of collection id available for offer
|
|
2810
|
+
* @property {boolean} [all_items] - Boolean flag determining if offer is
|
|
2811
|
+
* applicable on all offers
|
|
2812
|
+
* @property {number[]} [item_brand] - List of all brand ids on which promotion
|
|
2813
|
+
* is applicable
|
|
2814
|
+
* @property {string[]} [article_ids] - List of unique identifier of articles on
|
|
2815
|
+
* which offer will be applicable
|
|
2816
|
+
* @property {string[]} [item_sku] - List of all item sku on which promotion is applicable
|
|
2817
|
+
* @property {number[]} [item_id] - List of all item ids on which offer is applicable
|
|
2818
|
+
* @property {number[]} [item_l1_category] - List of all L1 category on which
|
|
2819
|
+
* offer is applicable
|
|
2820
|
+
* @property {number[]} [item_l2_category] - List of all L2 category on which
|
|
2821
|
+
* offer is applicable
|
|
2822
|
+
* @property {number[]} [item_category] - List of all L3 category on which offer
|
|
2823
|
+
* is applicable
|
|
2824
|
+
* @property {number[]} [item_department] - List of all departments ids on which
|
|
2825
|
+
* offer is applicable
|
|
2826
|
+
* @property {number[]} [item_store] - List of all item store ids on which offer
|
|
2827
|
+
* is applicable
|
|
2828
|
+
* @property {string[]} [item_size] - List of all item sizes on which offer is applicable
|
|
2829
|
+
* @property {number[]} [item_company] - List of all company ids on which offer
|
|
2830
|
+
* is applicable
|
|
2831
|
+
* @property {string[]} [item_tags] - List of all product tags on which offer is
|
|
2832
|
+
* applicable
|
|
2833
|
+
* @property {CompareObject} [cart_quantity]
|
|
2834
|
+
* @property {CompareObject} [cart_total]
|
|
2835
|
+
* @property {number[]} [item_exclude_l1_category] - List of all L1 categories
|
|
2836
|
+
* on which offer is not applicable
|
|
2837
|
+
* @property {number[]} [item_exclude_l2_category] - List of all L2 categories
|
|
2838
|
+
* on which offer is not applicable
|
|
2839
|
+
* @property {number[]} [item_exclude_category] - List of all L3 categories on
|
|
2840
|
+
* which offer is not applicable
|
|
2841
|
+
* @property {CompareObject} [cart_unique_item_quantity]
|
|
2842
|
+
* @property {CompareObject} [cart_unique_item_amount]
|
|
2843
|
+
* @property {number[]} [item_exclude_department] - List of all department ids
|
|
2844
|
+
* on which offer is not applicable
|
|
2845
|
+
* @property {number[]} [item_exclude_store] - List of all item store ids on
|
|
2846
|
+
* which offer is not applicable
|
|
2847
|
+
* @property {number[]} [item_exclude_brand] - List of all brand ids on which
|
|
2848
|
+
* offer is not applicable
|
|
2849
|
+
* @property {string[]} [item_exclude_sku] - List of all item sku on which offer
|
|
2850
|
+
* is not applicable
|
|
2851
|
+
* @property {number[]} [item_exclude_company] - List of all company id on which
|
|
2852
|
+
* offer is not applicable
|
|
2853
|
+
* @property {string[]} [available_zones] - List of all zones on which offer is applicable
|
|
2854
|
+
* @property {number[]} [item_exclude_id] - List of all item ids on which offer
|
|
2855
|
+
* is not applicable
|
|
2856
|
+
* @property {string[]} [buy_rules] - List of buy rules that is applicable for this offer
|
|
2857
|
+
* @property {ItemSizeMapping} [item_size_mapping]
|
|
2858
|
+
*/
|
|
2859
|
+
|
|
2860
|
+
/**
|
|
2861
|
+
* @typedef DiscountRuleOffer
|
|
2862
|
+
* @property {number} [max_discount_amount] - Maximum discount amount in offer
|
|
2863
|
+
* @property {number} [discount_price] - Discount price in offer
|
|
2864
|
+
* @property {boolean} [apportion_discount] - Flag to distribute discount for each article
|
|
2865
|
+
* @property {boolean} [partial_can_ret] - Flag indicated return the product partially
|
|
2866
|
+
* @property {number} [max_usage_per_transaction] - Maximum usage per transaction in offer
|
|
2867
|
+
* @property {number} [min_offer_quantity] - Minimum quantity of offer in offer
|
|
2868
|
+
* @property {number} [discount_amount] - Discount amount in offer
|
|
2869
|
+
* @property {number} [discount_percentage] - Discount percentage in offer
|
|
2870
|
+
* @property {number} [max_offer_quantity] - Maximum quantity of product in offer
|
|
2871
|
+
*/
|
|
2872
|
+
|
|
2873
|
+
/**
|
|
2874
|
+
* @typedef OfferDiscountRule
|
|
2875
|
+
* @property {string} [discount_type] - The type of discount in offer
|
|
2876
|
+
* @property {string} [buy_condition] - Points to buy rule in offer. One
|
|
2877
|
+
* discount rule can only point to one buy rule.
|
|
2878
|
+
* @property {OfferItemCriteria} [item_criteria]
|
|
2879
|
+
* @property {DiscountRuleOffer} [offer]
|
|
2880
|
+
* @property {boolean} [is_exact] - Flag is true then use coupon applicable
|
|
2881
|
+
* articles for calculation
|
|
2882
|
+
*/
|
|
2883
|
+
|
|
2884
|
+
/**
|
|
2885
|
+
* @typedef OfferUsesRemaining
|
|
2886
|
+
* @property {number} [user] - Define total offer count per user
|
|
2887
|
+
* @property {number} [total] - Define total offer count
|
|
2888
|
+
* @property {number} [app] - Define offer count associated with application id
|
|
2889
|
+
*/
|
|
2890
|
+
|
|
2891
|
+
/**
|
|
2892
|
+
* @typedef OfferUsesRestriction
|
|
2893
|
+
* @property {OfferUsesRemaining} [maximum]
|
|
2894
|
+
* @property {OfferUsesRemaining} [remaining]
|
|
2895
|
+
*/
|
|
2896
|
+
|
|
2897
|
+
/**
|
|
2898
|
+
* @typedef OfferRestrictionFulfillmentOptions
|
|
2899
|
+
* @property {string} fulfillment_slug - Fulfillment option id
|
|
2900
|
+
* @property {string[]} [zones] - List of zones ids on which offer is applicable.
|
|
2901
|
+
*/
|
|
2902
|
+
|
|
2903
|
+
/**
|
|
2904
|
+
* @typedef OfferRestrictions
|
|
2905
|
+
* @property {OfferUsesRestriction} [uses]
|
|
2906
|
+
* @property {PostOrder} [post_order]
|
|
2907
|
+
* @property {string[]} [platforms] - List of platform on which offer allowed
|
|
2908
|
+
* like web, android
|
|
2909
|
+
* @property {PaymentModes} [payments]
|
|
2910
|
+
* @property {number[]} [ordering_stores] - List of store id on which offer is allowed
|
|
2911
|
+
* @property {number} [order_quantity] - Prmomotion offer max order count
|
|
2912
|
+
* @property {OfferUser} [user]
|
|
2913
|
+
* @property {boolean} [multi_store_allowed] - Allow offer to be applied on
|
|
2914
|
+
* multiple stores
|
|
2915
|
+
* @property {OfferRestrictionFulfillmentOptions[]} [fulfillment_options] - List
|
|
2916
|
+
* of fulfillment options on which offer is applicable.
|
|
2917
|
+
*/
|
|
2918
|
+
|
|
2919
|
+
/**
|
|
2920
|
+
* @typedef OfferDisplayMeta
|
|
2921
|
+
* @property {string} description - Detail about the offers
|
|
2922
|
+
* @property {boolean} [is_display] - Coupon offer will be displayed or hidden
|
|
2923
|
+
* on UI based on this flag
|
|
2924
|
+
* @property {boolean} [is_public] - Determines if coupon offer is publicaly
|
|
2925
|
+
* available or not
|
|
2926
|
+
* @property {string} name - Name of offer that needs to display
|
|
2927
|
+
* @property {string} [offer_text] - Promotion offer text used to display
|
|
2928
|
+
* @property {string} [offer_label] - Offer label of promotion that needs to display
|
|
2929
|
+
* @property {string} [reason] - Reason for offer rejection
|
|
2930
|
+
*/
|
|
2931
|
+
|
|
2932
|
+
/**
|
|
2933
|
+
* @typedef OfferCouponConfiguration
|
|
2934
|
+
* @property {number} [coupon_count] - Total number of coupons to be generated
|
|
2935
|
+
* when coupon type is bulk
|
|
2936
|
+
* @property {string} [coupon_prefix] - Bulk coupon code prefix string. All
|
|
2937
|
+
* coupons will be generated with this prefix.
|
|
2938
|
+
* @property {string} coupon_type - The type of coupon like bulk or single.
|
|
2939
|
+
*/
|
|
2940
|
+
|
|
2941
|
+
/**
|
|
2942
|
+
* @typedef OfferOwnership
|
|
2943
|
+
* @property {string} payable_category - Promotion amount payable category
|
|
2944
|
+
* @property {string} [payable_by] - Promotion amount bearable party
|
|
2945
|
+
*/
|
|
2946
|
+
|
|
2947
|
+
/**
|
|
2948
|
+
* @typedef OfferSchema
|
|
2949
|
+
* @property {string} [_id] - Unique identifier of offer. This will be auto
|
|
2950
|
+
* generated upon successful offer creation.
|
|
2951
|
+
* @property {string} mode - Offer mode, like coupon or promotion
|
|
2952
|
+
* @property {boolean} [auto_apply] - Indicates whether the offer is
|
|
2953
|
+
* automatically applied. This flag is false for coupons and true for
|
|
2954
|
+
* promotions. For free-gift promotions, a false value means manual gift
|
|
2955
|
+
* selection is required.
|
|
2956
|
+
* @property {string} [application_id] - Application id through which offer was created.
|
|
2957
|
+
* @property {string} [company_id] - Company id through which offer was created.
|
|
2958
|
+
* @property {OfferDiscountRule[]} [discount_rules] - Discount rules based on
|
|
2959
|
+
* which offer will be applied
|
|
2960
|
+
* @property {Object} [buy_rules] - Contains the individual buy rules associated
|
|
2961
|
+
* with the offer. The keys in this object are dynamic (e.g., 'rule#1',
|
|
2962
|
+
* 'rule#2', etc.), and each key must correspond to a buy condition referenced
|
|
2963
|
+
* within `discount_rules`. For example, if a discount rule includes a
|
|
2964
|
+
* buy_condition '(rule#1)', then 'rule#1' must be defined in this object.
|
|
2965
|
+
* Each rule key value must follow the format of OfferItemCriteria schema.
|
|
2966
|
+
* @property {OfferRestrictions} [restrictions]
|
|
2967
|
+
* @property {OfferDisplayMeta} display_meta
|
|
2968
|
+
* @property {OfferOwnership} [ownership]
|
|
2969
|
+
* @property {OfferAuthor} [author]
|
|
2970
|
+
* @property {OfferDateMeta} [date_meta]
|
|
2971
|
+
* @property {OfferSchedule} [_schedule]
|
|
2972
|
+
* @property {Object} [_custom_json] - Set extra properties in offer
|
|
2973
|
+
* @property {boolean} [stackable] - Boolean value set true to apply other
|
|
2974
|
+
* promotions as well.
|
|
2975
|
+
* @property {string} status - Status of the offer
|
|
2976
|
+
* @property {boolean} published - Determines whether the offer is published to
|
|
2977
|
+
* customers or marked inactive
|
|
2978
|
+
* @property {string} type - Different types of offers available in the system.
|
|
2979
|
+
* This is used to determine the type of offer and the calculation of the
|
|
2980
|
+
* offer. Some types are mode specific, few examples are :> -
|
|
2981
|
+
* free_item_discount_absolute is only applicable for coupon mode -
|
|
2982
|
+
* contract_price, shipping_price, free_gift_items, cashback, free_items,
|
|
2983
|
+
* free_non_sellable_items, external_price_adjustment_discount, custom is only
|
|
2984
|
+
* applicable for promotion mode
|
|
2985
|
+
* @property {number} [priority] - Defines the priority of the offer. Its
|
|
2986
|
+
* behavior varies based on the offer type. For coupons, a higher priority
|
|
2987
|
+
* value means the coupon will appear higher in the listing order. For
|
|
2988
|
+
* promotions, this value determines the sequence in which promotions are
|
|
2989
|
+
* evaluated and applied. Promotions are evaluated in descending order of
|
|
2990
|
+
* their effective priority. In case of conflicting priorities, the offer will
|
|
2991
|
+
* be prioritised on the basis of creation order (desc).
|
|
2992
|
+
* @property {boolean} [is_exclusive_coupon] - Flag to determine if coupon is
|
|
2993
|
+
* exclusive. Exclusive coupon removes other applied offers from the cart. If
|
|
2994
|
+
* both `is_exclusive_coupon` and `apply_exclusive` are set,
|
|
2995
|
+
* `is_exclusive_coupon` takes priority for offer evaluation logic effectively
|
|
2996
|
+
* making the offer exclusive.
|
|
2997
|
+
* @property {string} [apply_exclusive] - Controls how this offer excludes other
|
|
2998
|
+
* offers when it is applied. When this offer is applied at cart level, no
|
|
2999
|
+
* other promotions are evaluated or applied for the same cart (it becomes the
|
|
3000
|
+
* only active promotion for that cart). When this offer is applied on
|
|
3001
|
+
* specific articles, those articles will not be eligible for any other
|
|
3002
|
+
* promotions, but other promotions can still apply to different articles in
|
|
3003
|
+
* the cart. If null, the offer follows the normal stacking rules and does not
|
|
3004
|
+
* enforce additional exclusivity.
|
|
3005
|
+
* @property {string} [calculate_on] - Article Price on which offer is
|
|
3006
|
+
* calculated, like effective price or marked price. Only available for few
|
|
3007
|
+
* supported types lile Contract pricing and Ladder pricing.
|
|
3008
|
+
* @property {string} [promo_group] - The type of promotion group
|
|
3009
|
+
* @property {string} [currency] - ISO 4217 currency code in which the offer's
|
|
3010
|
+
* discount amounts and calculations are specified (e.g., "INR", "USD",
|
|
3011
|
+
* "EUR"). This currency is used as the base currency for discount
|
|
3012
|
+
* calculations and currency conversions when applying the offer. If not
|
|
3013
|
+
* provided, defaults to the seller's default currency code. All discount
|
|
3014
|
+
* values in discount_rules are interpreted in this currency.
|
|
3015
|
+
* @property {string} [code] - Unique identifier code for the offer. For coupons
|
|
3016
|
+
* (i.e mode = "coupon"), this is the coupon code that users enter to apply
|
|
3017
|
+
* the offer (e.g., "SAVE20", "WELCOME50"). For promotions (mode =
|
|
3018
|
+
* "promotion"), this field is typically null or empty as promotions are
|
|
3019
|
+
* auto-applied. This code is used to fetch and identify offers when applying
|
|
3020
|
+
* them to carts. Must be unique within an application_id. For bulk coupons,
|
|
3021
|
+
* this is auto-generated based on coupon_config.coupon_prefix.
|
|
3022
|
+
* @property {OfferCouponConfiguration} [coupon_config]
|
|
3023
|
+
* @property {boolean} [is_processed] - Flag to verify if promotion is ready to
|
|
3024
|
+
* be applied on cart and ready to update promotion
|
|
3025
|
+
* @property {boolean} [is_bank_offer] - Flag to determine if any bank offer is applicable
|
|
3026
|
+
*/
|
|
3027
|
+
|
|
3028
|
+
/**
|
|
3029
|
+
* @typedef OfferPartialUpdate
|
|
3030
|
+
* @property {PromotionSchedule} [schedule]
|
|
3031
|
+
*/
|
|
3032
|
+
|
|
3033
|
+
/**
|
|
3034
|
+
* @typedef OfferAuthor
|
|
3035
|
+
* @property {string} [created_by] - The user id of user, who has created the offer
|
|
3036
|
+
* @property {string} [modified_by] - The user id of user, who has modified the offer
|
|
3037
|
+
* @property {string} [approved_by] - The user id of user, who has approved the offer
|
|
3038
|
+
* @property {string} [rejected_by] - The user id of user, who has rejected the offer
|
|
3039
|
+
*/
|
|
3040
|
+
|
|
3041
|
+
/**
|
|
3042
|
+
* @typedef OfferDateMeta
|
|
3043
|
+
* @property {string} [modified_on] - Date time format when the offer last modified
|
|
3044
|
+
* @property {string} [created_on] - Date time format when the offer created
|
|
3045
|
+
* @property {string} [approved_on] - Date time format when the offer approved
|
|
3046
|
+
* @property {string} [rejected_on] - Date time format when the offer rejected
|
|
3047
|
+
*/
|
|
3048
|
+
|
|
3049
|
+
/**
|
|
3050
|
+
* @typedef NextScheduleItems
|
|
3051
|
+
* @property {string} [start] - Start date of schedule
|
|
3052
|
+
* @property {string} [end] - End date of schedule
|
|
3053
|
+
*/
|
|
3054
|
+
|
|
3055
|
+
/**
|
|
3056
|
+
* @typedef OfferSchedule
|
|
3057
|
+
* @property {string} end - The end date and time until which the offer remains valid.
|
|
3058
|
+
* @property {string} start - The start date and time from which the offer becomes valid.
|
|
3059
|
+
* @property {NextScheduleItems[]} [next_schedule] - A auto generated list of
|
|
3060
|
+
* date-time entries based on start, end, cron and duration data on which the
|
|
3061
|
+
* offer is scheduled to activate in the future.
|
|
3062
|
+
* @property {string} [cron] - A cron expression used to schedule the offer to
|
|
3063
|
+
* activate periodically. When cron is null or not provided, duration is optional.
|
|
3064
|
+
* @property {number} [duration] - Duration of the offer activation in seconds.
|
|
3065
|
+
* Mandatory when cron is provided.
|
|
3066
|
+
*/
|
|
3067
|
+
|
|
3068
|
+
/**
|
|
3069
|
+
* @typedef OfferListItem
|
|
3070
|
+
* @property {string} [mode] - Offer mode, like coupon or promotion
|
|
3071
|
+
* @property {string} [type] - Type of the offer
|
|
3072
|
+
* @property {string} [status] - Status of the offer
|
|
3073
|
+
* @property {boolean} [published] - Determines whether the offer is published
|
|
3074
|
+
* to customers or marked inactive
|
|
3075
|
+
* @property {OfferDisplayMeta} [display_meta]
|
|
3076
|
+
* @property {OfferAuthor} [author]
|
|
3077
|
+
* @property {OfferDateMeta} [date_meta]
|
|
3078
|
+
* @property {OfferSchedule} [schedule]
|
|
3079
|
+
*/
|
|
3080
|
+
|
|
3081
|
+
/**
|
|
3082
|
+
* @typedef OfferListResult
|
|
3083
|
+
* @property {OfferListItem[]} [items] - List of offers
|
|
3084
|
+
* @property {Page} [page]
|
|
3085
|
+
*/
|
|
3086
|
+
|
|
2772
3087
|
class CartPlatformModel {
|
|
2773
3088
|
/** @returns {RedeemLoyaltyPoints} */
|
|
2774
3089
|
static RedeemLoyaltyPoints() {
|
|
@@ -3109,7 +3424,7 @@ class CartPlatformModel {
|
|
|
3109
3424
|
static Ownership1() {
|
|
3110
3425
|
return Joi.object({
|
|
3111
3426
|
payable_category: Joi.string().allow(""),
|
|
3112
|
-
payable_by: Joi.string().allow(""),
|
|
3427
|
+
payable_by: Joi.string().allow("").allow(null),
|
|
3113
3428
|
});
|
|
3114
3429
|
}
|
|
3115
3430
|
|
|
@@ -4180,6 +4495,34 @@ class CartPlatformModel {
|
|
|
4180
4495
|
});
|
|
4181
4496
|
}
|
|
4182
4497
|
|
|
4498
|
+
/** @returns {CurrencyValue} */
|
|
4499
|
+
static CurrencyValue() {
|
|
4500
|
+
return Joi.object({
|
|
4501
|
+
currency: Joi.string().allow(""),
|
|
4502
|
+
value: Joi.number(),
|
|
4503
|
+
});
|
|
4504
|
+
}
|
|
4505
|
+
|
|
4506
|
+
/** @returns {ChargesAmount} */
|
|
4507
|
+
static ChargesAmount() {
|
|
4508
|
+
return Joi.object({
|
|
4509
|
+
base_currency: CartPlatformModel.CurrencyValue(),
|
|
4510
|
+
ordering_currency: CartPlatformModel.CurrencyValue(),
|
|
4511
|
+
});
|
|
4512
|
+
}
|
|
4513
|
+
|
|
4514
|
+
/** @returns {ArticleCharges} */
|
|
4515
|
+
static ArticleCharges() {
|
|
4516
|
+
return Joi.object({
|
|
4517
|
+
meta: Joi.object().pattern(/\S/, Joi.any()),
|
|
4518
|
+
amount: CartPlatformModel.ChargesAmount(),
|
|
4519
|
+
name: Joi.string().allow(""),
|
|
4520
|
+
allow_refund: Joi.boolean(),
|
|
4521
|
+
code: Joi.string().allow(""),
|
|
4522
|
+
type: Joi.string().allow(""),
|
|
4523
|
+
});
|
|
4524
|
+
}
|
|
4525
|
+
|
|
4183
4526
|
/** @returns {CartProductInfo} */
|
|
4184
4527
|
static CartProductInfo() {
|
|
4185
4528
|
return Joi.object({
|
|
@@ -4208,6 +4551,7 @@ class CartPlatformModel {
|
|
|
4208
4551
|
promo_meta: CartPlatformModel.PromoMeta(),
|
|
4209
4552
|
custom_order: Joi.object().pattern(/\S/, Joi.any()),
|
|
4210
4553
|
item_type: Joi.string().allow(""),
|
|
4554
|
+
charges: Joi.array().items(CartPlatformModel.ArticleCharges()),
|
|
4211
4555
|
});
|
|
4212
4556
|
}
|
|
4213
4557
|
|
|
@@ -5575,5 +5919,257 @@ class CartPlatformModel {
|
|
|
5575
5919
|
field: Joi.string().allow("").required(),
|
|
5576
5920
|
});
|
|
5577
5921
|
}
|
|
5922
|
+
|
|
5923
|
+
/** @returns {OfferUser} */
|
|
5924
|
+
static OfferUser() {
|
|
5925
|
+
return Joi.object({
|
|
5926
|
+
groups: Joi.array().items(Joi.number()),
|
|
5927
|
+
type: Joi.string().allow(""),
|
|
5928
|
+
anonymous: Joi.boolean(),
|
|
5929
|
+
id: Joi.array().items(Joi.string().allow("")),
|
|
5930
|
+
registered: CartPlatformModel.UserRegistered(),
|
|
5931
|
+
email_domain: Joi.array().items(Joi.string().allow("")),
|
|
5932
|
+
});
|
|
5933
|
+
}
|
|
5934
|
+
|
|
5935
|
+
/** @returns {OfferItemCriteria} */
|
|
5936
|
+
static OfferItemCriteria() {
|
|
5937
|
+
return Joi.object({
|
|
5938
|
+
category_id: Joi.array().items(Joi.number()),
|
|
5939
|
+
collection_id: Joi.array().items(Joi.string().allow("")),
|
|
5940
|
+
all_items: Joi.boolean(),
|
|
5941
|
+
item_brand: Joi.array().items(Joi.number()),
|
|
5942
|
+
article_ids: Joi.array().items(Joi.string().allow("")),
|
|
5943
|
+
item_sku: Joi.array().items(Joi.string().allow("")),
|
|
5944
|
+
item_id: Joi.array().items(Joi.number()),
|
|
5945
|
+
item_l1_category: Joi.array().items(Joi.number()),
|
|
5946
|
+
item_l2_category: Joi.array().items(Joi.number()),
|
|
5947
|
+
item_category: Joi.array().items(Joi.number()),
|
|
5948
|
+
item_department: Joi.array().items(Joi.number()),
|
|
5949
|
+
item_store: Joi.array().items(Joi.number()),
|
|
5950
|
+
item_size: Joi.array().items(Joi.string().allow("")),
|
|
5951
|
+
item_company: Joi.array().items(Joi.number()),
|
|
5952
|
+
item_tags: Joi.array().items(Joi.string().allow("")),
|
|
5953
|
+
cart_quantity: CartPlatformModel.CompareObject(),
|
|
5954
|
+
cart_total: CartPlatformModel.CompareObject(),
|
|
5955
|
+
item_exclude_l1_category: Joi.array().items(Joi.number()),
|
|
5956
|
+
item_exclude_l2_category: Joi.array().items(Joi.number()),
|
|
5957
|
+
item_exclude_category: Joi.array().items(Joi.number()),
|
|
5958
|
+
cart_unique_item_quantity: CartPlatformModel.CompareObject(),
|
|
5959
|
+
cart_unique_item_amount: CartPlatformModel.CompareObject(),
|
|
5960
|
+
item_exclude_department: Joi.array().items(Joi.number()),
|
|
5961
|
+
item_exclude_store: Joi.array().items(Joi.number()),
|
|
5962
|
+
item_exclude_brand: Joi.array().items(Joi.number()),
|
|
5963
|
+
item_exclude_sku: Joi.array().items(Joi.string().allow("")),
|
|
5964
|
+
item_exclude_company: Joi.array().items(Joi.number()),
|
|
5965
|
+
available_zones: Joi.array().items(Joi.string().allow("")),
|
|
5966
|
+
item_exclude_id: Joi.array().items(Joi.number()),
|
|
5967
|
+
buy_rules: Joi.array().items(Joi.string().allow("")),
|
|
5968
|
+
item_size_mapping: CartPlatformModel.ItemSizeMapping(),
|
|
5969
|
+
});
|
|
5970
|
+
}
|
|
5971
|
+
|
|
5972
|
+
/** @returns {DiscountRuleOffer} */
|
|
5973
|
+
static DiscountRuleOffer() {
|
|
5974
|
+
return Joi.object({
|
|
5975
|
+
max_discount_amount: Joi.number(),
|
|
5976
|
+
discount_price: Joi.number(),
|
|
5977
|
+
apportion_discount: Joi.boolean(),
|
|
5978
|
+
partial_can_ret: Joi.boolean(),
|
|
5979
|
+
max_usage_per_transaction: Joi.number().allow(null),
|
|
5980
|
+
min_offer_quantity: Joi.number(),
|
|
5981
|
+
discount_amount: Joi.number(),
|
|
5982
|
+
discount_percentage: Joi.number().allow(null),
|
|
5983
|
+
max_offer_quantity: Joi.number(),
|
|
5984
|
+
});
|
|
5985
|
+
}
|
|
5986
|
+
|
|
5987
|
+
/** @returns {OfferDiscountRule} */
|
|
5988
|
+
static OfferDiscountRule() {
|
|
5989
|
+
return Joi.object({
|
|
5990
|
+
discount_type: Joi.string().allow(""),
|
|
5991
|
+
buy_condition: Joi.string().allow(""),
|
|
5992
|
+
item_criteria: CartPlatformModel.OfferItemCriteria(),
|
|
5993
|
+
offer: CartPlatformModel.DiscountRuleOffer(),
|
|
5994
|
+
is_exact: Joi.boolean(),
|
|
5995
|
+
});
|
|
5996
|
+
}
|
|
5997
|
+
|
|
5998
|
+
/** @returns {OfferUsesRemaining} */
|
|
5999
|
+
static OfferUsesRemaining() {
|
|
6000
|
+
return Joi.object({
|
|
6001
|
+
user: Joi.number(),
|
|
6002
|
+
total: Joi.number(),
|
|
6003
|
+
app: Joi.number(),
|
|
6004
|
+
});
|
|
6005
|
+
}
|
|
6006
|
+
|
|
6007
|
+
/** @returns {OfferUsesRestriction} */
|
|
6008
|
+
static OfferUsesRestriction() {
|
|
6009
|
+
return Joi.object({
|
|
6010
|
+
maximum: CartPlatformModel.OfferUsesRemaining(),
|
|
6011
|
+
remaining: CartPlatformModel.OfferUsesRemaining(),
|
|
6012
|
+
});
|
|
6013
|
+
}
|
|
6014
|
+
|
|
6015
|
+
/** @returns {OfferRestrictionFulfillmentOptions} */
|
|
6016
|
+
static OfferRestrictionFulfillmentOptions() {
|
|
6017
|
+
return Joi.object({
|
|
6018
|
+
fulfillment_slug: Joi.string().allow("").required(),
|
|
6019
|
+
zones: Joi.array().items(Joi.string().allow("")),
|
|
6020
|
+
});
|
|
6021
|
+
}
|
|
6022
|
+
|
|
6023
|
+
/** @returns {OfferRestrictions} */
|
|
6024
|
+
static OfferRestrictions() {
|
|
6025
|
+
return Joi.object({
|
|
6026
|
+
uses: CartPlatformModel.OfferUsesRestriction(),
|
|
6027
|
+
post_order: CartPlatformModel.PostOrder(),
|
|
6028
|
+
platforms: Joi.array().items(Joi.string().allow("")),
|
|
6029
|
+
payments: CartPlatformModel.PaymentModes(),
|
|
6030
|
+
ordering_stores: Joi.array().items(Joi.number()),
|
|
6031
|
+
order_quantity: Joi.number(),
|
|
6032
|
+
user: CartPlatformModel.OfferUser(),
|
|
6033
|
+
multi_store_allowed: Joi.boolean(),
|
|
6034
|
+
fulfillment_options: Joi.array().items(
|
|
6035
|
+
CartPlatformModel.OfferRestrictionFulfillmentOptions()
|
|
6036
|
+
),
|
|
6037
|
+
});
|
|
6038
|
+
}
|
|
6039
|
+
|
|
6040
|
+
/** @returns {OfferDisplayMeta} */
|
|
6041
|
+
static OfferDisplayMeta() {
|
|
6042
|
+
return Joi.object({
|
|
6043
|
+
description: Joi.string().allow("").required(),
|
|
6044
|
+
is_display: Joi.boolean(),
|
|
6045
|
+
is_public: Joi.boolean(),
|
|
6046
|
+
name: Joi.string().allow("").required(),
|
|
6047
|
+
offer_text: Joi.string().allow("").allow(null),
|
|
6048
|
+
offer_label: Joi.string().allow("").allow(null),
|
|
6049
|
+
reason: Joi.string().allow("").allow(null),
|
|
6050
|
+
});
|
|
6051
|
+
}
|
|
6052
|
+
|
|
6053
|
+
/** @returns {OfferCouponConfiguration} */
|
|
6054
|
+
static OfferCouponConfiguration() {
|
|
6055
|
+
return Joi.object({
|
|
6056
|
+
coupon_count: Joi.number(),
|
|
6057
|
+
coupon_prefix: Joi.string().allow(""),
|
|
6058
|
+
coupon_type: Joi.string().allow("").required(),
|
|
6059
|
+
});
|
|
6060
|
+
}
|
|
6061
|
+
|
|
6062
|
+
/** @returns {OfferOwnership} */
|
|
6063
|
+
static OfferOwnership() {
|
|
6064
|
+
return Joi.object({
|
|
6065
|
+
payable_category: Joi.string().allow("").required(),
|
|
6066
|
+
payable_by: Joi.string().allow("").allow(null),
|
|
6067
|
+
});
|
|
6068
|
+
}
|
|
6069
|
+
|
|
6070
|
+
/** @returns {OfferSchema} */
|
|
6071
|
+
static OfferSchema() {
|
|
6072
|
+
return Joi.object({
|
|
6073
|
+
_id: Joi.string().allow(""),
|
|
6074
|
+
mode: Joi.string().allow("").required(),
|
|
6075
|
+
auto_apply: Joi.boolean(),
|
|
6076
|
+
application_id: Joi.string().allow(""),
|
|
6077
|
+
company_id: Joi.string().allow(""),
|
|
6078
|
+
discount_rules: Joi.array().items(CartPlatformModel.OfferDiscountRule()),
|
|
6079
|
+
buy_rules: Joi.object().pattern(
|
|
6080
|
+
/\S/,
|
|
6081
|
+
CartPlatformModel.OfferItemCriteria()
|
|
6082
|
+
),
|
|
6083
|
+
restrictions: CartPlatformModel.OfferRestrictions(),
|
|
6084
|
+
display_meta: CartPlatformModel.OfferDisplayMeta().required(),
|
|
6085
|
+
ownership: CartPlatformModel.OfferOwnership(),
|
|
6086
|
+
author: CartPlatformModel.OfferAuthor(),
|
|
6087
|
+
date_meta: CartPlatformModel.OfferDateMeta(),
|
|
6088
|
+
_schedule: CartPlatformModel.OfferSchedule(),
|
|
6089
|
+
_custom_json: Joi.object().pattern(/\S/, Joi.any()),
|
|
6090
|
+
stackable: Joi.boolean(),
|
|
6091
|
+
status: Joi.string().allow("").required(),
|
|
6092
|
+
published: Joi.boolean().required(),
|
|
6093
|
+
type: Joi.string().allow("").required(),
|
|
6094
|
+
priority: Joi.number(),
|
|
6095
|
+
is_exclusive_coupon: Joi.boolean(),
|
|
6096
|
+
apply_exclusive: Joi.string().allow("").allow(null),
|
|
6097
|
+
calculate_on: Joi.string().allow(""),
|
|
6098
|
+
promo_group: Joi.string().allow(""),
|
|
6099
|
+
currency: Joi.string().allow(""),
|
|
6100
|
+
code: Joi.string().allow(""),
|
|
6101
|
+
coupon_config: CartPlatformModel.OfferCouponConfiguration(),
|
|
6102
|
+
is_processed: Joi.boolean(),
|
|
6103
|
+
is_bank_offer: Joi.boolean(),
|
|
6104
|
+
});
|
|
6105
|
+
}
|
|
6106
|
+
|
|
6107
|
+
/** @returns {OfferPartialUpdate} */
|
|
6108
|
+
static OfferPartialUpdate() {
|
|
6109
|
+
return Joi.object({
|
|
6110
|
+
schedule: CartPlatformModel.PromotionSchedule(),
|
|
6111
|
+
});
|
|
6112
|
+
}
|
|
6113
|
+
|
|
6114
|
+
/** @returns {OfferAuthor} */
|
|
6115
|
+
static OfferAuthor() {
|
|
6116
|
+
return Joi.object({
|
|
6117
|
+
created_by: Joi.string().allow("").allow(null),
|
|
6118
|
+
modified_by: Joi.string().allow("").allow(null),
|
|
6119
|
+
approved_by: Joi.string().allow("").allow(null),
|
|
6120
|
+
rejected_by: Joi.string().allow("").allow(null),
|
|
6121
|
+
});
|
|
6122
|
+
}
|
|
6123
|
+
|
|
6124
|
+
/** @returns {OfferDateMeta} */
|
|
6125
|
+
static OfferDateMeta() {
|
|
6126
|
+
return Joi.object({
|
|
6127
|
+
modified_on: Joi.string().allow("").allow(null),
|
|
6128
|
+
created_on: Joi.string().allow("").allow(null),
|
|
6129
|
+
approved_on: Joi.string().allow("").allow(null),
|
|
6130
|
+
rejected_on: Joi.string().allow("").allow(null),
|
|
6131
|
+
});
|
|
6132
|
+
}
|
|
6133
|
+
|
|
6134
|
+
/** @returns {NextScheduleItems} */
|
|
6135
|
+
static NextScheduleItems() {
|
|
6136
|
+
return Joi.object({
|
|
6137
|
+
start: Joi.string().allow(""),
|
|
6138
|
+
end: Joi.string().allow(""),
|
|
6139
|
+
});
|
|
6140
|
+
}
|
|
6141
|
+
|
|
6142
|
+
/** @returns {OfferSchedule} */
|
|
6143
|
+
static OfferSchedule() {
|
|
6144
|
+
return Joi.object({
|
|
6145
|
+
end: Joi.string().allow("").required(),
|
|
6146
|
+
start: Joi.string().allow("").required(),
|
|
6147
|
+
next_schedule: Joi.array().items(CartPlatformModel.NextScheduleItems()),
|
|
6148
|
+
cron: Joi.string().allow("").allow(null),
|
|
6149
|
+
duration: Joi.number().allow(null),
|
|
6150
|
+
});
|
|
6151
|
+
}
|
|
6152
|
+
|
|
6153
|
+
/** @returns {OfferListItem} */
|
|
6154
|
+
static OfferListItem() {
|
|
6155
|
+
return Joi.object({
|
|
6156
|
+
mode: Joi.string().allow(""),
|
|
6157
|
+
type: Joi.string().allow(""),
|
|
6158
|
+
status: Joi.string().allow(""),
|
|
6159
|
+
published: Joi.boolean(),
|
|
6160
|
+
display_meta: CartPlatformModel.OfferDisplayMeta(),
|
|
6161
|
+
author: CartPlatformModel.OfferAuthor(),
|
|
6162
|
+
date_meta: CartPlatformModel.OfferDateMeta(),
|
|
6163
|
+
schedule: CartPlatformModel.OfferSchedule(),
|
|
6164
|
+
});
|
|
6165
|
+
}
|
|
6166
|
+
|
|
6167
|
+
/** @returns {OfferListResult} */
|
|
6168
|
+
static OfferListResult() {
|
|
6169
|
+
return Joi.object({
|
|
6170
|
+
items: Joi.array().items(CartPlatformModel.OfferListItem()),
|
|
6171
|
+
page: CartPlatformModel.Page(),
|
|
6172
|
+
});
|
|
6173
|
+
}
|
|
5578
6174
|
}
|
|
5579
6175
|
module.exports = CartPlatformModel;
|