# EG11-05 Towar magazynowy z wersją

from BTCInput import *

class StockItem(object):
    '''
    Towar magazynowy dla sklepu z odzieżą
    '''

    min_price = 0.5 
    max_price = 500.0 
    
    def __init__(self, stock_ref, price, color):
        self.stock_ref = stock_ref
        self.__price = price
        self.__stock_level = 0
        self.StockItem_version = 1
        self.color = color

    @property
    def item_name(self):
        return 'Towar magazynowy'

    def check_version():
        # To jest wersja 1 - nie trzeba niczego aktualizować 
        pass

    def __str__(self): 
        template = '''Numer magazynowy: {0}
Typ: {1}
Cena: {2}
Stan magazynowy: {3}
Kolor: {4}''' 
        return template.format(self.stock_ref, self.item_name,
                              self.price, self.stock_level, self.color) 

    @property
    def price(self):
        return self.__price

    @property
    def stock_level(self):
        return self.__stock_level

class Dress(StockItem):

    def __init__(self, stock_ref, price, color, pattern, size):        
        super().__init__(stock_ref, price, color)
        self.name = 'Sukienka' 
        self.pattern = pattern
        self.size = size
        self.Dress_version = 1

    @property
    def item_name(self):
        return 'Sukienka'

    def check_version():
        # To jest wersja 1 - nie trzeba niczego aktualizować 
        super().check_version()
        pass

    def __str__(self):
        stock_details = super().__str__()
        template = '''{0}
Fason: {1}
Rozmiar: {2}'''
        return template.format(stock_details, self.pattern,
                               self.size) 

class Pants(StockItem):

    def __init__(self, stock_ref, price, color, pattern, length, waist):
        super().__init__(stock_ref, price, color)
        self.name = 'Spodnie'
        self.pattern = pattern
        self.length = length
        self.waist = waist
        self.pants_version = 1

    @property
    def item_name(self):
        return 'Spodnie'

    def check_version():
        # To jest wersja 1 - nie trzeba niczego aktualizować 
        super().check_version()
        pass

    def __str__(self):
        stock_details = super().__str__()
        template = '''{0}
Fason: {1}
Długość:  {2}
Pas: {3}'''
        return template.format(stock_details, self.pattern,
                               self.length, self.waist) 
class Hat(StockItem):

    def __init__(self, stock_ref, price, color, size):
        super().__init__(stock_ref, price, color)
        self.name = 'Kapelusz'
        self.size = size
        self.Hat_version = 1

    @property
    def item_name(self):
        return "Kapelusz" 

    def check_version():
        # To jest wersja 1 - nie trzeba niczego aktualizować 
        super().check_version()
        pass


    def __str__(self):
        stock_details = super().__str__()
        template = '''{0}
Rozmiar: {1}'''
        return template.format(stock_details, self.size)

class Blouse(StockItem):
    
    def __init__(self, stock_ref, price, color, size, style, pattern):
        super().__init__(stock_ref, price, color)
        self.name = 'Bluza'
        self.size = size
        self.style = style 
        self.pattern = pattern
        self.Hat_version = 1

    @property
    def item_name(self):
        return "Bluza" 

    def check_version():
        # To jest wersja 1 - nie trzeba niczego aktualizować 
        super().check_version()
        pass

    def __str__(self):
        stock_details = super().__str__()
        template = '''{0}
Rozmiar: {1}
Styl:  {2}
Fason: {3}'''
        return template.format(stock_details, self.size,
                               self.style, self.pattern) 


x = Dress(stock_ref='D0001', price=100, color='czerwony', pattern='wieczorowa', size=12)
print(x)
