feat: Add seed_test_data script to populate initial test data for events, testimonials, hackathons, and mentors

This commit is contained in:
MythEclipse
2025-10-08 23:03:00 +07:00
parent 8c2527d61e
commit 466ba3391a
14 changed files with 395 additions and 54 deletions
@@ -59,7 +59,12 @@ impl GachaClaimSchema {
&Uuid::new_v4().to_string(),
),
user: user_id,
item: roll.item.id.clone(),
// roll.item is optional at the DTO level; assume caller ensured a valid item exists
item: roll
.item
.as_ref()
.map(|i| i.id.clone())
.unwrap_or_else(|| make_thing(&ResourceEnum::GachaItems.to_string(), &Uuid::new_v4().to_string())),
..Default::default()
}
}