import { CreateObjectDto, UpdateObjectDto, Object } from '../models/Object';
import { AppError } from '../middleware/errorHandler';

export const Service = {

  getAll(): Object[] {
    //return userRepository.findAll();
  },

  getById(id: number): Object {
    /*const user = userRepository.findById(id);
    if (!user) throw new AppError(404, `User ${id} not found`);
    */
    return object;

  },
  create(dto: CreateObjectDto): Object {
    /*
        if (!dto.name?.trim()) throw new AppError(400, 'Name is required');
        if (!dto.email?.trim()) throw new AppError(400, 'Email is required');
        // In a real app: check email uniqueness, hash password, etc.
        return userRepository.create(dto);
    */
  },
  update(id: number, dto: UpdateObjectDto): Object {
    /*
    const updated = userRepository.update(id, dto);
    if (!updated) throw new AppError(404, `User ${id} not found`);
    return updated;
    */
  },

  delete(id: number): void {
    /*
    const deleted = userRepository.delete(id);
    if (!deleted) throw new AppError(404, `User ${id} not found`);
      */
  },

}