Skip to content

feat: Transaction service with anti-fraud validation using Kafka#603

Open
IvanPerez-dev wants to merge 7 commits intoyaperos:mainfrom
IvanPerez-dev:main
Open

feat: Transaction service with anti-fraud validation using Kafka#603
IvanPerez-dev wants to merge 7 commits intoyaperos:mainfrom
IvanPerez-dev:main

Conversation

@IvanPerez-dev
Copy link

Implementation

  • Transaction service built with Spring Boot + Onion Architecture (DDD)
  • Anti-fraud service as a Kafka worker for fraud validation
  • Event-driven communication via Apache Kafka
  • PostgreSQL for transaction persistence

Flow

  1. Transaction created via REST API → saved with status PENDING
  2. Event published to Kafka topic transaction.created
  3. Anti-fraud service validates: amount > 1000 = REJECTED, otherwise APPROVED
  4. Result published to transaction.status topic
  5. Transaction service updates status in database

Tech Stack

Java 21, Spring Boot, Apache Kafka, PostgreSQL, MapStruct, Swagger

Ivan Perez and others added 7 commits February 27, 2026 23:53
- define Transaction domain model with approve/reject behavior
- add TransactionStatus and TransferType enums
- create TransactionRepository interface in domain layer
- implement TransactionRepositoryImpl with JPA in infrastructure layer
- add TransactionEntity with JPA mapping
- scaffold use case interfaces in application abstractions
- complete get by id transaction
- complete create transaction with mapppers
- emit event when creating transaction
- interfaces for publishing and consuming events
- config consumer and producer en properties
- publisher transaction created implemented
- consumer transaction validation implemented
anti-fraud service configured
- readme documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant