diff --git a/pom.xml b/pom.xml
index 13bb307..1dc43bd 100644
--- a/pom.xml
+++ b/pom.xml
@@ -175,6 +175,14 @@
loki-logback-appender
2.0.1
+
+ org.springframework.boot
+ spring-boot-starter-cache
+
+
+ com.github.ben-manes.caffeine
+ caffeine
+
diff --git a/src/main/java/zw/qantra/tm/TmApplication.java b/src/main/java/zw/qantra/tm/TmApplication.java
index 1a7763c..c60ab3c 100644
--- a/src/main/java/zw/qantra/tm/TmApplication.java
+++ b/src/main/java/zw/qantra/tm/TmApplication.java
@@ -3,6 +3,7 @@ package zw.qantra.tm;
import io.nflow.rest.config.RestConfiguration;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
+import org.springframework.cache.annotation.EnableCaching;
import org.springframework.context.annotation.Bean;
import com.google.gson.Gson;
@@ -10,6 +11,7 @@ import org.springframework.context.annotation.Import;
@SpringBootApplication
@Import(RestConfiguration.class)
+@EnableCaching
public class TmApplication {
public static void main(String[] args) {
diff --git a/src/main/java/zw/qantra/tm/config/CacheConfig.java b/src/main/java/zw/qantra/tm/config/CacheConfig.java
new file mode 100644
index 0000000..cdd302b
--- /dev/null
+++ b/src/main/java/zw/qantra/tm/config/CacheConfig.java
@@ -0,0 +1,25 @@
+package zw.qantra.tm.config;
+
+import com.github.benmanes.caffeine.cache.Caffeine;
+import org.springframework.cache.CacheManager;
+import org.springframework.cache.annotation.EnableCaching;
+import org.springframework.cache.caffeine.CaffeineCacheManager;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import java.util.concurrent.TimeUnit;
+
+@Configuration
+@EnableCaching
+public class CacheConfig {
+
+ @Bean
+ public CacheManager cacheManager() {
+ CaffeineCacheManager cacheManager = new CaffeineCacheManager("providerProducts");
+ cacheManager.setCaffeine(Caffeine.newBuilder()
+ .expireAfterWrite(24, TimeUnit.HOURS)
+ .maximumSize(10000));
+ return cacheManager;
+ }
+}
+
diff --git a/src/main/java/zw/qantra/tm/domain/controllers/ProviderController.java b/src/main/java/zw/qantra/tm/domain/controllers/ProviderController.java
index ad9334c..1f6d8ce 100644
--- a/src/main/java/zw/qantra/tm/domain/controllers/ProviderController.java
+++ b/src/main/java/zw/qantra/tm/domain/controllers/ProviderController.java
@@ -22,7 +22,7 @@ public class ProviderController {
@GetMapping("/{id}/products")
public ResponseEntity getProducts(@PathVariable UUID id) {
- return ResponseEntity.ok(providerService.getProviderProducts(id));
+ return ResponseEntity.ok(providerService.getProviderProducts(id.toString()));
}
@GetMapping("/{id}/products/{productId}")
diff --git a/src/main/java/zw/qantra/tm/domain/controllers/TransactonController.java b/src/main/java/zw/qantra/tm/domain/controllers/TransactonController.java
index e7c7805..35347b5 100644
--- a/src/main/java/zw/qantra/tm/domain/controllers/TransactonController.java
+++ b/src/main/java/zw/qantra/tm/domain/controllers/TransactonController.java
@@ -109,7 +109,7 @@ public class TransactonController {
workflowInstanceService.updateWorkflowInstance(update, action);
CompletableFuture