https://project.mdnd-it.cc/work_packages/94
This commit is contained in:
2025-08-23 04:25:28 +02:00
parent 725516ad6c
commit 19cfa031d0
25823 changed files with 1095587 additions and 2801760 deletions
@@ -0,0 +1,54 @@
import { DeckAggregate } from '../../Domain/Deck/DeckAggregate';
import { IDeckRepository } from '../../Domain/IRepository/IDeckRepository';
export declare class DeckRepository implements IDeckRepository {
private repo;
constructor();
create(deck: Partial<DeckAggregate>): Promise<Partial<DeckAggregate> & DeckAggregate>;
findByPage(from: number, to: number): Promise<{
decks: DeckAggregate[];
totalCount: number;
}>;
findByPageIncludingDeleted(from: number, to: number): Promise<{
decks: DeckAggregate[];
totalCount: number;
}>;
findById(id: string): Promise<DeckAggregate | null>;
findByIdIncludingDeleted(id: string): Promise<DeckAggregate | null>;
update(id: string, update: Partial<DeckAggregate>): Promise<DeckAggregate | null>;
delete(id: string): Promise<import("typeorm").DeleteResult>;
softDelete(id: string): Promise<DeckAggregate | null>;
search(query: string, limit?: number, offset?: number): Promise<{
decks: DeckAggregate[];
totalCount: number;
}>;
searchIncludingDeleted(query: string, limit?: number, offset?: number): Promise<{
decks: DeckAggregate[];
totalCount: number;
}>;
/**
* Count active (non-soft-deleted) decks for a specific user
* @param userId - User ID to count decks for
* @returns Number of active decks
*/
countActiveByUserId(userId: string): Promise<number>;
/**
* Count organizational decks for a specific user
* @param userId - User ID to count organizational decks for
* @returns Number of organizational decks
*/
countOrganizationalByUserId(userId: string): Promise<number>;
/**
* Find decks with filtering based on user permissions and mandatory pagination
* @param userId - User ID for filtering
* @param userOrgId - User's organization ID (if any)
* @param isAdmin - Whether user is admin (bypasses filtering)
* @param from - Start index for pagination (default: 0)
* @param to - End index for pagination (default: 49)
* @returns Paginated filtered list of decks with total count
*/
findFilteredDecks(userId: string, userOrgId?: string | null, isAdmin?: boolean, from?: number, to?: number): Promise<{
decks: DeckAggregate[];
totalCount: number;
}>;
}
//# sourceMappingURL=DeckRepository.d.ts.map