More refactorings, more file re-arrangings

This commit is contained in:
aditya.chandel
2025-01-12 13:56:36 -07:00
parent ef3556cb0c
commit d29d59c299
31 changed files with 66 additions and 182 deletions
@@ -1,21 +0,0 @@
import { Book } from '../../../book/model/book.model';
export interface BookNotification {
action: Action;
addedBook?: Book;
removedBookIds?: Set<number>;
}
export enum Action {
BOOK_ADDED = 'BOOK_ADDED',
BOOKS_REMOVED = 'BOOKS_REMOVED',
}
export function parseBookNotification(messageBody: string): BookNotification {
const raw = JSON.parse(messageBody);
return {
action: raw.action,
addedBook: raw.addedBook,
removedBookIds: raw.removedBookIds ? new Set<number>(raw.removedBookIds) : undefined,
};
}