// File generated from our OpenAPI spec by Stainless.

package com.increase.api.models.transactions

import com.fasterxml.jackson.module.kotlin.jacksonTypeRef
import com.increase.api.core.jsonMapper
import java.time.LocalDate
import java.time.OffsetDateTime
import org.assertj.core.api.Assertions.assertThat
import org.junit.jupiter.api.Test

internal class TransactionTest {

    @Test
    fun create() {
        val transaction =
            Transaction.builder()
                .id("transaction_uyrp7fld2ium70oa7oi")
                .accountId("account_in71c4amph0vgo2qllky")
                .amount(100L)
                .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                .currency(Transaction.Currency.USD)
                .description("INVOICE 2468")
                .routeId("account_number_v18nkfqm6afpsrvy82b2")
                .routeType(Transaction.RouteType.ACCOUNT_NUMBER)
                .source(
                    Transaction.Source.builder()
                        .category(Transaction.Source.Category.INBOUND_ACH_TRANSFER)
                        .accountRevenuePayment(
                            Transaction.Source.AccountRevenuePayment.builder()
                                .accruedOnAccountId("account_in71c4amph0vgo2qllky")
                                .periodEnd(OffsetDateTime.parse("2025-06-30T23:59:59+00:00"))
                                .periodStart(OffsetDateTime.parse("2025-06-01T00:00:00+00:00"))
                                .build()
                        )
                        .accountTransferIntention(
                            Transaction.Source.AccountTransferIntention.builder()
                                .amount(100L)
                                .currency(Transaction.Source.AccountTransferIntention.Currency.USD)
                                .description("INVOICE 2468")
                                .destinationAccountId("account_uf16sut2ct5bevmq3eh")
                                .sourceAccountId("account_in71c4amph0vgo2qllky")
                                .transferId("account_transfer_7k9qe1ysdgqztnt63l7n")
                                .build()
                        )
                        .achTransferIntention(
                            Transaction.Source.AchTransferIntention.builder()
                                .accountNumber("987654321")
                                .amount(100L)
                                .routingNumber("101050001")
                                .statementDescriptor("INVOICE 2468")
                                .transferId("account_transfer_7k9qe1ysdgqztnt63l7n")
                                .build()
                        )
                        .achTransferRejection(
                            Transaction.Source.AchTransferRejection.builder()
                                .transferId("account_transfer_7k9qe1ysdgqztnt63l7n")
                                .build()
                        )
                        .achTransferReturn(
                            Transaction.Source.AchTransferReturn.builder()
                                .addendaInformation(null)
                                .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                                .rawReturnReasonCode("R01")
                                .returnReasonCode(
                                    Transaction.Source.AchTransferReturn.ReturnReasonCode
                                        .INSUFFICIENT_FUND
                                )
                                .traceNumber("111122223292834")
                                .transactionId("transaction_uyrp7fld2ium70oa7oi")
                                .transferId("ach_transfer_uoxatyh3lt5evrsdvo7q")
                                .build()
                        )
                        .blockchainOfframpTransferSettlement(
                            Transaction.Source.BlockchainOfframpTransferSettlement.builder()
                                .sourceBlockchainAddressId(
                                    "blockchain_address_tijjpqp9t5d358ehydqi"
                                )
                                .transferId("blockchain_offramp_transfer_sqd2x3ti6u2sy91v696m")
                                .build()
                        )
                        .blockchainOnrampTransferIntention(
                            Transaction.Source.BlockchainOnrampTransferIntention.builder()
                                .destinationBlockchainAddress("0xaabbccdd")
                                .transferId("blockchain_onramp_transfer_sg8nzy569rk0dnfk28bv")
                                .build()
                        )
                        .cardDisputeAcceptance(
                            Transaction.Source.CardDisputeAcceptance.builder()
                                .acceptedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                                .transactionId("transaction_uyrp7fld2ium70oa7oi")
                                .build()
                        )
                        .cardDisputeFinancial(
                            Transaction.Source.CardDisputeFinancial.builder()
                                .amount(1000L)
                                .network(Transaction.Source.CardDisputeFinancial.Network.VISA)
                                .transactionId("transaction_uyrp7fld2ium70oa7oi")
                                .visa(
                                    Transaction.Source.CardDisputeFinancial.Visa.builder()
                                        .eventType(
                                            Transaction.Source.CardDisputeFinancial.Visa.EventType
                                                .CHARGEBACK_SUBMITTED
                                        )
                                        .build()
                                )
                                .build()
                        )
                        .cardDisputeLoss(
                            Transaction.Source.CardDisputeLoss.builder()
                                .explanation("The card dispute was lost.")
                                .lostAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                                .transactionId("transaction_uyrp7fld2ium70oa7oi")
                                .build()
                        )
                        .cardFinancial(
                            Transaction.Source.CardFinancial.builder()
                                .id("card_financial_di5b98i72ppomo268zfk")
                                .actioner(Transaction.Source.CardFinancial.Actioner.INCREASE)
                                .additionalAmounts(
                                    Transaction.Source.CardFinancial.AdditionalAmounts.builder()
                                        .clinic(
                                            Transaction.Source.CardFinancial.AdditionalAmounts
                                                .Clinic
                                                .builder()
                                                .amount(0L)
                                                .currency("currency")
                                                .build()
                                        )
                                        .dental(
                                            Transaction.Source.CardFinancial.AdditionalAmounts
                                                .Dental
                                                .builder()
                                                .amount(0L)
                                                .currency("currency")
                                                .build()
                                        )
                                        .original(
                                            Transaction.Source.CardFinancial.AdditionalAmounts
                                                .Original
                                                .builder()
                                                .amount(0L)
                                                .currency("currency")
                                                .build()
                                        )
                                        .prescription(
                                            Transaction.Source.CardFinancial.AdditionalAmounts
                                                .Prescription
                                                .builder()
                                                .amount(0L)
                                                .currency("currency")
                                                .build()
                                        )
                                        .surcharge(
                                            Transaction.Source.CardFinancial.AdditionalAmounts
                                                .Surcharge
                                                .builder()
                                                .amount(10L)
                                                .currency("USD")
                                                .build()
                                        )
                                        .totalCumulative(
                                            Transaction.Source.CardFinancial.AdditionalAmounts
                                                .TotalCumulative
                                                .builder()
                                                .amount(0L)
                                                .currency("currency")
                                                .build()
                                        )
                                        .totalHealthcare(
                                            Transaction.Source.CardFinancial.AdditionalAmounts
                                                .TotalHealthcare
                                                .builder()
                                                .amount(0L)
                                                .currency("currency")
                                                .build()
                                        )
                                        .transit(
                                            Transaction.Source.CardFinancial.AdditionalAmounts
                                                .Transit
                                                .builder()
                                                .amount(0L)
                                                .currency("currency")
                                                .build()
                                        )
                                        .unknown(
                                            Transaction.Source.CardFinancial.AdditionalAmounts
                                                .Unknown
                                                .builder()
                                                .amount(0L)
                                                .currency("currency")
                                                .build()
                                        )
                                        .vision(
                                            Transaction.Source.CardFinancial.AdditionalAmounts
                                                .Vision
                                                .builder()
                                                .amount(0L)
                                                .currency("currency")
                                                .build()
                                        )
                                        .build()
                                )
                                .amount(100L)
                                .cardPaymentId("card_payment_nd3k2kacrqjli8482ave")
                                .currency(Transaction.Source.CardFinancial.Currency.USD)
                                .digitalWalletTokenId(null)
                                .direction(Transaction.Source.CardFinancial.Direction.SETTLEMENT)
                                .merchantAcceptorId("5665270011000168")
                                .merchantCategoryCode("5734")
                                .merchantCity("New York")
                                .merchantCountry("US")
                                .merchantDescriptor("AMAZON.COM")
                                .merchantPostalCode("10045")
                                .merchantState("NY")
                                .networkDetails(
                                    Transaction.Source.CardFinancial.NetworkDetails.builder()
                                        .category(
                                            Transaction.Source.CardFinancial.NetworkDetails.Category
                                                .VISA
                                        )
                                        .pulse(
                                            Transaction.Source.CardFinancial.NetworkDetails.Pulse
                                                .builder()
                                                .build()
                                        )
                                        .visa(
                                            Transaction.Source.CardFinancial.NetworkDetails.Visa
                                                .builder()
                                                .electronicCommerceIndicator(
                                                    Transaction.Source.CardFinancial.NetworkDetails
                                                        .Visa
                                                        .ElectronicCommerceIndicator
                                                        .SECURE_ELECTRONIC_COMMERCE
                                                )
                                                .pointOfServiceEntryMode(
                                                    Transaction.Source.CardFinancial.NetworkDetails
                                                        .Visa
                                                        .PointOfServiceEntryMode
                                                        .MANUAL
                                                )
                                                .standInProcessingReason(null)
                                                .terminalEntryCapability(
                                                    Transaction.Source.CardFinancial.NetworkDetails
                                                        .Visa
                                                        .TerminalEntryCapability
                                                        .MAGNETIC_STRIPE
                                                )
                                                .build()
                                        )
                                        .build()
                                )
                                .networkIdentifiers(
                                    Transaction.Source.CardFinancial.NetworkIdentifiers.builder()
                                        .authorizationIdentificationResponse(null)
                                        .retrievalReferenceNumber("785867080153")
                                        .traceNumber("487941")
                                        .transactionId("627199945183184")
                                        .build()
                                )
                                .networkRiskScore(10L)
                                .physicalCardId(null)
                                .presentmentAmount(100L)
                                .presentmentCurrency("USD")
                                .processingCategory(
                                    Transaction.Source.CardFinancial.ProcessingCategory.PURCHASE
                                )
                                .realTimeDecisionId(null)
                                .addSchemeFee(
                                    Transaction.Source.CardFinancial.SchemeFee.builder()
                                        .amount("0.137465")
                                        .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                                        .currency(
                                            Transaction.Source.CardFinancial.SchemeFee.Currency.USD
                                        )
                                        .feeType(
                                            Transaction.Source.CardFinancial.SchemeFee.FeeType
                                                .VISA_CORPORATE_ACCEPTANCE_FEE
                                        )
                                        .fixedComponent(null)
                                        .variableRate("0.0002")
                                        .build()
                                )
                                .terminalId("RCN5VNXS")
                                .transactionId("transaction_uyrp7fld2ium70oa7oi")
                                .type(Transaction.Source.CardFinancial.Type.CARD_FINANCIAL)
                                .verification(
                                    Transaction.Source.CardFinancial.Verification.builder()
                                        .cardVerificationCode(
                                            Transaction.Source.CardFinancial.Verification
                                                .CardVerificationCode
                                                .builder()
                                                .result(
                                                    Transaction.Source.CardFinancial.Verification
                                                        .CardVerificationCode
                                                        .Result
                                                        .MATCH
                                                )
                                                .build()
                                        )
                                        .cardholderAddress(
                                            Transaction.Source.CardFinancial.Verification
                                                .CardholderAddress
                                                .builder()
                                                .actualLine1("33 Liberty Street")
                                                .actualPostalCode("94131")
                                                .providedLine1("33 Liberty Street")
                                                .providedPostalCode("94132")
                                                .result(
                                                    Transaction.Source.CardFinancial.Verification
                                                        .CardholderAddress
                                                        .Result
                                                        .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH
                                                )
                                                .build()
                                        )
                                        .cardholderName(
                                            Transaction.Source.CardFinancial.Verification
                                                .CardholderName
                                                .builder()
                                                .providedFirstName("provided_first_name")
                                                .providedLastName("provided_last_name")
                                                .providedMiddleName("provided_middle_name")
                                                .build()
                                        )
                                        .build()
                                )
                                .build()
                        )
                        .cardPushTransferAcceptance(
                            Transaction.Source.CardPushTransferAcceptance.builder()
                                .settlementAmount(100L)
                                .transferId("outbound_card_push_transfer_e0z9rdpamraczh4tvwye")
                                .build()
                        )
                        .cardRefund(
                            Transaction.Source.CardRefund.builder()
                                .id("card_refund_imgc2xwplh6t4r3gn16e")
                                .amount(100L)
                                .cardPaymentId("card_payment_nd3k2kacrqjli8482ave")
                                .cashback(
                                    Transaction.Source.CardRefund.Cashback.builder()
                                        .amount("0.137465")
                                        .currency(
                                            Transaction.Source.CardRefund.Cashback.Currency.USD
                                        )
                                        .build()
                                )
                                .currency(Transaction.Source.CardRefund.Currency.USD)
                                .interchange(
                                    Transaction.Source.CardRefund.Interchange.builder()
                                        .amount("0.137465")
                                        .code("271")
                                        .currency(
                                            Transaction.Source.CardRefund.Interchange.Currency.USD
                                        )
                                        .build()
                                )
                                .merchantAcceptorId("5665270011000168")
                                .merchantCategoryCode("5734")
                                .merchantCity("New York")
                                .merchantCountry("US")
                                .merchantName("AMAZON.COM")
                                .merchantPostalCode("10045")
                                .merchantState("NY")
                                .networkIdentifiers(
                                    Transaction.Source.CardRefund.NetworkIdentifiers.builder()
                                        .acquirerBusinessId("69650702")
                                        .acquirerReferenceNumber("83163715445437604865089")
                                        .authorizationIdentificationResponse("ABC123")
                                        .transactionId("627199945183184")
                                        .build()
                                )
                                .presentmentAmount(100L)
                                .presentmentCurrency("USD")
                                .purchaseDetails(
                                    Transaction.Source.CardRefund.PurchaseDetails.builder()
                                        .carRental(
                                            Transaction.Source.CardRefund.PurchaseDetails.CarRental
                                                .builder()
                                                .carClassCode("car_class_code")
                                                .checkoutDate(LocalDate.parse("2019-12-27"))
                                                .dailyRentalRateAmount(0L)
                                                .dailyRentalRateCurrency(
                                                    "daily_rental_rate_currency"
                                                )
                                                .daysRented(0L)
                                                .extraCharges(
                                                    Transaction.Source.CardRefund.PurchaseDetails
                                                        .CarRental
                                                        .ExtraCharges
                                                        .NO_EXTRA_CHARGE
                                                )
                                                .fuelChargesAmount(0L)
                                                .fuelChargesCurrency("fuel_charges_currency")
                                                .insuranceChargesAmount(0L)
                                                .insuranceChargesCurrency(
                                                    "insurance_charges_currency"
                                                )
                                                .noShowIndicator(
                                                    Transaction.Source.CardRefund.PurchaseDetails
                                                        .CarRental
                                                        .NoShowIndicator
                                                        .NOT_APPLICABLE
                                                )
                                                .oneWayDropOffChargesAmount(0L)
                                                .oneWayDropOffChargesCurrency(
                                                    "one_way_drop_off_charges_currency"
                                                )
                                                .renterName("renter_name")
                                                .weeklyRentalRateAmount(0L)
                                                .weeklyRentalRateCurrency(
                                                    "weekly_rental_rate_currency"
                                                )
                                                .build()
                                        )
                                        .customerReferenceIdentifier("51201")
                                        .localTaxAmount(null)
                                        .localTaxCurrency("usd")
                                        .lodging(
                                            Transaction.Source.CardRefund.PurchaseDetails.Lodging
                                                .builder()
                                                .checkInDate(LocalDate.parse("2023-07-20"))
                                                .dailyRoomRateAmount(1000L)
                                                .dailyRoomRateCurrency("usd")
                                                .extraCharges(
                                                    Transaction.Source.CardRefund.PurchaseDetails
                                                        .Lodging
                                                        .ExtraCharges
                                                        .RESTAURANT
                                                )
                                                .folioCashAdvancesAmount(0L)
                                                .folioCashAdvancesCurrency("usd")
                                                .foodBeverageChargesAmount(0L)
                                                .foodBeverageChargesCurrency("usd")
                                                .noShowIndicator(
                                                    Transaction.Source.CardRefund.PurchaseDetails
                                                        .Lodging
                                                        .NoShowIndicator
                                                        .NO_SHOW
                                                )
                                                .prepaidExpensesAmount(0L)
                                                .prepaidExpensesCurrency("usd")
                                                .roomNights(1L)
                                                .totalRoomTaxAmount(100L)
                                                .totalRoomTaxCurrency("usd")
                                                .totalTaxAmount(100L)
                                                .totalTaxCurrency("usd")
                                                .build()
                                        )
                                        .nationalTaxAmount(null)
                                        .nationalTaxCurrency("usd")
                                        .purchaseIdentifier("10203")
                                        .purchaseIdentifierFormat(
                                            Transaction.Source.CardRefund.PurchaseDetails
                                                .PurchaseIdentifierFormat
                                                .ORDER_NUMBER
                                        )
                                        .travel(
                                            Transaction.Source.CardRefund.PurchaseDetails.Travel
                                                .builder()
                                                .ancillary(
                                                    Transaction.Source.CardRefund.PurchaseDetails
                                                        .Travel
                                                        .Ancillary
                                                        .builder()
                                                        .connectedTicketDocumentNumber(
                                                            "connected_ticket_document_number"
                                                        )
                                                        .creditReasonIndicator(
                                                            Transaction.Source.CardRefund
                                                                .PurchaseDetails
                                                                .Travel
                                                                .Ancillary
                                                                .CreditReasonIndicator
                                                                .NO_CREDIT
                                                        )
                                                        .passengerNameOrDescription(
                                                            "passenger_name_or_description"
                                                        )
                                                        .addService(
                                                            Transaction.Source.CardRefund
                                                                .PurchaseDetails
                                                                .Travel
                                                                .Ancillary
                                                                .Service
                                                                .builder()
                                                                .category(
                                                                    Transaction.Source.CardRefund
                                                                        .PurchaseDetails
                                                                        .Travel
                                                                        .Ancillary
                                                                        .Service
                                                                        .Category
                                                                        .NONE
                                                                )
                                                                .subCategory("sub_category")
                                                                .build()
                                                        )
                                                        .ticketDocumentNumber(
                                                            "ticket_document_number"
                                                        )
                                                        .build()
                                                )
                                                .computerizedReservationSystem(
                                                    "computerized_reservation_system"
                                                )
                                                .creditReasonIndicator(
                                                    Transaction.Source.CardRefund.PurchaseDetails
                                                        .Travel
                                                        .CreditReasonIndicator
                                                        .NO_CREDIT
                                                )
                                                .departureDate(LocalDate.parse("2019-12-27"))
                                                .originationCityAirportCode(
                                                    "origination_city_airport_code"
                                                )
                                                .passengerName("passenger_name")
                                                .restrictedTicketIndicator(
                                                    Transaction.Source.CardRefund.PurchaseDetails
                                                        .Travel
                                                        .RestrictedTicketIndicator
                                                        .NO_RESTRICTIONS
                                                )
                                                .ticketChangeIndicator(
                                                    Transaction.Source.CardRefund.PurchaseDetails
                                                        .Travel
                                                        .TicketChangeIndicator
                                                        .NONE
                                                )
                                                .ticketNumber("ticket_number")
                                                .travelAgencyCode("travel_agency_code")
                                                .travelAgencyName("travel_agency_name")
                                                .addTripLeg(
                                                    Transaction.Source.CardRefund.PurchaseDetails
                                                        .Travel
                                                        .TripLeg
                                                        .builder()
                                                        .carrierCode("carrier_code")
                                                        .destinationCityAirportCode(
                                                            "destination_city_airport_code"
                                                        )
                                                        .fareBasisCode("fare_basis_code")
                                                        .flightNumber("flight_number")
                                                        .serviceClass("service_class")
                                                        .stopOverCode(
                                                            Transaction.Source.CardRefund
                                                                .PurchaseDetails
                                                                .Travel
                                                                .TripLeg
                                                                .StopOverCode
                                                                .NONE
                                                        )
                                                        .build()
                                                )
                                                .build()
                                        )
                                        .build()
                                )
                                .addSchemeFee(
                                    Transaction.Source.CardRefund.SchemeFee.builder()
                                        .amount("0.137465")
                                        .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                                        .currency(
                                            Transaction.Source.CardRefund.SchemeFee.Currency.USD
                                        )
                                        .feeType(
                                            Transaction.Source.CardRefund.SchemeFee.FeeType
                                                .VISA_CORPORATE_ACCEPTANCE_FEE
                                        )
                                        .fixedComponent(null)
                                        .variableRate("0.0002")
                                        .build()
                                )
                                .transactionId("transaction_uyrp7fld2ium70oa7oi")
                                .type(Transaction.Source.CardRefund.Type.CARD_REFUND)
                                .build()
                        )
                        .cardRevenuePayment(
                            Transaction.Source.CardRevenuePayment.builder()
                                .amount(100L)
                                .currency(Transaction.Source.CardRevenuePayment.Currency.USD)
                                .periodEnd(OffsetDateTime.parse("2025-06-30T23:59:59+00:00"))
                                .periodStart(OffsetDateTime.parse("2025-06-01T00:00:00+00:00"))
                                .transactedOnAccountId("account_in71c4amph0vgo2qllky")
                                .build()
                        )
                        .cardSettlement(
                            Transaction.Source.CardSettlement.builder()
                                .id("card_settlement_khv5kfeu0vndj291omg6")
                                .amount(100L)
                                .cardAuthorization(null)
                                .cardPaymentId("card_payment_nd3k2kacrqjli8482ave")
                                .cashback(
                                    Transaction.Source.CardSettlement.Cashback.builder()
                                        .amount("0.137465")
                                        .currency(
                                            Transaction.Source.CardSettlement.Cashback.Currency.USD
                                        )
                                        .build()
                                )
                                .currency(Transaction.Source.CardSettlement.Currency.USD)
                                .interchange(
                                    Transaction.Source.CardSettlement.Interchange.builder()
                                        .amount("0.137465")
                                        .code("271")
                                        .currency(
                                            Transaction.Source.CardSettlement.Interchange.Currency
                                                .USD
                                        )
                                        .build()
                                )
                                .merchantAcceptorId("5665270011000168")
                                .merchantCategoryCode("5734")
                                .merchantCity("New York")
                                .merchantCountry("US")
                                .merchantName("AMAZON.COM")
                                .merchantPostalCode("10045")
                                .merchantState("NY")
                                .network(Transaction.Source.CardSettlement.Network.VISA)
                                .networkIdentifiers(
                                    Transaction.Source.CardSettlement.NetworkIdentifiers.builder()
                                        .acquirerBusinessId("69650702")
                                        .acquirerReferenceNumber("83163715445437604865089")
                                        .authorizationIdentificationResponse("ABC123")
                                        .transactionId("627199945183184")
                                        .build()
                                )
                                .pendingTransactionId(null)
                                .presentmentAmount(100L)
                                .presentmentCurrency("USD")
                                .purchaseDetails(
                                    Transaction.Source.CardSettlement.PurchaseDetails.builder()
                                        .carRental(
                                            Transaction.Source.CardSettlement.PurchaseDetails
                                                .CarRental
                                                .builder()
                                                .carClassCode("car_class_code")
                                                .checkoutDate(LocalDate.parse("2019-12-27"))
                                                .dailyRentalRateAmount(0L)
                                                .dailyRentalRateCurrency(
                                                    "daily_rental_rate_currency"
                                                )
                                                .daysRented(0L)
                                                .extraCharges(
                                                    Transaction.Source.CardSettlement
                                                        .PurchaseDetails
                                                        .CarRental
                                                        .ExtraCharges
                                                        .NO_EXTRA_CHARGE
                                                )
                                                .fuelChargesAmount(0L)
                                                .fuelChargesCurrency("fuel_charges_currency")
                                                .insuranceChargesAmount(0L)
                                                .insuranceChargesCurrency(
                                                    "insurance_charges_currency"
                                                )
                                                .noShowIndicator(
                                                    Transaction.Source.CardSettlement
                                                        .PurchaseDetails
                                                        .CarRental
                                                        .NoShowIndicator
                                                        .NOT_APPLICABLE
                                                )
                                                .oneWayDropOffChargesAmount(0L)
                                                .oneWayDropOffChargesCurrency(
                                                    "one_way_drop_off_charges_currency"
                                                )
                                                .renterName("renter_name")
                                                .weeklyRentalRateAmount(0L)
                                                .weeklyRentalRateCurrency(
                                                    "weekly_rental_rate_currency"
                                                )
                                                .build()
                                        )
                                        .customerReferenceIdentifier("51201")
                                        .localTaxAmount(null)
                                        .localTaxCurrency("usd")
                                        .lodging(
                                            Transaction.Source.CardSettlement.PurchaseDetails
                                                .Lodging
                                                .builder()
                                                .checkInDate(LocalDate.parse("2023-07-20"))
                                                .dailyRoomRateAmount(1000L)
                                                .dailyRoomRateCurrency("usd")
                                                .extraCharges(
                                                    Transaction.Source.CardSettlement
                                                        .PurchaseDetails
                                                        .Lodging
                                                        .ExtraCharges
                                                        .RESTAURANT
                                                )
                                                .folioCashAdvancesAmount(0L)
                                                .folioCashAdvancesCurrency("usd")
                                                .foodBeverageChargesAmount(0L)
                                                .foodBeverageChargesCurrency("usd")
                                                .noShowIndicator(
                                                    Transaction.Source.CardSettlement
                                                        .PurchaseDetails
                                                        .Lodging
                                                        .NoShowIndicator
                                                        .NO_SHOW
                                                )
                                                .prepaidExpensesAmount(0L)
                                                .prepaidExpensesCurrency("usd")
                                                .roomNights(1L)
                                                .totalRoomTaxAmount(100L)
                                                .totalRoomTaxCurrency("usd")
                                                .totalTaxAmount(100L)
                                                .totalTaxCurrency("usd")
                                                .build()
                                        )
                                        .nationalTaxAmount(null)
                                        .nationalTaxCurrency("usd")
                                        .purchaseIdentifier("10203")
                                        .purchaseIdentifierFormat(
                                            Transaction.Source.CardSettlement.PurchaseDetails
                                                .PurchaseIdentifierFormat
                                                .ORDER_NUMBER
                                        )
                                        .travel(
                                            Transaction.Source.CardSettlement.PurchaseDetails.Travel
                                                .builder()
                                                .ancillary(
                                                    Transaction.Source.CardSettlement
                                                        .PurchaseDetails
                                                        .Travel
                                                        .Ancillary
                                                        .builder()
                                                        .connectedTicketDocumentNumber(
                                                            "connected_ticket_document_number"
                                                        )
                                                        .creditReasonIndicator(
                                                            Transaction.Source.CardSettlement
                                                                .PurchaseDetails
                                                                .Travel
                                                                .Ancillary
                                                                .CreditReasonIndicator
                                                                .NO_CREDIT
                                                        )
                                                        .passengerNameOrDescription(
                                                            "passenger_name_or_description"
                                                        )
                                                        .addService(
                                                            Transaction.Source.CardSettlement
                                                                .PurchaseDetails
                                                                .Travel
                                                                .Ancillary
                                                                .Service
                                                                .builder()
                                                                .category(
                                                                    Transaction.Source
                                                                        .CardSettlement
                                                                        .PurchaseDetails
                                                                        .Travel
                                                                        .Ancillary
                                                                        .Service
                                                                        .Category
                                                                        .NONE
                                                                )
                                                                .subCategory("sub_category")
                                                                .build()
                                                        )
                                                        .ticketDocumentNumber(
                                                            "ticket_document_number"
                                                        )
                                                        .build()
                                                )
                                                .computerizedReservationSystem(
                                                    "computerized_reservation_system"
                                                )
                                                .creditReasonIndicator(
                                                    Transaction.Source.CardSettlement
                                                        .PurchaseDetails
                                                        .Travel
                                                        .CreditReasonIndicator
                                                        .NO_CREDIT
                                                )
                                                .departureDate(LocalDate.parse("2019-12-27"))
                                                .originationCityAirportCode(
                                                    "origination_city_airport_code"
                                                )
                                                .passengerName("passenger_name")
                                                .restrictedTicketIndicator(
                                                    Transaction.Source.CardSettlement
                                                        .PurchaseDetails
                                                        .Travel
                                                        .RestrictedTicketIndicator
                                                        .NO_RESTRICTIONS
                                                )
                                                .ticketChangeIndicator(
                                                    Transaction.Source.CardSettlement
                                                        .PurchaseDetails
                                                        .Travel
                                                        .TicketChangeIndicator
                                                        .NONE
                                                )
                                                .ticketNumber("ticket_number")
                                                .travelAgencyCode("travel_agency_code")
                                                .travelAgencyName("travel_agency_name")
                                                .addTripLeg(
                                                    Transaction.Source.CardSettlement
                                                        .PurchaseDetails
                                                        .Travel
                                                        .TripLeg
                                                        .builder()
                                                        .carrierCode("carrier_code")
                                                        .destinationCityAirportCode(
                                                            "destination_city_airport_code"
                                                        )
                                                        .fareBasisCode("fare_basis_code")
                                                        .flightNumber("flight_number")
                                                        .serviceClass("service_class")
                                                        .stopOverCode(
                                                            Transaction.Source.CardSettlement
                                                                .PurchaseDetails
                                                                .Travel
                                                                .TripLeg
                                                                .StopOverCode
                                                                .NONE
                                                        )
                                                        .build()
                                                )
                                                .build()
                                        )
                                        .build()
                                )
                                .addSchemeFee(
                                    Transaction.Source.CardSettlement.SchemeFee.builder()
                                        .amount("0.137465")
                                        .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                                        .currency(
                                            Transaction.Source.CardSettlement.SchemeFee.Currency.USD
                                        )
                                        .feeType(
                                            Transaction.Source.CardSettlement.SchemeFee.FeeType
                                                .VISA_CORPORATE_ACCEPTANCE_FEE
                                        )
                                        .fixedComponent(null)
                                        .variableRate("0.0002")
                                        .build()
                                )
                                .surcharge(
                                    Transaction.Source.CardSettlement.Surcharge.builder()
                                        .amount(0L)
                                        .presentmentAmount(0L)
                                        .build()
                                )
                                .transactionId("transaction_uyrp7fld2ium70oa7oi")
                                .type(Transaction.Source.CardSettlement.Type.CARD_SETTLEMENT)
                                .build()
                        )
                        .cashbackPayment(
                            Transaction.Source.CashbackPayment.builder()
                                .accruedOnCardId("card_oubs0hwk5rn6knuecxg2")
                                .amount(100L)
                                .currency(Transaction.Source.CashbackPayment.Currency.USD)
                                .periodEnd(OffsetDateTime.parse("2025-06-30T23:59:59+00:00"))
                                .periodStart(OffsetDateTime.parse("2025-06-01T00:00:00+00:00"))
                                .build()
                        )
                        .checkDepositAcceptance(
                            Transaction.Source.CheckDepositAcceptance.builder()
                                .accountNumber("987654321")
                                .amount(1000L)
                                .auxiliaryOnUs("101")
                                .checkDepositId("check_deposit_f06n9gpg7sxn8t19lfc1")
                                .currency(Transaction.Source.CheckDepositAcceptance.Currency.USD)
                                .routingNumber("101050001")
                                .serialNumber(null)
                                .build()
                        )
                        .checkDepositReturn(
                            Transaction.Source.CheckDepositReturn.builder()
                                .amount(100L)
                                .checkDepositId("check_deposit_f06n9gpg7sxn8t19lfc1")
                                .currency(Transaction.Source.CheckDepositReturn.Currency.USD)
                                .returnReason(
                                    Transaction.Source.CheckDepositReturn.ReturnReason
                                        .INSUFFICIENT_FUNDS
                                )
                                .returnedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                                .transactionId("transaction_uyrp7fld2ium70oa7oi")
                                .build()
                        )
                        .checkTransferDeposit(
                            Transaction.Source.CheckTransferDeposit.builder()
                                .backImageFileId("file_makxrc67oh9l6sg7w9yc")
                                .bankOfFirstDepositRoutingNumber(null)
                                .depositedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                                .frontImageFileId("file_makxrc67oh9l6sg7w9yc")
                                .inboundCheckDepositId("inbound_check_deposit_zoshvqybq0cjjm31mra")
                                .transactionId("transaction_uyrp7fld2ium70oa7oi")
                                .transferId("check_transfer_30b43acfu9vw8fyc4f5")
                                .type(
                                    Transaction.Source.CheckTransferDeposit.Type
                                        .CHECK_TRANSFER_DEPOSIT
                                )
                                .build()
                        )
                        .fednowTransferAcknowledgement(
                            Transaction.Source.FednowTransferAcknowledgement.builder()
                                .transferId("fednow_transfer_4i0mptrdu1mueg1196bg")
                                .build()
                        )
                        .feePayment(
                            Transaction.Source.FeePayment.builder()
                                .amount(100L)
                                .currency(Transaction.Source.FeePayment.Currency.USD)
                                .feePeriodStart(LocalDate.parse("2023-05-01"))
                                .programId("program_i2v2os4mwza1oetokh9i")
                                .build()
                        )
                        .inboundAchTransfer(
                            Transaction.Source.InboundAchTransfer.builder()
                                .addenda(
                                    Transaction.Source.InboundAchTransfer.Addenda.builder()
                                        .category(
                                            Transaction.Source.InboundAchTransfer.Addenda.Category
                                                .FREEFORM
                                        )
                                        .freeform(
                                            Transaction.Source.InboundAchTransfer.Addenda.Freeform
                                                .builder()
                                                .addEntry(
                                                    Transaction.Source.InboundAchTransfer.Addenda
                                                        .Freeform
                                                        .Entry
                                                        .builder()
                                                        .paymentRelatedInformation(
                                                            "payment_related_information"
                                                        )
                                                        .build()
                                                )
                                                .build()
                                        )
                                        .build()
                                )
                                .amount(100L)
                                .originatorCompanyDescriptiveDate(null)
                                .originatorCompanyDiscretionaryData(null)
                                .originatorCompanyEntryDescription("RESERVE")
                                .originatorCompanyId("0987654321")
                                .originatorCompanyName("BIG BANK")
                                .receiverIdNumber("12345678900")
                                .receiverName("IAN CREASE")
                                .traceNumber("021000038461022")
                                .transferId("inbound_ach_transfer_tdrwqr3fq9gnnq49odev")
                                .build()
                        )
                        .inboundAchTransferReturnIntention(
                            Transaction.Source.InboundAchTransferReturnIntention.builder()
                                .inboundAchTransferId("inbound_ach_transfer_tdrwqr3fq9gnnq49odev")
                                .build()
                        )
                        .inboundCheckAdjustment(
                            Transaction.Source.InboundCheckAdjustment.builder()
                                .adjustedTransactionId("transaction_uyrp7fld2ium70oa7oi")
                                .amount(1750L)
                                .reason(
                                    Transaction.Source.InboundCheckAdjustment.Reason.LATE_RETURN
                                )
                                .build()
                        )
                        .inboundCheckDepositReturnIntention(
                            Transaction.Source.InboundCheckDepositReturnIntention.builder()
                                .inboundCheckDepositId("inbound_check_deposit_zoshvqybq0cjjm31mra")
                                .transferId("check_transfer_30b43acfu9vw8fyc4f5")
                                .build()
                        )
                        .inboundFednowTransferConfirmation(
                            Transaction.Source.InboundFednowTransferConfirmation.builder()
                                .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20")
                                .build()
                        )
                        .inboundRealTimePaymentsTransferConfirmation(
                            Transaction.Source.InboundRealTimePaymentsTransferConfirmation.builder()
                                .amount(100L)
                                .creditorName("Ian Crease")
                                .currency(
                                    Transaction.Source.InboundRealTimePaymentsTransferConfirmation
                                        .Currency
                                        .USD
                                )
                                .debtorAccountNumber("987654321")
                                .debtorName("National Phonograph Company")
                                .debtorRoutingNumber("101050001")
                                .transactionIdentification("20220501234567891T1BSLZO01745013025")
                                .transferId(
                                    "inbound_real_time_payments_transfer_63hlz498vcxg644hcrzr"
                                )
                                .unstructuredRemittanceInformation("Invoice 29582")
                                .build()
                        )
                        .inboundWireReversal(
                            Transaction.Source.InboundWireReversal.builder()
                                .amount(12345L)
                                .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                                .debtorRoutingNumber("101050001")
                                .description("Inbound wire reversal 2022021100335128")
                                .inputCycleDate(LocalDate.parse("2022-02-11"))
                                .inputMessageAccountabilityData("20220211B6B7HU2R011023")
                                .inputSequenceNumber("11023")
                                .inputSource("B6B7HU2R")
                                .instructionIdentification(null)
                                .returnReasonAdditionalInformation(null)
                                .returnReasonCode(null)
                                .returnReasonCodeDescription(null)
                                .transactionId("transaction_uyrp7fld2ium70oa7oi")
                                .wireTransferId("wire_transfer_5akynk7dqsq25qwk9q2u")
                                .build()
                        )
                        .inboundWireTransfer(
                            Transaction.Source.InboundWireTransfer.builder()
                                .amount(100L)
                                .creditorAddressLine1(null)
                                .creditorAddressLine2(null)
                                .creditorAddressLine3(null)
                                .creditorName(null)
                                .debtorAddressLine1(null)
                                .debtorAddressLine2(null)
                                .debtorAddressLine3(null)
                                .debtorName(null)
                                .description("Inbound wire transfer")
                                .endToEndIdentification(null)
                                .inputMessageAccountabilityData(null)
                                .instructingAgentRoutingNumber(null)
                                .instructionIdentification(null)
                                .purpose(null)
                                .transferId("inbound_wire_transfer_f228m6bmhtcxjco9pwp0")
                                .uniqueEndToEndTransactionReference(null)
                                .unstructuredRemittanceInformation(null)
                                .build()
                        )
                        .inboundWireTransferReversal(
                            Transaction.Source.InboundWireTransferReversal.builder()
                                .inboundWireTransferId("inbound_wire_transfer_f228m6bmhtcxjco9pwp0")
                                .build()
                        )
                        .interestPayment(
                            Transaction.Source.InterestPayment.builder()
                                .accruedOnAccountId("account_in71c4amph0vgo2qllky")
                                .amount(100L)
                                .currency(Transaction.Source.InterestPayment.Currency.USD)
                                .periodEnd(OffsetDateTime.parse("2025-06-30T23:59:59+00:00"))
                                .periodStart(OffsetDateTime.parse("2025-06-01T00:00:00+00:00"))
                                .build()
                        )
                        .internalSource(
                            Transaction.Source.InternalSource.builder()
                                .amount(100L)
                                .currency(Transaction.Source.InternalSource.Currency.USD)
                                .reason(Transaction.Source.InternalSource.Reason.SAMPLE_FUNDS)
                                .build()
                        )
                        .other(Transaction.Source.Other.builder().build())
                        .realTimePaymentsTransferAcknowledgement(
                            Transaction.Source.RealTimePaymentsTransferAcknowledgement.builder()
                                .accountNumber("987654321")
                                .amount(100L)
                                .routingNumber("101050001")
                                .transferId("real_time_payments_transfer_iyuhl5kdn7ssmup83mvq")
                                .unstructuredRemittanceInformation("Invoice 29582")
                                .build()
                        )
                        .sampleFunds(
                            Transaction.Source.SampleFunds.builder().originator("dashboard").build()
                        )
                        .swiftTransferIntention(
                            Transaction.Source.SwiftTransferIntention.builder()
                                .transferId("swift_transfer_29h21xkng03788zwd3fh")
                                .build()
                        )
                        .swiftTransferReturn(
                            Transaction.Source.SwiftTransferReturn.builder()
                                .transferId("swift_transfer_29h21xkng03788zwd3fh")
                                .build()
                        )
                        .wireTransferIntention(
                            Transaction.Source.WireTransferIntention.builder()
                                .accountNumber("987654321")
                                .amount(100L)
                                .messageToRecipient("HELLO")
                                .routingNumber("101050001")
                                .transferId("wire_transfer_5akynk7dqsq25qwk9q2u")
                                .build()
                        )
                        .build()
                )
                .type(Transaction.Type.TRANSACTION)
                .build()

        assertThat(transaction.id()).isEqualTo("transaction_uyrp7fld2ium70oa7oi")
        assertThat(transaction.accountId()).isEqualTo("account_in71c4amph0vgo2qllky")
        assertThat(transaction.amount()).isEqualTo(100L)
        assertThat(transaction.createdAt()).isEqualTo(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
        assertThat(transaction.currency()).isEqualTo(Transaction.Currency.USD)
        assertThat(transaction.description()).isEqualTo("INVOICE 2468")
        assertThat(transaction.routeId()).contains("account_number_v18nkfqm6afpsrvy82b2")
        assertThat(transaction.routeType()).contains(Transaction.RouteType.ACCOUNT_NUMBER)
        assertThat(transaction.source())
            .isEqualTo(
                Transaction.Source.builder()
                    .category(Transaction.Source.Category.INBOUND_ACH_TRANSFER)
                    .accountRevenuePayment(
                        Transaction.Source.AccountRevenuePayment.builder()
                            .accruedOnAccountId("account_in71c4amph0vgo2qllky")
                            .periodEnd(OffsetDateTime.parse("2025-06-30T23:59:59+00:00"))
                            .periodStart(OffsetDateTime.parse("2025-06-01T00:00:00+00:00"))
                            .build()
                    )
                    .accountTransferIntention(
                        Transaction.Source.AccountTransferIntention.builder()
                            .amount(100L)
                            .currency(Transaction.Source.AccountTransferIntention.Currency.USD)
                            .description("INVOICE 2468")
                            .destinationAccountId("account_uf16sut2ct5bevmq3eh")
                            .sourceAccountId("account_in71c4amph0vgo2qllky")
                            .transferId("account_transfer_7k9qe1ysdgqztnt63l7n")
                            .build()
                    )
                    .achTransferIntention(
                        Transaction.Source.AchTransferIntention.builder()
                            .accountNumber("987654321")
                            .amount(100L)
                            .routingNumber("101050001")
                            .statementDescriptor("INVOICE 2468")
                            .transferId("account_transfer_7k9qe1ysdgqztnt63l7n")
                            .build()
                    )
                    .achTransferRejection(
                        Transaction.Source.AchTransferRejection.builder()
                            .transferId("account_transfer_7k9qe1ysdgqztnt63l7n")
                            .build()
                    )
                    .achTransferReturn(
                        Transaction.Source.AchTransferReturn.builder()
                            .addendaInformation(null)
                            .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                            .rawReturnReasonCode("R01")
                            .returnReasonCode(
                                Transaction.Source.AchTransferReturn.ReturnReasonCode
                                    .INSUFFICIENT_FUND
                            )
                            .traceNumber("111122223292834")
                            .transactionId("transaction_uyrp7fld2ium70oa7oi")
                            .transferId("ach_transfer_uoxatyh3lt5evrsdvo7q")
                            .build()
                    )
                    .blockchainOfframpTransferSettlement(
                        Transaction.Source.BlockchainOfframpTransferSettlement.builder()
                            .sourceBlockchainAddressId("blockchain_address_tijjpqp9t5d358ehydqi")
                            .transferId("blockchain_offramp_transfer_sqd2x3ti6u2sy91v696m")
                            .build()
                    )
                    .blockchainOnrampTransferIntention(
                        Transaction.Source.BlockchainOnrampTransferIntention.builder()
                            .destinationBlockchainAddress("0xaabbccdd")
                            .transferId("blockchain_onramp_transfer_sg8nzy569rk0dnfk28bv")
                            .build()
                    )
                    .cardDisputeAcceptance(
                        Transaction.Source.CardDisputeAcceptance.builder()
                            .acceptedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                            .transactionId("transaction_uyrp7fld2ium70oa7oi")
                            .build()
                    )
                    .cardDisputeFinancial(
                        Transaction.Source.CardDisputeFinancial.builder()
                            .amount(1000L)
                            .network(Transaction.Source.CardDisputeFinancial.Network.VISA)
                            .transactionId("transaction_uyrp7fld2ium70oa7oi")
                            .visa(
                                Transaction.Source.CardDisputeFinancial.Visa.builder()
                                    .eventType(
                                        Transaction.Source.CardDisputeFinancial.Visa.EventType
                                            .CHARGEBACK_SUBMITTED
                                    )
                                    .build()
                            )
                            .build()
                    )
                    .cardDisputeLoss(
                        Transaction.Source.CardDisputeLoss.builder()
                            .explanation("The card dispute was lost.")
                            .lostAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                            .transactionId("transaction_uyrp7fld2ium70oa7oi")
                            .build()
                    )
                    .cardFinancial(
                        Transaction.Source.CardFinancial.builder()
                            .id("card_financial_di5b98i72ppomo268zfk")
                            .actioner(Transaction.Source.CardFinancial.Actioner.INCREASE)
                            .additionalAmounts(
                                Transaction.Source.CardFinancial.AdditionalAmounts.builder()
                                    .clinic(
                                        Transaction.Source.CardFinancial.AdditionalAmounts.Clinic
                                            .builder()
                                            .amount(0L)
                                            .currency("currency")
                                            .build()
                                    )
                                    .dental(
                                        Transaction.Source.CardFinancial.AdditionalAmounts.Dental
                                            .builder()
                                            .amount(0L)
                                            .currency("currency")
                                            .build()
                                    )
                                    .original(
                                        Transaction.Source.CardFinancial.AdditionalAmounts.Original
                                            .builder()
                                            .amount(0L)
                                            .currency("currency")
                                            .build()
                                    )
                                    .prescription(
                                        Transaction.Source.CardFinancial.AdditionalAmounts
                                            .Prescription
                                            .builder()
                                            .amount(0L)
                                            .currency("currency")
                                            .build()
                                    )
                                    .surcharge(
                                        Transaction.Source.CardFinancial.AdditionalAmounts.Surcharge
                                            .builder()
                                            .amount(10L)
                                            .currency("USD")
                                            .build()
                                    )
                                    .totalCumulative(
                                        Transaction.Source.CardFinancial.AdditionalAmounts
                                            .TotalCumulative
                                            .builder()
                                            .amount(0L)
                                            .currency("currency")
                                            .build()
                                    )
                                    .totalHealthcare(
                                        Transaction.Source.CardFinancial.AdditionalAmounts
                                            .TotalHealthcare
                                            .builder()
                                            .amount(0L)
                                            .currency("currency")
                                            .build()
                                    )
                                    .transit(
                                        Transaction.Source.CardFinancial.AdditionalAmounts.Transit
                                            .builder()
                                            .amount(0L)
                                            .currency("currency")
                                            .build()
                                    )
                                    .unknown(
                                        Transaction.Source.CardFinancial.AdditionalAmounts.Unknown
                                            .builder()
                                            .amount(0L)
                                            .currency("currency")
                                            .build()
                                    )
                                    .vision(
                                        Transaction.Source.CardFinancial.AdditionalAmounts.Vision
                                            .builder()
                                            .amount(0L)
                                            .currency("currency")
                                            .build()
                                    )
                                    .build()
                            )
                            .amount(100L)
                            .cardPaymentId("card_payment_nd3k2kacrqjli8482ave")
                            .currency(Transaction.Source.CardFinancial.Currency.USD)
                            .digitalWalletTokenId(null)
                            .direction(Transaction.Source.CardFinancial.Direction.SETTLEMENT)
                            .merchantAcceptorId("5665270011000168")
                            .merchantCategoryCode("5734")
                            .merchantCity("New York")
                            .merchantCountry("US")
                            .merchantDescriptor("AMAZON.COM")
                            .merchantPostalCode("10045")
                            .merchantState("NY")
                            .networkDetails(
                                Transaction.Source.CardFinancial.NetworkDetails.builder()
                                    .category(
                                        Transaction.Source.CardFinancial.NetworkDetails.Category
                                            .VISA
                                    )
                                    .pulse(
                                        Transaction.Source.CardFinancial.NetworkDetails.Pulse
                                            .builder()
                                            .build()
                                    )
                                    .visa(
                                        Transaction.Source.CardFinancial.NetworkDetails.Visa
                                            .builder()
                                            .electronicCommerceIndicator(
                                                Transaction.Source.CardFinancial.NetworkDetails.Visa
                                                    .ElectronicCommerceIndicator
                                                    .SECURE_ELECTRONIC_COMMERCE
                                            )
                                            .pointOfServiceEntryMode(
                                                Transaction.Source.CardFinancial.NetworkDetails.Visa
                                                    .PointOfServiceEntryMode
                                                    .MANUAL
                                            )
                                            .standInProcessingReason(null)
                                            .terminalEntryCapability(
                                                Transaction.Source.CardFinancial.NetworkDetails.Visa
                                                    .TerminalEntryCapability
                                                    .MAGNETIC_STRIPE
                                            )
                                            .build()
                                    )
                                    .build()
                            )
                            .networkIdentifiers(
                                Transaction.Source.CardFinancial.NetworkIdentifiers.builder()
                                    .authorizationIdentificationResponse(null)
                                    .retrievalReferenceNumber("785867080153")
                                    .traceNumber("487941")
                                    .transactionId("627199945183184")
                                    .build()
                            )
                            .networkRiskScore(10L)
                            .physicalCardId(null)
                            .presentmentAmount(100L)
                            .presentmentCurrency("USD")
                            .processingCategory(
                                Transaction.Source.CardFinancial.ProcessingCategory.PURCHASE
                            )
                            .realTimeDecisionId(null)
                            .addSchemeFee(
                                Transaction.Source.CardFinancial.SchemeFee.builder()
                                    .amount("0.137465")
                                    .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                                    .currency(
                                        Transaction.Source.CardFinancial.SchemeFee.Currency.USD
                                    )
                                    .feeType(
                                        Transaction.Source.CardFinancial.SchemeFee.FeeType
                                            .VISA_CORPORATE_ACCEPTANCE_FEE
                                    )
                                    .fixedComponent(null)
                                    .variableRate("0.0002")
                                    .build()
                            )
                            .terminalId("RCN5VNXS")
                            .transactionId("transaction_uyrp7fld2ium70oa7oi")
                            .type(Transaction.Source.CardFinancial.Type.CARD_FINANCIAL)
                            .verification(
                                Transaction.Source.CardFinancial.Verification.builder()
                                    .cardVerificationCode(
                                        Transaction.Source.CardFinancial.Verification
                                            .CardVerificationCode
                                            .builder()
                                            .result(
                                                Transaction.Source.CardFinancial.Verification
                                                    .CardVerificationCode
                                                    .Result
                                                    .MATCH
                                            )
                                            .build()
                                    )
                                    .cardholderAddress(
                                        Transaction.Source.CardFinancial.Verification
                                            .CardholderAddress
                                            .builder()
                                            .actualLine1("33 Liberty Street")
                                            .actualPostalCode("94131")
                                            .providedLine1("33 Liberty Street")
                                            .providedPostalCode("94132")
                                            .result(
                                                Transaction.Source.CardFinancial.Verification
                                                    .CardholderAddress
                                                    .Result
                                                    .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH
                                            )
                                            .build()
                                    )
                                    .cardholderName(
                                        Transaction.Source.CardFinancial.Verification.CardholderName
                                            .builder()
                                            .providedFirstName("provided_first_name")
                                            .providedLastName("provided_last_name")
                                            .providedMiddleName("provided_middle_name")
                                            .build()
                                    )
                                    .build()
                            )
                            .build()
                    )
                    .cardPushTransferAcceptance(
                        Transaction.Source.CardPushTransferAcceptance.builder()
                            .settlementAmount(100L)
                            .transferId("outbound_card_push_transfer_e0z9rdpamraczh4tvwye")
                            .build()
                    )
                    .cardRefund(
                        Transaction.Source.CardRefund.builder()
                            .id("card_refund_imgc2xwplh6t4r3gn16e")
                            .amount(100L)
                            .cardPaymentId("card_payment_nd3k2kacrqjli8482ave")
                            .cashback(
                                Transaction.Source.CardRefund.Cashback.builder()
                                    .amount("0.137465")
                                    .currency(Transaction.Source.CardRefund.Cashback.Currency.USD)
                                    .build()
                            )
                            .currency(Transaction.Source.CardRefund.Currency.USD)
                            .interchange(
                                Transaction.Source.CardRefund.Interchange.builder()
                                    .amount("0.137465")
                                    .code("271")
                                    .currency(
                                        Transaction.Source.CardRefund.Interchange.Currency.USD
                                    )
                                    .build()
                            )
                            .merchantAcceptorId("5665270011000168")
                            .merchantCategoryCode("5734")
                            .merchantCity("New York")
                            .merchantCountry("US")
                            .merchantName("AMAZON.COM")
                            .merchantPostalCode("10045")
                            .merchantState("NY")
                            .networkIdentifiers(
                                Transaction.Source.CardRefund.NetworkIdentifiers.builder()
                                    .acquirerBusinessId("69650702")
                                    .acquirerReferenceNumber("83163715445437604865089")
                                    .authorizationIdentificationResponse("ABC123")
                                    .transactionId("627199945183184")
                                    .build()
                            )
                            .presentmentAmount(100L)
                            .presentmentCurrency("USD")
                            .purchaseDetails(
                                Transaction.Source.CardRefund.PurchaseDetails.builder()
                                    .carRental(
                                        Transaction.Source.CardRefund.PurchaseDetails.CarRental
                                            .builder()
                                            .carClassCode("car_class_code")
                                            .checkoutDate(LocalDate.parse("2019-12-27"))
                                            .dailyRentalRateAmount(0L)
                                            .dailyRentalRateCurrency("daily_rental_rate_currency")
                                            .daysRented(0L)
                                            .extraCharges(
                                                Transaction.Source.CardRefund.PurchaseDetails
                                                    .CarRental
                                                    .ExtraCharges
                                                    .NO_EXTRA_CHARGE
                                            )
                                            .fuelChargesAmount(0L)
                                            .fuelChargesCurrency("fuel_charges_currency")
                                            .insuranceChargesAmount(0L)
                                            .insuranceChargesCurrency("insurance_charges_currency")
                                            .noShowIndicator(
                                                Transaction.Source.CardRefund.PurchaseDetails
                                                    .CarRental
                                                    .NoShowIndicator
                                                    .NOT_APPLICABLE
                                            )
                                            .oneWayDropOffChargesAmount(0L)
                                            .oneWayDropOffChargesCurrency(
                                                "one_way_drop_off_charges_currency"
                                            )
                                            .renterName("renter_name")
                                            .weeklyRentalRateAmount(0L)
                                            .weeklyRentalRateCurrency("weekly_rental_rate_currency")
                                            .build()
                                    )
                                    .customerReferenceIdentifier("51201")
                                    .localTaxAmount(null)
                                    .localTaxCurrency("usd")
                                    .lodging(
                                        Transaction.Source.CardRefund.PurchaseDetails.Lodging
                                            .builder()
                                            .checkInDate(LocalDate.parse("2023-07-20"))
                                            .dailyRoomRateAmount(1000L)
                                            .dailyRoomRateCurrency("usd")
                                            .extraCharges(
                                                Transaction.Source.CardRefund.PurchaseDetails
                                                    .Lodging
                                                    .ExtraCharges
                                                    .RESTAURANT
                                            )
                                            .folioCashAdvancesAmount(0L)
                                            .folioCashAdvancesCurrency("usd")
                                            .foodBeverageChargesAmount(0L)
                                            .foodBeverageChargesCurrency("usd")
                                            .noShowIndicator(
                                                Transaction.Source.CardRefund.PurchaseDetails
                                                    .Lodging
                                                    .NoShowIndicator
                                                    .NO_SHOW
                                            )
                                            .prepaidExpensesAmount(0L)
                                            .prepaidExpensesCurrency("usd")
                                            .roomNights(1L)
                                            .totalRoomTaxAmount(100L)
                                            .totalRoomTaxCurrency("usd")
                                            .totalTaxAmount(100L)
                                            .totalTaxCurrency("usd")
                                            .build()
                                    )
                                    .nationalTaxAmount(null)
                                    .nationalTaxCurrency("usd")
                                    .purchaseIdentifier("10203")
                                    .purchaseIdentifierFormat(
                                        Transaction.Source.CardRefund.PurchaseDetails
                                            .PurchaseIdentifierFormat
                                            .ORDER_NUMBER
                                    )
                                    .travel(
                                        Transaction.Source.CardRefund.PurchaseDetails.Travel
                                            .builder()
                                            .ancillary(
                                                Transaction.Source.CardRefund.PurchaseDetails.Travel
                                                    .Ancillary
                                                    .builder()
                                                    .connectedTicketDocumentNumber(
                                                        "connected_ticket_document_number"
                                                    )
                                                    .creditReasonIndicator(
                                                        Transaction.Source.CardRefund
                                                            .PurchaseDetails
                                                            .Travel
                                                            .Ancillary
                                                            .CreditReasonIndicator
                                                            .NO_CREDIT
                                                    )
                                                    .passengerNameOrDescription(
                                                        "passenger_name_or_description"
                                                    )
                                                    .addService(
                                                        Transaction.Source.CardRefund
                                                            .PurchaseDetails
                                                            .Travel
                                                            .Ancillary
                                                            .Service
                                                            .builder()
                                                            .category(
                                                                Transaction.Source.CardRefund
                                                                    .PurchaseDetails
                                                                    .Travel
                                                                    .Ancillary
                                                                    .Service
                                                                    .Category
                                                                    .NONE
                                                            )
                                                            .subCategory("sub_category")
                                                            .build()
                                                    )
                                                    .ticketDocumentNumber("ticket_document_number")
                                                    .build()
                                            )
                                            .computerizedReservationSystem(
                                                "computerized_reservation_system"
                                            )
                                            .creditReasonIndicator(
                                                Transaction.Source.CardRefund.PurchaseDetails.Travel
                                                    .CreditReasonIndicator
                                                    .NO_CREDIT
                                            )
                                            .departureDate(LocalDate.parse("2019-12-27"))
                                            .originationCityAirportCode(
                                                "origination_city_airport_code"
                                            )
                                            .passengerName("passenger_name")
                                            .restrictedTicketIndicator(
                                                Transaction.Source.CardRefund.PurchaseDetails.Travel
                                                    .RestrictedTicketIndicator
                                                    .NO_RESTRICTIONS
                                            )
                                            .ticketChangeIndicator(
                                                Transaction.Source.CardRefund.PurchaseDetails.Travel
                                                    .TicketChangeIndicator
                                                    .NONE
                                            )
                                            .ticketNumber("ticket_number")
                                            .travelAgencyCode("travel_agency_code")
                                            .travelAgencyName("travel_agency_name")
                                            .addTripLeg(
                                                Transaction.Source.CardRefund.PurchaseDetails.Travel
                                                    .TripLeg
                                                    .builder()
                                                    .carrierCode("carrier_code")
                                                    .destinationCityAirportCode(
                                                        "destination_city_airport_code"
                                                    )
                                                    .fareBasisCode("fare_basis_code")
                                                    .flightNumber("flight_number")
                                                    .serviceClass("service_class")
                                                    .stopOverCode(
                                                        Transaction.Source.CardRefund
                                                            .PurchaseDetails
                                                            .Travel
                                                            .TripLeg
                                                            .StopOverCode
                                                            .NONE
                                                    )
                                                    .build()
                                            )
                                            .build()
                                    )
                                    .build()
                            )
                            .addSchemeFee(
                                Transaction.Source.CardRefund.SchemeFee.builder()
                                    .amount("0.137465")
                                    .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                                    .currency(Transaction.Source.CardRefund.SchemeFee.Currency.USD)
                                    .feeType(
                                        Transaction.Source.CardRefund.SchemeFee.FeeType
                                            .VISA_CORPORATE_ACCEPTANCE_FEE
                                    )
                                    .fixedComponent(null)
                                    .variableRate("0.0002")
                                    .build()
                            )
                            .transactionId("transaction_uyrp7fld2ium70oa7oi")
                            .type(Transaction.Source.CardRefund.Type.CARD_REFUND)
                            .build()
                    )
                    .cardRevenuePayment(
                        Transaction.Source.CardRevenuePayment.builder()
                            .amount(100L)
                            .currency(Transaction.Source.CardRevenuePayment.Currency.USD)
                            .periodEnd(OffsetDateTime.parse("2025-06-30T23:59:59+00:00"))
                            .periodStart(OffsetDateTime.parse("2025-06-01T00:00:00+00:00"))
                            .transactedOnAccountId("account_in71c4amph0vgo2qllky")
                            .build()
                    )
                    .cardSettlement(
                        Transaction.Source.CardSettlement.builder()
                            .id("card_settlement_khv5kfeu0vndj291omg6")
                            .amount(100L)
                            .cardAuthorization(null)
                            .cardPaymentId("card_payment_nd3k2kacrqjli8482ave")
                            .cashback(
                                Transaction.Source.CardSettlement.Cashback.builder()
                                    .amount("0.137465")
                                    .currency(
                                        Transaction.Source.CardSettlement.Cashback.Currency.USD
                                    )
                                    .build()
                            )
                            .currency(Transaction.Source.CardSettlement.Currency.USD)
                            .interchange(
                                Transaction.Source.CardSettlement.Interchange.builder()
                                    .amount("0.137465")
                                    .code("271")
                                    .currency(
                                        Transaction.Source.CardSettlement.Interchange.Currency.USD
                                    )
                                    .build()
                            )
                            .merchantAcceptorId("5665270011000168")
                            .merchantCategoryCode("5734")
                            .merchantCity("New York")
                            .merchantCountry("US")
                            .merchantName("AMAZON.COM")
                            .merchantPostalCode("10045")
                            .merchantState("NY")
                            .network(Transaction.Source.CardSettlement.Network.VISA)
                            .networkIdentifiers(
                                Transaction.Source.CardSettlement.NetworkIdentifiers.builder()
                                    .acquirerBusinessId("69650702")
                                    .acquirerReferenceNumber("83163715445437604865089")
                                    .authorizationIdentificationResponse("ABC123")
                                    .transactionId("627199945183184")
                                    .build()
                            )
                            .pendingTransactionId(null)
                            .presentmentAmount(100L)
                            .presentmentCurrency("USD")
                            .purchaseDetails(
                                Transaction.Source.CardSettlement.PurchaseDetails.builder()
                                    .carRental(
                                        Transaction.Source.CardSettlement.PurchaseDetails.CarRental
                                            .builder()
                                            .carClassCode("car_class_code")
                                            .checkoutDate(LocalDate.parse("2019-12-27"))
                                            .dailyRentalRateAmount(0L)
                                            .dailyRentalRateCurrency("daily_rental_rate_currency")
                                            .daysRented(0L)
                                            .extraCharges(
                                                Transaction.Source.CardSettlement.PurchaseDetails
                                                    .CarRental
                                                    .ExtraCharges
                                                    .NO_EXTRA_CHARGE
                                            )
                                            .fuelChargesAmount(0L)
                                            .fuelChargesCurrency("fuel_charges_currency")
                                            .insuranceChargesAmount(0L)
                                            .insuranceChargesCurrency("insurance_charges_currency")
                                            .noShowIndicator(
                                                Transaction.Source.CardSettlement.PurchaseDetails
                                                    .CarRental
                                                    .NoShowIndicator
                                                    .NOT_APPLICABLE
                                            )
                                            .oneWayDropOffChargesAmount(0L)
                                            .oneWayDropOffChargesCurrency(
                                                "one_way_drop_off_charges_currency"
                                            )
                                            .renterName("renter_name")
                                            .weeklyRentalRateAmount(0L)
                                            .weeklyRentalRateCurrency("weekly_rental_rate_currency")
                                            .build()
                                    )
                                    .customerReferenceIdentifier("51201")
                                    .localTaxAmount(null)
                                    .localTaxCurrency("usd")
                                    .lodging(
                                        Transaction.Source.CardSettlement.PurchaseDetails.Lodging
                                            .builder()
                                            .checkInDate(LocalDate.parse("2023-07-20"))
                                            .dailyRoomRateAmount(1000L)
                                            .dailyRoomRateCurrency("usd")
                                            .extraCharges(
                                                Transaction.Source.CardSettlement.PurchaseDetails
                                                    .Lodging
                                                    .ExtraCharges
                                                    .RESTAURANT
                                            )
                                            .folioCashAdvancesAmount(0L)
                                            .folioCashAdvancesCurrency("usd")
                                            .foodBeverageChargesAmount(0L)
                                            .foodBeverageChargesCurrency("usd")
                                            .noShowIndicator(
                                                Transaction.Source.CardSettlement.PurchaseDetails
                                                    .Lodging
                                                    .NoShowIndicator
                                                    .NO_SHOW
                                            )
                                            .prepaidExpensesAmount(0L)
                                            .prepaidExpensesCurrency("usd")
                                            .roomNights(1L)
                                            .totalRoomTaxAmount(100L)
                                            .totalRoomTaxCurrency("usd")
                                            .totalTaxAmount(100L)
                                            .totalTaxCurrency("usd")
                                            .build()
                                    )
                                    .nationalTaxAmount(null)
                                    .nationalTaxCurrency("usd")
                                    .purchaseIdentifier("10203")
                                    .purchaseIdentifierFormat(
                                        Transaction.Source.CardSettlement.PurchaseDetails
                                            .PurchaseIdentifierFormat
                                            .ORDER_NUMBER
                                    )
                                    .travel(
                                        Transaction.Source.CardSettlement.PurchaseDetails.Travel
                                            .builder()
                                            .ancillary(
                                                Transaction.Source.CardSettlement.PurchaseDetails
                                                    .Travel
                                                    .Ancillary
                                                    .builder()
                                                    .connectedTicketDocumentNumber(
                                                        "connected_ticket_document_number"
                                                    )
                                                    .creditReasonIndicator(
                                                        Transaction.Source.CardSettlement
                                                            .PurchaseDetails
                                                            .Travel
                                                            .Ancillary
                                                            .CreditReasonIndicator
                                                            .NO_CREDIT
                                                    )
                                                    .passengerNameOrDescription(
                                                        "passenger_name_or_description"
                                                    )
                                                    .addService(
                                                        Transaction.Source.CardSettlement
                                                            .PurchaseDetails
                                                            .Travel
                                                            .Ancillary
                                                            .Service
                                                            .builder()
                                                            .category(
                                                                Transaction.Source.CardSettlement
                                                                    .PurchaseDetails
                                                                    .Travel
                                                                    .Ancillary
                                                                    .Service
                                                                    .Category
                                                                    .NONE
                                                            )
                                                            .subCategory("sub_category")
                                                            .build()
                                                    )
                                                    .ticketDocumentNumber("ticket_document_number")
                                                    .build()
                                            )
                                            .computerizedReservationSystem(
                                                "computerized_reservation_system"
                                            )
                                            .creditReasonIndicator(
                                                Transaction.Source.CardSettlement.PurchaseDetails
                                                    .Travel
                                                    .CreditReasonIndicator
                                                    .NO_CREDIT
                                            )
                                            .departureDate(LocalDate.parse("2019-12-27"))
                                            .originationCityAirportCode(
                                                "origination_city_airport_code"
                                            )
                                            .passengerName("passenger_name")
                                            .restrictedTicketIndicator(
                                                Transaction.Source.CardSettlement.PurchaseDetails
                                                    .Travel
                                                    .RestrictedTicketIndicator
                                                    .NO_RESTRICTIONS
                                            )
                                            .ticketChangeIndicator(
                                                Transaction.Source.CardSettlement.PurchaseDetails
                                                    .Travel
                                                    .TicketChangeIndicator
                                                    .NONE
                                            )
                                            .ticketNumber("ticket_number")
                                            .travelAgencyCode("travel_agency_code")
                                            .travelAgencyName("travel_agency_name")
                                            .addTripLeg(
                                                Transaction.Source.CardSettlement.PurchaseDetails
                                                    .Travel
                                                    .TripLeg
                                                    .builder()
                                                    .carrierCode("carrier_code")
                                                    .destinationCityAirportCode(
                                                        "destination_city_airport_code"
                                                    )
                                                    .fareBasisCode("fare_basis_code")
                                                    .flightNumber("flight_number")
                                                    .serviceClass("service_class")
                                                    .stopOverCode(
                                                        Transaction.Source.CardSettlement
                                                            .PurchaseDetails
                                                            .Travel
                                                            .TripLeg
                                                            .StopOverCode
                                                            .NONE
                                                    )
                                                    .build()
                                            )
                                            .build()
                                    )
                                    .build()
                            )
                            .addSchemeFee(
                                Transaction.Source.CardSettlement.SchemeFee.builder()
                                    .amount("0.137465")
                                    .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                                    .currency(
                                        Transaction.Source.CardSettlement.SchemeFee.Currency.USD
                                    )
                                    .feeType(
                                        Transaction.Source.CardSettlement.SchemeFee.FeeType
                                            .VISA_CORPORATE_ACCEPTANCE_FEE
                                    )
                                    .fixedComponent(null)
                                    .variableRate("0.0002")
                                    .build()
                            )
                            .surcharge(
                                Transaction.Source.CardSettlement.Surcharge.builder()
                                    .amount(0L)
                                    .presentmentAmount(0L)
                                    .build()
                            )
                            .transactionId("transaction_uyrp7fld2ium70oa7oi")
                            .type(Transaction.Source.CardSettlement.Type.CARD_SETTLEMENT)
                            .build()
                    )
                    .cashbackPayment(
                        Transaction.Source.CashbackPayment.builder()
                            .accruedOnCardId("card_oubs0hwk5rn6knuecxg2")
                            .amount(100L)
                            .currency(Transaction.Source.CashbackPayment.Currency.USD)
                            .periodEnd(OffsetDateTime.parse("2025-06-30T23:59:59+00:00"))
                            .periodStart(OffsetDateTime.parse("2025-06-01T00:00:00+00:00"))
                            .build()
                    )
                    .checkDepositAcceptance(
                        Transaction.Source.CheckDepositAcceptance.builder()
                            .accountNumber("987654321")
                            .amount(1000L)
                            .auxiliaryOnUs("101")
                            .checkDepositId("check_deposit_f06n9gpg7sxn8t19lfc1")
                            .currency(Transaction.Source.CheckDepositAcceptance.Currency.USD)
                            .routingNumber("101050001")
                            .serialNumber(null)
                            .build()
                    )
                    .checkDepositReturn(
                        Transaction.Source.CheckDepositReturn.builder()
                            .amount(100L)
                            .checkDepositId("check_deposit_f06n9gpg7sxn8t19lfc1")
                            .currency(Transaction.Source.CheckDepositReturn.Currency.USD)
                            .returnReason(
                                Transaction.Source.CheckDepositReturn.ReturnReason
                                    .INSUFFICIENT_FUNDS
                            )
                            .returnedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                            .transactionId("transaction_uyrp7fld2ium70oa7oi")
                            .build()
                    )
                    .checkTransferDeposit(
                        Transaction.Source.CheckTransferDeposit.builder()
                            .backImageFileId("file_makxrc67oh9l6sg7w9yc")
                            .bankOfFirstDepositRoutingNumber(null)
                            .depositedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                            .frontImageFileId("file_makxrc67oh9l6sg7w9yc")
                            .inboundCheckDepositId("inbound_check_deposit_zoshvqybq0cjjm31mra")
                            .transactionId("transaction_uyrp7fld2ium70oa7oi")
                            .transferId("check_transfer_30b43acfu9vw8fyc4f5")
                            .type(
                                Transaction.Source.CheckTransferDeposit.Type.CHECK_TRANSFER_DEPOSIT
                            )
                            .build()
                    )
                    .fednowTransferAcknowledgement(
                        Transaction.Source.FednowTransferAcknowledgement.builder()
                            .transferId("fednow_transfer_4i0mptrdu1mueg1196bg")
                            .build()
                    )
                    .feePayment(
                        Transaction.Source.FeePayment.builder()
                            .amount(100L)
                            .currency(Transaction.Source.FeePayment.Currency.USD)
                            .feePeriodStart(LocalDate.parse("2023-05-01"))
                            .programId("program_i2v2os4mwza1oetokh9i")
                            .build()
                    )
                    .inboundAchTransfer(
                        Transaction.Source.InboundAchTransfer.builder()
                            .addenda(
                                Transaction.Source.InboundAchTransfer.Addenda.builder()
                                    .category(
                                        Transaction.Source.InboundAchTransfer.Addenda.Category
                                            .FREEFORM
                                    )
                                    .freeform(
                                        Transaction.Source.InboundAchTransfer.Addenda.Freeform
                                            .builder()
                                            .addEntry(
                                                Transaction.Source.InboundAchTransfer.Addenda
                                                    .Freeform
                                                    .Entry
                                                    .builder()
                                                    .paymentRelatedInformation(
                                                        "payment_related_information"
                                                    )
                                                    .build()
                                            )
                                            .build()
                                    )
                                    .build()
                            )
                            .amount(100L)
                            .originatorCompanyDescriptiveDate(null)
                            .originatorCompanyDiscretionaryData(null)
                            .originatorCompanyEntryDescription("RESERVE")
                            .originatorCompanyId("0987654321")
                            .originatorCompanyName("BIG BANK")
                            .receiverIdNumber("12345678900")
                            .receiverName("IAN CREASE")
                            .traceNumber("021000038461022")
                            .transferId("inbound_ach_transfer_tdrwqr3fq9gnnq49odev")
                            .build()
                    )
                    .inboundAchTransferReturnIntention(
                        Transaction.Source.InboundAchTransferReturnIntention.builder()
                            .inboundAchTransferId("inbound_ach_transfer_tdrwqr3fq9gnnq49odev")
                            .build()
                    )
                    .inboundCheckAdjustment(
                        Transaction.Source.InboundCheckAdjustment.builder()
                            .adjustedTransactionId("transaction_uyrp7fld2ium70oa7oi")
                            .amount(1750L)
                            .reason(Transaction.Source.InboundCheckAdjustment.Reason.LATE_RETURN)
                            .build()
                    )
                    .inboundCheckDepositReturnIntention(
                        Transaction.Source.InboundCheckDepositReturnIntention.builder()
                            .inboundCheckDepositId("inbound_check_deposit_zoshvqybq0cjjm31mra")
                            .transferId("check_transfer_30b43acfu9vw8fyc4f5")
                            .build()
                    )
                    .inboundFednowTransferConfirmation(
                        Transaction.Source.InboundFednowTransferConfirmation.builder()
                            .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20")
                            .build()
                    )
                    .inboundRealTimePaymentsTransferConfirmation(
                        Transaction.Source.InboundRealTimePaymentsTransferConfirmation.builder()
                            .amount(100L)
                            .creditorName("Ian Crease")
                            .currency(
                                Transaction.Source.InboundRealTimePaymentsTransferConfirmation
                                    .Currency
                                    .USD
                            )
                            .debtorAccountNumber("987654321")
                            .debtorName("National Phonograph Company")
                            .debtorRoutingNumber("101050001")
                            .transactionIdentification("20220501234567891T1BSLZO01745013025")
                            .transferId("inbound_real_time_payments_transfer_63hlz498vcxg644hcrzr")
                            .unstructuredRemittanceInformation("Invoice 29582")
                            .build()
                    )
                    .inboundWireReversal(
                        Transaction.Source.InboundWireReversal.builder()
                            .amount(12345L)
                            .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                            .debtorRoutingNumber("101050001")
                            .description("Inbound wire reversal 2022021100335128")
                            .inputCycleDate(LocalDate.parse("2022-02-11"))
                            .inputMessageAccountabilityData("20220211B6B7HU2R011023")
                            .inputSequenceNumber("11023")
                            .inputSource("B6B7HU2R")
                            .instructionIdentification(null)
                            .returnReasonAdditionalInformation(null)
                            .returnReasonCode(null)
                            .returnReasonCodeDescription(null)
                            .transactionId("transaction_uyrp7fld2ium70oa7oi")
                            .wireTransferId("wire_transfer_5akynk7dqsq25qwk9q2u")
                            .build()
                    )
                    .inboundWireTransfer(
                        Transaction.Source.InboundWireTransfer.builder()
                            .amount(100L)
                            .creditorAddressLine1(null)
                            .creditorAddressLine2(null)
                            .creditorAddressLine3(null)
                            .creditorName(null)
                            .debtorAddressLine1(null)
                            .debtorAddressLine2(null)
                            .debtorAddressLine3(null)
                            .debtorName(null)
                            .description("Inbound wire transfer")
                            .endToEndIdentification(null)
                            .inputMessageAccountabilityData(null)
                            .instructingAgentRoutingNumber(null)
                            .instructionIdentification(null)
                            .purpose(null)
                            .transferId("inbound_wire_transfer_f228m6bmhtcxjco9pwp0")
                            .uniqueEndToEndTransactionReference(null)
                            .unstructuredRemittanceInformation(null)
                            .build()
                    )
                    .inboundWireTransferReversal(
                        Transaction.Source.InboundWireTransferReversal.builder()
                            .inboundWireTransferId("inbound_wire_transfer_f228m6bmhtcxjco9pwp0")
                            .build()
                    )
                    .interestPayment(
                        Transaction.Source.InterestPayment.builder()
                            .accruedOnAccountId("account_in71c4amph0vgo2qllky")
                            .amount(100L)
                            .currency(Transaction.Source.InterestPayment.Currency.USD)
                            .periodEnd(OffsetDateTime.parse("2025-06-30T23:59:59+00:00"))
                            .periodStart(OffsetDateTime.parse("2025-06-01T00:00:00+00:00"))
                            .build()
                    )
                    .internalSource(
                        Transaction.Source.InternalSource.builder()
                            .amount(100L)
                            .currency(Transaction.Source.InternalSource.Currency.USD)
                            .reason(Transaction.Source.InternalSource.Reason.SAMPLE_FUNDS)
                            .build()
                    )
                    .other(Transaction.Source.Other.builder().build())
                    .realTimePaymentsTransferAcknowledgement(
                        Transaction.Source.RealTimePaymentsTransferAcknowledgement.builder()
                            .accountNumber("987654321")
                            .amount(100L)
                            .routingNumber("101050001")
                            .transferId("real_time_payments_transfer_iyuhl5kdn7ssmup83mvq")
                            .unstructuredRemittanceInformation("Invoice 29582")
                            .build()
                    )
                    .sampleFunds(
                        Transaction.Source.SampleFunds.builder().originator("dashboard").build()
                    )
                    .swiftTransferIntention(
                        Transaction.Source.SwiftTransferIntention.builder()
                            .transferId("swift_transfer_29h21xkng03788zwd3fh")
                            .build()
                    )
                    .swiftTransferReturn(
                        Transaction.Source.SwiftTransferReturn.builder()
                            .transferId("swift_transfer_29h21xkng03788zwd3fh")
                            .build()
                    )
                    .wireTransferIntention(
                        Transaction.Source.WireTransferIntention.builder()
                            .accountNumber("987654321")
                            .amount(100L)
                            .messageToRecipient("HELLO")
                            .routingNumber("101050001")
                            .transferId("wire_transfer_5akynk7dqsq25qwk9q2u")
                            .build()
                    )
                    .build()
            )
        assertThat(transaction.type()).isEqualTo(Transaction.Type.TRANSACTION)
    }

    @Test
    fun roundtrip() {
        val jsonMapper = jsonMapper()
        val transaction =
            Transaction.builder()
                .id("transaction_uyrp7fld2ium70oa7oi")
                .accountId("account_in71c4amph0vgo2qllky")
                .amount(100L)
                .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                .currency(Transaction.Currency.USD)
                .description("INVOICE 2468")
                .routeId("account_number_v18nkfqm6afpsrvy82b2")
                .routeType(Transaction.RouteType.ACCOUNT_NUMBER)
                .source(
                    Transaction.Source.builder()
                        .category(Transaction.Source.Category.INBOUND_ACH_TRANSFER)
                        .accountRevenuePayment(
                            Transaction.Source.AccountRevenuePayment.builder()
                                .accruedOnAccountId("account_in71c4amph0vgo2qllky")
                                .periodEnd(OffsetDateTime.parse("2025-06-30T23:59:59+00:00"))
                                .periodStart(OffsetDateTime.parse("2025-06-01T00:00:00+00:00"))
                                .build()
                        )
                        .accountTransferIntention(
                            Transaction.Source.AccountTransferIntention.builder()
                                .amount(100L)
                                .currency(Transaction.Source.AccountTransferIntention.Currency.USD)
                                .description("INVOICE 2468")
                                .destinationAccountId("account_uf16sut2ct5bevmq3eh")
                                .sourceAccountId("account_in71c4amph0vgo2qllky")
                                .transferId("account_transfer_7k9qe1ysdgqztnt63l7n")
                                .build()
                        )
                        .achTransferIntention(
                            Transaction.Source.AchTransferIntention.builder()
                                .accountNumber("987654321")
                                .amount(100L)
                                .routingNumber("101050001")
                                .statementDescriptor("INVOICE 2468")
                                .transferId("account_transfer_7k9qe1ysdgqztnt63l7n")
                                .build()
                        )
                        .achTransferRejection(
                            Transaction.Source.AchTransferRejection.builder()
                                .transferId("account_transfer_7k9qe1ysdgqztnt63l7n")
                                .build()
                        )
                        .achTransferReturn(
                            Transaction.Source.AchTransferReturn.builder()
                                .addendaInformation(null)
                                .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                                .rawReturnReasonCode("R01")
                                .returnReasonCode(
                                    Transaction.Source.AchTransferReturn.ReturnReasonCode
                                        .INSUFFICIENT_FUND
                                )
                                .traceNumber("111122223292834")
                                .transactionId("transaction_uyrp7fld2ium70oa7oi")
                                .transferId("ach_transfer_uoxatyh3lt5evrsdvo7q")
                                .build()
                        )
                        .blockchainOfframpTransferSettlement(
                            Transaction.Source.BlockchainOfframpTransferSettlement.builder()
                                .sourceBlockchainAddressId(
                                    "blockchain_address_tijjpqp9t5d358ehydqi"
                                )
                                .transferId("blockchain_offramp_transfer_sqd2x3ti6u2sy91v696m")
                                .build()
                        )
                        .blockchainOnrampTransferIntention(
                            Transaction.Source.BlockchainOnrampTransferIntention.builder()
                                .destinationBlockchainAddress("0xaabbccdd")
                                .transferId("blockchain_onramp_transfer_sg8nzy569rk0dnfk28bv")
                                .build()
                        )
                        .cardDisputeAcceptance(
                            Transaction.Source.CardDisputeAcceptance.builder()
                                .acceptedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                                .transactionId("transaction_uyrp7fld2ium70oa7oi")
                                .build()
                        )
                        .cardDisputeFinancial(
                            Transaction.Source.CardDisputeFinancial.builder()
                                .amount(1000L)
                                .network(Transaction.Source.CardDisputeFinancial.Network.VISA)
                                .transactionId("transaction_uyrp7fld2ium70oa7oi")
                                .visa(
                                    Transaction.Source.CardDisputeFinancial.Visa.builder()
                                        .eventType(
                                            Transaction.Source.CardDisputeFinancial.Visa.EventType
                                                .CHARGEBACK_SUBMITTED
                                        )
                                        .build()
                                )
                                .build()
                        )
                        .cardDisputeLoss(
                            Transaction.Source.CardDisputeLoss.builder()
                                .explanation("The card dispute was lost.")
                                .lostAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                                .transactionId("transaction_uyrp7fld2ium70oa7oi")
                                .build()
                        )
                        .cardFinancial(
                            Transaction.Source.CardFinancial.builder()
                                .id("card_financial_di5b98i72ppomo268zfk")
                                .actioner(Transaction.Source.CardFinancial.Actioner.INCREASE)
                                .additionalAmounts(
                                    Transaction.Source.CardFinancial.AdditionalAmounts.builder()
                                        .clinic(
                                            Transaction.Source.CardFinancial.AdditionalAmounts
                                                .Clinic
                                                .builder()
                                                .amount(0L)
                                                .currency("currency")
                                                .build()
                                        )
                                        .dental(
                                            Transaction.Source.CardFinancial.AdditionalAmounts
                                                .Dental
                                                .builder()
                                                .amount(0L)
                                                .currency("currency")
                                                .build()
                                        )
                                        .original(
                                            Transaction.Source.CardFinancial.AdditionalAmounts
                                                .Original
                                                .builder()
                                                .amount(0L)
                                                .currency("currency")
                                                .build()
                                        )
                                        .prescription(
                                            Transaction.Source.CardFinancial.AdditionalAmounts
                                                .Prescription
                                                .builder()
                                                .amount(0L)
                                                .currency("currency")
                                                .build()
                                        )
                                        .surcharge(
                                            Transaction.Source.CardFinancial.AdditionalAmounts
                                                .Surcharge
                                                .builder()
                                                .amount(10L)
                                                .currency("USD")
                                                .build()
                                        )
                                        .totalCumulative(
                                            Transaction.Source.CardFinancial.AdditionalAmounts
                                                .TotalCumulative
                                                .builder()
                                                .amount(0L)
                                                .currency("currency")
                                                .build()
                                        )
                                        .totalHealthcare(
                                            Transaction.Source.CardFinancial.AdditionalAmounts
                                                .TotalHealthcare
                                                .builder()
                                                .amount(0L)
                                                .currency("currency")
                                                .build()
                                        )
                                        .transit(
                                            Transaction.Source.CardFinancial.AdditionalAmounts
                                                .Transit
                                                .builder()
                                                .amount(0L)
                                                .currency("currency")
                                                .build()
                                        )
                                        .unknown(
                                            Transaction.Source.CardFinancial.AdditionalAmounts
                                                .Unknown
                                                .builder()
                                                .amount(0L)
                                                .currency("currency")
                                                .build()
                                        )
                                        .vision(
                                            Transaction.Source.CardFinancial.AdditionalAmounts
                                                .Vision
                                                .builder()
                                                .amount(0L)
                                                .currency("currency")
                                                .build()
                                        )
                                        .build()
                                )
                                .amount(100L)
                                .cardPaymentId("card_payment_nd3k2kacrqjli8482ave")
                                .currency(Transaction.Source.CardFinancial.Currency.USD)
                                .digitalWalletTokenId(null)
                                .direction(Transaction.Source.CardFinancial.Direction.SETTLEMENT)
                                .merchantAcceptorId("5665270011000168")
                                .merchantCategoryCode("5734")
                                .merchantCity("New York")
                                .merchantCountry("US")
                                .merchantDescriptor("AMAZON.COM")
                                .merchantPostalCode("10045")
                                .merchantState("NY")
                                .networkDetails(
                                    Transaction.Source.CardFinancial.NetworkDetails.builder()
                                        .category(
                                            Transaction.Source.CardFinancial.NetworkDetails.Category
                                                .VISA
                                        )
                                        .pulse(
                                            Transaction.Source.CardFinancial.NetworkDetails.Pulse
                                                .builder()
                                                .build()
                                        )
                                        .visa(
                                            Transaction.Source.CardFinancial.NetworkDetails.Visa
                                                .builder()
                                                .electronicCommerceIndicator(
                                                    Transaction.Source.CardFinancial.NetworkDetails
                                                        .Visa
                                                        .ElectronicCommerceIndicator
                                                        .SECURE_ELECTRONIC_COMMERCE
                                                )
                                                .pointOfServiceEntryMode(
                                                    Transaction.Source.CardFinancial.NetworkDetails
                                                        .Visa
                                                        .PointOfServiceEntryMode
                                                        .MANUAL
                                                )
                                                .standInProcessingReason(null)
                                                .terminalEntryCapability(
                                                    Transaction.Source.CardFinancial.NetworkDetails
                                                        .Visa
                                                        .TerminalEntryCapability
                                                        .MAGNETIC_STRIPE
                                                )
                                                .build()
                                        )
                                        .build()
                                )
                                .networkIdentifiers(
                                    Transaction.Source.CardFinancial.NetworkIdentifiers.builder()
                                        .authorizationIdentificationResponse(null)
                                        .retrievalReferenceNumber("785867080153")
                                        .traceNumber("487941")
                                        .transactionId("627199945183184")
                                        .build()
                                )
                                .networkRiskScore(10L)
                                .physicalCardId(null)
                                .presentmentAmount(100L)
                                .presentmentCurrency("USD")
                                .processingCategory(
                                    Transaction.Source.CardFinancial.ProcessingCategory.PURCHASE
                                )
                                .realTimeDecisionId(null)
                                .addSchemeFee(
                                    Transaction.Source.CardFinancial.SchemeFee.builder()
                                        .amount("0.137465")
                                        .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                                        .currency(
                                            Transaction.Source.CardFinancial.SchemeFee.Currency.USD
                                        )
                                        .feeType(
                                            Transaction.Source.CardFinancial.SchemeFee.FeeType
                                                .VISA_CORPORATE_ACCEPTANCE_FEE
                                        )
                                        .fixedComponent(null)
                                        .variableRate("0.0002")
                                        .build()
                                )
                                .terminalId("RCN5VNXS")
                                .transactionId("transaction_uyrp7fld2ium70oa7oi")
                                .type(Transaction.Source.CardFinancial.Type.CARD_FINANCIAL)
                                .verification(
                                    Transaction.Source.CardFinancial.Verification.builder()
                                        .cardVerificationCode(
                                            Transaction.Source.CardFinancial.Verification
                                                .CardVerificationCode
                                                .builder()
                                                .result(
                                                    Transaction.Source.CardFinancial.Verification
                                                        .CardVerificationCode
                                                        .Result
                                                        .MATCH
                                                )
                                                .build()
                                        )
                                        .cardholderAddress(
                                            Transaction.Source.CardFinancial.Verification
                                                .CardholderAddress
                                                .builder()
                                                .actualLine1("33 Liberty Street")
                                                .actualPostalCode("94131")
                                                .providedLine1("33 Liberty Street")
                                                .providedPostalCode("94132")
                                                .result(
                                                    Transaction.Source.CardFinancial.Verification
                                                        .CardholderAddress
                                                        .Result
                                                        .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH
                                                )
                                                .build()
                                        )
                                        .cardholderName(
                                            Transaction.Source.CardFinancial.Verification
                                                .CardholderName
                                                .builder()
                                                .providedFirstName("provided_first_name")
                                                .providedLastName("provided_last_name")
                                                .providedMiddleName("provided_middle_name")
                                                .build()
                                        )
                                        .build()
                                )
                                .build()
                        )
                        .cardPushTransferAcceptance(
                            Transaction.Source.CardPushTransferAcceptance.builder()
                                .settlementAmount(100L)
                                .transferId("outbound_card_push_transfer_e0z9rdpamraczh4tvwye")
                                .build()
                        )
                        .cardRefund(
                            Transaction.Source.CardRefund.builder()
                                .id("card_refund_imgc2xwplh6t4r3gn16e")
                                .amount(100L)
                                .cardPaymentId("card_payment_nd3k2kacrqjli8482ave")
                                .cashback(
                                    Transaction.Source.CardRefund.Cashback.builder()
                                        .amount("0.137465")
                                        .currency(
                                            Transaction.Source.CardRefund.Cashback.Currency.USD
                                        )
                                        .build()
                                )
                                .currency(Transaction.Source.CardRefund.Currency.USD)
                                .interchange(
                                    Transaction.Source.CardRefund.Interchange.builder()
                                        .amount("0.137465")
                                        .code("271")
                                        .currency(
                                            Transaction.Source.CardRefund.Interchange.Currency.USD
                                        )
                                        .build()
                                )
                                .merchantAcceptorId("5665270011000168")
                                .merchantCategoryCode("5734")
                                .merchantCity("New York")
                                .merchantCountry("US")
                                .merchantName("AMAZON.COM")
                                .merchantPostalCode("10045")
                                .merchantState("NY")
                                .networkIdentifiers(
                                    Transaction.Source.CardRefund.NetworkIdentifiers.builder()
                                        .acquirerBusinessId("69650702")
                                        .acquirerReferenceNumber("83163715445437604865089")
                                        .authorizationIdentificationResponse("ABC123")
                                        .transactionId("627199945183184")
                                        .build()
                                )
                                .presentmentAmount(100L)
                                .presentmentCurrency("USD")
                                .purchaseDetails(
                                    Transaction.Source.CardRefund.PurchaseDetails.builder()
                                        .carRental(
                                            Transaction.Source.CardRefund.PurchaseDetails.CarRental
                                                .builder()
                                                .carClassCode("car_class_code")
                                                .checkoutDate(LocalDate.parse("2019-12-27"))
                                                .dailyRentalRateAmount(0L)
                                                .dailyRentalRateCurrency(
                                                    "daily_rental_rate_currency"
                                                )
                                                .daysRented(0L)
                                                .extraCharges(
                                                    Transaction.Source.CardRefund.PurchaseDetails
                                                        .CarRental
                                                        .ExtraCharges
                                                        .NO_EXTRA_CHARGE
                                                )
                                                .fuelChargesAmount(0L)
                                                .fuelChargesCurrency("fuel_charges_currency")
                                                .insuranceChargesAmount(0L)
                                                .insuranceChargesCurrency(
                                                    "insurance_charges_currency"
                                                )
                                                .noShowIndicator(
                                                    Transaction.Source.CardRefund.PurchaseDetails
                                                        .CarRental
                                                        .NoShowIndicator
                                                        .NOT_APPLICABLE
                                                )
                                                .oneWayDropOffChargesAmount(0L)
                                                .oneWayDropOffChargesCurrency(
                                                    "one_way_drop_off_charges_currency"
                                                )
                                                .renterName("renter_name")
                                                .weeklyRentalRateAmount(0L)
                                                .weeklyRentalRateCurrency(
                                                    "weekly_rental_rate_currency"
                                                )
                                                .build()
                                        )
                                        .customerReferenceIdentifier("51201")
                                        .localTaxAmount(null)
                                        .localTaxCurrency("usd")
                                        .lodging(
                                            Transaction.Source.CardRefund.PurchaseDetails.Lodging
                                                .builder()
                                                .checkInDate(LocalDate.parse("2023-07-20"))
                                                .dailyRoomRateAmount(1000L)
                                                .dailyRoomRateCurrency("usd")
                                                .extraCharges(
                                                    Transaction.Source.CardRefund.PurchaseDetails
                                                        .Lodging
                                                        .ExtraCharges
                                                        .RESTAURANT
                                                )
                                                .folioCashAdvancesAmount(0L)
                                                .folioCashAdvancesCurrency("usd")
                                                .foodBeverageChargesAmount(0L)
                                                .foodBeverageChargesCurrency("usd")
                                                .noShowIndicator(
                                                    Transaction.Source.CardRefund.PurchaseDetails
                                                        .Lodging
                                                        .NoShowIndicator
                                                        .NO_SHOW
                                                )
                                                .prepaidExpensesAmount(0L)
                                                .prepaidExpensesCurrency("usd")
                                                .roomNights(1L)
                                                .totalRoomTaxAmount(100L)
                                                .totalRoomTaxCurrency("usd")
                                                .totalTaxAmount(100L)
                                                .totalTaxCurrency("usd")
                                                .build()
                                        )
                                        .nationalTaxAmount(null)
                                        .nationalTaxCurrency("usd")
                                        .purchaseIdentifier("10203")
                                        .purchaseIdentifierFormat(
                                            Transaction.Source.CardRefund.PurchaseDetails
                                                .PurchaseIdentifierFormat
                                                .ORDER_NUMBER
                                        )
                                        .travel(
                                            Transaction.Source.CardRefund.PurchaseDetails.Travel
                                                .builder()
                                                .ancillary(
                                                    Transaction.Source.CardRefund.PurchaseDetails
                                                        .Travel
                                                        .Ancillary
                                                        .builder()
                                                        .connectedTicketDocumentNumber(
                                                            "connected_ticket_document_number"
                                                        )
                                                        .creditReasonIndicator(
                                                            Transaction.Source.CardRefund
                                                                .PurchaseDetails
                                                                .Travel
                                                                .Ancillary
                                                                .CreditReasonIndicator
                                                                .NO_CREDIT
                                                        )
                                                        .passengerNameOrDescription(
                                                            "passenger_name_or_description"
                                                        )
                                                        .addService(
                                                            Transaction.Source.CardRefund
                                                                .PurchaseDetails
                                                                .Travel
                                                                .Ancillary
                                                                .Service
                                                                .builder()
                                                                .category(
                                                                    Transaction.Source.CardRefund
                                                                        .PurchaseDetails
                                                                        .Travel
                                                                        .Ancillary
                                                                        .Service
                                                                        .Category
                                                                        .NONE
                                                                )
                                                                .subCategory("sub_category")
                                                                .build()
                                                        )
                                                        .ticketDocumentNumber(
                                                            "ticket_document_number"
                                                        )
                                                        .build()
                                                )
                                                .computerizedReservationSystem(
                                                    "computerized_reservation_system"
                                                )
                                                .creditReasonIndicator(
                                                    Transaction.Source.CardRefund.PurchaseDetails
                                                        .Travel
                                                        .CreditReasonIndicator
                                                        .NO_CREDIT
                                                )
                                                .departureDate(LocalDate.parse("2019-12-27"))
                                                .originationCityAirportCode(
                                                    "origination_city_airport_code"
                                                )
                                                .passengerName("passenger_name")
                                                .restrictedTicketIndicator(
                                                    Transaction.Source.CardRefund.PurchaseDetails
                                                        .Travel
                                                        .RestrictedTicketIndicator
                                                        .NO_RESTRICTIONS
                                                )
                                                .ticketChangeIndicator(
                                                    Transaction.Source.CardRefund.PurchaseDetails
                                                        .Travel
                                                        .TicketChangeIndicator
                                                        .NONE
                                                )
                                                .ticketNumber("ticket_number")
                                                .travelAgencyCode("travel_agency_code")
                                                .travelAgencyName("travel_agency_name")
                                                .addTripLeg(
                                                    Transaction.Source.CardRefund.PurchaseDetails
                                                        .Travel
                                                        .TripLeg
                                                        .builder()
                                                        .carrierCode("carrier_code")
                                                        .destinationCityAirportCode(
                                                            "destination_city_airport_code"
                                                        )
                                                        .fareBasisCode("fare_basis_code")
                                                        .flightNumber("flight_number")
                                                        .serviceClass("service_class")
                                                        .stopOverCode(
                                                            Transaction.Source.CardRefund
                                                                .PurchaseDetails
                                                                .Travel
                                                                .TripLeg
                                                                .StopOverCode
                                                                .NONE
                                                        )
                                                        .build()
                                                )
                                                .build()
                                        )
                                        .build()
                                )
                                .addSchemeFee(
                                    Transaction.Source.CardRefund.SchemeFee.builder()
                                        .amount("0.137465")
                                        .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                                        .currency(
                                            Transaction.Source.CardRefund.SchemeFee.Currency.USD
                                        )
                                        .feeType(
                                            Transaction.Source.CardRefund.SchemeFee.FeeType
                                                .VISA_CORPORATE_ACCEPTANCE_FEE
                                        )
                                        .fixedComponent(null)
                                        .variableRate("0.0002")
                                        .build()
                                )
                                .transactionId("transaction_uyrp7fld2ium70oa7oi")
                                .type(Transaction.Source.CardRefund.Type.CARD_REFUND)
                                .build()
                        )
                        .cardRevenuePayment(
                            Transaction.Source.CardRevenuePayment.builder()
                                .amount(100L)
                                .currency(Transaction.Source.CardRevenuePayment.Currency.USD)
                                .periodEnd(OffsetDateTime.parse("2025-06-30T23:59:59+00:00"))
                                .periodStart(OffsetDateTime.parse("2025-06-01T00:00:00+00:00"))
                                .transactedOnAccountId("account_in71c4amph0vgo2qllky")
                                .build()
                        )
                        .cardSettlement(
                            Transaction.Source.CardSettlement.builder()
                                .id("card_settlement_khv5kfeu0vndj291omg6")
                                .amount(100L)
                                .cardAuthorization(null)
                                .cardPaymentId("card_payment_nd3k2kacrqjli8482ave")
                                .cashback(
                                    Transaction.Source.CardSettlement.Cashback.builder()
                                        .amount("0.137465")
                                        .currency(
                                            Transaction.Source.CardSettlement.Cashback.Currency.USD
                                        )
                                        .build()
                                )
                                .currency(Transaction.Source.CardSettlement.Currency.USD)
                                .interchange(
                                    Transaction.Source.CardSettlement.Interchange.builder()
                                        .amount("0.137465")
                                        .code("271")
                                        .currency(
                                            Transaction.Source.CardSettlement.Interchange.Currency
                                                .USD
                                        )
                                        .build()
                                )
                                .merchantAcceptorId("5665270011000168")
                                .merchantCategoryCode("5734")
                                .merchantCity("New York")
                                .merchantCountry("US")
                                .merchantName("AMAZON.COM")
                                .merchantPostalCode("10045")
                                .merchantState("NY")
                                .network(Transaction.Source.CardSettlement.Network.VISA)
                                .networkIdentifiers(
                                    Transaction.Source.CardSettlement.NetworkIdentifiers.builder()
                                        .acquirerBusinessId("69650702")
                                        .acquirerReferenceNumber("83163715445437604865089")
                                        .authorizationIdentificationResponse("ABC123")
                                        .transactionId("627199945183184")
                                        .build()
                                )
                                .pendingTransactionId(null)
                                .presentmentAmount(100L)
                                .presentmentCurrency("USD")
                                .purchaseDetails(
                                    Transaction.Source.CardSettlement.PurchaseDetails.builder()
                                        .carRental(
                                            Transaction.Source.CardSettlement.PurchaseDetails
                                                .CarRental
                                                .builder()
                                                .carClassCode("car_class_code")
                                                .checkoutDate(LocalDate.parse("2019-12-27"))
                                                .dailyRentalRateAmount(0L)
                                                .dailyRentalRateCurrency(
                                                    "daily_rental_rate_currency"
                                                )
                                                .daysRented(0L)
                                                .extraCharges(
                                                    Transaction.Source.CardSettlement
                                                        .PurchaseDetails
                                                        .CarRental
                                                        .ExtraCharges
                                                        .NO_EXTRA_CHARGE
                                                )
                                                .fuelChargesAmount(0L)
                                                .fuelChargesCurrency("fuel_charges_currency")
                                                .insuranceChargesAmount(0L)
                                                .insuranceChargesCurrency(
                                                    "insurance_charges_currency"
                                                )
                                                .noShowIndicator(
                                                    Transaction.Source.CardSettlement
                                                        .PurchaseDetails
                                                        .CarRental
                                                        .NoShowIndicator
                                                        .NOT_APPLICABLE
                                                )
                                                .oneWayDropOffChargesAmount(0L)
                                                .oneWayDropOffChargesCurrency(
                                                    "one_way_drop_off_charges_currency"
                                                )
                                                .renterName("renter_name")
                                                .weeklyRentalRateAmount(0L)
                                                .weeklyRentalRateCurrency(
                                                    "weekly_rental_rate_currency"
                                                )
                                                .build()
                                        )
                                        .customerReferenceIdentifier("51201")
                                        .localTaxAmount(null)
                                        .localTaxCurrency("usd")
                                        .lodging(
                                            Transaction.Source.CardSettlement.PurchaseDetails
                                                .Lodging
                                                .builder()
                                                .checkInDate(LocalDate.parse("2023-07-20"))
                                                .dailyRoomRateAmount(1000L)
                                                .dailyRoomRateCurrency("usd")
                                                .extraCharges(
                                                    Transaction.Source.CardSettlement
                                                        .PurchaseDetails
                                                        .Lodging
                                                        .ExtraCharges
                                                        .RESTAURANT
                                                )
                                                .folioCashAdvancesAmount(0L)
                                                .folioCashAdvancesCurrency("usd")
                                                .foodBeverageChargesAmount(0L)
                                                .foodBeverageChargesCurrency("usd")
                                                .noShowIndicator(
                                                    Transaction.Source.CardSettlement
                                                        .PurchaseDetails
                                                        .Lodging
                                                        .NoShowIndicator
                                                        .NO_SHOW
                                                )
                                                .prepaidExpensesAmount(0L)
                                                .prepaidExpensesCurrency("usd")
                                                .roomNights(1L)
                                                .totalRoomTaxAmount(100L)
                                                .totalRoomTaxCurrency("usd")
                                                .totalTaxAmount(100L)
                                                .totalTaxCurrency("usd")
                                                .build()
                                        )
                                        .nationalTaxAmount(null)
                                        .nationalTaxCurrency("usd")
                                        .purchaseIdentifier("10203")
                                        .purchaseIdentifierFormat(
                                            Transaction.Source.CardSettlement.PurchaseDetails
                                                .PurchaseIdentifierFormat
                                                .ORDER_NUMBER
                                        )
                                        .travel(
                                            Transaction.Source.CardSettlement.PurchaseDetails.Travel
                                                .builder()
                                                .ancillary(
                                                    Transaction.Source.CardSettlement
                                                        .PurchaseDetails
                                                        .Travel
                                                        .Ancillary
                                                        .builder()
                                                        .connectedTicketDocumentNumber(
                                                            "connected_ticket_document_number"
                                                        )
                                                        .creditReasonIndicator(
                                                            Transaction.Source.CardSettlement
                                                                .PurchaseDetails
                                                                .Travel
                                                                .Ancillary
                                                                .CreditReasonIndicator
                                                                .NO_CREDIT
                                                        )
                                                        .passengerNameOrDescription(
                                                            "passenger_name_or_description"
                                                        )
                                                        .addService(
                                                            Transaction.Source.CardSettlement
                                                                .PurchaseDetails
                                                                .Travel
                                                                .Ancillary
                                                                .Service
                                                                .builder()
                                                                .category(
                                                                    Transaction.Source
                                                                        .CardSettlement
                                                                        .PurchaseDetails
                                                                        .Travel
                                                                        .Ancillary
                                                                        .Service
                                                                        .Category
                                                                        .NONE
                                                                )
                                                                .subCategory("sub_category")
                                                                .build()
                                                        )
                                                        .ticketDocumentNumber(
                                                            "ticket_document_number"
                                                        )
                                                        .build()
                                                )
                                                .computerizedReservationSystem(
                                                    "computerized_reservation_system"
                                                )
                                                .creditReasonIndicator(
                                                    Transaction.Source.CardSettlement
                                                        .PurchaseDetails
                                                        .Travel
                                                        .CreditReasonIndicator
                                                        .NO_CREDIT
                                                )
                                                .departureDate(LocalDate.parse("2019-12-27"))
                                                .originationCityAirportCode(
                                                    "origination_city_airport_code"
                                                )
                                                .passengerName("passenger_name")
                                                .restrictedTicketIndicator(
                                                    Transaction.Source.CardSettlement
                                                        .PurchaseDetails
                                                        .Travel
                                                        .RestrictedTicketIndicator
                                                        .NO_RESTRICTIONS
                                                )
                                                .ticketChangeIndicator(
                                                    Transaction.Source.CardSettlement
                                                        .PurchaseDetails
                                                        .Travel
                                                        .TicketChangeIndicator
                                                        .NONE
                                                )
                                                .ticketNumber("ticket_number")
                                                .travelAgencyCode("travel_agency_code")
                                                .travelAgencyName("travel_agency_name")
                                                .addTripLeg(
                                                    Transaction.Source.CardSettlement
                                                        .PurchaseDetails
                                                        .Travel
                                                        .TripLeg
                                                        .builder()
                                                        .carrierCode("carrier_code")
                                                        .destinationCityAirportCode(
                                                            "destination_city_airport_code"
                                                        )
                                                        .fareBasisCode("fare_basis_code")
                                                        .flightNumber("flight_number")
                                                        .serviceClass("service_class")
                                                        .stopOverCode(
                                                            Transaction.Source.CardSettlement
                                                                .PurchaseDetails
                                                                .Travel
                                                                .TripLeg
                                                                .StopOverCode
                                                                .NONE
                                                        )
                                                        .build()
                                                )
                                                .build()
                                        )
                                        .build()
                                )
                                .addSchemeFee(
                                    Transaction.Source.CardSettlement.SchemeFee.builder()
                                        .amount("0.137465")
                                        .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                                        .currency(
                                            Transaction.Source.CardSettlement.SchemeFee.Currency.USD
                                        )
                                        .feeType(
                                            Transaction.Source.CardSettlement.SchemeFee.FeeType
                                                .VISA_CORPORATE_ACCEPTANCE_FEE
                                        )
                                        .fixedComponent(null)
                                        .variableRate("0.0002")
                                        .build()
                                )
                                .surcharge(
                                    Transaction.Source.CardSettlement.Surcharge.builder()
                                        .amount(0L)
                                        .presentmentAmount(0L)
                                        .build()
                                )
                                .transactionId("transaction_uyrp7fld2ium70oa7oi")
                                .type(Transaction.Source.CardSettlement.Type.CARD_SETTLEMENT)
                                .build()
                        )
                        .cashbackPayment(
                            Transaction.Source.CashbackPayment.builder()
                                .accruedOnCardId("card_oubs0hwk5rn6knuecxg2")
                                .amount(100L)
                                .currency(Transaction.Source.CashbackPayment.Currency.USD)
                                .periodEnd(OffsetDateTime.parse("2025-06-30T23:59:59+00:00"))
                                .periodStart(OffsetDateTime.parse("2025-06-01T00:00:00+00:00"))
                                .build()
                        )
                        .checkDepositAcceptance(
                            Transaction.Source.CheckDepositAcceptance.builder()
                                .accountNumber("987654321")
                                .amount(1000L)
                                .auxiliaryOnUs("101")
                                .checkDepositId("check_deposit_f06n9gpg7sxn8t19lfc1")
                                .currency(Transaction.Source.CheckDepositAcceptance.Currency.USD)
                                .routingNumber("101050001")
                                .serialNumber(null)
                                .build()
                        )
                        .checkDepositReturn(
                            Transaction.Source.CheckDepositReturn.builder()
                                .amount(100L)
                                .checkDepositId("check_deposit_f06n9gpg7sxn8t19lfc1")
                                .currency(Transaction.Source.CheckDepositReturn.Currency.USD)
                                .returnReason(
                                    Transaction.Source.CheckDepositReturn.ReturnReason
                                        .INSUFFICIENT_FUNDS
                                )
                                .returnedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                                .transactionId("transaction_uyrp7fld2ium70oa7oi")
                                .build()
                        )
                        .checkTransferDeposit(
                            Transaction.Source.CheckTransferDeposit.builder()
                                .backImageFileId("file_makxrc67oh9l6sg7w9yc")
                                .bankOfFirstDepositRoutingNumber(null)
                                .depositedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                                .frontImageFileId("file_makxrc67oh9l6sg7w9yc")
                                .inboundCheckDepositId("inbound_check_deposit_zoshvqybq0cjjm31mra")
                                .transactionId("transaction_uyrp7fld2ium70oa7oi")
                                .transferId("check_transfer_30b43acfu9vw8fyc4f5")
                                .type(
                                    Transaction.Source.CheckTransferDeposit.Type
                                        .CHECK_TRANSFER_DEPOSIT
                                )
                                .build()
                        )
                        .fednowTransferAcknowledgement(
                            Transaction.Source.FednowTransferAcknowledgement.builder()
                                .transferId("fednow_transfer_4i0mptrdu1mueg1196bg")
                                .build()
                        )
                        .feePayment(
                            Transaction.Source.FeePayment.builder()
                                .amount(100L)
                                .currency(Transaction.Source.FeePayment.Currency.USD)
                                .feePeriodStart(LocalDate.parse("2023-05-01"))
                                .programId("program_i2v2os4mwza1oetokh9i")
                                .build()
                        )
                        .inboundAchTransfer(
                            Transaction.Source.InboundAchTransfer.builder()
                                .addenda(
                                    Transaction.Source.InboundAchTransfer.Addenda.builder()
                                        .category(
                                            Transaction.Source.InboundAchTransfer.Addenda.Category
                                                .FREEFORM
                                        )
                                        .freeform(
                                            Transaction.Source.InboundAchTransfer.Addenda.Freeform
                                                .builder()
                                                .addEntry(
                                                    Transaction.Source.InboundAchTransfer.Addenda
                                                        .Freeform
                                                        .Entry
                                                        .builder()
                                                        .paymentRelatedInformation(
                                                            "payment_related_information"
                                                        )
                                                        .build()
                                                )
                                                .build()
                                        )
                                        .build()
                                )
                                .amount(100L)
                                .originatorCompanyDescriptiveDate(null)
                                .originatorCompanyDiscretionaryData(null)
                                .originatorCompanyEntryDescription("RESERVE")
                                .originatorCompanyId("0987654321")
                                .originatorCompanyName("BIG BANK")
                                .receiverIdNumber("12345678900")
                                .receiverName("IAN CREASE")
                                .traceNumber("021000038461022")
                                .transferId("inbound_ach_transfer_tdrwqr3fq9gnnq49odev")
                                .build()
                        )
                        .inboundAchTransferReturnIntention(
                            Transaction.Source.InboundAchTransferReturnIntention.builder()
                                .inboundAchTransferId("inbound_ach_transfer_tdrwqr3fq9gnnq49odev")
                                .build()
                        )
                        .inboundCheckAdjustment(
                            Transaction.Source.InboundCheckAdjustment.builder()
                                .adjustedTransactionId("transaction_uyrp7fld2ium70oa7oi")
                                .amount(1750L)
                                .reason(
                                    Transaction.Source.InboundCheckAdjustment.Reason.LATE_RETURN
                                )
                                .build()
                        )
                        .inboundCheckDepositReturnIntention(
                            Transaction.Source.InboundCheckDepositReturnIntention.builder()
                                .inboundCheckDepositId("inbound_check_deposit_zoshvqybq0cjjm31mra")
                                .transferId("check_transfer_30b43acfu9vw8fyc4f5")
                                .build()
                        )
                        .inboundFednowTransferConfirmation(
                            Transaction.Source.InboundFednowTransferConfirmation.builder()
                                .transferId("inbound_fednow_transfer_ctxxbc07oh5ke5w1hk20")
                                .build()
                        )
                        .inboundRealTimePaymentsTransferConfirmation(
                            Transaction.Source.InboundRealTimePaymentsTransferConfirmation.builder()
                                .amount(100L)
                                .creditorName("Ian Crease")
                                .currency(
                                    Transaction.Source.InboundRealTimePaymentsTransferConfirmation
                                        .Currency
                                        .USD
                                )
                                .debtorAccountNumber("987654321")
                                .debtorName("National Phonograph Company")
                                .debtorRoutingNumber("101050001")
                                .transactionIdentification("20220501234567891T1BSLZO01745013025")
                                .transferId(
                                    "inbound_real_time_payments_transfer_63hlz498vcxg644hcrzr"
                                )
                                .unstructuredRemittanceInformation("Invoice 29582")
                                .build()
                        )
                        .inboundWireReversal(
                            Transaction.Source.InboundWireReversal.builder()
                                .amount(12345L)
                                .createdAt(OffsetDateTime.parse("2020-01-31T23:59:59Z"))
                                .debtorRoutingNumber("101050001")
                                .description("Inbound wire reversal 2022021100335128")
                                .inputCycleDate(LocalDate.parse("2022-02-11"))
                                .inputMessageAccountabilityData("20220211B6B7HU2R011023")
                                .inputSequenceNumber("11023")
                                .inputSource("B6B7HU2R")
                                .instructionIdentification(null)
                                .returnReasonAdditionalInformation(null)
                                .returnReasonCode(null)
                                .returnReasonCodeDescription(null)
                                .transactionId("transaction_uyrp7fld2ium70oa7oi")
                                .wireTransferId("wire_transfer_5akynk7dqsq25qwk9q2u")
                                .build()
                        )
                        .inboundWireTransfer(
                            Transaction.Source.InboundWireTransfer.builder()
                                .amount(100L)
                                .creditorAddressLine1(null)
                                .creditorAddressLine2(null)
                                .creditorAddressLine3(null)
                                .creditorName(null)
                                .debtorAddressLine1(null)
                                .debtorAddressLine2(null)
                                .debtorAddressLine3(null)
                                .debtorName(null)
                                .description("Inbound wire transfer")
                                .endToEndIdentification(null)
                                .inputMessageAccountabilityData(null)
                                .instructingAgentRoutingNumber(null)
                                .instructionIdentification(null)
                                .purpose(null)
                                .transferId("inbound_wire_transfer_f228m6bmhtcxjco9pwp0")
                                .uniqueEndToEndTransactionReference(null)
                                .unstructuredRemittanceInformation(null)
                                .build()
                        )
                        .inboundWireTransferReversal(
                            Transaction.Source.InboundWireTransferReversal.builder()
                                .inboundWireTransferId("inbound_wire_transfer_f228m6bmhtcxjco9pwp0")
                                .build()
                        )
                        .interestPayment(
                            Transaction.Source.InterestPayment.builder()
                                .accruedOnAccountId("account_in71c4amph0vgo2qllky")
                                .amount(100L)
                                .currency(Transaction.Source.InterestPayment.Currency.USD)
                                .periodEnd(OffsetDateTime.parse("2025-06-30T23:59:59+00:00"))
                                .periodStart(OffsetDateTime.parse("2025-06-01T00:00:00+00:00"))
                                .build()
                        )
                        .internalSource(
                            Transaction.Source.InternalSource.builder()
                                .amount(100L)
                                .currency(Transaction.Source.InternalSource.Currency.USD)
                                .reason(Transaction.Source.InternalSource.Reason.SAMPLE_FUNDS)
                                .build()
                        )
                        .other(Transaction.Source.Other.builder().build())
                        .realTimePaymentsTransferAcknowledgement(
                            Transaction.Source.RealTimePaymentsTransferAcknowledgement.builder()
                                .accountNumber("987654321")
                                .amount(100L)
                                .routingNumber("101050001")
                                .transferId("real_time_payments_transfer_iyuhl5kdn7ssmup83mvq")
                                .unstructuredRemittanceInformation("Invoice 29582")
                                .build()
                        )
                        .sampleFunds(
                            Transaction.Source.SampleFunds.builder().originator("dashboard").build()
                        )
                        .swiftTransferIntention(
                            Transaction.Source.SwiftTransferIntention.builder()
                                .transferId("swift_transfer_29h21xkng03788zwd3fh")
                                .build()
                        )
                        .swiftTransferReturn(
                            Transaction.Source.SwiftTransferReturn.builder()
                                .transferId("swift_transfer_29h21xkng03788zwd3fh")
                                .build()
                        )
                        .wireTransferIntention(
                            Transaction.Source.WireTransferIntention.builder()
                                .accountNumber("987654321")
                                .amount(100L)
                                .messageToRecipient("HELLO")
                                .routingNumber("101050001")
                                .transferId("wire_transfer_5akynk7dqsq25qwk9q2u")
                                .build()
                        )
                        .build()
                )
                .type(Transaction.Type.TRANSACTION)
                .build()

        val roundtrippedTransaction =
            jsonMapper.readValue(
                jsonMapper.writeValueAsString(transaction),
                jacksonTypeRef<Transaction>(),
            )

        assertThat(roundtrippedTransaction).isEqualTo(transaction)
    }
}
