Refactor group mode switching logic to ensure proper list management
ci / build-backend (push) Successful in 1m36s
ci / build-frontend (push) Successful in 52s
ci / tests (push) Successful in 2m3s
ci / sonar (push) Successful in 6m21s

Updated the Group and UpdateGroupCommandHandler classes to clarify the behavior of group mode switching. The transition to dynamic mode now clears the existing item list to prevent old items from interfering with the new rule-based composition. Enhanced documentation and comments to explain the implications of mode changes. Updated tests to reflect the new behavior, ensuring that the group correctly handles item lists during mode transitions. Localization strings were also updated to inform users about the changes in item management during mode switching.
This commit is contained in:
Leonid Pershin
2026-07-31 04:22:36 +03:00
parent 7163a0b937
commit 375e0a810b
9 changed files with 79 additions and 37 deletions
@@ -50,8 +50,9 @@ public class GetGroupTests
var group = Group.Create("Динамическая");
group.SetFilter(new GroupFilter(GenreIds: [genre.Id]).ToJson());
group.AddElement(GroupElementKind.Show, pinned.Id);
group.SetMode(GroupMode.Dynamic);
// Закрепляют уже в динамическом режиме: там список — это поправки к правилу.
group.AddElement(GroupElementKind.Show, pinned.Id);
await using (var seed = fixture.New())
{