+ public static function applicationAccepted(Tournament $tournament, Application $application, User $user) {
+ $protocol = static::create([
+ 'tournament_id' => $tournament->id,
+ 'user_id' => $user->id,
+ 'type' => 'application.accepted',
+ 'details' => [
+ 'tournament' => static::tournamentMemo($tournament),
+ 'application' => static::applicationMemo($application),
+ 'user' => static::userMemo($application->user),
+ ],
+ ]);
+ ProtocolAdded::dispatch($protocol);
+ }
+
+ public static function applicationReceived(Tournament $tournament, Application $application, User $user) {
+ $protocol = static::create([
+ 'tournament_id' => $tournament->id,
+ 'user_id' => $user->id,
+ 'type' => 'application.received',
+ 'details' => [
+ 'tournament' => static::tournamentMemo($tournament),
+ 'application' => static::applicationMemo($application),
+ 'user' => static::userMemo($application->user),
+ ],
+ ]);
+ ProtocolAdded::dispatch($protocol);
+ }
+
+ public static function applicationRejected(Tournament $tournament, Application $application, User $user) {
+ $protocol = static::create([
+ 'tournament_id' => $tournament->id,
+ 'user_id' => $user->id,
+ 'type' => 'application.rejected',
+ 'details' => [
+ 'tournament' => static::tournamentMemo($tournament),
+ 'application' => static::applicationMemo($application),
+ 'user' => static::userMemo($application->user),
+ ],
+ ]);
+ ProtocolAdded::dispatch($protocol);
+ }
+
+ public static function resultCommented(Tournament $tournament, Result $result, User $user) {
+ $protocol = static::create([
+ 'tournament_id' => $tournament->id,
+ 'user_id' => $user->id,
+ 'type' => 'result.comment',
+ 'details' => [
+ 'tournament' => static::tournamentMemo($tournament),
+ 'result' => static::resultMemo($result),
+ 'round' => static::roundMemo($result->round),
+ ],
+ ]);
+ ProtocolAdded::dispatch($protocol);
+ }
+
+ public static function resultReported(Tournament $tournament, Result $result, User $user) {
+ $protocol = static::create([
+ 'tournament_id' => $tournament->id,
+ 'user_id' => $user->id,
+ 'type' => 'result.report',
+ 'details' => [
+ 'tournament' => static::tournamentMemo($tournament),
+ 'result' => static::resultMemo($result),
+ 'round' => static::roundMemo($result->round),
+ ],
+ ]);
+ ProtocolAdded::dispatch($protocol);
+ }
+