This repository has no description
1export interface CollectionQueryOptions {
2 page: number;
3 limit: number;
4 sortBy: CollectionSortField;
5 sortOrder: SortOrder;
6 searchText?: string;
7}
8
9export interface PaginatedQueryResult<T> {
10 items: T[];
11 totalCount: number;
12 hasMore: boolean;
13}
14
15export enum CollectionSortField {
16 NAME = 'name',
17 CREATED_AT = 'createdAt',
18 UPDATED_AT = 'updatedAt',
19 CARD_COUNT = 'cardCount',
20}
21
22export enum SortOrder {
23 ASC = 'asc',
24 DESC = 'desc',
25}
26
27// Raw data from repository - minimal, just what's stored
28export interface CollectionQueryResultDTO {
29 id: string;
30 uri?: string;
31 name: string;
32 description?: string;
33 updatedAt: Date;
34 createdAt: Date;
35 cardCount: number;
36 authorId: string; // Just the curator ID, not enriched data
37}
38
39// View data for collections containing a specific card
40export interface CollectionContainingCardDTO {
41 id: string;
42 uri?: string;
43 name: string;
44 description?: string;
45}
46
47export interface ICollectionQueryRepository {
48 findByCreator(
49 curatorId: string,
50 options: CollectionQueryOptions,
51 ): Promise<PaginatedQueryResult<CollectionQueryResultDTO>>;
52
53 getCollectionsContainingCardForUser(
54 cardId: string,
55 curatorId: string,
56 ): Promise<CollectionContainingCardDTO[]>;
57}