! Merge branch 'dev'

This commit is contained in:
2025-07-18 11:47:28 +02:00
3 changed files with 7 additions and 4 deletions

View File

@@ -31,7 +31,7 @@ class Remainder extends Model
protected $casts = [
'status' => RemainderStatus::class,
'due_at' => 'datetime',
'due_at' => 'datetime:Y-m-d H:i:s',
];
/**

View File

@@ -25,10 +25,12 @@ class RemainderFactory extends Factory
false => null
};
return [
'discord_user_id' => DiscordUser::factory(),
'channel_id' => $channel_id,
'due_at' => $this->faker->dateTimeBetween('now', '+1 year'),
//NOTE: Trend does not play well with the default DateTime format (ex.: 2025-05-12T08:18:51.000000Z)
'due_at' => $this->faker->dateTimeBetween('now', '+1 year')->format('Y-m-d H:i:s'),
'message' => $this->faker->realText(32),
'status' => RemainderStatus::NEW->value,
];

View File

@@ -21,8 +21,8 @@ class DiscordUserSeeder extends Seeder
// Creating Discord Users
$discordUsers = DiscordUser::factory()->times($discordUserCount)->make(
//TODO? maybe add sum random creation times here ex.:->subSeconds(rand(0, 30 * 24 * 60 * 60))
['created_at' => Carbon::now()]
['created_at' => Carbon::now()
->subSeconds(rand(0, 30 * 24 * 60 * 60))] // randomize to the last 30 days
);
// Saving Discord Users
@@ -46,6 +46,7 @@ class DiscordUserSeeder extends Seeder
'discord_user_id' => $discordUser->id,
'created_at' => Carbon::now(),
]);
// add remainder to buffer
$remainders = $remainders->concat($discordUserRemainders);
if ($remainders->count() >= $chunkSize) {