@harvest-profit/harvest-profit-calculations
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -14,38 +14,2 @@ Object.defineProperty(exports, "__esModule", { | ||
/** | ||
* Contracts represent sales. | ||
* @typedef {Object} contract | ||
* @property {number} amount_sold The amount sold from the contract | ||
* @property {number} cash_price The value of the contract | ||
* @property {string} type_name The name of the contract type | ||
*/ | ||
/** | ||
* Contract Size Object | ||
* @typedef {Object} contractSize | ||
* @property {string} name The name of the contract size | ||
* @property {string} value The value of the contract size to be stored | ||
*/ | ||
/** | ||
* Contract Long/Short attribute. Only used with Futures Contracts. | ||
* @typedef {Object} contractLongShort | ||
* @property {string} name The display name of the Long/Short value | ||
* @property {string} value The value of the contract long/short to be stored | ||
*/ | ||
/** | ||
* Contract Month attribute. Only used many different contract types. | ||
* @typedef {Object} contractMonths | ||
* @property {string} name The name of the contract month | ||
* @property {string} value The value of the contract month to be stored | ||
*/ | ||
/** | ||
* Contract Option Strategy. Only used with Option Sale contracts. | ||
* @typedef {Object} contractOptionStrategy | ||
* @property {string} name The name of the contract option strategy | ||
* @property {string} value The value of the contract option strategy to be stored | ||
*/ | ||
/** | ||
* @module Contracts | ||
@@ -61,67 +25,2 @@ */ | ||
Contracts.sizes = [{ | ||
name: 'Regular - 5,000 bushels', | ||
value: 'regular' | ||
}, { | ||
name: 'Mini - 1,000 bushels', | ||
value: 'mini' | ||
}]; | ||
Contracts.longShort = [{ | ||
name: 'Long', | ||
value: 'long' | ||
}, { | ||
name: 'Short', | ||
value: 'short' | ||
}]; | ||
Contracts.months = [{ | ||
name: 'January', | ||
value: 1 | ||
}, { | ||
name: 'February', | ||
value: 2 | ||
}, { | ||
name: 'March', | ||
value: 3 | ||
}, { | ||
name: 'April', | ||
value: 4 | ||
}, { | ||
name: 'May', | ||
value: 5 | ||
}, { | ||
name: 'June', | ||
value: 6 | ||
}, { | ||
name: 'July', | ||
value: 7 | ||
}, { | ||
name: 'August', | ||
value: 8 | ||
}, { | ||
name: 'September', | ||
value: 9 | ||
}, { | ||
name: 'October', | ||
value: 10 | ||
}, { | ||
name: 'November', | ||
value: 11 | ||
}, { | ||
name: 'December', | ||
value: 12 | ||
}]; | ||
Contracts.optionStrategy = [{ | ||
name: 'Long Put', | ||
value: 'long_put' | ||
}, { | ||
name: 'Short Put', | ||
value: 'short_put' | ||
}, { | ||
name: 'Long Call', | ||
value: 'long_call' | ||
}, { | ||
name: 'Short Call', | ||
value: 'short_call' | ||
}]; | ||
Contracts.filterValidRevenueContracts = function (contracts) { | ||
@@ -145,3 +44,3 @@ var invalidTypes = ['optionsale']; | ||
Contracts.calculateContractProduction = function (contracts) { | ||
Contracts.calculateContractsProduction = function (contracts) { | ||
var filteredContracts = Contracts.filterValidProductionContracts(contracts); | ||
@@ -154,3 +53,3 @@ var production = _lodash2['default'].sumBy(filteredContracts, function (contract) { | ||
Contracts.calculateContractRevenue = function (contracts) { | ||
Contracts.calculateContractsRevenue = function (contracts) { | ||
var filteredContracts = Contracts.filterValidRevenueContracts(contracts); | ||
@@ -163,32 +62,2 @@ var revenue = _lodash2['default'].sumBy(filteredContracts, function (contract) { | ||
Contracts.translateContractTypeToName = function (type) { | ||
var types = { | ||
basis: 'Basis', | ||
cashsale: 'Cash Sale', | ||
forward: 'Forward', | ||
futures: 'Futures', | ||
hedgetoarrive: 'Hedge To Arrive', | ||
optionsale: 'Option Sale' | ||
}; | ||
if (types[type]) { | ||
return types[type]; | ||
} | ||
return _lodash2['default'].capitalize(type); | ||
}; | ||
Contracts.translateContractTypeToUrl = function (type) { | ||
var types = { | ||
basis: 'basis', | ||
cashsale: 'cash_sale', | ||
forward: 'forward', | ||
futures: 'futures', | ||
hedgetoarrive: 'hedge_to_arrive', | ||
optionsale: 'option_sale' | ||
}; | ||
if (types[type]) { | ||
return types[type]; | ||
} | ||
return type; | ||
}; | ||
exports['default'] = Contracts; |
{ | ||
"name": "@harvest-profit/harvest-profit-calculations", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "All the calculations", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
<div style="text-align: center"> | ||
<img src="https://www.harvestprofit.com/logo.png" alt="Harvest Profit"></img> | ||
</div> | ||
## Installation | ||
You will need an [NPM access token](https://docs.npmjs.com/private-modules/intro) to access this repo. | ||
Simply run the following to install: | ||
```bash | ||
yarn add @harvest-profit/harvest-profit-calculations | ||
``` | ||
## Development | ||
[Clone](https://help.github.com/articles/cloning-a-repository/) this repo, and begin committing changes. PRs are preferred over committing directly to master. | ||
To run tests locally on your machine, run the following: | ||
```bash | ||
yarn run test | ||
``` | ||
To preview documentation locally on your machine, run the following: | ||
```bash | ||
yarn run build-docs | ||
``` | ||
After merging your pull request, consider updating the documentation with the following command: | ||
```bash | ||
yarn run publish-docs | ||
``` | ||
## Publishing | ||
This package is published as a Private NPM Module. | ||
To publish to the private NPM registry, simply run the following, after bumping the `package.json` version: | ||
```bash | ||
# Publish using Yarn | ||
yarn publish | ||
# Or publish using NPM | ||
npm publish | ||
``` | ||
## License | ||
Copyright 2017-Present Harvest Profit. | ||
This repo contains private code. No copying or external use permitted. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
8
48
15066
335
1