Skip to content

sprint-3#9

Open
ShamilovR wants to merge 1 commit intomasterfrom
sprint_3
Open

sprint-3#9
ShamilovR wants to merge 1 commit intomasterfrom
sprint_3

Conversation

@ShamilovR
Copy link
Owner

No description provided.

self.__tax_rate = {'чипсы': 20, 'кола': 20, 'печенье': 20, 'молоко': 10, 'кефир': 10}

@property
def get_name_items(self):
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Можно лучше: название пропертей стоит давать по названию атрибута

return self.__number_items

def add_item_to_cheque(self, name):
if len(name) != 0 or len(name) < 40:
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: условие составлено не верно

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Коммент необходимо описать более развернуто, указать, что именно мы получим при такой реализации условия, а что мы должны быти получить по заданию, чтобы дать студенту направление мысли для исправления

def add_item_to_cheque(self, name):
if len(name) != 0 or len(name) < 40:
raise ValueError('Нельзя добавить товар, если в его названии нет символов или их больше 40')
else:
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: отсутствует проверка наличия товара в справочнике

if len(self.__name_items) > 10:
return sum(total) - (sum(total) * 10) / 100
else:
return sum(total) * 0.9
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: в данном случае должна возвращаться полная стоимость товаров

Comment on lines +51 to +54
if len(twenty_percent_tax) > 10:
return (sum(total) - (sum(total) * 10) / 100)
else:
return sum(total)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: не верная формула расчета НДС. Рассчитана полная стоимость всех позиций

Comment on lines +66 to +69
if len(ten_percent_tax) > 10:
return (sum(total) - (sum(total) * 10) / 100)
else:
return sum(total)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: не верная формула расчета НДС. Рассчитана полная стоимость всех позиций

ten_percent_tax = []
for i in range(0, len(self.__name_items)):
if self.__name_items[i] in self.__tax_rate:
if self.__tax_rate.get(self.__name_items[i]) == 20:
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: неверное условие фильтрации

return sum(total)

def total_tax(self):
return OnlineSalesRegisterCollector.ten_percent_tax_calculation() + OnlineSalesRegisterCollector.twenty_percent_tax_calculation()
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: для вызова данных методов необходимо создать экземпляр класса, а раз вызов происходит внутри класса, то вызов должен происходить через self

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Коммент дает студенту вариативность написания, что является неверным. Создавать экземпляр класса внутри методов этого же класса нельзя, корректным будет только обращение через self

if len(str(telephone_number)) > 10:
raise ValueError('Необходимо ввести 10 цифр после "+7"')
try:
float(telephone_number)
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Нужно исправить: необходимо проверять является ли введенное значение целочисленным. Лучше всего для этого подойдет функция isinstance

if twenty_percent_tax[i] in self.__item_price:
total.append(self.__item_price.get(twenty_percent_tax[i]))
if len(twenty_percent_tax) > 10:
return (sum(total) - (sum(total) * 10) / 100)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Отсутствует коммент: Нужно исправить: применена формула для расчета 10% ндс а не 20 по методу

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants