/*
 * The MIT License (MIT)
 *
 * Copyright (c) 2013 - 2017 PayinTech
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE.
 */
package io.payintech.wallet.entity;

import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.payintech.wallet.enumeration.TransferStatus;

import java.io.Serializable;

/**
 * TransfersProcessItemEntity.
 *
 * @author Thibault Meyer
 * @version 16.08.26
 * @since 16.08.26
 */
public class TransfersProcessItemEntity extends TransfersRequestItemEntity implements Serializable {

    /**
     * Order ID.
     *
     * @since 16.08.26
     */
    private final String orderId;

    /**
     * Status.
     *
     * @since 16.08.26
     */
    private final TransferStatus status;

    /**
     * Instantiates a new transfer request item entity.
     *
     * @param beneficiary Transfer beneficiary
     * @param amount      Amount (in cents)
     * @param message     The message to display in ledger
     * @since 16.08.26
     */
    @JsonCreator
    public TransfersProcessItemEntity(@JsonProperty(value = "orderId", required = true) final String orderId,
                                      @JsonProperty(value = "status", required = true) final TransferStatus status,
                                      @JsonProperty(value = "beneficiary", required = true) final String beneficiary,
                                      @JsonProperty(value = "amount", required = true) final Long amount,
                                      @JsonProperty(value = "message", required = true) final String message) {
        super(beneficiary, amount, message);
        this.orderId = orderId;
        this.status = status;
    }

    /**
     * Get the order ID.
     *
     * @return The order ID
     * @since 16.08.26
     */
    public String getOrderId() {
        return this.orderId;
    }

    /**
     * Get the execution status.
     *
     * @return The execution status
     * @since 16.08.26
     */
    public TransferStatus getStatus() {
        return this.status;
    }
}
