Skip to content

Commit 501079a

Browse files
feat(ItemResponse): add statusDetail. (#51)
* fix(ItemResponse): add statusDetail. * Versions
1 parent 84dd5c5 commit 501079a

File tree

6 files changed

+77
-2
lines changed

6 files changed

+77
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Currently, the package is available in Github Packages, so make sure to have the
2020
<dependency>
2121
<groupId>ai.pluggy</groupId>
2222
<artifactId>pluggy-java</artifactId>
23-
<version>1.2.0</version>
23+
<version>1.3.0</version>
2424
</dependency>
2525
```
2626

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
<groupId>ai.pluggy</groupId>
77
<artifactId>pluggy-java</artifactId>
8-
<version>1.2.0</version>
8+
<version>1.3.0</version>
99

1010
<packaging>jar</packaging>
1111

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package ai.pluggy.client.response;
2+
3+
import java.util.Date;
4+
import java.util.List;
5+
import lombok.Builder;
6+
import lombok.Data;
7+
8+
@Data
9+
@Builder
10+
public class ItemProductState {
11+
/** Whether product was collected in this last execution or not */
12+
boolean isUpdated;
13+
/** Date when product was last collected for this Item, null if it has never been. */
14+
Date lastUpdatedAt;
15+
/** If product was not collected, this field will provide more detailed info about the reason. */
16+
List<ItemProductStepWarning> warnings;
17+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package ai.pluggy.client.response;
2+
3+
import lombok.Builder;
4+
import lombok.Data;
5+
6+
@Data
7+
@Builder
8+
public class ItemProductStepWarning {
9+
/** The specific warning code */
10+
String code;
11+
/** Human readable message that explains the warning */
12+
String message;
13+
/** Related error message exactly as found in the institution (if any). */
14+
String providerMessage;
15+
}

src/main/java/ai/pluggy/client/response/ItemResponse.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public class ItemResponse {
2020
String webhookUrl;
2121
ItemError error = null;
2222
CredentialLabel parameter;
23+
ItemStatusDetail statusDetail;
2324
String clientUserId;
2425
Integer consecutiveFailedLoginAttempts;
2526
}
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
package ai.pluggy.client.response;
2+
3+
import lombok.Builder;
4+
import lombok.Data;
5+
6+
/**
7+
* Only available when item.status is 'PARTIAL_SUCCESS'.
8+
* Provides fine-grained information, per product, about their latest collection state.
9+
*
10+
* If a product was not requested at all, its entry will be null.
11+
* If it was requested, it's entry will reflect if it has been collected or not.
12+
* If collected, isUpdated will be true, and lastUpdatedAt will be the Date when it happened
13+
* 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.
14+
*/
15+
@Data
16+
@Builder
17+
public class ItemStatusDetail {
18+
/** Collection details for 'ACCOUNTS' product, or null if it was not requested at all. */
19+
private ItemProductState accounts;
20+
/** Collection details for 'CREDIT_CARDS' product, or null if it was not requested at all. */
21+
private ItemProductState creditCards;
22+
/** Collection details for account 'TRANSACTIONS' product, or null if it was not requested at all. */
23+
private ItemProductState transactions;
24+
/** Collection details for 'INVESTMENTS' product, or null if it was not requested at all. */
25+
private ItemProductState investments;
26+
/** Collection details for 'INVESTMENT_TRANSACTIONS' product, or null if it was not requested at all. */
27+
private ItemProductState investmentTransactions;
28+
/** Collection details for 'IDENTITY' product, or null if it was not requested at all. */
29+
private ItemProductState identity;
30+
/** Collection details for 'PAYMENT_DATA' product, or null if it was not requested at all. */
31+
private ItemProductState paymentData;
32+
/** Collection details for 'INCOME_REPORT' product, or null if it was not requested at all. */
33+
private ItemProductState incomeReports;
34+
/** Collection details for 'PORTFOLIO' product, or null if it was not requested at all. */
35+
private ItemProductState portfolio;
36+
/** Collection details for 'LOAN' product, or null if it was not requested at all. */
37+
private ItemProductState loans;
38+
/** Collection details for 'OPPORTUNITIES' product, or null if it was not requested at all. */
39+
private ItemProductState opportunities;
40+
/** Collection details for 'BENEFIT' product, or null if it was not requested at all. */
41+
private ItemProductState benefits;
42+
}

0 commit comments

Comments
 (0)