package gov.va.vinci.dart.db.mock;

import java.util.HashSet;

import gov.va.vinci.dart.biz.Review;
import gov.va.vinci.dart.biz.SoftwareRequest;
import gov.va.vinci.dart.db.SoftwareRequestDAO;
import gov.va.vinci.dart.service.DartObjectFactory;

public class SoftwareRequestDAOMock implements SoftwareRequestDAO {

	@Override
	public void save(SoftwareRequest request) {
		if (request == null) {
			throw new IllegalArgumentException();
		}

//		initializeRequestHash();

		// allocate a new id
		DartObjectFactory.getInstance().getRequestDAO().save(request);
	
//		if (request.getReviews() == null) {
		if (request.getAllReviews() == null) {
			request.setReviews(new HashSet<Review>());
		}
		
//		IDHash.put(request.getId(), request);
	}

}
