package org.example.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.ToString;

@ToString
@JsonIgnoreProperties(
        ignoreUnknown = true
)
public class TransactionResponse {
    @JsonProperty("serviceRefId")
    private String serviceRefId;
    @JsonProperty("decision")
    private String decision;
    @JsonProperty("code")
    private String code;
    @JsonProperty("message")
    private String message;
    @JsonProperty("amount")
    private Amount amount;
    @JsonProperty("header")
    private Header header;
    @JsonProperty("footer")
    private Footer footer;
    @JsonProperty("providerTime")
    private String providerTime;
    @JsonProperty("modelName")
    private String modelName;

    // Getters and setters

    @JsonIgnoreProperties(
            ignoreUnknown = true
    )
    public static class Amount {
        @JsonProperty("value")
        private String value;
        @JsonProperty("currency")
        private String currency;

        // Getters and setters
        public String getValue() {
            return value;
        }

        public void setValue(String value) {
            this.value = value;
        }

        public String getCurrency() {
            return currency;
        }

        public void setCurrency(String currency) {
            this.currency = currency;
        }
    }

    @JsonIgnoreProperties(
            ignoreUnknown = true
    )
    public static class Header {
        @JsonProperty("merchantName")
        private String merchantName;
        @JsonProperty("merchantAddress")
        private String merchantAddress;
        @JsonProperty("logo")
        private String logo;

        // Getters and setters
        public String getMerchantName() {
            return merchantName;
        }

        public void setMerchantName(String merchantName) {
            this.merchantName = merchantName;
        }

        public String getMerchantAddress() {
            return merchantAddress;
        }

        public void setMerchantAddress(String merchantAddress) {
            this.merchantAddress = merchantAddress;
        }

        public String getLogo() {
            return logo;
        }

        public void setLogo(String logo) {
            this.logo = logo;
        }
    }

    @JsonIgnoreProperties(
            ignoreUnknown = true
    )
    public static class Footer {
        @JsonProperty("description")
        private String description;
        @JsonProperty("logo")
        private String logo;
        @JsonProperty("message")
        private String message;

        // Getters and setters
        public String getDescription() {
            return description;
        }

        public void setDescription(String description) {
            this.description = description;
        }

        public String getLogo() {
            return logo;
        }

        public void setLogo(String logo) {
            this.logo = logo;
        }

        public String getMessage() {
            return message;
        }

        public void setMessage(String message) {
            this.message = message;
        }
    }

    // Getters and setters for TransactionResponse fields
    public String getServiceRefId() {
        return serviceRefId;
    }

    public void setServiceRefId(String serviceRefId) {
        this.serviceRefId = serviceRefId;
    }

    public String getDecision() {
        return decision;
    }

    public void setDecision(String decision) {
        this.decision = decision;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Amount getAmount() {
        return amount;
    }

    public void setAmount(Amount amount) {
        this.amount = amount;
    }

    public Header getHeader() {
        return header;
    }

    public void setHeader(Header header) {
        this.header = header;
    }

    public Footer getFooter() {
        return footer;
    }

    public void setFooter(Footer footer) {
        this.footer = footer;
    }

    public String getProviderTime() {
        return providerTime;
    }

    public void setProviderTime(String providerTime) {
        this.providerTime = providerTime;
    }

    public String getModelName() {
        return modelName;
    }

    public void setModelName(String modelName) {
        this.modelName = modelName;
    }
}