Implement functionality to add shows to existing collections from suggestions
Added a new endpoint for adding shows to already assembled franchises based on the same suggestion key. Updated the CollectionSuggestion and CollectionSuggestionDto records to include a CollectionId for tracking existing collections. Enhanced the CollectionSuggestions component in the frontend to support this new functionality, allowing users to add missing parts to existing collections. Updated localization strings to reflect the new addition feature in both English and Russian, ensuring clarity for users. Adjusted tests to verify the correct behavior of the addition process and its integration with existing collection logic.
This commit is contained in:
+7
-1
@@ -26,6 +26,11 @@ public sealed class SuggestCollectionsQueryHandler(
|
||||
.Select(n => n.Trim())
|
||||
.ToHashSet(StringComparer.CurrentCultureIgnoreCase);
|
||||
|
||||
// У дополнения имя — это имя самой коллекции, и совпадение с ней ничего не значит: такое
|
||||
// предложение и живёт ровно потому, что франшиза уже собрана.
|
||||
bool AlreadyCreated(CollectionSuggestion s) =>
|
||||
s.CollectionId is null && existing.Contains(s.Name);
|
||||
|
||||
return
|
||||
[
|
||||
.. suggestions.Select(s => new CollectionSuggestionDto(
|
||||
@@ -33,7 +38,8 @@ public sealed class SuggestCollectionsQueryHandler(
|
||||
s.Source,
|
||||
s.Name,
|
||||
s.Parts,
|
||||
existing.Contains(s.Name)
|
||||
AlreadyCreated(s),
|
||||
s.CollectionId
|
||||
)),
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user