import { Injectable, NotFoundException } from '@nestjs/common'; import { FocusItemsRepository } from './focus-items.repository'; import { FocusItem } from './types/focus-item.types'; @Injectable() export class FocusItemsService { constructor(private readonly repository: FocusItemsRepository) {} async findAll(): Promise { return this.repository.findAll(); } async create(dto: any): Promise { return this.repository.create(dto); } async update(id: string, dto: any): Promise { const item = await this.repository.update(id, dto); if (!item) throw new NotFoundException(`Focus item ${id} not found`); return item; } async complete(id: string): Promise { const item = await this.repository.update(id, { status: 'completed', completedAt: new Date(), }); if (!item) throw new NotFoundException(`Focus item ${id} not found`); return item; } }