-
-
Notifications
You must be signed in to change notification settings - Fork 99
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(home): show user's current AOTW unlock status (#3054)
- Loading branch information
1 parent
67af73a
commit 19808d4
Showing
20 changed files
with
365 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Http\Data; | ||
|
||
use App\Platform\Data\EventAchievementData; | ||
use Spatie\LaravelData\Data; | ||
use Spatie\TypeScriptTransformer\Attributes\TypeScript; | ||
|
||
#[TypeScript('AchievementOfTheWeekProps')] | ||
class AchievementOfTheWeekPropsData extends Data | ||
{ | ||
public function __construct( | ||
public EventAchievementData $currentEventAchievement, | ||
public bool $doesUserHaveUnlock, | ||
) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Database\Factories; | ||
|
||
use App\Models\Achievement; | ||
use App\Models\EventAchievement; | ||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
|
||
/** | ||
* @extends Factory<EventAchievement> | ||
*/ | ||
class EventAchievementFactory extends Factory | ||
{ | ||
protected $model = EventAchievement::class; | ||
|
||
/** | ||
* @return array<string, mixed> | ||
*/ | ||
public function definition(): array | ||
{ | ||
return [ | ||
'achievement_id' => Achievement::factory(), | ||
'source_achievement_id' => Achievement::factory(), | ||
'active_from' => now(), | ||
'active_until' => now()->addWeek(), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Database\Factories; | ||
|
||
use App\Models\Event; | ||
use App\Models\Game; | ||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
use Illuminate\Support\Carbon; | ||
|
||
/** | ||
* @extends Factory<Event> | ||
*/ | ||
class EventFactory extends Factory | ||
{ | ||
protected $model = Event::class; | ||
|
||
/** | ||
* @return array<string, mixed> | ||
*/ | ||
public function definition(): array | ||
{ | ||
$activeFrom = Carbon::instance($this->faker->dateTimeBetween('-1 year', '+1 year')); | ||
|
||
return [ | ||
'legacy_game_id' => Game::factory(), | ||
'slug' => $this->faker->unique()->slug(), | ||
'active_from' => $activeFrom, | ||
'active_until' => $activeFrom->clone()->addYear(), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.