feat: add ability to like books

This commit is contained in:
2026-02-04 21:14:13 -08:00
parent a9764a4a82
commit 729f410443
19 changed files with 1256 additions and 8 deletions
+2
View File
@@ -8,6 +8,8 @@ export enum AuditAction {
ENTRY_CREATE = "ENTRY_CREATE",
ENTRY_UPDATE = "ENTRY_UPDATE",
ENTRY_DELETE = "ENTRY_DELETE",
LIKE = "LIKE",
UNLIKE = "UNLIKE",
USER_BAN = "USER_BAN",
USER_UNBAN = "USER_UNBAN",
RATE_LIMIT_EXCEEDED = "RATE_LIMIT_EXCEEDED",
+32
View File
@@ -0,0 +1,32 @@
/**
* @copyright 2026 NHCarrigan
* @license Naomi's Public License
* @author Naomi Carrigan
*/
export interface Like {
id: string;
userId: string;
entityType: 'book' | 'game' | 'show' | 'manga' | 'music' | 'art';
entityId: string;
createdAt: Date;
}
export type CreateLikeDto = Pick<Like, 'entityType' | 'entityId'>;
export interface LikeCountDto {
entityId: string;
entityType: string;
count: number;
}
export interface LikedItemDto {
like: Like;
item: any; // This will be the actual entity (Book, Game, etc.)
}
// Response types
export interface LikeResponse {
liked: boolean;
count: number;
}