Skip to content

Commit

Permalink
Adde new income producing cake operations to incomeOverview service
Browse files Browse the repository at this point in the history
  • Loading branch information
geldmacher committed Feb 17, 2022
1 parent 9ea6f42 commit 9e14a69
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "cake-to-cointracking-converter",
"version": "4.7.0",
"version": "4.7.1",
"description": "CLI script to translate Cake export data to a valid CoinTracking import",
"main": "./processCsv.js",
"scripts": {
Expand Down
26 changes: 15 additions & 11 deletions services/generateIncomeOverview.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const Decimal = require('decimal.js');
const { v5: uuidv5 } = require('uuid');

// Allow extreme small numbers with exponential notation
Decimal.set({
Decimal.set({
toExpNeg: -9e15
});

Expand All @@ -13,8 +13,8 @@ const stats = new Map();

/**
* Update stats map
*
* @param {*} record
*
* @param {*} record
*/
const updateStats = (record) => {
// Generate own uuid to identify record groups
Expand Down Expand Up @@ -43,7 +43,11 @@ const updateStats = (record) => {
case 'Referral reward':
case 'Referral signup bonus':
case 'Signup bonus':
case 'Promotion bonus':
case 'Promotion bonus':
case 'Entry staking wallet: Referral signup bonus':
case 'Entry staking wallet: Bonus/Airdrop':
case 'Entry staking wallet: Freezer promotion bonus':
case 'Entry staking wallet: Lending DFI Bonus':
hasProducedIncome = true;
break;
default:
Expand Down Expand Up @@ -80,8 +84,8 @@ const updateStats = (record) => {

/**
* Generate monthly income overview output
*
* @param {*} records
*
* @param {*} records
*/
const generateIncomeOverview = (records) => {

Expand All @@ -107,19 +111,19 @@ const generateIncomeOverview = (records) => {
width: 30
},
columns: {
0: {
0: {
width: 5
},
1: {
1: {
width: 5
},
2: {
2: {
width: 15
},
3: {
3: {
width: 25
},
43: {
43: {
width: 35
}
}
Expand Down

0 comments on commit 9e14a69

Please sign in to comment.