Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 2 additions & 25 deletions client/config/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,35 +125,12 @@ module.exports = [
},
activeOrg: function (
$stateParams,
whitelists,
moment
whitelists
) {
var lowerAccountName = $stateParams.userName.toLowerCase();
var activeOrg = whitelists.find(function (whitelist) {
return whitelists.find(function (whitelist) {
return whitelist.attrs.lowerName === lowerAccountName;
});
// All of this should be moved to inside @runnable/api-client
activeOrg.attrs.trialEnd = moment().add(2, 'days').toISOString();
activeOrg.attrs.activePeriodEnd = moment().subtract(1, 'days').toISOString();
activeOrg.attrs.gracePeriodEnd = moment().add(5, 'days').toISOString();
activeOrg.attrs.stripeCustomerId = 1234;
activeOrg.attrs.hasPaymentMethod = false;
activeOrg.isInTrial = function () {
return moment(activeOrg.attrs.trialEnd) > moment().utc();
};
activeOrg.isInGrace = function () {
return !activeOrg.isInTrial() && moment(activeOrg.attrs.gracePeriodEnd) > moment().utc();
};
activeOrg.isInActivePeriod = function () {
return moment(activeOrg.attrs.activePeriodEnd) > moment().utc();
};
activeOrg.isGraceExpired = function () {
return !activeOrg.isInTrial() && moment.utc(activeOrg.attrs.gracePeriodEnd) < moment().utc();
};
activeOrg.trialDaysRemaining = function () {
return moment(activeOrg.attrs.trialEnd).diff(moment.utc(), 'days');
};
return activeOrg;
},
activeAccount: function (
$q,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
],
"dependencies": {
"101": "0.14.1",
"@runnable/api-client": "^9.0.0",
"@runnable/api-client": "v9.1.0",
"angular": "1.3.15",
"angular-animate": "1.3.15",
"angular-clipboard": "^1.1.1",
Expand Down