@dascompany/product 4.1.0 → 4.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/SQL.json CHANGED
@@ -19,7 +19,7 @@
19
19
  },
20
20
  "accountCart": {
21
21
  "select": "SELECT * FROM clients.account_cart WHERE account_id = $account_id::BIGINT",
22
- "insert": "INSERT INTO clients.account_cart(account_id, product_id, installation) VALUES ($account_id::BIGINT, $product_id::BIGINT, installation::BOOL)",
22
+ "insert": "INSERT INTO clients.account_cart(account_id, product_id, installation) VALUES ($account_id::BIGINT, $product_id::BIGINT, $installation::BOOL)",
23
23
  "update": "UPDATE clients.account_cart SET installation = $installation WHERE account_id = $account_id::BIGINT AND product_id = $product_id::BIGINT AND installation = $installation::Bool",
24
24
  "delete": "DELETE FROM clients.account_cart WHERE product_id = $product_id::BIGINT AND account_id = $account_id::BIGINT AND installation = $installation::BOOL"
25
25
  },
@@ -1,5 +1,5 @@
1
1
  export default class PriceConverter {
2
- static netToGrossPrice(netPrice: number, vatPercentage?: number): number;
3
- static grossToNetPrice(grossPrice: number, vatPercentage?: number): string;
2
+ static netToGrossPrice(netPriceinPenny: number, vatPercentage?: number): number;
3
+ static grossToNetPrice(grossPriceinPenny: number, vatPercentage?: number): string;
4
4
  static priceToPenny(price: number): number;
5
5
  }
@@ -1,13 +1,11 @@
1
1
  export default class PriceConverter {
2
- static netToGrossPrice(netPrice, vatPercentage = 23) {
3
- const netPriceInPenny = Math.round(netPrice * 100);
4
- const vatPriceInPenny = Math.round((netPriceInPenny * vatPercentage) / 100);
5
- const grossPriceInPenny = netPriceInPenny + vatPriceInPenny;
2
+ static netToGrossPrice(netPriceinPenny, vatPercentage = 23) {
3
+ const vatPriceInPenny = Math.round((netPriceinPenny * vatPercentage) / 100);
4
+ const grossPriceInPenny = netPriceinPenny + vatPriceInPenny;
6
5
  return grossPriceInPenny;
7
6
  }
8
- static grossToNetPrice(grossPrice, vatPercentage = 23) {
9
- const grossPriceInPenny = Math.round(grossPrice * 100);
10
- const netPrice = ((grossPriceInPenny / (vatPercentage / 100 + 1)) / 100).toFixed(2);
7
+ static grossToNetPrice(grossPriceinPenny, vatPercentage = 23) {
8
+ const netPrice = ((grossPriceinPenny / (vatPercentage / 100 + 1)) / 100).toFixed(2);
11
9
  return netPrice;
12
10
  }
13
11
  static priceToPenny(price) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dascompany/product",
3
- "version": "4.1.0",
3
+ "version": "4.1.2",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "test": "vitest",