from oscar.core.loading import get_class, get_model

from ocyan.main.loading import get_baseclass

BaseProductToModel = get_baseclass(
    "oscar_odin.mappings.catalogue", "ProductToModel", "ocyan.plugin.oscar_odin"
)

ProductResource = get_class("oscar_odin.resources.catalogue", "ProductResource")
ProductModel = get_model("catalogue", "Product")


class ProductToModel(BaseProductToModel):
    from_obj = ProductResource
    to_obj = ProductModel

    IMPACTED_FIELDS = dict(
        BaseProductToModel.IMPACTED_FIELDS,
        vat_rate={"Product.vat_rate"},
        long_description={"Product.long_description"},
    )
