from enum import Enum


class TextVariant(Enum):
    PRODUCT_NAME = "PRODUCT_NAME"
    PRODUCT_FULL_DESCRIPTION = "PRODUCT_FULL_DESCRIPTION"
    PRODUCT_SHORT_DESCRIPTION = "PRODUCT_SHORT_DESCRIPTION"
    PRODUCT_ATTRIBUTE_NAME = "PRODUCT_ATTRIBUTE_NAME"
    PRODUCT_ATTRIBUTE_TERM = "PRODUCT_ATTRIBUTE_TERM"
    PRODUCT_CATEGORY = "PRODUCT_CATEGORY"

    @property
    def readable(self):
        return self.value.lower().replace("_", " ")


class LLMRequestVariant(Enum):
    TRANSLATE_PRODUCT_NAME = "TRANSLATE_PRODUCT_NAME"
    TRANSLATE_PRODUCT_CATEGORY_NAME = "TRANSLATE_PRODUCT_CATEGORY_NAME"
    TRANSLATE_PRODUCT_FULL_DESCRIPTION = "TRANSLATE_PRODUCT_FULL_DESCRIPTION"
    TRANSLATE_PRODUCT_SHORT_DESCRIPTION = "TRANSLATE_PRODUCT_SHORT_DESCRIPTION"
    TRANSLATE_PRODUCT_ATTRIBUTE_NAME = "TRANSLATE_PRODUCT_ATTRIBUTE_NAME"
    TRANSLATE_PRODUCT_ATTRIBUTE_TERM = "TRANSLATE_PRODUCT_ATTRIBUTE_TERM"
    ASSIGN_PRODUCT_CATEGORY = "ASSIGN_PRODUCT_CATEGORY"
    ASSIGN_FURNITURE_TYPE = "ASSIGN_FURNITURE_TYPE"
    REQUEST_DIALOG_REPLY = "REQUEST_DIALOG_REPLY"
    IMAGINE_DIALOG_SITUATION_LOCATION = "IMAGINE_DIALOG_SITUATION_LOCATION"
    IMAGINE_DIALOG_SITUATION_PARTICIPANTS = "IMAGINE_DIALOG_SITUATION_PARTICIPANTS"
    IMAGINE_DIALOG_SITUATION_TARGETS = "IMAGINE_DIALOG_SITUATION_TARGETS"

    @property
    def readable(self):
        return self.value.replace("TRANSLATE_", "").replace("ASSIGN_", "").lower().replace("_", " ")

    @property
    def table_attr(self):
        match self.value:
            case "TRANSLATE_PRODUCT_NAME":
                return "name"
            case "TRANSLATE_PRODUCT_SHORT_DESCRIPTION":
                return "original_description_short"
            case "TRANSLATE_PRODUCT_FULL_DESCRIPTION":
                return "original_description_full"
            case _:
                raise ValueError("Invalid table attr")
