/*
 * This file is part of Bisq.
 *
 * Bisq is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or (at
 * your option) any later version.
 *
 * Bisq is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
 * License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with Bisq. If not, see <http://www.gnu.org/licenses/>.
 */

package bisq.core.offer.bisq_v1;

import java.util.List;
import java.util.Map;

import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import javax.annotation.Nullable;

/**
 * The set of editable OfferPayload fields.
 */
@Getter
@Setter
@ToString
public final class MutableOfferPayloadFields {

    private final long price;
    private final double marketPriceMargin;
    private final boolean useMarketBasedPrice;
    private final String baseCurrencyCode;
    private final String counterCurrencyCode;
    private final String paymentMethodId;
    private final String makerPaymentAccountId;
    @Nullable
    private final String countryCode;
    @Nullable
    private final List<String> acceptedCountryCodes;
    @Nullable
    private final String bankId;
    @Nullable
    private final List<String> acceptedBankIds;
    @Nullable
    private final Map<String, String> extraDataMap;

    public MutableOfferPayloadFields(OfferPayload offerPayload) {
        this(offerPayload.getPrice(),
                offerPayload.getMarketPriceMargin(),
                offerPayload.isUseMarketBasedPrice(),
                offerPayload.getBaseCurrencyCode(),
                offerPayload.getCounterCurrencyCode(),
                offerPayload.getPaymentMethodId(),
                offerPayload.getMakerPaymentAccountId(),
                offerPayload.getCountryCode(),
                offerPayload.getAcceptedCountryCodes(),
                offerPayload.getBankId(),
                offerPayload.getAcceptedBankIds(),
                offerPayload.getExtraDataMap());
    }

    public MutableOfferPayloadFields(long price,
                                     double marketPriceMargin,
                                     boolean useMarketBasedPrice,
                                     String baseCurrencyCode,
                                     String counterCurrencyCode,
                                     String paymentMethodId,
                                     String makerPaymentAccountId,
                                     @Nullable String countryCode,
                                     @Nullable List<String> acceptedCountryCodes,
                                     @Nullable String bankId,
                                     @Nullable List<String> acceptedBankIds,
                                     @Nullable Map<String, String> extraDataMap) {
        this.price = price;
        this.marketPriceMargin = marketPriceMargin;
        this.useMarketBasedPrice = useMarketBasedPrice;
        this.baseCurrencyCode = baseCurrencyCode;
        this.counterCurrencyCode = counterCurrencyCode;
        this.paymentMethodId = paymentMethodId;
        this.makerPaymentAccountId = makerPaymentAccountId;
        this.countryCode = countryCode;
        this.acceptedCountryCodes = acceptedCountryCodes;
        this.bankId = bankId;
        this.acceptedBankIds = acceptedBankIds;
        this.extraDataMap = extraDataMap;
    }
}

@@ -802,32 +802,8 @@
 ter;
-%0Aimport lombok.ToString;
 %0A%0Aim
@@ -907,18 +907,8 @@
 ter%0A
-@ToString%0A
 publ
@@ -3601,11 +3601,945 @@
 p;%0A    %7D
+%0A%0A    @Override%0A    public String toString() %7B%0A        return %22MutableOfferPayloadFields%7B%22 + %22%5Cn%22 +%0A                %22  price=%22 + price + %22%5Cn%22 +%0A                %22, marketPriceMargin=%22 + marketPriceMargin + %22%5Cn%22 +%0A                %22, useMarketBasedPrice=%22 + useMarketBasedPrice + %22%5Cn%22 +%0A                %22, baseCurrencyCode='%22 + baseCurrencyCode + '%5C'' + %22%5Cn%22 +%0A                %22, counterCurrencyCode='%22 + counterCurrencyCode + '%5C'' + %22%5Cn%22 +%0A                %22, paymentMethodId='%22 + paymentMethodId + '%5C'' + %22%5Cn%22 +%0A                %22, makerPaymentAccountId='%22 + makerPaymentAccountId + '%5C'' + %22%5Cn%22 +%0A                %22, countryCode='%22 + countryCode + '%5C'' + %22%5Cn%22 +%0A                %22, acceptedCountryCodes=%22 + acceptedCountryCodes + %22%5Cn%22 +%0A                %22, bankId='%22 + bankId + '%5C'' + %22%5Cn%22 +%0A                %22, acceptedBankIds=%22 + acceptedBankIds + %22%5Cn%22 +%0A                %22, extraDataMap=%22 + extraDataMap + %22%5Cn%22 +%0A                '%7D';%0A    %7D
 %0A%7D%0A

Add more readable toString method to MutableOfferPayloadFields