New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@holaluz/pomada

Package Overview
Dependencies
Maintainers
5
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@holaluz/pomada - npm Package Compare versions

Comparing version 1.3.0-beta.1 to 1.3.0-beta.2

8

dist/product-price/application/get-product-prices.d.ts

@@ -7,6 +7,6 @@ import { CupsError } from '../../cups/domain/cups-error';

products: ProductName[];
consumption: ValueByPeriod;
currentPower: ValueByPeriod;
optimizedPower: ValueByPeriod;
desiredPower: ValueByPeriod;
consumption?: ValueByPeriod;
currentPower?: ValueByPeriod;
optimizedPower?: ValueByPeriod;
desiredPower?: ValueByPeriod;
};

@@ -13,0 +13,0 @@ declare type GetProductPricesCallbacks = {

@@ -8,8 +8,9 @@ "use strict";

// Gets the fee, energy and power price of an Holaluz product, for the consumption and powers provided.
// If no consumption or currentPower is provided, it will only return energy prices.
async function getProductPrices({ products, consumption, currentPower, optimizedPower, desiredPower, }, { onSuccess, onError }) {
const productPrices = products.map((p) => ({
name: p,
fee: 0,
}));
await Promise.all([
// Gets energy/power prices
const requests = [
...productPrices.map(async (product) => {

@@ -27,3 +28,6 @@ if (product.name === product_name_1.ProductName.fair)

}),
...productPrices.map(async (product) => {
];
// If we are checking prices for a consumption, gets monthly fee per product
if (consumption && currentPower && optimizedPower && desiredPower) {
requests.push(...productPrices.map(async (product) => {
const targetPower = product.name === product_name_1.ProductName.fair ? optimizedPower : desiredPower;

@@ -37,4 +41,5 @@ const feeResult = await get_fee_of_product_1.getFeeOfProduct(product.name, consumption, currentPower, targetPower);

throw feeResult.getFail();
}),
])
}));
}
await Promise.all(requests)
.then(() => onSuccess(productPrices))

@@ -41,0 +46,0 @@ .catch((e) => onError(e));

@@ -5,5 +5,5 @@ import { ValueByPeriod } from '../../period/domain/value-by-period';

name: ProductName;
fee: Number;
fee?: Number;
energy?: ValueByPeriod;
power?: ValueByPeriod;
}
export declare enum ProductName {
classic = "CL_1P_20TD",
classicThreePrices = "CL_3P_20TD",
fair = "TJ_3P_20TD"
}

@@ -7,4 +7,5 @@ "use strict";

ProductName["classic"] = "CL_1P_20TD";
ProductName["classicThreePrices"] = "CL_3P_20TD";
ProductName["fair"] = "TJ_3P_20TD";
})(ProductName = exports.ProductName || (exports.ProductName = {}));
//# sourceMappingURL=product-name.js.map
{
"name": "@holaluz/pomada",
"version": "1.3.0-beta.1",
"version": "1.3.0-beta.2",
"description": "Holaluz shared FE business logic repository",

@@ -5,0 +5,0 @@ "author": "Holaluz",

@@ -30,2 +30,3 @@ # Pomada

desiredPower: supplyPoint.optimizedPower,
optimizedPower: supplyPoint.optimizedPower,
},

@@ -32,0 +33,0 @@ {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc