-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add closure error data * feat: add closure error data to view * chore: add error cause
- Loading branch information
1 parent
8755970
commit 1339bcb
Showing
9 changed files
with
282 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
src/main/java/it/pagopa/ecommerce/commons/documents/v2/ClosureErrorData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
package it.pagopa.ecommerce.commons.documents.v2; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.Generated; | ||
import lombok.NoArgsConstructor; | ||
import org.springframework.data.mongodb.core.mapping.Document; | ||
import org.springframework.http.HttpStatus; | ||
|
||
import javax.annotation.Nullable; | ||
import javax.validation.constraints.NotNull; | ||
|
||
/** | ||
* Data related to closure error event | ||
*/ | ||
@Data | ||
@Document | ||
@AllArgsConstructor | ||
@NoArgsConstructor | ||
@Generated | ||
public class ClosureErrorData { | ||
|
||
/** | ||
* Enumeration of errors that can happen | ||
*/ | ||
public enum ErrorType { | ||
/** | ||
* KO response received from Node | ||
*/ | ||
KO_RESPONSE_RECEIVED, | ||
/** | ||
* Error happen during communication, no response have been received | ||
*/ | ||
COMMUNICATION_ERROR, | ||
} | ||
|
||
/** | ||
* Http error code received by Node in close payment response: This field is | ||
* null when HTTP response error code cannot be detected (f.e. timeout) | ||
*/ | ||
@Nullable | ||
private HttpStatus httpErrorCode; | ||
|
||
/** | ||
* Node error description taken from error response body, if any | ||
*/ | ||
@Nullable | ||
private String errorDescription; | ||
|
||
@NotNull | ||
private ErrorType errorType; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
40 changes: 40 additions & 0 deletions
40
src/main/java/it/pagopa/ecommerce/commons/documents/v2/TransactionClosureRetriedData.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package it.pagopa.ecommerce.commons.documents.v2; | ||
|
||
import lombok.Data; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Generated; | ||
import lombok.NoArgsConstructor; | ||
import org.springframework.data.mongodb.core.mapping.Document; | ||
|
||
import javax.annotation.Nullable; | ||
|
||
/** | ||
* Data related to retry event for a transaction closure operation | ||
* | ||
* @see BaseTransactionRetriedData | ||
*/ | ||
|
||
@Data | ||
@EqualsAndHashCode(callSuper = true) | ||
@Document | ||
@NoArgsConstructor | ||
@Generated | ||
public final class TransactionClosureRetriedData extends BaseTransactionRetriedData { | ||
|
||
@Nullable | ||
private ClosureErrorData closureErrorData; | ||
|
||
/** | ||
* Constructor | ||
* | ||
* @param closureErrorData node closure error data | ||
* @param retryCount the retry event counter | ||
*/ | ||
public TransactionClosureRetriedData( | ||
@Nullable ClosureErrorData closureErrorData, | ||
Integer retryCount | ||
) { | ||
super(retryCount); | ||
this.closureErrorData = closureErrorData; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.