diff --git a/pom.xml b/pom.xml
index d762ca8..35267b4 100644
--- a/pom.xml
+++ b/pom.xml
@@ -119,6 +119,10 @@
com.google.api
gax
+
+ com.google.cloud
+ google-cloud-dlp
+
diff --git a/src/.DS_Store b/src/.DS_Store
deleted file mode 100644
index 7b5c75f..0000000
Binary files a/src/.DS_Store and /dev/null differ
diff --git a/src/main/java/com/example/config/DlpConfig.java b/src/main/java/com/example/config/DlpConfig.java
new file mode 100644
index 0000000..8bbd9a2
--- /dev/null
+++ b/src/main/java/com/example/config/DlpConfig.java
@@ -0,0 +1,15 @@
+package com.example.config;
+
+import com.google.cloud.dlp.v2.DlpServiceClient;
+import java.io.IOException;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+@Configuration
+public class DlpConfig {
+
+ @Bean(destroyMethod = "close")
+ public DlpServiceClient dlpServiceClient() throws IOException {
+ return DlpServiceClient.create();
+ }
+}
diff --git a/src/main/java/com/example/controller/ConversationSummaryController.java b/src/main/java/com/example/controller/ConversationSummaryController.java
index 7e54a94..e73e1b5 100644
--- a/src/main/java/com/example/controller/ConversationSummaryController.java
+++ b/src/main/java/com/example/controller/ConversationSummaryController.java
@@ -31,6 +31,7 @@ public class ConversationSummaryController {
this.conversationSummaryService = conversationSummaryService;
}
+
@PostMapping("/conversation")
public ResponseEntity summarizeConversation(
@Valid @RequestBody ConversationSummaryRequest request) {
diff --git a/src/main/java/com/example/dto/dialogflow/conversation/QueryInputDTO.java b/src/main/java/com/example/dto/dialogflow/conversation/QueryInputDTO.java
index 4545b1a..b56bc1b 100644
--- a/src/main/java/com/example/dto/dialogflow/conversation/QueryInputDTO.java
+++ b/src/main/java/com/example/dto/dialogflow/conversation/QueryInputDTO.java
@@ -5,6 +5,8 @@
package com.example.dto.dialogflow.conversation;
+
+
import com.example.dto.dialogflow.notification.EventInputDTO;
public record QueryInputDTO(
diff --git a/src/main/java/com/example/dto/dialogflow/notification/EventInputDTO.java b/src/main/java/com/example/dto/dialogflow/notification/EventInputDTO.java
index 0501fcb..23317cc 100644
--- a/src/main/java/com/example/dto/dialogflow/notification/EventInputDTO.java
+++ b/src/main/java/com/example/dto/dialogflow/notification/EventInputDTO.java
@@ -7,4 +7,4 @@ package com.example.dto.dialogflow.notification;
public record EventInputDTO(
String event
-) {}
+) {}
\ No newline at end of file
diff --git a/src/main/java/com/example/dto/quickreplies/QuestionDTO.java b/src/main/java/com/example/dto/quickreplies/QuestionDTO.java
index 148eba9..198464b 100644
--- a/src/main/java/com/example/dto/quickreplies/QuestionDTO.java
+++ b/src/main/java/com/example/dto/quickreplies/QuestionDTO.java
@@ -1,8 +1,7 @@
package com.example.dto.quickreplies;
-
import com.fasterxml.jackson.annotation.JsonProperty;
-
public record QuestionDTO(
@JsonProperty("titulo") String titulo,
- @JsonProperty("descripcion") String descripcion
-) {}
+ @JsonProperty("descripcion") String descripcion,
+ @JsonProperty("respuesta") String respuesta
+) {}
\ No newline at end of file
diff --git a/src/main/java/com/example/dto/quickreplies/QuickReplyDTO.java b/src/main/java/com/example/dto/quickreplies/QuickReplyDTO.java
index 465cff4..9f690ef 100644
--- a/src/main/java/com/example/dto/quickreplies/QuickReplyDTO.java
+++ b/src/main/java/com/example/dto/quickreplies/QuickReplyDTO.java
@@ -1,9 +1,7 @@
package com.example.dto.quickreplies;
-
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
-
public record QuickReplyDTO(
@JsonProperty("header") String header,
@JsonProperty("preguntas") List preguntas
-) {}
+) {}
\ No newline at end of file
diff --git a/src/main/java/com/example/mapper/conversation/DialogflowRequestMapper.java b/src/main/java/com/example/mapper/conversation/DialogflowRequestMapper.java
index adceff6..d587d78 100644
--- a/src/main/java/com/example/mapper/conversation/DialogflowRequestMapper.java
+++ b/src/main/java/com/example/mapper/conversation/DialogflowRequestMapper.java
@@ -8,8 +8,9 @@ package com.example.mapper.conversation;
import com.example.dto.dialogflow.base.DetectIntentRequestDTO;
import com.example.dto.dialogflow.conversation.QueryInputDTO;
import com.example.util.ProtobufUtil;
-import com.google.cloud.dialogflow.cx.v3.DetectIntentRequest;
import com.google.cloud.dialogflow.cx.v3.EventInput;
+import com.google.cloud.dialogflow.cx.v3.DetectIntentRequest;
+
import com.google.cloud.dialogflow.cx.v3.QueryInput;
import com.google.cloud.dialogflow.cx.v3.QueryParameters;
import com.google.cloud.dialogflow.cx.v3.TextInput;
diff --git a/src/main/java/com/example/mapper/conversation/FirestoreConversationMapper.java b/src/main/java/com/example/mapper/conversation/FirestoreConversationMapper.java
index a9431bd..a35a285 100644
--- a/src/main/java/com/example/mapper/conversation/FirestoreConversationMapper.java
+++ b/src/main/java/com/example/mapper/conversation/FirestoreConversationMapper.java
@@ -39,6 +39,7 @@ public class FirestoreConversationMapper {
private static final String FIELD_MESSAGES = "mensajes";
private static final String FIELD_PANTALLA_CONTEXTO = "pantallaContexto";
+
// Constants for fields within the 'mensajes' sub-documents
private static final String FIELD_MESSAGE_ENTITY = "entidad";
private static final String FIELD_MESSAGE_TYPE = "tipo";
@@ -75,6 +76,8 @@ public class FirestoreConversationMapper {
sessionMap.put(FIELD_PANTALLA_CONTEXTO, pantallaContexto);
}
+
+
sessionMap.put(FIELD_CREATED_AT, Timestamp.of(java.util.Date.from(Instant.now())));
sessionMap.put(FIELD_LAST_UPDATED, Timestamp.of(java.util.Date.from(Instant.now())));
@@ -85,6 +88,8 @@ public class FirestoreConversationMapper {
return sessionMap;
}
+
+
private Map toFirestoreEntryMap(ConversationEntryDTO entry) {
Map entryMap = new HashMap<>();
entryMap.put(FIELD_MESSAGE_ENTITY, entry.entity().name());
@@ -125,6 +130,7 @@ public class FirestoreConversationMapper {
.map(this::mapFirestoreEntryMapToConversationEntryDTO)
.collect(Collectors.toList());
}
+
return new ConversationSessionDTO(sessionId, userId, telefono, createdAt, lastModified, entries, pantallaContexto);
}
diff --git a/src/main/java/com/example/mapper/quickreplies/FirestoreQuickReplyMapper.java b/src/main/java/com/example/mapper/quickreplies/FirestoreQuickReplyMapper.java
deleted file mode 100644
index f320bf5..0000000
--- a/src/main/java/com/example/mapper/quickreplies/FirestoreQuickReplyMapper.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*
- * Copyright 2025 Google. This software is provided as-is, without warranty or representation for any use or purpose.
- * Your use of it is subject to your agreement with Google.
- */
-
-package com.example.mapper.quickreplies;
-
-import com.example.dto.dialogflow.conversation.ConversationEntryDTO;
-import com.example.dto.dialogflow.conversation.ConversationEntryEntity;
-import com.example.dto.dialogflow.conversation.ConversationEntryType;
-import com.example.dto.dialogflow.conversation.ConversationSessionDTO;
-import com.google.cloud.Timestamp;
-import com.google.cloud.firestore.FieldValue;
-import com.google.cloud.firestore.DocumentSnapshot;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.stereotype.Component;
-
-import java.time.Instant;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.stream.Collectors;
-
-@Component
-public class FirestoreQuickReplyMapper {
-
- private static final Logger logger = LoggerFactory.getLogger(FirestoreQuickReplyMapper.class);
-
- private static final String FIELD_SESSION_ID = "session_id";
- private static final String FIELD_USER_ID = "usuario_id";
- private static final String FIELD_PHONE_NUMBER = "telefono";
- private static final String FIELD_CREATED_AT = "fechaCreacion";
- private static final String FIELD_LAST_UPDATED = "ultimaActualizacion";
- private static final String FIELD_MESSAGES = "mensajes";
-
- private static final String FIELD_MESSAGE_ENTITY = "entidad";
- private static final String FIELD_MESSAGE_TYPE = "tipo";
- private static final String FIELD_MESSAGE_TEXT = "mensaje";
- private static final String FIELD_MESSAGE_TIMESTAMP = "tiempo";
- private static final String FIELD_MESSAGE_PARAMETERS = "parametros";
- private static final String FIELD_MESSAGE_CHANNEL = "canal";
-
-
- public Map createUpdateMapForSingleEntry(ConversationEntryDTO newEntry) {
- Map updates = new HashMap<>();
- Map entryMap = toFirestoreEntryMap(newEntry);
- updates.put(FIELD_MESSAGES, FieldValue.arrayUnion(entryMap));
- updates.put(FIELD_LAST_UPDATED, Timestamp.of(java.util.Date.from(Instant.now())));
- return updates;
- }
-
- public Map createNewSessionMapForSingleEntry(String sessionId, String userId, String telefono, ConversationEntryDTO initialEntry) {
- Map sessionMap = new HashMap<>();
- sessionMap.put(FIELD_SESSION_ID, sessionId);
- sessionMap.put(FIELD_USER_ID, userId);
-
- if (telefono != null && !telefono.trim().isEmpty()) {
- sessionMap.put(FIELD_PHONE_NUMBER, telefono);
- } else {
- sessionMap.put(FIELD_PHONE_NUMBER, null);
- }
-
- sessionMap.put(FIELD_CREATED_AT, Timestamp.of(java.util.Date.from(Instant.now())));
- sessionMap.put(FIELD_LAST_UPDATED, Timestamp.of(java.util.Date.from(Instant.now())));
-
- List