"""Import mapper domain constants."""

from __future__ import annotations

ENTITY_TYPES = (
    "brand",
    "hub",
    "category",
    "collection",
    "attribute",
    "attribute_option",
)

OPTIONAL_ENTITY_TYPES = frozenset({"collection", "attribute", "attribute_option"})
IGNORE_ALLOWED_ENTITY_TYPES = frozenset({"collection", "attribute", "attribute_option"})

AUTO_RESOLVED_STATUSES = frozenset({"exact_match", "known_mapping"})
USER_RESOLVED_STATUSES = frozenset({"mapped", "created", "ignored"})
RESOLVED_STATUSES = AUTO_RESOLVED_STATUSES | USER_RESOLVED_STATUSES
BLOCKING_STATUSES = frozenset({"suggested", "ambiguous", "unmatched", "invalid"})

SELECTABLE_ATTRIBUTE_TYPES = frozenset({"select", "multiselect", "dropdown", "enum"})

SESSION_STATES = (
    "uploaded",
    "analyzing",
    "needs_mapping",
    "ready",
    "importing",
    "completed",
    "failed",
    "cancelled",
)

UI_STATUS_LABELS = {
    "exact_match": "Matched",
    "known_mapping": "Matched",
    "suggested": "Needs Review",
    "ambiguous": "Needs Review",
    "unmatched": "New Value",
    "mapped": "Resolved",
    "created": "Resolved",
    "ignored": "Resolved",
    "invalid": "Error",
}

ENTITY_TYPE_LABELS = {
    "brand": "Brand",
    "hub": "Hub",
    "category": "Category",
    "collection": "Collection",
    "attribute": "Attribute",
    "attribute_option": "Attribute Value",
}

SUGGESTION_THRESHOLD = 0.78
HIGH_SUGGESTION_THRESHOLD = 0.92
