package cz.moneta.test.dsl.cagw.api.cbl.psd.aisp.my.accounts.id.transactions;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
public class TransactionsResponse {
    private int nextPage;
    private int pageCount;
    private int pageNumber;
    private int pageSize;
    private Transactions[] transactions;

    @NoArgsConstructor
    @AllArgsConstructor
    @Data
    public static class Transactions {
        private Amount amount;
        private BookingDate bookingDate;
        private String creditDebitIndicator;
        private EntryDetails entryDetails;
        private String entryReference;
        private String reversalIndicator;
        private String status;
        private ValueDate valueDate;
        private EnteredDate enteredDate;

        @NoArgsConstructor
        @AllArgsConstructor
        @Data
        public static class Amount {
            private String currency;
            private double value;
        }

        @NoArgsConstructor
        @AllArgsConstructor
        @Data
        public static class BookingDate {
            private String date;
        }

        @NoArgsConstructor
        @AllArgsConstructor
        @Data
        public static class EntryDetails {
            private TransactionDetails transactionDetails;

            @NoArgsConstructor
            @AllArgsConstructor
            @Data
            public static class TransactionDetails {
                private Purpose purpose;
                private References references;
                private RelatedParties relatedParties;
                private RemittanceInformation remittanceInformation;

                @NoArgsConstructor
                @AllArgsConstructor
                @Data
                public static class Purpose {
                    private String proprietary;
                }

                @NoArgsConstructor
                @AllArgsConstructor
                @Data
                public static class References {
                    private String chequeNumber;
                    private String clearingSystemReference;
                    private String endToEndIdentification;
                    private String instructionIdentification;
                    private String paymentInformationIdentification;
                    private String transactionDescription;
                }

                @NoArgsConstructor
                @AllArgsConstructor
                @Data
                public static class RelatedParties {
                    private Creditor creditor;
                    private CreditorAccount creditorAccount;
                    private Debtor debtor;
                    private DebtorAccount debtorAccount;

                    @NoArgsConstructor
                    @AllArgsConstructor
                    @Data
                    public static class Creditor {
                        private String name;
                        private PostalAddress postalAddress;

                        @NoArgsConstructor
                        @AllArgsConstructor
                        @Data
                        public static class PostalAddress {
                            private String addressLine;
                            private String country;
                            private String townName;
                        }
                    }

                    @NoArgsConstructor
                    @AllArgsConstructor
                    @Data
                    public static class CreditorAccount {
                        private String currency;
                        private Identification identification;

                        @NoArgsConstructor
                        @AllArgsConstructor
                        @Data
                        public static class Identification {
                            private String iban;
                            private Other other;

                            @NoArgsConstructor
                            @AllArgsConstructor
                            @Data
                            public static class Other {
                                private String identification;
                            }
                        }
                    }

                    @NoArgsConstructor
                    @AllArgsConstructor
                    @Data
                    public static class Debtor {
                        private String name;
                        private PostalAddress postalAddress;

                        @NoArgsConstructor
                        @AllArgsConstructor
                        @Data
                        public static class PostalAddress {
                            private String addressLine;
                            private String country;
                            private String townName;
                        }
                    }

                    @NoArgsConstructor
                    @AllArgsConstructor
                    @Data
                    public static class DebtorAccount {
                        private String currency;
                        private Identification identification;

                        @NoArgsConstructor
                        @AllArgsConstructor
                        @Data
                        public static class Identification {
                            private String iban;
                            private Other other;

                            @NoArgsConstructor
                            @AllArgsConstructor
                            @Data
                            public static class Other {
                                private String identification;
                            }
                        }
                    }
                }
                @NoArgsConstructor
                @AllArgsConstructor
                @Data
                public static class RemittanceInformation {
                    private Structured structured;
                    private String unstructured;

                    @NoArgsConstructor
                    @AllArgsConstructor
                    @Data
                    public static class Structured {
                        private CreditorReferenceInformation creditorReferenceInformation;

                        @NoArgsConstructor
                        @AllArgsConstructor
                        @Data
                        public static class CreditorReferenceInformation {
                            private String reference;
                        }
                    }
                }
            }
        }

        @NoArgsConstructor
        @AllArgsConstructor
        @Data
        public static class ValueDate {
            private String date;
        }

        @NoArgsConstructor
        @AllArgsConstructor
        @Data
        public static class EnteredDate {
            private String date;
        }
    }
}
