Implement functionality to add shows to existing collections from suggestions
ci / build-backend (push) Successful in 1m40s
ci / build-frontend (push) Successful in 53s
ci / tests (push) Successful in 1m46s
ci / sonar (push) Successful in 6m47s

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:
Leonid Pershin
2026-07-28 14:49:27 +03:00
parent 6c85db2d60
commit ac41111fa0
12 changed files with 413 additions and 39 deletions
+5 -1
View File
@@ -275,13 +275,17 @@ export type CollectionDto = {
/** Откуда взялось предложение франшизы: данные источника либо догадка по названиям. */
export type CollectionSuggestionSource = 'Metadata' | 'NameGuess'
/** Предложение собрать франшизу: имя и части в предлагаемом порядке. */
/**
* Предложение собрать франшизу: имя и части в предлагаемом порядке. `collectionId` задан —
* франшиза уже собрана, и предлагается дополнить её недостающими частями.
*/
export type CollectionSuggestionDto = {
key: string
source: CollectionSuggestionSource
name: string
parts: { showId: string; name: string; year: number | null }[]
alreadyExists: boolean
collectionId: string | null
}
/** Коллекция, в которую входит шоу — для блока на экране шоу. */
+4 -1
View File
@@ -175,9 +175,12 @@ export const en = {
orderHint: 'Drag to set the order of the parts — that is the order they air in.',
suggestions: {
title: 'Franchise suggestions',
hint: 'Built from movies not in any collection yet. Check the parts — the name-based guess sometimes misses.',
hint: 'Built from movies not in any collection yet: what to assemble into a new franchise and what to add to an assembled one. Check the parts — the name-based guess sometimes misses.',
parts: '{{count}} parts',
exists: 'already exists',
additionBadge: 'addition',
add: 'Add',
added: 'Added to the collection: {{count}}',
created: 'Collection created',
allCreated: 'Every suggestion has been created already.',
showExisting: 'Show already created ({{count}})',
+4 -1
View File
@@ -175,9 +175,12 @@ export const ru = {
orderHint: 'Порядок частей задаётся перетаскиванием — в нём они и пойдут в эфир.',
suggestions: {
title: 'Предложения франшиз',
hint: 'Собрано из полнометражек, не входящих ни в одну коллекцию. Проверьте состав — по названиям догадка иногда промахивается.',
hint: 'Собрано из полнометражек, не входящих ни в одну коллекцию: что собрать в новую франшизу и чем дополнить уже собранную. Проверьте состав — по названиям догадка иногда промахивается.',
parts: '{{count}} частей',
exists: 'уже есть',
additionBadge: 'дополнение',
add: 'Добавить',
added: 'Добавлено в коллекцию: {{count}}',
created: 'Коллекция создана',
allCreated: 'Все предложения уже созданы.',
showExisting: 'Показать уже созданные ({{count}})',