@timeax/digital-service-engine 0.2.8 → 0.2.9

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.
@@ -7052,6 +7052,10 @@ function filterServicesForVisibleGroup(input, deps) {
7052
7052
  (_h = (_g = context.ratePolicy) != null ? _g : explicitFallbackSettings == null ? void 0 : explicitFallbackSettings.ratePolicy) != null ? _h : builderOptions == null ? void 0 : builderOptions.ratePolicy
7053
7053
  );
7054
7054
  const policySource = (_j = (_i = context.policies) != null ? _i : builderOptions == null ? void 0 : builderOptions.policies) != null ? _j : [];
7055
+ const resolvedCustomPrimaryRate = resolveCustomPrimaryRate(
7056
+ context.rateContext,
7057
+ svcMap
7058
+ );
7055
7059
  const visibleServiceIds = context.selectedButtons === void 0 ? void 0 : collectVisibleServiceIds(
7056
7060
  deps.builder,
7057
7061
  context.tagId,
@@ -7078,7 +7082,11 @@ function filterServicesForVisibleGroup(input, deps) {
7078
7082
  cap.id,
7079
7083
  (_k = context.effectiveConstraints) != null ? _k : {}
7080
7084
  );
7081
- const passesRate2 = candidatePassesRateCoherence(
7085
+ const passesRate2 = resolvedCustomPrimaryRate != null ? passesRatePolicy(
7086
+ resolvedRatePolicy,
7087
+ resolvedCustomPrimaryRate,
7088
+ toFiniteNumber(cap.rate)
7089
+ ) : candidatePassesRateCoherence(
7082
7090
  deps.builder,
7083
7091
  svcMap,
7084
7092
  context.tagId,
@@ -7118,6 +7126,17 @@ function filterServicesForVisibleGroup(input, deps) {
7118
7126
  diagnostics: lastDiagnostics && lastDiagnostics.length ? lastDiagnostics : void 0
7119
7127
  };
7120
7128
  }
7129
+ function resolveCustomPrimaryRate(rateContext, serviceMap) {
7130
+ if (!rateContext || rateContext.mode !== "custom_primary_rate") {
7131
+ return void 0;
7132
+ }
7133
+ if (rateContext.source === "manual") {
7134
+ return toFiniteNumber(rateContext.primaryRate);
7135
+ }
7136
+ if (rateContext.primaryServiceId == null) return void 0;
7137
+ const cap = getServiceCapability(serviceMap, rateContext.primaryServiceId);
7138
+ return toFiniteNumber(cap == null ? void 0 : cap.rate);
7139
+ }
7121
7140
  function evaluatePoliciesRaw(raw, serviceIds, svcMap, tagId, visibleServiceIds) {
7122
7141
  const compiled = compilePolicies(raw);
7123
7142
  const evaluated = evaluateServicePolicies(
@@ -9008,7 +9027,8 @@ function filterServicesForVisibleGroup2(ctx, candidates, input) {
9008
9027
  policies: input.policies,
9009
9028
  ratePolicy: input.ratePolicy,
9010
9029
  fallbackSettings: input.fallbackSettings,
9011
- fallback: input.fallback
9030
+ fallback: input.fallback,
9031
+ rateContext: input.rateContext
9012
9032
  }
9013
9033
  };
9014
9034
  const result = filterServicesForVisibleGroup(coreInput, {