! 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 = [ protected $casts = [
'status' => RemainderStatus::class, '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 false => null
}; };
return [ return [
'discord_user_id' => DiscordUser::factory(), 'discord_user_id' => DiscordUser::factory(),
'channel_id' => $channel_id, '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), 'message' => $this->faker->realText(32),
'status' => RemainderStatus::NEW->value, 'status' => RemainderStatus::NEW->value,
]; ];

View File

@@ -21,8 +21,8 @@ class DiscordUserSeeder extends Seeder
// Creating Discord Users // Creating Discord Users
$discordUsers = DiscordUser::factory()->times($discordUserCount)->make( $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 // Saving Discord Users
@@ -46,6 +46,7 @@ class DiscordUserSeeder extends Seeder
'discord_user_id' => $discordUser->id, 'discord_user_id' => $discordUser->id,
'created_at' => Carbon::now(), 'created_at' => Carbon::now(),
]); ]);
// add remainder to buffer // add remainder to buffer
$remainders = $remainders->concat($discordUserRemainders); $remainders = $remainders->concat($discordUserRemainders);
if ($remainders->count() >= $chunkSize) { if ($remainders->count() >= $chunkSize) {