Source/Points.js

"use strict";
/**
 *  @module     Points
 *  @overview   Defines the points distribution for various services available on
 *              Magic Batua.
 *
 *  @author     Animesh Mishra <hello@animesh.ltd>
 *  @copyright  © 2018 Animesh Ltd. All Rights Reserved.
 */
Object.defineProperty(exports, "__esModule", { value: true });
/** @exports Points */
exports.description = "Defines points distribution table.";
/**
 *  Returns the number of points that must be awarded to the account carrying
 *  out the transaction for the `service`.
 *
 *  A `service` is one of the transaction categories supported by the Magic Batua
 *  platform. At the time of writing, points were only awarded for the following
 *  three services:
 *
 *  - Signup
 *  - College Fees
 *  - Mobile Prepaid
 *
 *  @param {service} service   Name of the service used
 *
 *  @returns {number} Number of points that must be credited to the transaction
 *  maker's account.
 */
function ToSelfFor(service) {
    switch (service) {
        case "Signup":
            return 600;
        case "College Fees":
            return 20;
        case "Mobile Prepaid":
            return 1;
        default:
            return 0;
    }
}
exports.ToSelfFor = ToSelfFor;
/**
 *  Returns the number of points that must be awarded to the referrer of the account
 *  that is carrying out the transaction for the `service`.
 *
 *  A `service` is one of the transaction categories supported by the Magic Batua
 *  platform. At the time of writing, points were only awarded for the following
 *  three services:
 *
 *  - Signup
 *  - College Fees
 *  - Mobile Prepaid
 *
 *  @param {service} service   Name of the service used
 *
 *  @returns {number} Number of points that must be credited to the transaction
 *  maker's referrer.
 */
function ToReferrerFor(service) {
    switch (service) {
        case "Signup":
            return 400;
        case "College Fees":
            return 20;
        case "Mobile Prepaid":
            return 1;
        default:
            return 0;
    }
}
exports.ToReferrerFor = ToReferrerFor;
//# sourceMappingURL=Points.js.map