improving workflow fault tolerance

This commit is contained in:
2025-10-26 23:14:24 +02:00
parent 22ecc4b589
commit b5e891afed
18 changed files with 63 additions and 178 deletions

View File

@@ -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<Object> dbtest(@RequestBody Transaction transaction) {
transactionService.save(transaction);
transaction.setType(RequestType.REQUEST);
transactionService.save(transaction);
return ResponseEntity.ok(transaction);
}
@GetMapping("/hello/{email}")
public ResponseEntity<String> helloEndpoint(@PathVariable String email) {