Skip to content

Commit

Permalink
style: remove unnecessary JSDoc from calculators
Browse files Browse the repository at this point in the history
  • Loading branch information
ozgurg committed Mar 24, 2024
1 parent e0e61d1 commit c47cf20
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 33 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ module.exports = {
}
}],
"vue/multi-word-component-names": "off",
"require-jsdoc": "off",
"valid-jsdoc": 0
}
};
12 changes: 0 additions & 12 deletions domain/konsol-vergisi-hesaplayici/calculator.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,13 @@ class Calculator {
}

/**
* @private
* @param {number} price
*/
#doCalculation(price) {
this.#calculateFromTaxAddedPrice ? this.#price -= price : this.#price += price;
}

/**
* @private
* @param {{[key: string]: number|null}} taxFees
* @returns {number}
*/
Expand All @@ -83,32 +81,22 @@ class Calculator {
return this.#calculateFromTaxAddedPrice ? calculateTaxFromTaxAddedPrice(price, rate) : calculateTaxFromTaxFreePrice(price, rate);
}

/**
* @private
*/
#_customTax() {
this.#taxFees.customTax = this.#calculateTax(this.#price, this.#taxRates.customTax);
this.#doCalculation(this.#taxFees.customTax);
}

/**
* @private
*/
#_specialConsumptionTax() {
this.#taxFees.specialConsumptionTax = this.#calculateTax(this.#price, this.#taxRates.specialConsumptionTax);
this.#doCalculation(this.#taxFees.specialConsumptionTax);
}

/**
* @private
*/
#_valueAddedTax() {
this.#taxFees.valueAddedTax = this.#calculateTax(this.#price, this.#taxRates.valueAddedTax);
this.#doCalculation(this.#taxFees.valueAddedTax);
}

/**
* @public
* @returns {{[key: string]: {[key: string]: number|null}}}
*/
calculate() {
Expand Down
21 changes: 0 additions & 21 deletions domain/telefon-vergisi-hesaplayici/calculator.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,13 @@ class Calculator {
}

/**
* @private
* @param {number} price
*/
#doCalculation(price) {
this.#calculateFromTaxAddedPrice ? this.#price -= price : this.#price += price;
}

/**
* @private
* @param {{[key: string]: number|null}} taxFees
* @returns {number}
*/
Expand All @@ -124,56 +122,37 @@ class Calculator {
return this.#calculateFromTaxAddedPrice ? calculateTaxFromTaxAddedPrice(price, rate) : calculateTaxFromTaxFreePrice(price, rate);
}

/**
* @private
*/
#_ministryOfCulture() {
this.#taxFees.ministryOfCulture = this.#calculateTax(this.#price, this.#taxRates.ministryOfCulture);
this.#doCalculation(this.#taxFees.ministryOfCulture);
}

/**
* @private
*/
#_trtImport() {
this.#taxFees.trtImport = this.#calculateTax(this.#price, this.#taxRates.trtImport);
this.#doCalculation(this.#taxFees.trtImport);
}

/**
* @private
*/
#_specialConsumptionTax() {
this.#taxRates.specialConsumptionTax = getSpecialConsumptionTaxRateByPrice(this.#price);
this.#taxFees.specialConsumptionTax = this.#calculateTax(this.#price, this.#taxRates.specialConsumptionTax);
this.#doCalculation(this.#taxFees.specialConsumptionTax);
}

/**
* @private
*/
#_valueAddedTax() {
this.#taxFees.valueAddedTax = this.#calculateTax(this.#price, this.#taxRates.valueAddedTax);
this.#doCalculation(this.#taxFees.valueAddedTax);
}

/**
* @private
*/
#_trtPassport() {
this.#taxFees.trtPassport = this.#taxRates.trtPassport * this.#eurToTryCurrency;
this.#doCalculation(this.#taxFees.trtPassport);
}

/**
* @private
*/
#_registration() {
this.#doCalculation(this.#taxFees.registration);
}

/**
* @public
* @returns {{[key: string]: {[key: string]: number|null}}}
*/
calculate() {
Expand Down

0 comments on commit c47cf20

Please sign in to comment.