Skip to content
This repository has been archived by the owner on Oct 30, 2018. It is now read-only.

Commit

Permalink
Merge pull request #58 from pgerbes1/master
Browse files Browse the repository at this point in the history
Correct constants to cents as they are the base unit of our billing software
  • Loading branch information
barbaraliau committed Apr 26, 2017
2 parents 381768c + 1f8c527 commit 6a8d42c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions bin/billing-queries.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ logger.debug('HELLO FROM BILLING-QUERIES!');
const moment = require('moment');
const Storage = require('storj-service-storage-models');
const BillingClient = require('../lib/utils/billing-client');
const DOLLARS_PER_GB_BANDWIDTH = 0.05;
const DOLLARS_PER_GB_HOUR_STORAGE = .00002054795;
const CENTS_PER_GB_BANDWIDTH = 5.0;
const CENTS_PER_GB_HOUR_STORAGE = 0.002054795;

const MONGO_USERNAME = process.env.MONGO_USERNAME && process.env.MONGO_USERNAME.match(/\S+/)[0];
const MONGO_PASSWORD = process.env.MONGO_PASSWORD && process.env.MONGO_PASSWORD.match(/\S+/)[0];
Expand Down Expand Up @@ -55,10 +55,10 @@ connectedPromise

// logger.debug('starting...');
const bandwidthDebitsPromise = generateDebits
.forBandwidth(beginTimestamp, endTimestamp, DOLLARS_PER_GB_BANDWIDTH)
.forBandwidth(beginTimestamp, endTimestamp, CENTS_PER_GB_BANDWIDTH)
.then(() => logger.debug('... forBandwidth done!'));
const storageDebitsPromise = generateDebits
.forStorage(beginTimestamp, endTimestamp, DOLLARS_PER_GB_HOUR_STORAGE)
.forStorage(beginTimestamp, endTimestamp, CENTS_PER_GB_HOUR_STORAGE)
.then(() => logger.debug('... forStorage done!'));
const referralCreditsPromise = generateReferralCredits()
.then(() => logger.debug('... referral credits done!'));
Expand Down
8 changes: 4 additions & 4 deletions bin/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ logger.debug('HELLO FROM TEST');
const moment = require('moment');
const Storage = require('storj-service-storage-models');
const BillingClient = require('../lib/utils/billing-client');
const DOLLARS_PER_GB_BANDWIDTH = 0.05;
const DOLLARS_PER_GB_HOUR_STORAGE = .00002054795;
const CENTS_PER_GB_BANDWIDTH = 5.0;
const CENTS_PER_GB_HOUR_STORAGE = 0.002054795;

const MONGO_USERNAME = process.env.MONGO_USERNAME && process.env.MONGO_USERNAME.match(/\S+/)[0];
const MONGO_PASSWORD = process.env.MONGO_PASSWORD && process.env.MONGO_PASSWORD.match(/\S+/)[0];
Expand Down Expand Up @@ -63,10 +63,10 @@ connectedPromise
// bandwidthDebitsPromises.push(generateDebits
logger.debug('starting...');
const bandwidthDebitPromise = generateDebits
.forBandwidth(beginTimestamp, endTimestamp, DOLLARS_PER_GB_BANDWIDTH)
.forBandwidth(beginTimestamp, endTimestamp, CENTS_PER_GB_BANDWIDTH)
.then(() => logger.debug(`... ${timestampRange} forBandwidth done!`));
const storageDebitPromise = generateDebits
.forStorage(beginTimestamp, endTimestamp, DOLLARS_PER_GB_HOUR_STORAGE)
.forStorage(beginTimestamp, endTimestamp, CENTS_PER_GB_HOUR_STORAGE)
.then(() => logger.debug(`... ${timestampRange} forStorage done!`));

logger.debug(`Kicking off debit calculation for ${timestampRange}`);
Expand Down

0 comments on commit 6a8d42c

Please sign in to comment.