- * This bean is marked as {@code @Primary} to ensure it's the default for dependency injection
- * throughout the application. It's configured using Spring Boot's {@link Jackson2ObjectMapperBuilder},
- * which automatically registers modules for Java 8 Time, Optional, etc., if they are on the classpath.
- * It also includes any custom {@link Module} beans defined in the application context.
- *
- *
- * @param builder The default Jackson2ObjectMapperBuilder, pre-configured by Spring Boot.
- * @param customModules A list of all custom Jackson {@link Module} beans found in the application context.
- * @return A customized {@link com.fasterxml.jackson.databind.ObjectMapper}.
- */
- @Primary
- @Bean
- public ObjectMapper primaryObjectMapper(Jackson2ObjectMapperBuilder builder, List customModules) {
- builder.modules(customModules);
- builder.featuresToDisable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
- return builder.build();
- }
-
- /**
- * Overrides the default ObjectMapper used by the nFlow REST API.
- *
- * This bean definition ensures that the nFlow REST endpoints use the same consistent,
- * primary ObjectMapper as the rest of the application.
- *
- */
- @Bean("nflowRestObjectMapper")
- public ObjectMapper nflowRestObjectMapper(ObjectMapper primaryObjectMapper) {
- return primaryObjectMapper;
- }
-
- /**
- * Overrides the default ObjectMapper used by the nFlow Engine for variable serialization.
- *
- * This is the key fix for `InvalidDefinitionException` with `LocalDateTime` in workflow variables.
- * It ensures the engine uses our fully configured primary ObjectMapper.
- *
- */
- @Bean("nflowEngineObjectMapper")
- public ObjectMapper nflowEngineObjectMapper(ObjectMapper primaryObjectMapper) {
- return primaryObjectMapper;
- }
-
- @Bean
- @NFlow
- public EngineConfiguration.EngineObjectMapperSupplier nflowObjectMapper() {
- ObjectMapper mapper = new ObjectMapper();
- mapper.setSerializationInclusion(JsonInclude.Include.NON_EMPTY);
- mapper.registerModule(new JodaModule());
- mapper.registerModule(new Jdk8Module());
- mapper.registerModule(new JSR310Module());
- mapper.disable(SerializationFeature.WRITE_DATES_AS_TIMESTAMPS);
- return () -> mapper;
- }
-
-}
\ No newline at end of file
diff --git a/src/main/java/zw/qantra/tm/domain/controllers/ConfigController.java b/src/main/java/zw/qantra/tm/domain/controllers/ConfigController.java
index 5e79c31..791ad77 100644
--- a/src/main/java/zw/qantra/tm/domain/controllers/ConfigController.java
+++ b/src/main/java/zw/qantra/tm/domain/controllers/ConfigController.java
@@ -107,6 +107,7 @@ public class ConfigController {
.externalId("78f1f497-c9eb-401c-b22c-884756e68e40")
.integrationProcessorLabel("STEWARD")
.accountFieldName("Phone Number")
+ .percentageCommission(6)
.build(),
Provider.builder()
.description("NetOne Airtime")
@@ -117,6 +118,7 @@ public class ConfigController {
.externalId("95d485a7-39c9-4559-8a27-6521969abe8f")
.integrationProcessorLabel("STEWARD")
.accountFieldName("Phone Number")
+ .percentageCommission(5.5)
.build(),
Provider.builder()
.description("Prepaid Zesa")
@@ -127,6 +129,7 @@ public class ConfigController {
.externalId("0f67f7cc-b62b-4fb5-915f-6740b2afdba6")
.integrationProcessorLabel("STEWARD")
.accountFieldName("Meter Number")
+ .percentageCommission(1.5)
.build(),
Provider.builder()
.description("Econet Broadband")
@@ -137,6 +140,7 @@ public class ConfigController {
.externalId("287863e2-a791-4106-b629-79dadc9a6779")
.integrationProcessorLabel("STEWARD")
.accountFieldName("Phone Number")
+ .percentageCommission(6)
.build()
);
providerService.getProviderRepository().saveAll(providers);
diff --git a/src/main/java/zw/qantra/tm/domain/controllers/OnboardingController.java b/src/main/java/zw/qantra/tm/domain/controllers/OnboardingController.java
index 404ecfd..e92cdef 100644
--- a/src/main/java/zw/qantra/tm/domain/controllers/OnboardingController.java
+++ b/src/main/java/zw/qantra/tm/domain/controllers/OnboardingController.java
@@ -65,6 +65,7 @@ public class OnboardingController {
var instance = workflowInstanceFactory.newWorkflowInstanceBuilder()
.setType(RegistrationWorkflow.TYPE)
.setExternalId(request.getUsername() + "-" + new Instant().getMillis())
+ .setBusinessKey(request.getUsername())
.putStateVariable("body", request)
.setNextActivation(DateTime.now())
.build();
diff --git a/src/main/java/zw/qantra/tm/domain/controllers/TestController.java b/src/main/java/zw/qantra/tm/domain/controllers/TestController.java
index feb067f..5e21db3 100644
--- a/src/main/java/zw/qantra/tm/domain/controllers/TestController.java
+++ b/src/main/java/zw/qantra/tm/domain/controllers/TestController.java
@@ -1,18 +1,31 @@
package zw.qantra.tm.domain.controllers;
+import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.*;
+import zw.qantra.tm.domain.enums.RequestType;
+import zw.qantra.tm.domain.models.Transaction;
import zw.qantra.tm.domain.services.EmailService;
+import zw.qantra.tm.domain.services.TransactionService;
@RestController
@RequestMapping("/test")
@CrossOrigin(origins = "*")
+@RequiredArgsConstructor
public class TestController {
- @Autowired
- private EmailService emailService;
+ private final EmailService emailService;
+ private final TransactionService transactionService;
+
+ @PostMapping("/dbtest")
+ public ResponseEntity