refill hearts like Duolingo: one every 5 hours, all of them after 24

Each heart used to take 24 hours, so a student who lost all five waited up to
five days. Now one heart returns every 5 hours, and 24 hours after the first
heart was lost they all come back at once (the owner's call). /api/user/hearts
reports both times (nextRefillAt, fullRefillAt); an existing timer longer than
5 hours is shortened the first time it is read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-24 06:58:39 +03:30
parent 701d8badcc
commit 96f0204fcf
8 changed files with 140 additions and 14 deletions

View File

@@ -39,6 +39,8 @@ class UserHeartsResponseSerializer(serializers.Serializer):
currentHearts = serializers.IntegerField()
maxHearts = serializers.IntegerField()
nextRefillAt = serializers.DateTimeField(allow_null=True)
# همه‌ی قلب‌ها کی یک‌جا پر می‌شوند (۲۴ ساعت بعد از اولین قلبِ ازدست‌رفته).
fullRefillAt = serializers.DateTimeField(allow_null=True)
isUnlimited = serializers.BooleanField()