Apply review comments

This commit is contained in:
2024-12-15 21:33:43 +01:00
parent e9361697f7
commit cde864fdc7
6 changed files with 226 additions and 70 deletions

View File

@ -650,6 +650,15 @@ class Counter(models.Model):
)
)["total"]
def customer_is_barman(self, customer: Customer | User) -> bool:
"""Check if current counter is a `bar` and that the customer is on the barmen_list
This is useful to compute special prices"""
if isinstance(customer, Customer):
customer: User = customer.user
return self.type == "BAR" and customer in self.barmen_list
class RefillingQuerySet(models.QuerySet):
def annotate_total(self) -> Self: