Skip to content

Commit

Permalink
fix: MMC-113 (#15)
Browse files Browse the repository at this point in the history
Co-authored-by: BaldiVi <[email protected]>
  • Loading branch information
BaldiVi-1 and BaldiVi authored Jan 21, 2025
1 parent 0a332f1 commit 3c1a037
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/main/java/it/gov/pagopa/tpp/dto/TppDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import lombok.experimental.SuperBuilder;

import java.time.LocalDateTime;
import java.util.HashMap;

@Data
@SuperBuilder
Expand Down Expand Up @@ -48,4 +49,10 @@ public class TppDTO {
private LocalDateTime lastUpdateDate;
private TokenSection tokenSection;

@NotNull(message = "Payment Button must not be null")
private String paymentButton;

@NotNull(message = "Agent Deep Link must not be null")
private HashMap<String, String> agentDeepLinks;

}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ public TppDTO map(Tpp tpp){
.creationDate(tpp.getCreationDate())
.lastUpdateDate(tpp.getLastUpdateDate())
.tokenSection(tpp.getTokenSection())
.paymentButton(tpp.getPaymentButton())
.agentDeepLinks(tpp.getAgentDeepLinks())
.build();
}
}
3 changes: 3 additions & 0 deletions src/main/java/it/gov/pagopa/tpp/model/Tpp.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.springframework.data.mongodb.core.mapping.Document;

import java.time.LocalDateTime;
import java.util.HashMap;

@Document(collection = "tpp")
@Data
Expand All @@ -29,4 +30,6 @@ public class Tpp {
private TokenSection tokenSection;
private LocalDateTime creationDate;
private LocalDateTime lastUpdateDate;
private String paymentButton;
private HashMap<String, String> agentDeepLinks;
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ public Tpp map(TppDTO tppDTO){
.contact(tppDTO.getContact())
.entityId(tppDTO.getEntityId())
.tokenSection(tppDTO.getTokenSection())
.paymentButton(tppDTO.getPaymentButton())
.agentDeepLinks(tppDTO.getAgentDeepLinks())
.build();
}

}
6 changes: 6 additions & 0 deletions src/test/java/it/gov/pagopa/tpp/utils/faker/TppDTOFaker.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import it.gov.pagopa.tpp.enums.AuthenticationType;
import it.gov.pagopa.tpp.model.Contact;

import java.util.HashMap;

public class TppDTOFaker {

private TppDTOFaker(){}
Expand All @@ -26,6 +28,10 @@ public static TppDTO mockInstance(Boolean bias) {
.lastUpdateDate(null)
.creationDate(null)
.tokenSection(TokenSectionFaker.mockInstance())
.paymentButton("#button")
.agentDeepLinks(new HashMap<>() {{
put("agent", "link");
}})
.build();
}

Expand Down
6 changes: 6 additions & 0 deletions src/test/java/it/gov/pagopa/tpp/utils/faker/TppFaker.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
import it.gov.pagopa.tpp.model.Contact;
import it.gov.pagopa.tpp.model.Tpp;

import java.util.HashMap;

public class TppFaker {

private TppFaker(){}
Expand All @@ -26,6 +28,10 @@ public static Tpp mockInstance(Boolean bias){
.lastUpdateDate(null)
.creationDate(null)
.tokenSection(TokenSectionFaker.mockInstance())
.paymentButton("#button")
.agentDeepLinks(new HashMap<>() {{
put("agent", "link");
}})
.build();
}
}

0 comments on commit 3c1a037

Please sign in to comment.