diff --git a/apps/dumili/api/prisma/schema.prisma b/apps/dumili/api/prisma/schema.prisma index 7db403621..aabe25404 100644 --- a/apps/dumili/api/prisma/schema.prisma +++ b/apps/dumili/api/prisma/schema.prisma @@ -92,6 +92,7 @@ model issueSuggestion { publicationcode String @db.VarChar(12) issuenumber String @db.VarChar(13) issuecode String @db.VarChar(25) + price String? @db.VarChar(160) acceptedOnEntries indexation[] @relation("indexation_accepted_issue_suggestion_idToissue_suggestion") indexation indexation @relation(fields: [indexationId], references: [id], onUpdate: Restrict, map: "issue_suggestion_indexation_id_fk") diff --git a/apps/dumili/api/services/indexation/index.ts b/apps/dumili/api/services/indexation/index.ts index b8bffee70..144a308da 100644 --- a/apps/dumili/api/services/indexation/index.ts +++ b/apps/dumili/api/services/indexation/index.ts @@ -221,6 +221,21 @@ export default (io: Server) => { .then(({ id }) => callback({ suggestionId: id })), ); + indexationSocket.on("updateIssueSuggestion", (suggestion, callback) => + prisma.indexation + .update({ + data: { + acceptedIssueSuggestion: { + update: suggestion, + }, + }, + where: { + id: indexationSocket.data.indexation.id, + } + }) + .then(() => callback({ status: "OK" })), + ); + indexationSocket.on("createOcrDetails", async (ocrDetails, callback) => { if ( !indexationSocket.data.indexation.pages.some( diff --git a/apps/dumili/api/services/indexation/types.ts b/apps/dumili/api/services/indexation/types.ts index 416d37ba3..90a4ab5d9 100644 --- a/apps/dumili/api/services/indexation/types.ts +++ b/apps/dumili/api/services/indexation/types.ts @@ -111,6 +111,16 @@ export default abstract class { callback: (data: { suggestionId: storySuggestion["id"] }) => void, ) => void; + abstract updateIssueSuggestion: ( + values: Pick< + issueSuggestion, + "price" + >, + callback: ( + data: { status: "OK" } + ) => void, + ) => void; + abstract acceptIssueSuggestion: ( suggestionId: issueSuggestion["id"] | null, callback: (data: { status: "OK" }) => void, diff --git a/apps/dumili/src/components/DumiliBook.vue b/apps/dumili/src/components/DumiliBook.vue deleted file mode 100644 index b9d2caec2..000000000 --- a/apps/dumili/src/components/DumiliBook.vue +++ /dev/null @@ -1,343 +0,0 @@ - - - - - diff --git a/apps/dumili/src/components/StorySuggestionList.vue b/apps/dumili/src/components/StorySuggestionList.vue index ba944d037..c05e79d7c 100644 --- a/apps/dumili/src/components/StorySuggestionList.vue +++ b/apps/dumili/src/components/StorySuggestionList.vue @@ -24,6 +24,24 @@ > + + @@ -40,6 +58,7 @@ import { dumiliSocketInjectionKey } from "~/composables/useDumiliSocket"; import { FullEntry } from "~dumili-services/indexation/types"; import { suggestions } from "../stores/suggestions"; import { storySuggestion } from "~prisma/client_dumili"; +import { getEntryPages } from "~dumili-utils/entryPages"; const { t: $t } = useI18n(); diff --git a/apps/dumili/src/components/TableOfContents.vue b/apps/dumili/src/components/TableOfContents.vue index 7c3bcba9d..edadc6a0d 100644 --- a/apps/dumili/src/components/TableOfContents.vue +++ b/apps/dumili/src/components/TableOfContents.vue @@ -1,13 +1,27 @@