diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 3de0600fe..3c933c245 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.437.0" + ".": "0.438.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index e7b826e77..8a9805b70 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 232 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-346f14f373a47d45ffb811ed7fd5ebf9c296f340358fed11ad93e0990463c043.yml -openapi_spec_hash: 198a8fc2986ce2db7c1e07022415ec62 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-fc32a84f69e813f34ad70b65dba1ac56957f3c69361935f50df26caadaae3fce.yml +openapi_spec_hash: 40b5bd3cc33a7002c1a6f36fe97377ef config_hash: b881baa4e0bc537d0caf02152712bd28 diff --git a/CHANGELOG.md b/CHANGELOG.md index b65192113..def42c7c5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.438.0 (2026-03-02) + +Full Changelog: [v0.437.0...v0.438.0](https://github.com/Increase/increase-java/compare/v0.437.0...v0.438.0) + +### Features + +* **api:** api update ([cf50111](https://github.com/Increase/increase-java/commit/cf50111a457edf735445f35a63b0a8079c016374)) + ## 0.437.0 (2026-03-02) Full Changelog: [v0.436.0...v0.437.0](https://github.com/Increase/increase-java/compare/v0.436.0...v0.437.0) diff --git a/README.md b/README.md index 67b73f267..b2fcf73c5 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.increase.api/increase-java)](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.437.0) -[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.437.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.437.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.increase.api/increase-java)](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.438.0) +[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.438.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.438.0) @@ -13,7 +13,7 @@ The Increase Java SDK is similar to the Increase Kotlin SDK but with minor diffe -The REST API documentation can be found on [increase.com](https://increase.com/documentation). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.increase.api/increase-java/0.437.0). +The REST API documentation can be found on [increase.com](https://increase.com/documentation). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.increase.api/increase-java/0.438.0). @@ -24,7 +24,7 @@ The REST API documentation can be found on [increase.com](https://increase.com/d ### Gradle ```kotlin -implementation("com.increase.api:increase-java:0.437.0") +implementation("com.increase.api:increase-java:0.438.0") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.437.0") com.increase.api increase-java - 0.437.0 + 0.438.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index bb7f53fad..1bb7b2a25 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.increase.api" - version = "0.437.0" // x-release-please-version + version = "0.438.0" // x-release-please-version } subprojects { diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/checkdeposits/CheckDeposit.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/checkdeposits/CheckDeposit.kt index dcde8c370..92f853b8f 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/checkdeposits/CheckDeposit.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/checkdeposits/CheckDeposit.kt @@ -11,7 +11,9 @@ import com.increase.api.core.ExcludeMissing import com.increase.api.core.JsonField import com.increase.api.core.JsonMissing import com.increase.api.core.JsonValue +import com.increase.api.core.checkKnown import com.increase.api.core.checkRequired +import com.increase.api.core.toImmutable import com.increase.api.errors.IncreaseInvalidDataException import java.time.OffsetDateTime import java.util.Collections @@ -29,6 +31,7 @@ private constructor( private val backImageFileId: JsonField, private val createdAt: JsonField, private val depositAcceptance: JsonField, + private val depositAdjustments: JsonField>, private val depositRejection: JsonField, private val depositReturn: JsonField, private val depositSubmission: JsonField, @@ -58,6 +61,9 @@ private constructor( @JsonProperty("deposit_acceptance") @ExcludeMissing depositAcceptance: JsonField = JsonMissing.of(), + @JsonProperty("deposit_adjustments") + @ExcludeMissing + depositAdjustments: JsonField> = JsonMissing.of(), @JsonProperty("deposit_rejection") @ExcludeMissing depositRejection: JsonField = JsonMissing.of(), @@ -95,6 +101,7 @@ private constructor( backImageFileId, createdAt, depositAcceptance, + depositAdjustments, depositRejection, depositReturn, depositSubmission, @@ -161,6 +168,16 @@ private constructor( fun depositAcceptance(): Optional = depositAcceptance.getOptional("deposit_acceptance") + /** + * If the deposit or the return was adjusted by the receiving institution, this will contain + * details of the adjustments. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun depositAdjustments(): List = + depositAdjustments.getRequired("deposit_adjustments") + /** * If your deposit is rejected by Increase, this will contain details as to why it was rejected. * @@ -317,6 +334,16 @@ private constructor( @ExcludeMissing fun _depositAcceptance(): JsonField = depositAcceptance + /** + * Returns the raw JSON value of [depositAdjustments]. + * + * Unlike [depositAdjustments], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("deposit_adjustments") + @ExcludeMissing + fun _depositAdjustments(): JsonField> = depositAdjustments + /** * Returns the raw JSON value of [depositRejection]. * @@ -447,6 +474,7 @@ private constructor( * .backImageFileId() * .createdAt() * .depositAcceptance() + * .depositAdjustments() * .depositRejection() * .depositReturn() * .depositSubmission() @@ -473,6 +501,7 @@ private constructor( private var backImageFileId: JsonField? = null private var createdAt: JsonField? = null private var depositAcceptance: JsonField? = null + private var depositAdjustments: JsonField>? = null private var depositRejection: JsonField? = null private var depositReturn: JsonField? = null private var depositSubmission: JsonField? = null @@ -495,6 +524,7 @@ private constructor( backImageFileId = checkDeposit.backImageFileId createdAt = checkDeposit.createdAt depositAcceptance = checkDeposit.depositAcceptance + depositAdjustments = checkDeposit.depositAdjustments.map { it.toMutableList() } depositRejection = checkDeposit.depositRejection depositReturn = checkDeposit.depositReturn depositSubmission = checkDeposit.depositSubmission @@ -600,6 +630,36 @@ private constructor( this.depositAcceptance = depositAcceptance } + /** + * If the deposit or the return was adjusted by the receiving institution, this will contain + * details of the adjustments. + */ + fun depositAdjustments(depositAdjustments: List) = + depositAdjustments(JsonField.of(depositAdjustments)) + + /** + * Sets [Builder.depositAdjustments] to an arbitrary JSON value. + * + * You should usually call [Builder.depositAdjustments] with a well-typed + * `List` value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun depositAdjustments(depositAdjustments: JsonField>) = apply { + this.depositAdjustments = depositAdjustments.map { it.toMutableList() } + } + + /** + * Adds a single [DepositAdjustment] to [depositAdjustments]. + * + * @throws IllegalStateException if the field was previously set to a non-list. + */ + fun addDepositAdjustment(depositAdjustment: DepositAdjustment) = apply { + depositAdjustments = + (depositAdjustments ?: JsonField.of(mutableListOf())).also { + checkKnown("depositAdjustments", it).add(depositAdjustment) + } + } + /** * If your deposit is rejected by Increase, this will contain details as to why it was * rejected. @@ -854,6 +914,7 @@ private constructor( * .backImageFileId() * .createdAt() * .depositAcceptance() + * .depositAdjustments() * .depositRejection() * .depositReturn() * .depositSubmission() @@ -878,6 +939,7 @@ private constructor( checkRequired("backImageFileId", backImageFileId), checkRequired("createdAt", createdAt), checkRequired("depositAcceptance", depositAcceptance), + checkRequired("depositAdjustments", depositAdjustments).map { it.toImmutable() }, checkRequired("depositRejection", depositRejection), checkRequired("depositReturn", depositReturn), checkRequired("depositSubmission", depositSubmission), @@ -907,6 +969,7 @@ private constructor( backImageFileId() createdAt() depositAcceptance().ifPresent { it.validate() } + depositAdjustments().forEach { it.validate() } depositRejection().ifPresent { it.validate() } depositReturn().ifPresent { it.validate() } depositSubmission().ifPresent { it.validate() } @@ -943,6 +1006,7 @@ private constructor( (if (backImageFileId.asKnown().isPresent) 1 else 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + (depositAcceptance.asKnown().getOrNull()?.validity() ?: 0) + + (depositAdjustments.asKnown().getOrNull()?.sumOf { it.validity().toInt() } ?: 0) + (depositRejection.asKnown().getOrNull()?.validity() ?: 0) + (depositReturn.asKnown().getOrNull()?.validity() ?: 0) + (depositSubmission.asKnown().getOrNull()?.validity() ?: 0) + @@ -1566,6 +1630,492 @@ private constructor( "DepositAcceptance{accountNumber=$accountNumber, amount=$amount, auxiliaryOnUs=$auxiliaryOnUs, checkDepositId=$checkDepositId, currency=$currency, routingNumber=$routingNumber, serialNumber=$serialNumber, additionalProperties=$additionalProperties}" } + class DepositAdjustment + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val adjustedAt: JsonField, + private val amount: JsonField, + private val reason: JsonField, + private val transactionId: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("adjusted_at") + @ExcludeMissing + adjustedAt: JsonField = JsonMissing.of(), + @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), + @JsonProperty("reason") @ExcludeMissing reason: JsonField = JsonMissing.of(), + @JsonProperty("transaction_id") + @ExcludeMissing + transactionId: JsonField = JsonMissing.of(), + ) : this(adjustedAt, amount, reason, transactionId, mutableMapOf()) + + /** + * The time at which the adjustment was received. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun adjustedAt(): OffsetDateTime = adjustedAt.getRequired("adjusted_at") + + /** + * The amount of the adjustment. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun amount(): Long = amount.getRequired("amount") + + /** + * The reason for the adjustment. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun reason(): Reason = reason.getRequired("reason") + + /** + * The id of the transaction for the adjustment. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). + */ + fun transactionId(): String = transactionId.getRequired("transaction_id") + + /** + * Returns the raw JSON value of [adjustedAt]. + * + * Unlike [adjustedAt], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("adjusted_at") + @ExcludeMissing + fun _adjustedAt(): JsonField = adjustedAt + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [reason]. + * + * Unlike [reason], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + + /** + * Returns the raw JSON value of [transactionId]. + * + * Unlike [transactionId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("transaction_id") + @ExcludeMissing + fun _transactionId(): JsonField = transactionId + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [DepositAdjustment]. + * + * The following fields are required: + * ```java + * .adjustedAt() + * .amount() + * .reason() + * .transactionId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [DepositAdjustment]. */ + class Builder internal constructor() { + + private var adjustedAt: JsonField? = null + private var amount: JsonField? = null + private var reason: JsonField? = null + private var transactionId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(depositAdjustment: DepositAdjustment) = apply { + adjustedAt = depositAdjustment.adjustedAt + amount = depositAdjustment.amount + reason = depositAdjustment.reason + transactionId = depositAdjustment.transactionId + additionalProperties = depositAdjustment.additionalProperties.toMutableMap() + } + + /** The time at which the adjustment was received. */ + fun adjustedAt(adjustedAt: OffsetDateTime) = adjustedAt(JsonField.of(adjustedAt)) + + /** + * Sets [Builder.adjustedAt] to an arbitrary JSON value. + * + * You should usually call [Builder.adjustedAt] with a well-typed [OffsetDateTime] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun adjustedAt(adjustedAt: JsonField) = apply { + this.adjustedAt = adjustedAt + } + + /** The amount of the adjustment. */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value instead. This + * method is primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** The reason for the adjustment. */ + fun reason(reason: Reason) = reason(JsonField.of(reason)) + + /** + * Sets [Builder.reason] to an arbitrary JSON value. + * + * You should usually call [Builder.reason] with a well-typed [Reason] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun reason(reason: JsonField) = apply { this.reason = reason } + + /** The id of the transaction for the adjustment. */ + fun transactionId(transactionId: String) = transactionId(JsonField.of(transactionId)) + + /** + * Sets [Builder.transactionId] to an arbitrary JSON value. + * + * You should usually call [Builder.transactionId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun transactionId(transactionId: JsonField) = apply { + this.transactionId = transactionId + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { additionalProperties.remove(key) } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [DepositAdjustment]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .adjustedAt() + * .amount() + * .reason() + * .transactionId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): DepositAdjustment = + DepositAdjustment( + checkRequired("adjustedAt", adjustedAt), + checkRequired("amount", amount), + checkRequired("reason", reason), + checkRequired("transactionId", transactionId), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): DepositAdjustment = apply { + if (validated) { + return@apply + } + + adjustedAt() + amount() + reason().validate() + transactionId() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (adjustedAt.asKnown().isPresent) 1 else 0) + + (if (amount.asKnown().isPresent) 1 else 0) + + (reason.asKnown().getOrNull()?.validity() ?: 0) + + (if (transactionId.asKnown().isPresent) 1 else 0) + + /** The reason for the adjustment. */ + class Reason @JsonCreator private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + /** + * The return was initiated too late and the receiving institution has responded + * with a Late Return Claim. + */ + @JvmField val LATE_RETURN = of("late_return") + + /** + * The check was deposited to the wrong payee and the depositing institution has + * reimbursed the funds with a Wrong Payee Credit. + */ + @JvmField val WRONG_PAYEE_CREDIT = of("wrong_payee_credit") + + /** + * The check was deposited with a different amount than what was written on the + * check. + */ + @JvmField val ADJUSTED_AMOUNT = of("adjusted_amount") + + /** + * The recipient was not able to process the check. This usually happens for e.g., + * low quality images. + */ + @JvmField val NON_CONFORMING_ITEM = of("non_conforming_item") + + /** The check has already been deposited elsewhere and so this is a duplicate. */ + @JvmField val PAID = of("paid") + + @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) + } + + /** An enum containing [Reason]'s known values. */ + enum class Known { + /** + * The return was initiated too late and the receiving institution has responded + * with a Late Return Claim. + */ + LATE_RETURN, + /** + * The check was deposited to the wrong payee and the depositing institution has + * reimbursed the funds with a Wrong Payee Credit. + */ + WRONG_PAYEE_CREDIT, + /** + * The check was deposited with a different amount than what was written on the + * check. + */ + ADJUSTED_AMOUNT, + /** + * The recipient was not able to process the check. This usually happens for e.g., + * low quality images. + */ + NON_CONFORMING_ITEM, + /** The check has already been deposited elsewhere and so this is a duplicate. */ + PAID, + } + + /** + * An enum containing [Reason]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Reason] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** + * The return was initiated too late and the receiving institution has responded + * with a Late Return Claim. + */ + LATE_RETURN, + /** + * The check was deposited to the wrong payee and the depositing institution has + * reimbursed the funds with a Wrong Payee Credit. + */ + WRONG_PAYEE_CREDIT, + /** + * The check was deposited with a different amount than what was written on the + * check. + */ + ADJUSTED_AMOUNT, + /** + * The recipient was not able to process the check. This usually happens for e.g., + * low quality images. + */ + NON_CONFORMING_ITEM, + /** The check has already been deposited elsewhere and so this is a duplicate. */ + PAID, + /** + * An enum member indicating that [Reason] was instantiated with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if you + * want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + LATE_RETURN -> Value.LATE_RETURN + WRONG_PAYEE_CREDIT -> Value.WRONG_PAYEE_CREDIT + ADJUSTED_AMOUNT -> Value.ADJUSTED_AMOUNT + NON_CONFORMING_ITEM -> Value.NON_CONFORMING_ITEM + PAID -> Value.PAID + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a known + * member. + */ + fun known(): Known = + when (this) { + LATE_RETURN -> Known.LATE_RETURN + WRONG_PAYEE_CREDIT -> Known.WRONG_PAYEE_CREDIT + ADJUSTED_AMOUNT -> Known.ADJUSTED_AMOUNT + NON_CONFORMING_ITEM -> Known.NON_CONFORMING_ITEM + PAID -> Known.PAID + else -> throw IncreaseInvalidDataException("Unknown Reason: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have the + * expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Reason = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Reason && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is DepositAdjustment && + adjustedAt == other.adjustedAt && + amount == other.amount && + reason == other.reason && + transactionId == other.transactionId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(adjustedAt, amount, reason, transactionId, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "DepositAdjustment{adjustedAt=$adjustedAt, amount=$amount, reason=$reason, transactionId=$transactionId, additionalProperties=$additionalProperties}" + } + /** * If your deposit is rejected by Increase, this will contain details as to why it was rejected. */ @@ -4749,6 +5299,7 @@ private constructor( backImageFileId == other.backImageFileId && createdAt == other.createdAt && depositAcceptance == other.depositAcceptance && + depositAdjustments == other.depositAdjustments && depositRejection == other.depositRejection && depositReturn == other.depositReturn && depositSubmission == other.depositSubmission && @@ -4772,6 +5323,7 @@ private constructor( backImageFileId, createdAt, depositAcceptance, + depositAdjustments, depositRejection, depositReturn, depositSubmission, @@ -4791,5 +5343,5 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CheckDeposit{id=$id, accountId=$accountId, amount=$amount, backImageFileId=$backImageFileId, createdAt=$createdAt, depositAcceptance=$depositAcceptance, depositRejection=$depositRejection, depositReturn=$depositReturn, depositSubmission=$depositSubmission, description=$description, frontImageFileId=$frontImageFileId, idempotencyKey=$idempotencyKey, inboundFundsHold=$inboundFundsHold, inboundMailItemId=$inboundMailItemId, lockboxId=$lockboxId, status=$status, transactionId=$transactionId, type=$type, additionalProperties=$additionalProperties}" + "CheckDeposit{id=$id, accountId=$accountId, amount=$amount, backImageFileId=$backImageFileId, createdAt=$createdAt, depositAcceptance=$depositAcceptance, depositAdjustments=$depositAdjustments, depositRejection=$depositRejection, depositReturn=$depositReturn, depositSubmission=$depositSubmission, description=$description, frontImageFileId=$frontImageFileId, idempotencyKey=$idempotencyKey, inboundFundsHold=$inboundFundsHold, inboundMailItemId=$inboundMailItemId, lockboxId=$lockboxId, status=$status, transactionId=$transactionId, type=$type, additionalProperties=$additionalProperties}" } diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/checkdeposits/CheckDepositListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/checkdeposits/CheckDepositListPageResponseTest.kt index 8c9c45213..5269c7686 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/checkdeposits/CheckDepositListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/checkdeposits/CheckDepositListPageResponseTest.kt @@ -32,6 +32,14 @@ internal class CheckDepositListPageResponseTest { .serialNumber(null) .build() ) + .addDepositAdjustment( + CheckDeposit.DepositAdjustment.builder() + .adjustedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .amount(1750L) + .reason(CheckDeposit.DepositAdjustment.Reason.LATE_RETURN) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .build() + ) .depositRejection( CheckDeposit.DepositRejection.builder() .amount(1750L) @@ -108,6 +116,14 @@ internal class CheckDepositListPageResponseTest { .serialNumber(null) .build() ) + .addDepositAdjustment( + CheckDeposit.DepositAdjustment.builder() + .adjustedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .amount(1750L) + .reason(CheckDeposit.DepositAdjustment.Reason.LATE_RETURN) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .build() + ) .depositRejection( CheckDeposit.DepositRejection.builder() .amount(1750L) @@ -186,6 +202,14 @@ internal class CheckDepositListPageResponseTest { .serialNumber(null) .build() ) + .addDepositAdjustment( + CheckDeposit.DepositAdjustment.builder() + .adjustedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .amount(1750L) + .reason(CheckDeposit.DepositAdjustment.Reason.LATE_RETURN) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .build() + ) .depositRejection( CheckDeposit.DepositRejection.builder() .amount(1750L) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/checkdeposits/CheckDepositTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/checkdeposits/CheckDepositTest.kt index 7790928bf..4f05303e2 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/checkdeposits/CheckDepositTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/checkdeposits/CheckDepositTest.kt @@ -30,6 +30,14 @@ internal class CheckDepositTest { .serialNumber(null) .build() ) + .addDepositAdjustment( + CheckDeposit.DepositAdjustment.builder() + .adjustedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .amount(1750L) + .reason(CheckDeposit.DepositAdjustment.Reason.LATE_RETURN) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .build() + ) .depositRejection( CheckDeposit.DepositRejection.builder() .amount(1750L) @@ -97,6 +105,15 @@ internal class CheckDepositTest { .serialNumber(null) .build() ) + assertThat(checkDeposit.depositAdjustments()) + .containsExactly( + CheckDeposit.DepositAdjustment.builder() + .adjustedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .amount(1750L) + .reason(CheckDeposit.DepositAdjustment.Reason.LATE_RETURN) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .build() + ) assertThat(checkDeposit.depositRejection()) .contains( CheckDeposit.DepositRejection.builder() @@ -172,6 +189,14 @@ internal class CheckDepositTest { .serialNumber(null) .build() ) + .addDepositAdjustment( + CheckDeposit.DepositAdjustment.builder() + .adjustedAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .amount(1750L) + .reason(CheckDeposit.DepositAdjustment.Reason.LATE_RETURN) + .transactionId("transaction_uyrp7fld2ium70oa7oi") + .build() + ) .depositRejection( CheckDeposit.DepositRejection.builder() .amount(1750L)