feat: restructure into XFlow monorepo with Nuxt 4, Modular Onion Monolith, Android client, and Desktop CLI
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { IUseCase } from '../../core/application/IUseCase';
|
||||
import { Result } from '../../core/domain/Result';
|
||||
import { DomainError, ValidationError } from '../../core/domain/DomainError';
|
||||
import { IListRepository } from '../domain/IListRepository';
|
||||
import { NoteList } from '../domain/NoteList';
|
||||
|
||||
export interface GetListsRequest {
|
||||
ownerId: string;
|
||||
category?: string;
|
||||
}
|
||||
|
||||
export class GetListsUseCase implements IUseCase<GetListsRequest, NoteList[]> {
|
||||
constructor(private readonly listRepository: IListRepository) {}
|
||||
|
||||
public async execute(req: GetListsRequest): Promise<Result<NoteList[], DomainError>> {
|
||||
if (!req.ownerId) {
|
||||
return Result.fail(new ValidationError('Owner ID is required'));
|
||||
}
|
||||
|
||||
const lists = await this.listRepository.findListsByOwner(req.ownerId, req.category);
|
||||
return Result.ok(lists);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user