games_app/backend/dist/repositories/faqRepository.d.ts

70 lines
2.8 KiB
TypeScript

import { FaqCategoryRow, FaqEntryRow } from '../models/faq.model';
export type FaqEntryWithCategory = FaqEntryRow & {
category_slug: string;
category_name: string;
};
export type FaqEntryAdminRow = FaqEntryWithCategory & {
created_by_name: string | null;
updated_by_name: string | null;
};
export declare function listCategories(activeOnly?: boolean): Promise<FaqCategoryRow[]>;
export declare function getCategoryById(id: number): Promise<FaqCategoryRow | null>;
export declare function getCategoryBySlug(slug: string): Promise<FaqCategoryRow | null>;
export declare function createCategory(input: {
slug: string;
name: string;
description?: string | null;
sortOrder?: number;
isActive?: boolean;
}): Promise<FaqCategoryRow>;
export declare function updateCategory(id: number, patch: Partial<{
slug: string;
name: string;
description: string | null;
sortOrder: number;
isActive: boolean;
}>): Promise<FaqCategoryRow | null>;
/** Atomically set one language PDF pointer (safe replace). */
export declare function setCategoryDocument(id: number, lang: 'fr' | 'en', filename: string, originalName: string): Promise<FaqCategoryRow | null>;
/** Clear one language PDF pointer; returns previous filenames for disk cleanup. */
export declare function clearCategoryDocument(id: number, lang: 'fr' | 'en'): Promise<{
row: FaqCategoryRow;
removedFilename: string | null;
} | null>;
export declare function deleteCategory(id: number): Promise<boolean>;
export declare function listPublicEntries(filters: {
categorySlug?: string;
search?: string;
}): Promise<FaqEntryWithCategory[]>;
export declare function listPopularEntries(limit?: number): Promise<FaqEntryWithCategory[]>;
export declare function getEntryById(id: string): Promise<FaqEntryWithCategory | null>;
export declare function incrementViewCount(id: string): Promise<void>;
export declare function recordHelpfulVote(faqId: string, voterKey: string, helpful: boolean): Promise<{
helpfulYes: number;
helpfulNo: number;
changed: boolean;
}>;
export declare function listAdminEntries(filters: {
categoryId?: number;
search?: string;
isActive?: boolean;
}): Promise<FaqEntryAdminRow[]>;
export declare function createEntry(input: {
categoryId: number;
question: string;
answerHtml: string;
isActive?: boolean;
sortOrder?: number;
userId: string;
}): Promise<FaqEntryRow>;
export declare function updateEntry(id: string, patch: Partial<{
categoryId: number;
question: string;
answerHtml: string;
isActive: boolean;
sortOrder: number;
userId: string;
}>): Promise<FaqEntryRow | null>;
export declare function deleteEntry(id: string): Promise<boolean>;
export declare function countEntriesInCategory(categoryId: number): Promise<number>;
//# sourceMappingURL=faqRepository.d.ts.map