class DetectorServiceImpl implements DetectorService {

    @Override
    public List<Detector> findByCreatedBy(String user) {
        List<Detector> detectors = repository.findByMeta_CreatedBy(user);
        if (detectors == null || detectors.isEmpty()) {
            throw new RecordNotFoundException("Invalid user: " + user);
        }
        return detectors;
    }

}