package ru.soune.nocopy.dto.complaint;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Builder;
import lombok.Data;

@Data
@Builder
public class BaseResponse {
    @JsonProperty("status")
    private String status;

    @JsonProperty("message")
    private String message;

    @JsonProperty("data")
    private Object data;

    @JsonProperty("error_code")
    private String errorCode;

    public static BaseResponse success(Object data) {
        return BaseResponse.builder()
                .status("SUCCESS")
                .data(data)
                .build();
    }

    public static BaseResponse error(String message, String errorCode) {
        return BaseResponse.builder()
                .status("ERROR")
                .message(message)
                .errorCode(errorCode)
                .build();
    }
}
