end of day

This commit is contained in:
Sayyid Hamid Mahdavi 2025-09-16 21:00:38 +03:30
parent 8f206269fa
commit 3d55d4eba3

View file

@ -15,10 +15,8 @@ class EventQuerySet(models.QuerySet):
pass
class Event(BaseModel):
actor = None
target = None
label = None
details = {}
label = models.CharField(max_length=255, db_index=True)
details = models.JSONField() # from to amount application user etc
objects = EventQuerySet.as_manager()
@ -28,6 +26,8 @@ class Event(BaseModel):
class PlanQuerySet(models.QuerySet):
# this is for list of discount code for example
def calculate(self, user, application=None):
for plan in self.filter(application=application)[:10]:
if not Promotion.objects.used(user):