2023-09-08 14:14:41 +03:00
|
|
|
import {OrderOption} from '@tryghost/bookshelf-repository';
|
|
|
|
import {Recommendation} from './Recommendation';
|
2023-08-29 18:06:57 +03:00
|
|
|
|
|
|
|
export interface RecommendationRepository {
|
2023-09-01 11:48:14 +03:00
|
|
|
save(entity: Recommendation): Promise<void>;
|
|
|
|
getById(id: string): Promise<Recommendation | null>;
|
2023-09-15 16:14:47 +03:00
|
|
|
getByUrl(url: URL): Promise<Recommendation | null>;
|
2023-09-08 13:32:06 +03:00
|
|
|
getAll({filter, order}?: {filter?: string, order?: OrderOption<Recommendation>}): Promise<Recommendation[]>;
|
2023-09-08 14:14:41 +03:00
|
|
|
getPage({filter, order, page, limit}: {
|
2023-09-08 13:32:06 +03:00
|
|
|
filter?: string;
|
|
|
|
order?: OrderOption<Recommendation>;
|
|
|
|
page: number;
|
|
|
|
limit: number;
|
|
|
|
}): Promise<Recommendation[]>;
|
2023-09-08 14:14:41 +03:00
|
|
|
getCount({filter}?: {
|
2023-09-08 13:32:06 +03:00
|
|
|
filter?: string;
|
|
|
|
}): Promise<number>;
|
2023-08-29 18:06:57 +03:00
|
|
|
};
|