Api reference
components.product_compliance_manager.public.api ¶
constraint_infos ¶
get_coverage_rules_constraint_infos ¶
Source code in components/product_compliance_manager/internal/business_logic/coverage_rule_constraint_infos.py
constraints ¶
search_guarantee_constraints ¶
Search for guarantee constraints by product type, source type, source reference and country
Source code in components/product_compliance_manager/public/api/constraints.py
violations ¶
compute_coverage_rules_violations ¶
Compute violations for a given coverage rules and guarantee constraints.
We want to link coverage rules to existing constraints, and create violations for missing coverage rules. In order to avoid false positives for guarantees that only appear in some bundle choices: - We first list all constraint bundles missing in the coverage rules - We then iterate over coverage rules having a constraint
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
coverage_rules
|
list[CoverageRule]
|
List of coverage rules. |
required |
guarantee_constraints
|
list[GuaranteeConstraint]
|
List of guarantee constraints. |
required |
guarantee_catalog
|
GuaranteeCatalog
|
Guarantee catalog. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
violations |
list[GuaranteeViolation]
|
List of violations. |
Source code in components/product_compliance_manager/internal/business_logic/coverage_rule_violations.py
components.product_compliance_manager.public.country_specifics ¶
components.product_compliance_manager.public.entities ¶
guarantee_constraint ¶
Entity for GuaranteeConstraint model.
GuaranteeConstraint
dataclass
¶
GuaranteeConstraint(
*,
source_type,
source_ref,
expression_type,
guarantee_refs,
eligibility_items_refs,
parameter_constraints
)
Bases: DataClassJsonMixin
Constraints on guarantees (as defined in the guarantee catalog).
from_internal_entity
staticmethod
¶
Convert an InternalGuaranteeConstraint into a GuaranteeConstraint
Source code in components/product_compliance_manager/public/entities/guarantee_constraint.py
GuaranteeParameterConstraint
dataclass
¶
guarantee_constraint_info ¶
GuaranteeConstraintInfo
dataclass
¶
GuaranteeConstraintInfo(
*,
type,
description,
guarantee_ref,
bundle_choice_ref,
parameter_type,
additional_args
)
Information about a guarantee constraint, not necessarily a violation.
constraint_key
property
¶
Builds a key that uniquely identifies a group of constraints. This can happen when multiple constraint sources target the same guarantee.
GuaranteeConstraintInfoAdditionalArgs
dataclass
¶
GuaranteeConstraintInfoAdditionalArgs(
*,
missing_eligibility_items=None,
min_value=None,
max_value=None,
exact_value=None,
sources=set()
)
Bases: DataClassJsonMixinWithNoneExclusion
Additional arguments for a guarantee violation, provides metadata for the frontend display.
merge ¶
Merge two GuaranteeConstraintInfoAdditionalArgs instances.
For sets (missing_eligibility_items, sources), combines all values. For min_value, keeps the maximum value. For max_value, keeps the minimum value. For exact_value, uses the value from other if present.
Source code in components/product_compliance_manager/public/entities/guarantee_constraint_info.py
GuaranteeConstraintInfoType ¶
guarantee_violation ¶
GuaranteeViolation
dataclass
¶
GuaranteeViolation(
*,
type,
description,
guarantee_ref,
bundle_choice_ref,
parameter_type,
additional_args
)
Bases: GuaranteeConstraintInfo
A guarantee constraint violation
from_guarantee_constraint_info
staticmethod
¶
Convert a GuaranteeConstraintInfo into a GuaranteeViolation.