@magic.batua/points
Version:
The Points module powers the loyalty points features of the Magic Batua platform.
132 lines (111 loc) • 4.24 kB
HTML
<html lang="en">
<head>
<meta charset="utf-8">
<title>Source/Points.js - Postman Documentation</title>
<script src="scripts/prettify/prettify.js"></script>
<script src="scripts/prettify/lang-css.js"></script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/ionicons.min.css">
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<input type="checkbox" id="nav-trigger" class="nav-trigger" />
<label for="nav-trigger" class="navicon-button x">
<div class="navicon"></div>
</label>
<label for="nav-trigger" class="overlay"></label>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Classes</h3><ul><li><a href="Ledger.html">Ledger</a><ul class='methods'><li data-type='method'><a href="Ledger.html#count">count</a></li><li data-type='method'><a href="Ledger.html#Issue">Issue</a></li><li data-type='method'><a href="Ledger.html#MakeReferralsRedeemable">MakeReferralsRedeemable</a></li><li data-type='method'><a href="Ledger.html#MakeSignupRedeemable">MakeSignupRedeemable</a></li><li data-type='method'><a href="Ledger.html#Redeem">Redeem</a></li></ul></li><li><a href="Transaction.html">Transaction</a></li></ul><h3>Modules</h3><ul><li><a href="module-Points.html">Points</a><ul class='methods'><li data-type='method'><a href="module-Points.html#~ToReferrerFor">ToReferrerFor</a></li><li data-type='method'><a href="module-Points.html#~ToSelfFor">ToSelfFor</a></li></ul></li></ul>
</nav>
<div id="main">
<h1 class="page-title">Source/Points.js</h1>
<section>
<article>
<pre class="prettyprint source linenums"><code>"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</code></pre>
</article>
</section>
</div>
<br class="clear">
<footer>
Documentation generated at Tue Mar 20 2018 02:33:08 GMT+0530 (IST)
</footer>
<script>prettyPrint();</script>
<script src="scripts/linenumber.js"></script>
</body>
</html>