fix: QA report BUG-01 to BUG-12 full resolution - demo switcher, AI tutor stream, timeline alignment, cbt filtering, danger styling, streak celebration
This commit is contained in:
@@ -72,23 +72,92 @@ def seed_local_database():
|
||||
)
|
||||
session.add(student_user)
|
||||
|
||||
# 3. Neha Verma (AI Coach demo student)
|
||||
neha_id = UUID("33333333-3333-3333-3333-333333333333")
|
||||
neha_user = models.User(
|
||||
id=neha_id,
|
||||
phone="9999999997",
|
||||
email="neha.demo@pragativeer.com",
|
||||
password_hash=bcrypt.hashpw("Pv9#kL2$mQ8!vX4@".encode('utf-8'), bcrypt.gensalt()).decode('utf-8'),
|
||||
name="Neha Verma",
|
||||
student_class=models.ClassEnum.TWELFTH,
|
||||
medium=models.MediumEnum.ENGLISH,
|
||||
target_exam=models.ExamEnum.JEE_MAIN,
|
||||
school="Modern School, Barakhamba Road",
|
||||
city="New Delhi",
|
||||
state="Delhi",
|
||||
tier=models.TierEnum.AI_COACH,
|
||||
trial_end=None,
|
||||
subscription_end=datetime.utcnow() + timedelta(days=345),
|
||||
streak_count=15,
|
||||
longest_streak=25,
|
||||
last_active=datetime.utcnow()
|
||||
)
|
||||
session.add(neha_user)
|
||||
|
||||
# 4. Priya Singh (Pro Tier demo student)
|
||||
priya_id = UUID("22222222-2222-2222-2222-222222222222")
|
||||
priya_user = models.User(
|
||||
id=priya_id,
|
||||
phone="9999999996",
|
||||
email="priya.demo@pragativeer.com",
|
||||
password_hash=bcrypt.hashpw("Pv9#kL2$mQ8!vX4@".encode('utf-8'), bcrypt.gensalt()).decode('utf-8'),
|
||||
name="Priya Singh",
|
||||
student_class=models.ClassEnum.TWELFTH,
|
||||
medium=models.MediumEnum.ENGLISH,
|
||||
target_exam=models.ExamEnum.NEET,
|
||||
school="City Montessori School",
|
||||
city="Lucknow",
|
||||
state="Uttar Pradesh",
|
||||
tier=models.TierEnum.PRO,
|
||||
trial_end=None,
|
||||
subscription_end=datetime.utcnow() + timedelta(days=345),
|
||||
streak_count=42,
|
||||
longest_streak=42,
|
||||
last_active=datetime.utcnow()
|
||||
)
|
||||
session.add(priya_user)
|
||||
|
||||
# 5. Amit Kumar (Free Tier demo student)
|
||||
amit_id = UUID("11111111-1111-1111-1111-111111111111")
|
||||
amit_user = models.User(
|
||||
id=amit_id,
|
||||
phone="9999999995",
|
||||
email="amit.demo@pragativeer.com",
|
||||
password_hash=bcrypt.hashpw("Pv9#kL2$mQ8!vX4@".encode('utf-8'), bcrypt.gensalt()).decode('utf-8'),
|
||||
name="Amit Kumar",
|
||||
student_class=models.ClassEnum.ELEVENTH,
|
||||
medium=models.MediumEnum.ENGLISH,
|
||||
target_exam=models.ExamEnum.JEE_MAIN,
|
||||
school="Loyola High School",
|
||||
city="Patna",
|
||||
state="Bihar",
|
||||
tier=models.TierEnum.FREE,
|
||||
trial_end=None,
|
||||
streak_count=38,
|
||||
longest_streak=38,
|
||||
last_active=datetime.utcnow()
|
||||
)
|
||||
session.add(amit_user)
|
||||
|
||||
# Flush users first so FK constraints for subscription/transaction are satisfied
|
||||
session.flush()
|
||||
|
||||
# Seed Demo Student Subscription record
|
||||
demo_subscription = models.Subscription(
|
||||
id=uuid4(),
|
||||
user_id=student_id,
|
||||
tier=models.TierEnum.AI_COACH,
|
||||
billing_cycle="Annual",
|
||||
start_date=datetime.utcnow() - timedelta(days=20),
|
||||
end_date=datetime.utcnow() + timedelta(days=345),
|
||||
amount=1199900,
|
||||
payment_id="PAY_DEMO_001",
|
||||
status="Active",
|
||||
auto_renew=True,
|
||||
)
|
||||
session.add(demo_subscription)
|
||||
# Seed Demo Student Subscription records
|
||||
for uid, tier in [(student_id, models.TierEnum.AI_COACH), (neha_id, models.TierEnum.AI_COACH), (priya_id, models.TierEnum.PRO)]:
|
||||
demo_subscription = models.Subscription(
|
||||
id=uuid4(),
|
||||
user_id=uid,
|
||||
tier=tier,
|
||||
billing_cycle="Annual",
|
||||
start_date=datetime.utcnow() - timedelta(days=20),
|
||||
end_date=datetime.utcnow() + timedelta(days=345),
|
||||
amount=1199900,
|
||||
payment_id=f"PAY_DEMO_{str(uid)[:6]}",
|
||||
status="Active",
|
||||
auto_renew=True,
|
||||
)
|
||||
session.add(demo_subscription)
|
||||
|
||||
# Seed Demo Student Transaction record
|
||||
demo_txn = models.Transaction(
|
||||
|
||||
Reference in New Issue
Block a user