2025-01-21 09:36:28 -06:00
|
|
|
import { Updateable } from 'kysely';
|
2024-07-05 09:08:36 -04:00
|
|
|
import { StackEntity } from 'src/entities/stack.entity';
|
|
|
|
|
|
|
|
|
|
export const IStackRepository = 'IStackRepository';
|
|
|
|
|
|
2024-08-19 13:37:15 -04:00
|
|
|
export interface StackSearch {
|
|
|
|
|
ownerId: string;
|
|
|
|
|
primaryAssetId?: string;
|
|
|
|
|
}
|
|
|
|
|
|
2024-07-05 09:08:36 -04:00
|
|
|
export interface IStackRepository {
|
2024-08-19 13:37:15 -04:00
|
|
|
search(query: StackSearch): Promise<StackEntity[]>;
|
|
|
|
|
create(stack: { ownerId: string; assetIds: string[] }): Promise<StackEntity>;
|
2025-01-21 09:36:28 -06:00
|
|
|
update(id: string, entity: Updateable<StackEntity>): Promise<StackEntity>;
|
2024-07-05 09:08:36 -04:00
|
|
|
delete(id: string): Promise<void>;
|
2024-08-19 13:37:15 -04:00
|
|
|
deleteAll(ids: string[]): Promise<void>;
|
2025-01-21 09:36:28 -06:00
|
|
|
getById(id: string): Promise<StackEntity | undefined>;
|
2024-07-05 09:08:36 -04:00
|
|
|
}
|