src/main/java/ca/sfu/delta/controllers/FormServiceRequestController.java
private String reserveNextRequestID() {
		int year = Calendar.getInstance().get(Calendar.YEAR) % 100;
		Integer formDigit = requestIDRepository.getNextID(year);
		RequestID requestID = new RequestID();
		requestID.setYear(year);
		requestID.setDigits(formDigit);
		requestIDRepository.save(requestID);
        System.out.println("reserving requestID" + String.format("%02d", year) + "-" + String.format("%04d", formDigit) );
        return String.format("%02d", year) + "-" + String.format("%04d", formDigit);
	}
// Reserve the next request ID in the sequence to ensure each form has a unique request ID
Reserve the next request ID in the sequence to ensure each form has a unique request ID
Reserve the next request ID in the sequence to ensure each form has a unique request ID
private String reserveNextRequestID() {
		int year = Calendar.getInstance().get(Calendar.YEAR) % 100;
		Integer formDigit = requestIDRepository.getNextID(year);
		RequestID requestID = new RequestID();
		requestID.setYear(year);
		requestID.setDigits(formDigit);
		requestIDRepository.save(requestID);
        System.out.println("reserving requestID" + String.format("%02d", year) + "-" + String.format("%04d", formDigit) );
        return String.format("%02d", year) + "-" + String.format("%04d", formDigit);
	}
private String reserveNextRequestID ( ) { int year = Calendar . getInstance ( ) . get ( Calendar . YEAR ) % 100 ; Integer formDigit = requestIDRepository . getNextID ( year ) ; RequestID requestID = new RequestID ( ) ; requestID . setYear ( year ) ; requestID . setDigits ( formDigit ) ; requestIDRepository . save ( requestID ) ; System . out . println ( "reserving requestID" + String . format ( "%02d" , year ) + "-" + String . format ( "%04d" , formDigit ) ) ; return String . format ( "%02d" , year ) + "-" + String . format ( "%04d" , formDigit ) ; }
Reserve the next request ID in the sequence to ensure each form has a unique request ID
Reserve the next request ID in the sequence to ensure each form has a unique request ID