package it.micegroup.gestioneferie.libs.response;

import java.io.Serializable;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import org.springframework.hateoas.RepresentationModel;
import it.micegroup.voila2runtime.exception.ErrorDetails;
import it.micegroup.voila2runtime.response.Messages;
import lombok.Data;

@Data
public class BaseResponse<T> extends RepresentationModel<BaseResponse<T>> implements Serializable {
	private Messages messages = new Messages();
	private T response;
	private ErrorDetails errorDetails;

	@SuppressWarnings("unused")
	public BaseResponse() {
	}

	public BaseResponse(Messages messages, T response) {
		this.messages = messages;
		this.response = response;
	}

	@SuppressWarnings("unused")
	public BaseResponse(T body) {
		setResponse(body);
	}

	@Override
	public String toString() {
		return "BaseResponse [Message=" + messages + ", response=" + response + "]";
	}
}
