UNPKG

beerbay-math

Version:

82 lines (78 loc) 1.93 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.USED_COUPON_10_USD = exports.UNDERUSED_COUPON_10_USD = exports.ALREADY_USED_BY_USER_COUPON = exports.USD_10_COUPON = exports.PERCENTAGE_20_COUPON = exports.FREE_SHIPPING_SPAIN_COUPON = exports.INACTIVE_COUPON = exports.MOCK_USER = void 0; var MOCK_USER = { id: 1, name: "alex v", email: "v@g.com" }; //Fake coupon used as demo for all properties exports.MOCK_USER = MOCK_USER; var MOCK_COUPON = { active: false, //So you can toggle it type: "shipping" || "percentage" || "flat", priceMinimum: 3.0, //3 usdc userMaxUses: 1, value: 12.0, //12 usd value maxUses: 25, //25 global uses uses: [{ user_email: "v@g.com" }] }; var INACTIVE_COUPON = { active: false }; exports.INACTIVE_COUPON = INACTIVE_COUPON; var FREE_SHIPPING_SPAIN_COUPON = { active: true, type: "shipping", shippingCountries: [{ id: 1 }] }; exports.FREE_SHIPPING_SPAIN_COUPON = FREE_SHIPPING_SPAIN_COUPON; var PERCENTAGE_20_COUPON = { active: true, type: "percentage", value: 0.2, priceMinimum: 20.0, userMaxUses: 1 }; exports.PERCENTAGE_20_COUPON = PERCENTAGE_20_COUPON; var USD_10_COUPON = { active: true, type: "flat", value: 10.0, priceMinimum: 20.0, userMaxUses: 1 }; exports.USD_10_COUPON = USD_10_COUPON; var ALREADY_USED_BY_USER_COUPON = { active: true, userMaxUses: 1, uses: [{ user_email: "v@g.com" }] }; //Used 2 times, can be used 3 times exports.ALREADY_USED_BY_USER_COUPON = ALREADY_USED_BY_USER_COUPON; var UNDERUSED_COUPON_10_USD = { active: true, type: "flat", value: 10.0, maxUses: 3, uses: [{}, {}] }; //Used 3 times, can be used 3 times = done exports.UNDERUSED_COUPON_10_USD = UNDERUSED_COUPON_10_USD; var USED_COUPON_10_USD = { active: true, type: "flat", value: 10.0, maxUses: 3, uses: [{}, {}, {}] }; exports.USED_COUPON_10_USD = USED_COUPON_10_USD;