feat(manage/games): cap to the max number of similar games to 6 per game ID#4978
feat(manage/games): cap to the max number of similar games to 6 per game ID#4978wescopeland wants to merge 5 commits into
Conversation
Confidence Score: 5/5Safe to merge — cap logic is correct, validation runs before any writes, and the UI properly reflects the new constraint. Cap validation is complete on both directions before the transaction opens, the exception is cleanly caught with a user-friendly message, and the button disable/tooltip state recalculates correctly on re-render. No files require special attention. Reviews (2): Last reviewed commit: "Merge branch 'master' into similar-games..." | Re-trigger Greptile |
| public readonly int $offendingGameId, | ||
| public readonly int $cap, | ||
| ) { | ||
| parent::__construct("Game #{$offendingGameId} would exceed the {$cap}-similar-game cap."); |
There was a problem hiding this comment.
App\Exceptions\SimilarGamesCapExceededException::__construct(): Argument #1 ($offendingGameId) must be of type int, string given, called in /var/www/html/app/Platform/Actions/LinkSimilarGamesAction.php on line 49
When trying to link a game by ID where the count would exceed.
There was a problem hiding this comment.
Thanks, fixed in latest.
| Notification::make() | ||
| ->danger() | ||
| ->title('Cap exceeded') | ||
| ->body("Cannot add: {$title} would exceed the {$e->cap}-similar-game cap. Remove an entry first.") |


https://discord.com/channels/310192285306454017/888607146290343976/1514281892562604092
This PR caps the max number of similar games at 6 per each game ID. The cap is bidirectional.