60 lines
2.2 KiB
TypeScript
60 lines
2.2 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 createCategory(input: {
|
|
slug: string;
|
|
name: string;
|
|
sortOrder?: number;
|
|
isActive?: boolean;
|
|
}): Promise<FaqCategoryRow>;
|
|
export declare function updateCategory(id: number, patch: Partial<{
|
|
slug: string;
|
|
name: string;
|
|
sortOrder: number;
|
|
isActive: boolean;
|
|
}>): Promise<FaqCategoryRow | 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
|