from typing import Optional

import odin

from oscar.core.loading import get_class

from ocyan.plugin.oscar.taxes.taxrate import ALL_TAX_RATES

BaseProductResource = get_class("oscar_odin.resources.catalogue", "ProductResource")
get_default_tax_rate = get_class("taxes.taxrate", "get_default_tax_rate")


class ProductResource(BaseProductResource):
    vat_rate: str = odin.Options(default=get_default_tax_rate(), choices=ALL_TAX_RATES)
    long_description: Optional[str]
