package cz.moneta.test.dsl.wso2.objects.smallbusiness;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.ArrayList;
import java.util.List;

/**
 * Response model for GET_PRODOPEN_TASKS service
 */
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Data
@EqualsAndHashCode(callSuper = false)
@ToString
@JsonIgnoreProperties(ignoreUnknown = true)
public class GetProdOpenTasksResponse {

    @JsonProperty("RS_DATA")
    @Builder.Default
    private List<RsData> rsData = new ArrayList<>();

    @JsonProperty("tifResponseStatus")
    private ErrorModel tifResponseStatus;

    @JsonProperty("fault")
    private FaultModel fault;

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class RsData {
        @JsonProperty("TKIID")
        private String tkiid;

        @JsonProperty("WFID")
        private String wfid;

        @JsonProperty("BUSSTATE")
        private String busstate;

        @JsonProperty("ACCOUNTNUMBER")
        private String accountnumber;

        @JsonProperty("APPLICATIONID")
        private String applicationid;

        @JsonProperty("APPLICATIONKEY")
        private Long applicationkey;

        @JsonProperty("APPLICATIONSETKEY")
        private Long applicationsetkey;

        @JsonProperty("AUTOSIGNATURE")
        private Boolean autosignature;

        @JsonProperty("BANKERSPROFILE")
        private String bankersprofile;

        @JsonProperty("CANCELLATIONTIME")
        private String cancellationtime;

        @JsonProperty("CARDLOGO")
        private String cardlogo;

        @JsonProperty("CARDTYPE")
        private Long cardtype;

        @JsonProperty("CLIENTID")
        private String clientid;

        @JsonProperty("CONTRACTNUMBER")
        private String contractnumber;

        @JsonProperty("CONTRACTSIGNED")
        private Boolean contractsigned;

        @JsonProperty("CONTRACTSIGNINGDATE")
        private String contractsigningdate;

        @JsonProperty("CREDITACCOUNTNUMBER")
        private String creditaccountnumber;

        @JsonProperty("DOCUMENTID")
        private String documentid;

        @JsonProperty("FIRSTSIGNINGBANKER")
        private String firstsigningbanker;

        @JsonProperty("KOTIME")
        private String kotime;

        @JsonProperty("PARENTWFID")
        private String parentwfid;

        @JsonProperty("PROCESSSTARTDATE")
        private String processstartdate;

        @JsonProperty("PRODUCTTYPE")
        private String producttype;

        @JsonProperty("REQUESTTYPE")
        private String requesttype;

        @JsonProperty("SECONDSIGNINGBANKER")
        private String secondsigningbanker;

        @JsonProperty("SETFEE")
        private Boolean setfee;

        @JsonProperty("SIGNINGTIME")
        private String signingtime;

        @JsonProperty("USERID")
        private String userid;

        @JsonProperty("VERIFYCONTRACT")
        private Boolean verifycontract;

        @JsonProperty("WAITINGFORCLIENTAPPROVAL")
        private Boolean waitingforclientapproval;

        @JsonProperty("ERRORFLAG")
        private Boolean errorflag;

        @JsonProperty("ERRORMWFFLAG")
        private Boolean errormwfflag;

        @JsonProperty("ERRORMESSAGE")
        private String errormessage;

        @JsonProperty("CONTAINMENT_CTX_ID")
        private String containmentCtxId;

        @JsonProperty("NAME")
        private String name;

        @JsonProperty("FIRST_ACTIVATED")
        private String firstActivated;

        @JsonProperty("EXPIRES")
        private String expires;

        @JsonProperty("OWNER")
        private String owner;

        @JsonProperty("STATE")
        private String state;

        @JsonProperty("LAST_STATE_CHANGE")
        private String lastStateChange;

        @JsonProperty("SUSPENDED")
        private Boolean suspended;

        @JsonProperty("IS_ESCALATED")
        private Boolean isEscalated;

        @JsonProperty("LAST_MODIFIED")
        private String lastModified;
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class ErrorModel {
        @JsonProperty("resultCode")
        private String resultCode;

        @JsonProperty("errorCode")
        private String errorCode;

        @JsonProperty("errorDesc")
        private String errorDesc;
    }

    @Data
    @Builder
    @NoArgsConstructor
    @AllArgsConstructor
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class FaultModel {
        @JsonProperty("code")
        private String code;

        @JsonProperty("message")
        private String message;

        @JsonProperty("description")
        private String description;
    }
}
