Skip to content

Commit

Permalink
feat(ItemResponse): add statusDetail. (#51)
Browse files Browse the repository at this point in the history
* fix(ItemResponse): add statusDetail.

* Versions
  • Loading branch information
NicolasMontone authored Sep 19, 2024
1 parent 84dd5c5 commit 501079a
Show file tree
Hide file tree
Showing 6 changed files with 77 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Currently, the package is available in Github Packages, so make sure to have the
<dependency>
<groupId>ai.pluggy</groupId>
<artifactId>pluggy-java</artifactId>
<version>1.2.0</version>
<version>1.3.0</version>
</dependency>
```

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<groupId>ai.pluggy</groupId>
<artifactId>pluggy-java</artifactId>
<version>1.2.0</version>
<version>1.3.0</version>

<packaging>jar</packaging>

Expand Down
17 changes: 17 additions & 0 deletions src/main/java/ai/pluggy/client/response/ItemProductState.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
package ai.pluggy.client.response;

import java.util.Date;
import java.util.List;
import lombok.Builder;
import lombok.Data;

@Data
@Builder
public class ItemProductState {
/** Whether product was collected in this last execution or not */
boolean isUpdated;
/** Date when product was last collected for this Item, null if it has never been. */
Date lastUpdatedAt;
/** If product was not collected, this field will provide more detailed info about the reason. */
List<ItemProductStepWarning> warnings;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package ai.pluggy.client.response;

import lombok.Builder;
import lombok.Data;

@Data
@Builder
public class ItemProductStepWarning {
/** The specific warning code */
String code;
/** Human readable message that explains the warning */
String message;
/** Related error message exactly as found in the institution (if any). */
String providerMessage;
}
1 change: 1 addition & 0 deletions src/main/java/ai/pluggy/client/response/ItemResponse.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public class ItemResponse {
String webhookUrl;
ItemError error = null;
CredentialLabel parameter;
ItemStatusDetail statusDetail;
String clientUserId;
Integer consecutiveFailedLoginAttempts;
}
42 changes: 42 additions & 0 deletions src/main/java/ai/pluggy/client/response/ItemStatusDetail.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package ai.pluggy.client.response;

import lombok.Builder;
import lombok.Data;

/**
* Only available when item.status is 'PARTIAL_SUCCESS'.
* Provides fine-grained information, per product, about their latest collection state.
*
* If a product was not requested at all, its entry will be null.
* If it was requested, it's entry will reflect if it has been collected or not.
* If collected, isUpdated will be true, and lastUpdatedAt will be the Date when it happened
* If not collected, isUpdated will be false, and lastUpdatedAt will be null it wasn't ever collected before, or the previous date if it was.
*/
@Data
@Builder
public class ItemStatusDetail {
/** Collection details for 'ACCOUNTS' product, or null if it was not requested at all. */
private ItemProductState accounts;
/** Collection details for 'CREDIT_CARDS' product, or null if it was not requested at all. */
private ItemProductState creditCards;
/** Collection details for account 'TRANSACTIONS' product, or null if it was not requested at all. */
private ItemProductState transactions;
/** Collection details for 'INVESTMENTS' product, or null if it was not requested at all. */
private ItemProductState investments;
/** Collection details for 'INVESTMENT_TRANSACTIONS' product, or null if it was not requested at all. */
private ItemProductState investmentTransactions;
/** Collection details for 'IDENTITY' product, or null if it was not requested at all. */
private ItemProductState identity;
/** Collection details for 'PAYMENT_DATA' product, or null if it was not requested at all. */
private ItemProductState paymentData;
/** Collection details for 'INCOME_REPORT' product, or null if it was not requested at all. */
private ItemProductState incomeReports;
/** Collection details for 'PORTFOLIO' product, or null if it was not requested at all. */
private ItemProductState portfolio;
/** Collection details for 'LOAN' product, or null if it was not requested at all. */
private ItemProductState loans;
/** Collection details for 'OPPORTUNITIES' product, or null if it was not requested at all. */
private ItemProductState opportunities;
/** Collection details for 'BENEFIT' product, or null if it was not requested at all. */
private ItemProductState benefits;
}

0 comments on commit 501079a

Please sign in to comment.