This repository has been archived by the owner on Jul 29, 2024. It is now read-only.
-
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.
Co-authored-by: fabrizio.guerrini <[email protected]>
- Loading branch information
1 parent
ec1edb6
commit 979d6a4
Showing
49 changed files
with
3,508 additions
and
61 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
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
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
18 changes: 0 additions & 18 deletions
18
src/main/java/it/gov/pagopa/swclient/mil/wallet/ErrorCode.java
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
src/main/java/it/gov/pagopa/swclient/mil/wallet/bean/package-info.java
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
src/main/java/it/gov/pagopa/swclient/mil/wallet/dao/package-info.java
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
src/main/java/it/gov/pagopa/swclient/mil/wallet/package-info.java
This file was deleted.
Oops, something went wrong.
6 changes: 0 additions & 6 deletions
6
src/main/java/it/gov/pagopa/swclient/mil/wallet/resource/package-info.java
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
src/main/java/it/pagopa/swclient/mil/wallet/ErrorCode.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,29 @@ | ||
/* | ||
* ErrorCode.java | ||
* | ||
* 12 dec 2022 | ||
*/ | ||
|
||
package it.pagopa.swclient.mil.wallet; | ||
|
||
/** | ||
* | ||
* @author Antonio Tarricone | ||
*/ | ||
public final class ErrorCode { | ||
public static final String MODULE_ID = "003"; | ||
public static final String PAN_TOKEN_MUST_NOT_BE_NULL = MODULE_ID + "000001"; | ||
public static final String PAN_TOKEN_MUST_MATCH_REGEXP = MODULE_ID + "000002"; | ||
public static final String SESSION_ID_MUST_NOT_BE_NULL = MODULE_ID + "000003"; | ||
public static final String SESSION_ID_MUST_MATCH_REGEXP = MODULE_ID + "000004"; | ||
public static final String SESSION_NOT_FOUND_ERROR = MODULE_ID + "000005"; | ||
public static final String ERROR_CALLING_SESSION_SERVICE = MODULE_ID + "000006"; | ||
public static final String ERROR_CALLING_PM_WALLET_SERVICE = MODULE_ID + "000007"; | ||
public static final String TC_NOT_YET_ACCEPTED_ERROR = MODULE_ID + "000008"; | ||
public static final String SAVE_CARD_NOT_ACTIVE_ERROR = MODULE_ID + "000009"; | ||
public static final String GENERIC_ERROR_CALLING_PM_WALLET_SERVICE = MODULE_ID + "00000A"; | ||
|
||
|
||
private ErrorCode() { | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/it/pagopa/swclient/mil/wallet/bean/Outcome.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,7 @@ | ||
package it.pagopa.swclient.mil.wallet.bean; | ||
|
||
public enum Outcome { | ||
OK, | ||
TERMS_AND_CONDITIONS_NOT_YET_ACCEPTED, | ||
PAIR_WITH_IO | ||
} |
42 changes: 42 additions & 0 deletions
42
src/main/java/it/pagopa/swclient/mil/wallet/bean/WalletHeaderParams.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,42 @@ | ||
package it.pagopa.swclient.mil.wallet.bean; | ||
|
||
import it.pagopa.swclient.mil.bean.CommonHeader; | ||
import it.pagopa.swclient.mil.wallet.ErrorCode; | ||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.Pattern; | ||
import jakarta.ws.rs.HeaderParam; | ||
|
||
public class WalletHeaderParams extends CommonHeader{ | ||
|
||
/* | ||
* Session ID | ||
*/ | ||
@HeaderParam("id") | ||
@NotNull(message = "[" + ErrorCode.SESSION_ID_MUST_NOT_BE_NULL + "] id must not be null") | ||
@Pattern(regexp = "^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$", message = "[" + ErrorCode.SESSION_ID_MUST_MATCH_REGEXP + "] id must match \"{regexp}\"") | ||
private String sessionId; | ||
|
||
/** | ||
* @return the sessionId | ||
*/ | ||
public String getSessionId() { | ||
return sessionId; | ||
} | ||
|
||
/** | ||
* @param sessionId the sessionId to set | ||
*/ | ||
public void setSessionId(String sessionId) { | ||
this.sessionId = sessionId; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
StringBuilder builder = new StringBuilder(); | ||
builder.append("WalletHeaderParams [sessionId="); | ||
builder.append(sessionId); | ||
builder.append("]"); | ||
return builder.toString(); | ||
} | ||
|
||
} |
40 changes: 40 additions & 0 deletions
40
src/main/java/it/pagopa/swclient/mil/wallet/bean/WalletRequest.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.swclient.mil.wallet.bean; | ||
|
||
import it.pagopa.swclient.mil.wallet.ErrorCode; | ||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.Pattern; | ||
|
||
|
||
public class WalletRequest { | ||
|
||
/* | ||
* The token of the PAN | ||
*/ | ||
@NotNull(message = "[" + ErrorCode.PAN_TOKEN_MUST_NOT_BE_NULL + "] panToken must not be null") | ||
@Pattern(regexp = "^[a-zA-Z0-9]{1,32}$", message = "[" + ErrorCode.PAN_TOKEN_MUST_MATCH_REGEXP + "] panToken must match \"{regexp}\"") | ||
private String panToken; | ||
|
||
/** | ||
* @return the panToken | ||
*/ | ||
public String getPanToken() { | ||
return panToken; | ||
} | ||
|
||
/** | ||
* @param panToken the panToken to set | ||
*/ | ||
public void setPanToken(String panToken) { | ||
this.panToken = panToken; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
StringBuilder builder = new StringBuilder(); | ||
builder.append("WalletRequest [panToken="); | ||
builder.append(panToken); | ||
builder.append("]"); | ||
return builder.toString(); | ||
} | ||
|
||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/it/pagopa/swclient/mil/wallet/client/PmWalletService.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,30 @@ | ||
package it.pagopa.swclient.mil.wallet.client; | ||
|
||
import org.eclipse.microprofile.rest.client.annotation.ClientHeaderParam; | ||
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient; | ||
|
||
import io.smallrye.mutiny.Uni; | ||
import it.pagopa.swclient.mil.wallet.client.bean.PmWalletCardsRequest; | ||
import jakarta.ws.rs.HeaderParam; | ||
import jakarta.ws.rs.POST; | ||
import jakarta.ws.rs.Path; | ||
import jakarta.ws.rs.core.Response; | ||
|
||
/** | ||
* Reactive rest client for the REST APIs exposed by the PM-Wallet service | ||
*/ | ||
@RegisterRestClient(configKey = "pmwallet-api") | ||
public interface PmWalletService { | ||
|
||
/** | ||
* Pre-save a payment card in the Wallet | ||
* @param version of the API | ||
* @param body containing the token of the PAN and the Tax code of the payment card owner | ||
* @return the 204 Ack status | ||
*/ | ||
@POST | ||
@Path("/cards") | ||
@ClientHeaderParam(name = "Ocp-Apim-Subscription-Key", value = "${ocp.apim.subscription}", required = false) | ||
Uni<Response> cards(@HeaderParam("Version") String version, PmWalletCardsRequest body); | ||
|
||
} |
Oops, something went wrong.