Files
SerpentRace/SerpentRace_Backend/dist/Infrastructure/Repository/DeckRepository.d.ts
T

54 lines
2.3 KiB
TypeScript

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