from src.items.helpers.constants import INCREMENTER_SELL_IN_VALUE
from src.items.base import Item


class AgedBrieItem(Item):
    def __init__(self, name: str, sell_in: int, quality: int):
        super().__init__(name, sell_in, quality)
        self.is_valid_quality(self.get_quality())

    def update_quality(self):
        if self.is_quality_valid_after_addition(1):
            self._quality += 1
        self._sell_in -= INCREMENTER_SELL_IN_VALUE
