from Decorators.CompanyRewardDecorator import CompanyRewardDecorator
from datetime import datetime


class NipHasDigitsFromThisDay(CompanyRewardDecorator):

    def hasAllDigits(self, number, word):
        for digit in number:
            hasDigit = False
            for char in word:
                if char == digit:
                    hasDigit = True
            if not hasDigit:
                return False
        return True

    def nipHasDigitsFromThisDay(self, word):
        now = datetime.now()
        day = str(now.day)
        month = str(now.month)
        return self.hasAllDigits(day, word) and self.hasAllDigits(month, word)

    def getReward(self):
        reward = 0
        for nip in self.getNip():
            if self.nipHasDigitsFromThisDay(nip):
                reward += 15
        return reward

e0dc393ac0e72e29b831c890b8f4da815001582a
<mask token>


class NipHasDigitsFromThisDay(CompanyRewardDecorator):
    <mask token>

    def nipHasDigitsFromThisDay(self, word):
        now = datetime.now()
        day = str(now.day)
        month = str(now.month)
        return self.hasAllDigits(day, word) and self.hasAllDigits(month, word)
    <mask token>

<mask token>


class NipHasDigitsFromThisDay(CompanyRewardDecorator):

    def hasAllDigits(self, number, word):
        for digit in number:
            hasDigit = False
            for char in word:
                if char == digit:
                    hasDigit = True
            if not hasDigit:
                return False
        return True

    def nipHasDigitsFromThisDay(self, word):
        now = datetime.now()
        day = str(now.day)
        month = str(now.month)
        return self.hasAllDigits(day, word) and self.hasAllDigits(month, word)
    <mask token>

<mask token>


class NipHasDigitsFromThisDay(CompanyRewardDecorator):

    def hasAllDigits(self, number, word):
        for digit in number:
            hasDigit = False
            for char in word:
                if char == digit:
                    hasDigit = True
            if not hasDigit:
                return False
        return True

    def nipHasDigitsFromThisDay(self, word):
        now = datetime.now()
        day = str(now.day)
        month = str(now.month)
        return self.hasAllDigits(day, word) and self.hasAllDigits(month, word)

    def getReward(self):
        reward = 0
        for nip in self.getNip():
            if self.nipHasDigitsFromThisDay(nip):
                reward += 15
        return reward

from Decorators.CompanyRewardDecorator import CompanyRewardDecorator
from datetime import datetime


class NipHasDigitsFromThisDay(CompanyRewardDecorator):

    def hasAllDigits(self, number, word):
        for digit in number:
            hasDigit = False
            for char in word:
                if char == digit:
                    hasDigit = True
            if not hasDigit:
                return False
        return True

    def nipHasDigitsFromThisDay(self, word):
        now = datetime.now()
        day = str(now.day)
        month = str(now.month)
        return self.hasAllDigits(day, word) and self.hasAllDigits(month, word)

    def getReward(self):
        reward = 0
        for nip in self.getNip():
            if self.nipHasDigitsFromThisDay(nip):
                reward += 15
        return reward
