Skip to content

Commit

Permalink
dumili: Allow to fill the issue price metadata, add warning if the cu…
Browse files Browse the repository at this point in the history
…rrent entry's selected story has a different amount of pages than the original
  • Loading branch information
bperel committed Nov 20, 2024
1 parent dfa45a4 commit 20a167c
Show file tree
Hide file tree
Showing 9 changed files with 87 additions and 347 deletions.
1 change: 1 addition & 0 deletions apps/dumili/api/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
15 changes: 15 additions & 0 deletions apps/dumili/api/services/indexation/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
10 changes: 10 additions & 0 deletions apps/dumili/api/services/indexation/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
343 changes: 0 additions & 343 deletions apps/dumili/src/components/DumiliBook.vue

This file was deleted.

Loading

0 comments on commit 20a167c

Please sign in to comment.