package cz.moneta.test.dsl.payment_engine.model;

import lombok.*;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;

/**
 * Načítání seznamu blokací.
 * Toto je vygenerovana trida pro /t/payments.cluster/frontend-reservation-controller/v1.
 * Byla vygenerovana ze souboru frontend-reservation-controller.json pomoci TransactionWso2ValidationAgainstSwaggerTestu.
 */
@AllArgsConstructor
@NoArgsConstructor
@Builder
@EqualsAndHashCode(callSuper = false)
@ToString
public class ReservationListSuccessResponse {
    /*
     * CACHE Account id. Long as String.
     */
    public String accIdent;
    /*
     * List of active reservations.
     */
    @Builder.Default
    public List<FrontendReservation> reservations = new ArrayList<>();

    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    @EqualsAndHashCode(callSuper = false)
    public static class FrontendReservation {
        public String cacheId;
        /*
         * Reservation Id in originating system.
         */
        public String extId;
        public String direction;
        /*
         * Reservation type.
         */
        public String type;
        /*
         * Reservation status reason.
         */
        public String statusReason;
        /*
         * Reservation is informative.
         */
        public Boolean infFlag;
        /*
         * Timestamp of reservation creation in originating system.
         */
        public String created;
        /*
         * Reservation expiration date.
         */
        public String expDate;
        /*
         * Channel ID.
         */
        public String channel;
        @Builder.Default
        public ReservationDescription resDescription = new ReservationDescription();
        /*
         * Encapsulates amount and currency.
         */
        @Builder.Default
        public BlockedAmount blockedAmount = new BlockedAmount();
        /*
         * Version of reservation, starting from 1.
         */
        public BigDecimal version;
        /*
         * Reservation status.
         */
        public String status;
    }

    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    @EqualsAndHashCode(callSuper = false)
    public static class ReservationDescription {
        public String line1;
        public String line2;
        public String line3;
    }

    @AllArgsConstructor
    @NoArgsConstructor
    @Builder
    @EqualsAndHashCode(callSuper = false)
    public static class BlockedAmount {
        public String amt;
        public String ccy;
    }
}