busroot-sdk 0.0.8-dev.2866265251 → 0.0.8-dev.2873962445

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.
Files changed (2) hide show
  1. package/build/index.js +6 -2
  2. package/package.json +1 -1
package/build/index.js CHANGED
@@ -9781,6 +9781,7 @@ var require_station_windows = __commonJS({
9781
9781
  exports2.extractDowntimesFromStationWindows = extractDowntimesFromStationWindows;
9782
9782
  exports2.getReliabilityData = getReliabilityData;
9783
9783
  exports2.calculateReliabilityMetrics = calculateReliabilityMetrics;
9784
+ exports2.lostProductionCostForDowntime = lostProductionCostForDowntime;
9784
9785
  exports2.downtimesToStationWindows = downtimesToStationWindows;
9785
9786
  exports2.filterStationWindowsBySkuCode = filterStationWindowsBySkuCode;
9786
9787
  exports2.filterStationWindowsByShiftNames = filterStationWindowsByShiftNames;
@@ -10327,6 +10328,10 @@ var require_station_windows = __commonJS({
10327
10328
  mttr: reliabilityData.totalStoppedTime / reliabilityData.stopsCount
10328
10329
  };
10329
10330
  }
10331
+ function lostProductionCostForDowntime(downtimeMs, skuValue, stationIdleCostPerMinute) {
10332
+ const idleCostPerMinute = skuValue ?? stationIdleCostPerMinute ?? 0;
10333
+ return idleCostPerMinute * (downtimeMs / time_1.TimeIntervals["1m"].ms);
10334
+ }
10330
10335
  function downtimesToStationWindows(downtimes, stations, nowOverride) {
10331
10336
  const now = nowOverride == null ? (0, moment_timezone_1.default)().valueOf() : nowOverride;
10332
10337
  const stationWindowsMap = downtimes.reduce((a, downtime) => {
@@ -10361,8 +10366,7 @@ var require_station_windows = __commonJS({
10361
10366
  a.set(timestamp, newStationWindow);
10362
10367
  } else {
10363
10368
  const issueTime = Math.min(windowEndAt, endAt) - Math.max(startAt, windowStartAt);
10364
- const idleCost = downtime.skuValue ?? stationIdleCostPerMinute;
10365
- const lostProductionCostDowntime = idleCost * (issueTime / time_1.TimeIntervals["1m"].ms);
10369
+ const lostProductionCostDowntime = lostProductionCostForDowntime(issueTime, downtime.skuValue, stationIdleCostPerMinute);
10366
10370
  const newStationWindow = {
10367
10371
  ...stationWindow,
10368
10372
  downtimeMs: Math.max(stationWindow.downtimeMs, issueTime),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "busroot-sdk",
3
- "version": "0.0.8-dev.2866265251",
3
+ "version": "0.0.8-dev.2873962445",
4
4
  "description": "An SDK for accessing Busroot from output.industries",
5
5
  "homepage": "https://www.output.industries",
6
6
  "main": "./build/index.js",