Files
Fulfillment-Backend/barcodes/attributes/__init__.py
2024-05-10 16:18:26 +03:00

27 lines
971 B
Python

from .article_attribute_getter import ArticleAttributeGetter
from .brand_attribute_getter import BrandAttributeGetter
from .client_name_attribute_getter import ClientNameAttributeGetter
from .color_attribute_getter import ColorAttributeGetter
from .composition_attribute_getter import CompositionAttributeGetter
from .name_attribute_getter import NameAttributeGetter
class AttributeWriterFactory:
@staticmethod
def get_writer(key: str):
match key:
case 'name':
return NameAttributeGetter()
case 'article':
return ArticleAttributeGetter()
case 'client.name':
return ClientNameAttributeGetter()
case 'brand':
return BrandAttributeGetter()
case 'color':
return ColorAttributeGetter()
case 'composition':
return CompositionAttributeGetter()
case _:
return None