├── .gitignore ├── EventDriven Microservices.postman_collection.json ├── LICENSE ├── README.md ├── edm.png ├── section1 ├── 00_start │ ├── accounts │ │ ├── .mvn │ │ │ └── wrapper │ │ │ │ ├── maven-wrapper.jar │ │ │ │ └── maven-wrapper.properties │ │ ├── mvnw │ │ ├── mvnw.cmd │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── eazybytes │ │ │ │ │ └── accounts │ │ │ │ │ ├── AccountsApplication.java │ │ │ │ │ ├── audit │ │ │ │ │ └── AuditAwareImpl.java │ │ │ │ │ ├── constants │ │ │ │ │ └── AccountsConstants.java │ │ │ │ │ ├── controller │ │ │ │ │ └── AccountsController.java │ │ │ │ │ ├── dto │ │ │ │ │ ├── AccountsDto.java │ │ │ │ │ └── ResponseDto.java │ │ │ │ │ ├── entity │ │ │ │ │ ├── Accounts.java │ │ │ │ │ └── BaseEntity.java │ │ │ │ │ ├── exception │ │ │ │ │ ├── AccountAlreadyExistsException.java │ │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ │ └── ResourceNotFoundException.java │ │ │ │ │ ├── mapper │ │ │ │ │ └── AccountsMapper.java │ │ │ │ │ ├── repository │ │ │ │ │ └── AccountsRepository.java │ │ │ │ │ └── service │ │ │ │ │ ├── IAccountsService.java │ │ │ │ │ └── impl │ │ │ │ │ └── AccountsServiceImpl.java │ │ │ └── resources │ │ │ │ ├── application.yml │ │ │ │ └── schema.sql │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── eazybytes │ │ │ └── accounts │ │ │ └── AccountsApplicationTests.java │ ├── cards │ │ ├── .mvn │ │ │ └── wrapper │ │ │ │ ├── maven-wrapper.jar │ │ │ │ └── maven-wrapper.properties │ │ ├── mvnw │ │ ├── mvnw.cmd │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── eazybytes │ │ │ │ │ └── cards │ │ │ │ │ ├── CardsApplication.java │ │ │ │ │ ├── audit │ │ │ │ │ └── AuditAwareImpl.java │ │ │ │ │ ├── constants │ │ │ │ │ └── CardsConstants.java │ │ │ │ │ ├── controller │ │ │ │ │ └── CardsController.java │ │ │ │ │ ├── dto │ │ │ │ │ ├── CardsDto.java │ │ │ │ │ └── ResponseDto.java │ │ │ │ │ ├── entity │ │ │ │ │ ├── BaseEntity.java │ │ │ │ │ └── Cards.java │ │ │ │ │ ├── exception │ │ │ │ │ ├── CardAlreadyExistsException.java │ │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ │ └── ResourceNotFoundException.java │ │ │ │ │ ├── mapper │ │ │ │ │ └── CardsMapper.java │ │ │ │ │ ├── repository │ │ │ │ │ └── CardsRepository.java │ │ │ │ │ └── service │ │ │ │ │ ├── ICardsService.java │ │ │ │ │ └── impl │ │ │ │ │ └── CardsServiceImpl.java │ │ │ └── resources │ │ │ │ ├── application.yml │ │ │ │ └── schema.sql │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── eazybytes │ │ │ └── cards │ │ │ └── CardsApplicationTests.java │ ├── customer │ │ ├── .mvn │ │ │ └── wrapper │ │ │ │ ├── maven-wrapper.jar │ │ │ │ └── maven-wrapper.properties │ │ ├── mvnw │ │ ├── mvnw.cmd │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── eazybytes │ │ │ │ │ └── customer │ │ │ │ │ ├── CustomersApplication.java │ │ │ │ │ ├── audit │ │ │ │ │ └── AuditAwareImpl.java │ │ │ │ │ ├── constants │ │ │ │ │ └── CustomerConstants.java │ │ │ │ │ ├── controller │ │ │ │ │ └── CustomerController.java │ │ │ │ │ ├── dto │ │ │ │ │ ├── CustomerDto.java │ │ │ │ │ └── ResponseDto.java │ │ │ │ │ ├── entity │ │ │ │ │ ├── BaseEntity.java │ │ │ │ │ └── Customer.java │ │ │ │ │ ├── exception │ │ │ │ │ ├── CustomerAlreadyExistsException.java │ │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ │ └── ResourceNotFoundException.java │ │ │ │ │ ├── mapper │ │ │ │ │ └── CustomerMapper.java │ │ │ │ │ ├── repository │ │ │ │ │ └── CustomerRepository.java │ │ │ │ │ └── service │ │ │ │ │ ├── ICustomerService.java │ │ │ │ │ └── impl │ │ │ │ │ └── CustomerServiceImpl.java │ │ │ └── resources │ │ │ │ ├── application.yml │ │ │ │ └── schema.sql │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── eazybytes │ │ │ └── customer │ │ │ └── AccountsApplicationTests.java │ ├── eazy-bom │ │ ├── .mvn │ │ │ └── wrapper │ │ │ │ └── maven-wrapper.properties │ │ ├── common │ │ │ ├── .gitignore │ │ │ ├── .mvn │ │ │ │ └── wrapper │ │ │ │ │ └── maven-wrapper.properties │ │ │ ├── mvnw │ │ │ ├── mvnw.cmd │ │ │ ├── pom.xml │ │ │ └── src │ │ │ │ ├── main │ │ │ │ ├── java │ │ │ │ │ └── com │ │ │ │ │ │ └── eazybytes │ │ │ │ │ │ └── common │ │ │ │ │ │ └── dto │ │ │ │ │ │ └── ErrorResponseDto.java │ │ │ │ └── resources │ │ │ │ │ └── application.properties │ │ │ │ └── test │ │ │ │ └── java │ │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── common │ │ │ │ └── CommonApplicationTests.java │ │ ├── mvnw │ │ ├── mvnw.cmd │ │ └── pom.xml │ ├── eurekaserver │ │ ├── .mvn │ │ │ └── wrapper │ │ │ │ ├── maven-wrapper.jar │ │ │ │ └── maven-wrapper.properties │ │ ├── mvnw │ │ ├── mvnw.cmd │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── eazybytes │ │ │ │ │ └── eurekaserver │ │ │ │ │ └── EurekaserverApplication.java │ │ │ └── resources │ │ │ │ └── application.yml │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── eazybytes │ │ │ └── eurekaserver │ │ │ └── EurekaserverApplicationTests.java │ ├── gatewayserver │ │ ├── .mvn │ │ │ └── wrapper │ │ │ │ ├── maven-wrapper.jar │ │ │ │ └── maven-wrapper.properties │ │ ├── mvnw │ │ ├── mvnw.cmd │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── eazybytes │ │ │ │ │ └── gatewayserver │ │ │ │ │ └── GatewayserverApplication.java │ │ │ └── resources │ │ │ │ └── application.yml │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── eazybytes │ │ │ └── gatewayserver │ │ │ └── GatewayserverApplicationTests.java │ └── loans │ │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ │ ├── mvnw │ │ ├── mvnw.cmd │ │ ├── pom.xml │ │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── loans │ │ │ │ ├── LoansApplication.java │ │ │ │ ├── audit │ │ │ │ └── AuditAwareImpl.java │ │ │ │ ├── constants │ │ │ │ └── LoansConstants.java │ │ │ │ ├── controller │ │ │ │ └── LoansController.java │ │ │ │ ├── dto │ │ │ │ ├── LoansDto.java │ │ │ │ └── ResponseDto.java │ │ │ │ ├── entity │ │ │ │ ├── BaseEntity.java │ │ │ │ └── Loans.java │ │ │ │ ├── exception │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ ├── LoanAlreadyExistsException.java │ │ │ │ └── ResourceNotFoundException.java │ │ │ │ ├── mapper │ │ │ │ └── LoansMapper.java │ │ │ │ ├── repository │ │ │ │ └── LoansRepository.java │ │ │ │ └── service │ │ │ │ ├── ILoansService.java │ │ │ │ └── impl │ │ │ │ └── LoansServiceImpl.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── loans │ │ └── LoansApplicationTests.java └── 01_end │ ├── accounts │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── accounts │ │ │ │ ├── AccountsApplication.java │ │ │ │ ├── audit │ │ │ │ └── AuditAwareImpl.java │ │ │ │ ├── constants │ │ │ │ └── AccountsConstants.java │ │ │ │ ├── controller │ │ │ │ └── AccountsController.java │ │ │ │ ├── dto │ │ │ │ ├── AccountsDto.java │ │ │ │ └── ResponseDto.java │ │ │ │ ├── entity │ │ │ │ ├── Accounts.java │ │ │ │ └── BaseEntity.java │ │ │ │ ├── exception │ │ │ │ ├── AccountAlreadyExistsException.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── ResourceNotFoundException.java │ │ │ │ ├── mapper │ │ │ │ └── AccountsMapper.java │ │ │ │ ├── repository │ │ │ │ └── AccountsRepository.java │ │ │ │ └── service │ │ │ │ ├── IAccountsService.java │ │ │ │ └── impl │ │ │ │ └── AccountsServiceImpl.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── accounts │ │ └── AccountsApplicationTests.java │ ├── cards │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── cards │ │ │ │ ├── CardsApplication.java │ │ │ │ ├── audit │ │ │ │ └── AuditAwareImpl.java │ │ │ │ ├── constants │ │ │ │ └── CardsConstants.java │ │ │ │ ├── controller │ │ │ │ └── CardsController.java │ │ │ │ ├── dto │ │ │ │ ├── CardsDto.java │ │ │ │ └── ResponseDto.java │ │ │ │ ├── entity │ │ │ │ ├── BaseEntity.java │ │ │ │ └── Cards.java │ │ │ │ ├── exception │ │ │ │ ├── CardAlreadyExistsException.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── ResourceNotFoundException.java │ │ │ │ ├── mapper │ │ │ │ └── CardsMapper.java │ │ │ │ ├── repository │ │ │ │ └── CardsRepository.java │ │ │ │ └── service │ │ │ │ ├── ICardsService.java │ │ │ │ └── impl │ │ │ │ └── CardsServiceImpl.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── cards │ │ └── CardsApplicationTests.java │ ├── customer │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── customer │ │ │ │ ├── CustomersApplication.java │ │ │ │ ├── audit │ │ │ │ └── AuditAwareImpl.java │ │ │ │ ├── constants │ │ │ │ └── CustomerConstants.java │ │ │ │ ├── controller │ │ │ │ └── CustomerController.java │ │ │ │ ├── dto │ │ │ │ ├── CustomerDto.java │ │ │ │ └── ResponseDto.java │ │ │ │ ├── entity │ │ │ │ ├── BaseEntity.java │ │ │ │ └── Customer.java │ │ │ │ ├── exception │ │ │ │ ├── CustomerAlreadyExistsException.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── ResourceNotFoundException.java │ │ │ │ ├── mapper │ │ │ │ └── CustomerMapper.java │ │ │ │ ├── repository │ │ │ │ └── CustomerRepository.java │ │ │ │ └── service │ │ │ │ ├── ICustomerService.java │ │ │ │ └── impl │ │ │ │ └── CustomerServiceImpl.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── customer │ │ └── AccountsApplicationTests.java │ ├── eazy-bom │ ├── .mvn │ │ └── wrapper │ │ │ └── maven-wrapper.properties │ ├── common │ │ ├── .gitignore │ │ ├── .mvn │ │ │ └── wrapper │ │ │ │ └── maven-wrapper.properties │ │ ├── mvnw │ │ ├── mvnw.cmd │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── eazybytes │ │ │ │ │ └── common │ │ │ │ │ └── dto │ │ │ │ │ └── ErrorResponseDto.java │ │ │ └── resources │ │ │ │ └── application.properties │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── eazybytes │ │ │ └── common │ │ │ └── CommonApplicationTests.java │ ├── mvnw │ ├── mvnw.cmd │ └── pom.xml │ ├── eurekaserver │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── eurekaserver │ │ │ │ └── EurekaserverApplication.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── eurekaserver │ │ └── EurekaserverApplicationTests.java │ ├── gatewayserver │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── gatewayserver │ │ │ │ ├── GatewayserverApplication.java │ │ │ │ ├── config │ │ │ │ └── ClientConfig.java │ │ │ │ ├── dto │ │ │ │ ├── AccountsDto.java │ │ │ │ ├── CardsDto.java │ │ │ │ ├── CustomerDto.java │ │ │ │ ├── CustomerSummaryDto.java │ │ │ │ └── LoansDto.java │ │ │ │ ├── handler │ │ │ │ └── CustomerCompositeHandler.java │ │ │ │ ├── router │ │ │ │ └── CustomerCompositeRouter.java │ │ │ │ └── service │ │ │ │ └── client │ │ │ │ └── CustomerSummaryClient.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── gatewayserver │ │ └── GatewayserverApplicationTests.java │ └── loans │ ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── eazybytes │ │ │ └── loans │ │ │ ├── LoansApplication.java │ │ │ ├── audit │ │ │ └── AuditAwareImpl.java │ │ │ ├── constants │ │ │ └── LoansConstants.java │ │ │ ├── controller │ │ │ └── LoansController.java │ │ │ ├── dto │ │ │ ├── LoansDto.java │ │ │ └── ResponseDto.java │ │ │ ├── entity │ │ │ ├── BaseEntity.java │ │ │ └── Loans.java │ │ │ ├── exception │ │ │ ├── GlobalExceptionHandler.java │ │ │ ├── LoanAlreadyExistsException.java │ │ │ └── ResourceNotFoundException.java │ │ │ ├── mapper │ │ │ └── LoansMapper.java │ │ │ ├── repository │ │ │ └── LoansRepository.java │ │ │ └── service │ │ │ ├── ILoansService.java │ │ │ └── impl │ │ │ └── LoansServiceImpl.java │ └── resources │ │ ├── application.yml │ │ └── schema.sql │ └── test │ └── java │ └── com │ └── eazybytes │ └── loans │ └── LoansApplicationTests.java ├── section3 ├── README.md ├── accounts │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── README.md │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── accounts │ │ │ │ ├── AccountsApplication.java │ │ │ │ ├── audit │ │ │ │ └── AuditAwareImpl.java │ │ │ │ ├── command │ │ │ │ ├── CreateAccountCommand.java │ │ │ │ ├── DeleteAccountCommand.java │ │ │ │ ├── UpdateAccountCommand.java │ │ │ │ ├── aggregate │ │ │ │ │ └── AccountsAggregate.java │ │ │ │ ├── controller │ │ │ │ │ └── AccountsCommandController.java │ │ │ │ ├── event │ │ │ │ │ ├── AccountCreatedEvent.java │ │ │ │ │ ├── AccountDeletedEvent.java │ │ │ │ │ └── AccountUpdatedEvent.java │ │ │ │ └── interceptor │ │ │ │ │ └── AccountsCommandInterceptor.java │ │ │ │ ├── constants │ │ │ │ └── AccountsConstants.java │ │ │ │ ├── dto │ │ │ │ ├── AccountsDto.java │ │ │ │ └── ResponseDto.java │ │ │ │ ├── entity │ │ │ │ ├── Accounts.java │ │ │ │ └── BaseEntity.java │ │ │ │ ├── exception │ │ │ │ ├── AccountAlreadyExistsException.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── ResourceNotFoundException.java │ │ │ │ ├── mapper │ │ │ │ └── AccountsMapper.java │ │ │ │ ├── query │ │ │ │ ├── FindAccountQuery.java │ │ │ │ ├── controller │ │ │ │ │ └── AccountsQueryController.java │ │ │ │ ├── handler │ │ │ │ │ └── AccountsQueryHandler.java │ │ │ │ └── projection │ │ │ │ │ └── AccountProjection.java │ │ │ │ ├── repository │ │ │ │ └── AccountsRepository.java │ │ │ │ └── service │ │ │ │ ├── IAccountsService.java │ │ │ │ └── impl │ │ │ │ └── AccountsServiceImpl.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── accounts │ │ └── AccountsApplicationTests.java ├── cards │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── README.md │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── cards │ │ │ │ ├── CardsApplication.java │ │ │ │ ├── audit │ │ │ │ └── AuditAwareImpl.java │ │ │ │ ├── command │ │ │ │ ├── CreateCardCommand.java │ │ │ │ ├── DeleteCardCommand.java │ │ │ │ ├── UpdateCardCommand.java │ │ │ │ ├── aggregate │ │ │ │ │ └── CardAggregate.java │ │ │ │ ├── controller │ │ │ │ │ └── CardCommandController.java │ │ │ │ ├── event │ │ │ │ │ ├── CardCreatedEvent.java │ │ │ │ │ ├── CardDeletedEvent.java │ │ │ │ │ └── CardUpdatedEvent.java │ │ │ │ └── interceptor │ │ │ │ │ └── CardCommandInterceptor.java │ │ │ │ ├── constants │ │ │ │ └── CardsConstants.java │ │ │ │ ├── dto │ │ │ │ ├── CardsDto.java │ │ │ │ └── ResponseDto.java │ │ │ │ ├── entity │ │ │ │ ├── BaseEntity.java │ │ │ │ └── Cards.java │ │ │ │ ├── exception │ │ │ │ ├── CardAlreadyExistsException.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── ResourceNotFoundException.java │ │ │ │ ├── mapper │ │ │ │ └── CardsMapper.java │ │ │ │ ├── query │ │ │ │ ├── FindCardQuery.java │ │ │ │ ├── controller │ │ │ │ │ └── CardQueryController.java │ │ │ │ ├── handler │ │ │ │ │ └── CardQueryHandler.java │ │ │ │ └── projection │ │ │ │ │ └── CardProjection.java │ │ │ │ ├── repository │ │ │ │ └── CardsRepository.java │ │ │ │ └── service │ │ │ │ ├── ICardsService.java │ │ │ │ └── impl │ │ │ │ └── CardsServiceImpl.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── cards │ │ └── CardsApplicationTests.java ├── customer │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── README.md │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── customer │ │ │ │ ├── CustomersApplication.java │ │ │ │ ├── audit │ │ │ │ └── AuditAwareImpl.java │ │ │ │ ├── command │ │ │ │ ├── CreateCustomerCommand.java │ │ │ │ ├── DeleteCustomerCommand.java │ │ │ │ ├── UpdateCustomerCommand.java │ │ │ │ ├── aggregate │ │ │ │ │ └── CustomerAggregate.java │ │ │ │ ├── controller │ │ │ │ │ └── CustomerCommandController.java │ │ │ │ ├── event │ │ │ │ │ ├── CustomerCreatedEvent.java │ │ │ │ │ ├── CustomerDeletedEvent.java │ │ │ │ │ └── CustomerUpdatedEvent.java │ │ │ │ └── interceptor │ │ │ │ │ └── CustomerCommandInterceptor.java │ │ │ │ ├── constants │ │ │ │ └── CustomerConstants.java │ │ │ │ ├── dto │ │ │ │ ├── CustomerDto.java │ │ │ │ └── ResponseDto.java │ │ │ │ ├── entity │ │ │ │ ├── BaseEntity.java │ │ │ │ └── Customer.java │ │ │ │ ├── exception │ │ │ │ ├── CustomerAlreadyExistsException.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── ResourceNotFoundException.java │ │ │ │ ├── mapper │ │ │ │ └── CustomerMapper.java │ │ │ │ ├── query │ │ │ │ ├── FindCustomerQuery.java │ │ │ │ ├── controller │ │ │ │ │ └── CustomerQueryController.java │ │ │ │ ├── handler │ │ │ │ │ └── CustomerQueryHandler.java │ │ │ │ └── projection │ │ │ │ │ └── CustomerProjection.java │ │ │ │ ├── repository │ │ │ │ └── CustomerRepository.java │ │ │ │ └── service │ │ │ │ ├── ICustomerService.java │ │ │ │ └── impl │ │ │ │ └── CustomerServiceImpl.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── customer │ │ └── AccountsApplicationTests.java ├── eazy-bom │ ├── .mvn │ │ └── wrapper │ │ │ └── maven-wrapper.properties │ ├── common │ │ ├── .gitignore │ │ ├── .mvn │ │ │ └── wrapper │ │ │ │ └── maven-wrapper.properties │ │ ├── mvnw │ │ ├── mvnw.cmd │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── eazybytes │ │ │ │ │ └── common │ │ │ │ │ └── dto │ │ │ │ │ └── ErrorResponseDto.java │ │ │ └── resources │ │ │ │ └── application.properties │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── eazybytes │ │ │ └── common │ │ │ └── CommonApplicationTests.java │ ├── mvnw │ ├── mvnw.cmd │ └── pom.xml ├── eurekaserver │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── eurekaserver │ │ │ │ └── EurekaserverApplication.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── eurekaserver │ │ └── EurekaserverApplicationTests.java ├── gatewayserver │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── gatewayserver │ │ │ │ ├── GatewayserverApplication.java │ │ │ │ ├── config │ │ │ │ └── ClientConfig.java │ │ │ │ ├── dto │ │ │ │ ├── AccountsDto.java │ │ │ │ ├── CardsDto.java │ │ │ │ ├── CustomerDto.java │ │ │ │ ├── CustomerSummaryDto.java │ │ │ │ └── LoansDto.java │ │ │ │ ├── handler │ │ │ │ └── CustomerCompositeHandler.java │ │ │ │ ├── router │ │ │ │ └── CustomerCompositeRouter.java │ │ │ │ └── service │ │ │ │ └── client │ │ │ │ └── CustomerSummaryClient.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── gatewayserver │ │ └── GatewayserverApplicationTests.java └── loans │ ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties │ ├── README.md │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── eazybytes │ │ │ └── loans │ │ │ ├── LoansApplication.java │ │ │ ├── audit │ │ │ └── AuditAwareImpl.java │ │ │ ├── command │ │ │ ├── CreateLoanCommand.java │ │ │ ├── DeleteLoanCommand.java │ │ │ ├── UpdateLoanCommand.java │ │ │ ├── aggregate │ │ │ │ └── LoanAggregate.java │ │ │ ├── controller │ │ │ │ └── LoanCommandController.java │ │ │ ├── event │ │ │ │ ├── LoanCreatedEvent.java │ │ │ │ ├── LoanDeletedEvent.java │ │ │ │ └── LoanUpdatedEvent.java │ │ │ └── interceptor │ │ │ │ └── LoanCommandInterceptor.java │ │ │ ├── constants │ │ │ └── LoansConstants.java │ │ │ ├── dto │ │ │ ├── LoansDto.java │ │ │ └── ResponseDto.java │ │ │ ├── entity │ │ │ ├── BaseEntity.java │ │ │ └── Loans.java │ │ │ ├── exception │ │ │ ├── GlobalExceptionHandler.java │ │ │ ├── LoanAlreadyExistsException.java │ │ │ └── ResourceNotFoundException.java │ │ │ ├── mapper │ │ │ └── LoansMapper.java │ │ │ ├── query │ │ │ ├── FindLoanQuery.java │ │ │ ├── controller │ │ │ │ └── LoanQueryController.java │ │ │ ├── handler │ │ │ │ └── LoanQueryHandler.java │ │ │ └── projection │ │ │ │ └── LoanProjection.java │ │ │ ├── repository │ │ │ └── LoansRepository.java │ │ │ └── service │ │ │ ├── ILoansService.java │ │ │ └── impl │ │ │ └── LoansServiceImpl.java │ └── resources │ │ ├── application.yml │ │ └── schema.sql │ └── test │ └── java │ └── com │ └── eazybytes │ └── loans │ └── LoansApplicationTests.java ├── section4 ├── accounts │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── accounts │ │ │ │ ├── AccountsApplication.java │ │ │ │ ├── audit │ │ │ │ └── AuditAwareImpl.java │ │ │ │ ├── command │ │ │ │ ├── CreateAccountCommand.java │ │ │ │ ├── DeleteAccountCommand.java │ │ │ │ ├── UpdateAccountCommand.java │ │ │ │ ├── aggregate │ │ │ │ │ └── AccountsAggregate.java │ │ │ │ ├── controller │ │ │ │ │ └── AccountsCommandController.java │ │ │ │ ├── event │ │ │ │ │ ├── AccountCreatedEvent.java │ │ │ │ │ ├── AccountDeletedEvent.java │ │ │ │ │ └── AccountUpdatedEvent.java │ │ │ │ └── interceptor │ │ │ │ │ └── AccountsCommandInterceptor.java │ │ │ │ ├── constants │ │ │ │ └── AccountsConstants.java │ │ │ │ ├── dto │ │ │ │ ├── AccountsDto.java │ │ │ │ └── ResponseDto.java │ │ │ │ ├── entity │ │ │ │ ├── Accounts.java │ │ │ │ └── BaseEntity.java │ │ │ │ ├── exception │ │ │ │ ├── AccountAlreadyExistsException.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── ResourceNotFoundException.java │ │ │ │ ├── mapper │ │ │ │ └── AccountsMapper.java │ │ │ │ ├── query │ │ │ │ ├── FindAccountQuery.java │ │ │ │ ├── controller │ │ │ │ │ └── AccountsQueryController.java │ │ │ │ ├── handler │ │ │ │ │ └── AccountsQueryHandler.java │ │ │ │ └── projection │ │ │ │ │ └── AccountProjection.java │ │ │ │ ├── repository │ │ │ │ └── AccountsRepository.java │ │ │ │ └── service │ │ │ │ ├── IAccountsService.java │ │ │ │ └── impl │ │ │ │ └── AccountsServiceImpl.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── accounts │ │ └── AccountsApplicationTests.java ├── cards │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── cards │ │ │ │ ├── CardsApplication.java │ │ │ │ ├── audit │ │ │ │ └── AuditAwareImpl.java │ │ │ │ ├── command │ │ │ │ ├── CreateCardCommand.java │ │ │ │ ├── DeleteCardCommand.java │ │ │ │ ├── UpdateCardCommand.java │ │ │ │ ├── aggregate │ │ │ │ │ └── CardAggregate.java │ │ │ │ ├── controller │ │ │ │ │ └── CardCommandController.java │ │ │ │ ├── event │ │ │ │ │ ├── CardCreatedEvent.java │ │ │ │ │ ├── CardDeletedEvent.java │ │ │ │ │ └── CardUpdatedEvent.java │ │ │ │ └── interceptor │ │ │ │ │ └── CardCommandInterceptor.java │ │ │ │ ├── constants │ │ │ │ └── CardsConstants.java │ │ │ │ ├── dto │ │ │ │ ├── CardsDto.java │ │ │ │ └── ResponseDto.java │ │ │ │ ├── entity │ │ │ │ ├── BaseEntity.java │ │ │ │ └── Cards.java │ │ │ │ ├── exception │ │ │ │ ├── CardAlreadyExistsException.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── ResourceNotFoundException.java │ │ │ │ ├── mapper │ │ │ │ └── CardsMapper.java │ │ │ │ ├── query │ │ │ │ ├── FindCardQuery.java │ │ │ │ ├── controller │ │ │ │ │ └── CardQueryController.java │ │ │ │ ├── handler │ │ │ │ │ └── CardQueryHandler.java │ │ │ │ └── projection │ │ │ │ │ └── CardProjection.java │ │ │ │ ├── repository │ │ │ │ └── CardsRepository.java │ │ │ │ └── service │ │ │ │ ├── ICardsService.java │ │ │ │ └── impl │ │ │ │ └── CardsServiceImpl.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── cards │ │ └── CardsApplicationTests.java ├── customer │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── customer │ │ │ │ ├── CustomersApplication.java │ │ │ │ ├── audit │ │ │ │ └── AuditAwareImpl.java │ │ │ │ ├── command │ │ │ │ ├── CreateCustomerCommand.java │ │ │ │ ├── DeleteCustomerCommand.java │ │ │ │ ├── UpdateCustomerCommand.java │ │ │ │ ├── aggregate │ │ │ │ │ └── CustomerAggregate.java │ │ │ │ ├── controller │ │ │ │ │ └── CustomerCommandController.java │ │ │ │ ├── event │ │ │ │ │ ├── CustomerCreatedEvent.java │ │ │ │ │ ├── CustomerDeletedEvent.java │ │ │ │ │ └── CustomerUpdatedEvent.java │ │ │ │ └── interceptor │ │ │ │ │ └── CustomerCommandInterceptor.java │ │ │ │ ├── constants │ │ │ │ └── CustomerConstants.java │ │ │ │ ├── dto │ │ │ │ ├── CustomerDto.java │ │ │ │ └── ResponseDto.java │ │ │ │ ├── entity │ │ │ │ ├── BaseEntity.java │ │ │ │ └── Customer.java │ │ │ │ ├── exception │ │ │ │ ├── CustomerAlreadyExistsException.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── ResourceNotFoundException.java │ │ │ │ ├── mapper │ │ │ │ └── CustomerMapper.java │ │ │ │ ├── query │ │ │ │ ├── FindCustomerQuery.java │ │ │ │ ├── controller │ │ │ │ │ └── CustomerQueryController.java │ │ │ │ ├── handler │ │ │ │ │ └── CustomerQueryHandler.java │ │ │ │ └── projection │ │ │ │ │ └── CustomerProjection.java │ │ │ │ ├── repository │ │ │ │ └── CustomerRepository.java │ │ │ │ └── service │ │ │ │ ├── ICustomerService.java │ │ │ │ └── impl │ │ │ │ └── CustomerServiceImpl.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── customer │ │ └── AccountsApplicationTests.java ├── eazy-bom │ ├── .mvn │ │ └── wrapper │ │ │ └── maven-wrapper.properties │ ├── common │ │ ├── .gitignore │ │ ├── .mvn │ │ │ └── wrapper │ │ │ │ └── maven-wrapper.properties │ │ ├── mvnw │ │ ├── mvnw.cmd │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── eazybytes │ │ │ │ │ └── common │ │ │ │ │ ├── config │ │ │ │ │ └── AxonConfig.java │ │ │ │ │ ├── dto │ │ │ │ │ └── ErrorResponseDto.java │ │ │ │ │ └── event │ │ │ │ │ ├── AccountDataChangedEvent.java │ │ │ │ │ ├── CardDataChangedEvent.java │ │ │ │ │ ├── CustomerDataChangedEvent.java │ │ │ │ │ └── LoanDataChangedEvent.java │ │ │ └── resources │ │ │ │ └── application.properties │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── eazybytes │ │ │ └── common │ │ │ └── CommonApplicationTests.java │ ├── mvnw │ ├── mvnw.cmd │ └── pom.xml ├── eurekaserver │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── eurekaserver │ │ │ │ └── EurekaserverApplication.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── eurekaserver │ │ └── EurekaserverApplicationTests.java ├── gatewayserver │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── gatewayserver │ │ │ │ ├── GatewayserverApplication.java │ │ │ │ ├── config │ │ │ │ └── ClientConfig.java │ │ │ │ ├── dto │ │ │ │ ├── AccountsDto.java │ │ │ │ ├── CardsDto.java │ │ │ │ ├── CustomerDto.java │ │ │ │ ├── CustomerSummaryDto.java │ │ │ │ └── LoansDto.java │ │ │ │ ├── handler │ │ │ │ └── CustomerCompositeHandler.java │ │ │ │ ├── router │ │ │ │ └── CustomerCompositeRouter.java │ │ │ │ └── service │ │ │ │ └── client │ │ │ │ └── CustomerSummaryClient.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── gatewayserver │ │ └── GatewayserverApplicationTests.java ├── loans │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── loans │ │ │ │ ├── LoansApplication.java │ │ │ │ ├── audit │ │ │ │ └── AuditAwareImpl.java │ │ │ │ ├── command │ │ │ │ ├── CreateLoanCommand.java │ │ │ │ ├── DeleteLoanCommand.java │ │ │ │ ├── UpdateLoanCommand.java │ │ │ │ ├── aggregate │ │ │ │ │ └── LoanAggregate.java │ │ │ │ ├── controller │ │ │ │ │ └── LoanCommandController.java │ │ │ │ ├── event │ │ │ │ │ ├── LoanCreatedEvent.java │ │ │ │ │ ├── LoanDeletedEvent.java │ │ │ │ │ └── LoanUpdatedEvent.java │ │ │ │ └── interceptor │ │ │ │ │ └── LoanCommandInterceptor.java │ │ │ │ ├── constants │ │ │ │ └── LoansConstants.java │ │ │ │ ├── dto │ │ │ │ ├── LoansDto.java │ │ │ │ └── ResponseDto.java │ │ │ │ ├── entity │ │ │ │ ├── BaseEntity.java │ │ │ │ └── Loans.java │ │ │ │ ├── exception │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ ├── LoanAlreadyExistsException.java │ │ │ │ └── ResourceNotFoundException.java │ │ │ │ ├── mapper │ │ │ │ └── LoansMapper.java │ │ │ │ ├── query │ │ │ │ ├── FindLoanQuery.java │ │ │ │ ├── controller │ │ │ │ │ └── LoanQueryController.java │ │ │ │ ├── handler │ │ │ │ │ └── LoanQueryHandler.java │ │ │ │ └── projection │ │ │ │ │ └── LoanProjection.java │ │ │ │ ├── repository │ │ │ │ └── LoansRepository.java │ │ │ │ └── service │ │ │ │ ├── ILoansService.java │ │ │ │ └── impl │ │ │ │ └── LoansServiceImpl.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── loans │ │ └── LoansApplicationTests.java └── profile │ ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── eazybytes │ │ │ └── profile │ │ │ ├── ProfileApplication.java │ │ │ ├── audit │ │ │ └── AuditAwareImpl.java │ │ │ ├── constants │ │ │ └── ProfileConstants.java │ │ │ ├── dto │ │ │ ├── ProfileDto.java │ │ │ └── ResponseDto.java │ │ │ ├── entity │ │ │ ├── BaseEntity.java │ │ │ └── Profile.java │ │ │ ├── exception │ │ │ ├── CustomerAlreadyExistsException.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ └── ResourceNotFoundException.java │ │ │ ├── mapper │ │ │ └── ProfileMapper.java │ │ │ ├── query │ │ │ ├── FindProfileQuery.java │ │ │ ├── controller │ │ │ │ └── ProfileQueryController.java │ │ │ ├── handler │ │ │ │ └── ProfileQueryHandler.java │ │ │ └── projection │ │ │ │ └── ProfileProjection.java │ │ │ ├── repository │ │ │ └── ProfileRepository.java │ │ │ └── service │ │ │ ├── IProfileService.java │ │ │ └── impl │ │ │ └── ProfileServiceImpl.java │ └── resources │ │ └── application.yml │ └── test │ └── java │ └── com │ └── eazybytes │ └── profile │ └── ProfileApplicationTests.java ├── section5 ├── accounts │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── accounts │ │ │ │ ├── AccountsApplication.java │ │ │ │ ├── audit │ │ │ │ └── AuditAwareImpl.java │ │ │ │ ├── constants │ │ │ │ └── AccountsConstants.java │ │ │ │ ├── controller │ │ │ │ └── AccountsController.java │ │ │ │ ├── dto │ │ │ │ ├── AccountsDto.java │ │ │ │ └── ResponseDto.java │ │ │ │ ├── entity │ │ │ │ ├── Accounts.java │ │ │ │ └── BaseEntity.java │ │ │ │ ├── exception │ │ │ │ ├── AccountAlreadyExistsException.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── ResourceNotFoundException.java │ │ │ │ ├── function │ │ │ │ └── AccountFunctions.java │ │ │ │ ├── mapper │ │ │ │ └── AccountsMapper.java │ │ │ │ ├── repository │ │ │ │ └── AccountsRepository.java │ │ │ │ └── service │ │ │ │ ├── IAccountsService.java │ │ │ │ └── impl │ │ │ │ └── AccountsServiceImpl.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── accounts │ │ └── AccountsApplicationTests.java ├── cards │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── cards │ │ │ │ ├── CardsApplication.java │ │ │ │ ├── audit │ │ │ │ └── AuditAwareImpl.java │ │ │ │ ├── constants │ │ │ │ └── CardsConstants.java │ │ │ │ ├── controller │ │ │ │ └── CardsController.java │ │ │ │ ├── dto │ │ │ │ ├── CardsDto.java │ │ │ │ └── ResponseDto.java │ │ │ │ ├── entity │ │ │ │ ├── BaseEntity.java │ │ │ │ └── Cards.java │ │ │ │ ├── exception │ │ │ │ ├── CardAlreadyExistsException.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── ResourceNotFoundException.java │ │ │ │ ├── function │ │ │ │ └── CardFunctions.java │ │ │ │ ├── mapper │ │ │ │ └── CardsMapper.java │ │ │ │ ├── repository │ │ │ │ └── CardsRepository.java │ │ │ │ └── service │ │ │ │ ├── ICardsService.java │ │ │ │ └── impl │ │ │ │ └── CardsServiceImpl.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── cards │ │ └── CardsApplicationTests.java ├── customer │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── customer │ │ │ │ ├── CustomersApplication.java │ │ │ │ ├── audit │ │ │ │ └── AuditAwareImpl.java │ │ │ │ ├── constants │ │ │ │ └── CustomerConstants.java │ │ │ │ ├── controller │ │ │ │ └── CustomerController.java │ │ │ │ ├── dto │ │ │ │ ├── CustomerDto.java │ │ │ │ └── ResponseDto.java │ │ │ │ ├── entity │ │ │ │ ├── BaseEntity.java │ │ │ │ └── Customer.java │ │ │ │ ├── exception │ │ │ │ ├── CustomerAlreadyExistsException.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── ResourceNotFoundException.java │ │ │ │ ├── function │ │ │ │ └── CustomerFunctions.java │ │ │ │ ├── mapper │ │ │ │ └── CustomerMapper.java │ │ │ │ ├── repository │ │ │ │ └── CustomerRepository.java │ │ │ │ └── service │ │ │ │ ├── ICustomerService.java │ │ │ │ └── impl │ │ │ │ └── CustomerServiceImpl.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── customer │ │ └── AccountsApplicationTests.java ├── eazy-bom │ ├── .mvn │ │ └── wrapper │ │ │ └── maven-wrapper.properties │ ├── common │ │ ├── .gitignore │ │ ├── .mvn │ │ │ └── wrapper │ │ │ │ └── maven-wrapper.properties │ │ ├── mvnw │ │ ├── mvnw.cmd │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── eazybytes │ │ │ │ │ └── common │ │ │ │ │ └── dto │ │ │ │ │ ├── ErrorResponseDto.java │ │ │ │ │ └── MobileNumberUpdateDto.java │ │ │ └── resources │ │ │ │ └── application.properties │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── eazybytes │ │ │ └── common │ │ │ └── CommonApplicationTests.java │ ├── mvnw │ ├── mvnw.cmd │ └── pom.xml ├── eurekaserver │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── eurekaserver │ │ │ │ └── EurekaserverApplication.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── eurekaserver │ │ └── EurekaserverApplicationTests.java ├── gatewayserver │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── gatewayserver │ │ │ │ ├── GatewayserverApplication.java │ │ │ │ ├── config │ │ │ │ └── ClientConfig.java │ │ │ │ ├── dto │ │ │ │ ├── AccountsDto.java │ │ │ │ ├── CardsDto.java │ │ │ │ ├── CustomerDto.java │ │ │ │ ├── CustomerSummaryDto.java │ │ │ │ └── LoansDto.java │ │ │ │ ├── handler │ │ │ │ └── CustomerCompositeHandler.java │ │ │ │ ├── router │ │ │ │ └── CustomerCompositeRouter.java │ │ │ │ └── service │ │ │ │ └── client │ │ │ │ └── CustomerSummaryClient.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── gatewayserver │ │ └── GatewayserverApplicationTests.java └── loans │ ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── eazybytes │ │ │ └── loans │ │ │ ├── LoansApplication.java │ │ │ ├── audit │ │ │ └── AuditAwareImpl.java │ │ │ ├── constants │ │ │ └── LoansConstants.java │ │ │ ├── controller │ │ │ └── LoansController.java │ │ │ ├── dto │ │ │ ├── LoansDto.java │ │ │ └── ResponseDto.java │ │ │ ├── entity │ │ │ ├── BaseEntity.java │ │ │ └── Loans.java │ │ │ ├── exception │ │ │ ├── GlobalExceptionHandler.java │ │ │ ├── LoanAlreadyExistsException.java │ │ │ └── ResourceNotFoundException.java │ │ │ ├── function │ │ │ └── LoanFunctions.java │ │ │ ├── mapper │ │ │ └── LoansMapper.java │ │ │ ├── repository │ │ │ └── LoansRepository.java │ │ │ └── service │ │ │ ├── ILoansService.java │ │ │ └── impl │ │ │ └── LoansServiceImpl.java │ └── resources │ │ ├── application.yml │ │ └── schema.sql │ └── test │ └── java │ └── com │ └── eazybytes │ └── loans │ └── LoansApplicationTests.java ├── section6 ├── accounts │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── README.md │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── accounts │ │ │ │ ├── AccountsApplication.java │ │ │ │ ├── audit │ │ │ │ └── AuditAwareImpl.java │ │ │ │ ├── command │ │ │ │ ├── CreateAccountCommand.java │ │ │ │ ├── DeleteAccountCommand.java │ │ │ │ ├── UpdateAccountCommand.java │ │ │ │ ├── aggregate │ │ │ │ │ └── AccountsAggregate.java │ │ │ │ ├── controller │ │ │ │ │ └── AccountsCommandController.java │ │ │ │ ├── event │ │ │ │ │ ├── AccountCreatedEvent.java │ │ │ │ │ ├── AccountDeletedEvent.java │ │ │ │ │ └── AccountUpdatedEvent.java │ │ │ │ └── interceptor │ │ │ │ │ └── AccountsCommandInterceptor.java │ │ │ │ ├── constants │ │ │ │ └── AccountsConstants.java │ │ │ │ ├── dto │ │ │ │ ├── AccountsDto.java │ │ │ │ └── ResponseDto.java │ │ │ │ ├── entity │ │ │ │ ├── Accounts.java │ │ │ │ └── BaseEntity.java │ │ │ │ ├── exception │ │ │ │ ├── AccountAlreadyExistsException.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── ResourceNotFoundException.java │ │ │ │ ├── mapper │ │ │ │ └── AccountsMapper.java │ │ │ │ ├── query │ │ │ │ ├── FindAccountQuery.java │ │ │ │ ├── controller │ │ │ │ │ └── AccountsQueryController.java │ │ │ │ ├── handler │ │ │ │ │ └── AccountsQueryHandler.java │ │ │ │ └── projection │ │ │ │ │ └── AccountProjection.java │ │ │ │ ├── repository │ │ │ │ └── AccountsRepository.java │ │ │ │ └── service │ │ │ │ ├── IAccountsService.java │ │ │ │ └── impl │ │ │ │ └── AccountsServiceImpl.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── accounts │ │ └── AccountsApplicationTests.java ├── cards │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── README.md │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── cards │ │ │ │ ├── CardsApplication.java │ │ │ │ ├── audit │ │ │ │ └── AuditAwareImpl.java │ │ │ │ ├── command │ │ │ │ ├── CreateCardCommand.java │ │ │ │ ├── DeleteCardCommand.java │ │ │ │ ├── UpdateCardCommand.java │ │ │ │ ├── aggregate │ │ │ │ │ └── CardAggregate.java │ │ │ │ ├── controller │ │ │ │ │ └── CardCommandController.java │ │ │ │ ├── event │ │ │ │ │ ├── CardCreatedEvent.java │ │ │ │ │ ├── CardDeletedEvent.java │ │ │ │ │ └── CardUpdatedEvent.java │ │ │ │ └── interceptor │ │ │ │ │ └── CardCommandInterceptor.java │ │ │ │ ├── constants │ │ │ │ └── CardsConstants.java │ │ │ │ ├── dto │ │ │ │ ├── CardsDto.java │ │ │ │ └── ResponseDto.java │ │ │ │ ├── entity │ │ │ │ ├── BaseEntity.java │ │ │ │ └── Cards.java │ │ │ │ ├── exception │ │ │ │ ├── CardAlreadyExistsException.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── ResourceNotFoundException.java │ │ │ │ ├── mapper │ │ │ │ └── CardsMapper.java │ │ │ │ ├── query │ │ │ │ ├── FindCardQuery.java │ │ │ │ ├── controller │ │ │ │ │ └── CardQueryController.java │ │ │ │ ├── handler │ │ │ │ │ └── CardQueryHandler.java │ │ │ │ └── projection │ │ │ │ │ └── CardProjection.java │ │ │ │ ├── repository │ │ │ │ └── CardsRepository.java │ │ │ │ └── service │ │ │ │ ├── ICardsService.java │ │ │ │ └── impl │ │ │ │ └── CardsServiceImpl.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── cards │ │ └── CardsApplicationTests.java ├── customer │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── README.md │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── customer │ │ │ │ ├── CustomersApplication.java │ │ │ │ ├── audit │ │ │ │ └── AuditAwareImpl.java │ │ │ │ ├── command │ │ │ │ ├── CreateCustomerCommand.java │ │ │ │ ├── DeleteCustomerCommand.java │ │ │ │ ├── UpdateCustomerCommand.java │ │ │ │ ├── aggregate │ │ │ │ │ └── CustomerAggregate.java │ │ │ │ ├── controller │ │ │ │ │ └── CustomerCommandController.java │ │ │ │ ├── event │ │ │ │ │ ├── CustomerCreatedEvent.java │ │ │ │ │ ├── CustomerDeletedEvent.java │ │ │ │ │ └── CustomerUpdatedEvent.java │ │ │ │ └── interceptor │ │ │ │ │ └── CustomerCommandInterceptor.java │ │ │ │ ├── constants │ │ │ │ └── CustomerConstants.java │ │ │ │ ├── dto │ │ │ │ ├── CustomerDto.java │ │ │ │ └── ResponseDto.java │ │ │ │ ├── entity │ │ │ │ ├── BaseEntity.java │ │ │ │ └── Customer.java │ │ │ │ ├── exception │ │ │ │ ├── CustomerAlreadyExistsException.java │ │ │ │ ├── GlobalExceptionHandler.java │ │ │ │ └── ResourceNotFoundException.java │ │ │ │ ├── mapper │ │ │ │ └── CustomerMapper.java │ │ │ │ ├── query │ │ │ │ ├── FindCustomerQuery.java │ │ │ │ ├── FindUpdateMobileSagaQuery.java │ │ │ │ ├── controller │ │ │ │ │ └── CustomerQueryController.java │ │ │ │ ├── handler │ │ │ │ │ └── CustomerQueryHandler.java │ │ │ │ └── projection │ │ │ │ │ └── CustomerProjection.java │ │ │ │ ├── repository │ │ │ │ └── CustomerRepository.java │ │ │ │ ├── saga │ │ │ │ └── UpdateMobileNumberSaga.java │ │ │ │ └── service │ │ │ │ ├── ICustomerService.java │ │ │ │ └── impl │ │ │ │ └── CustomerServiceImpl.java │ │ └── resources │ │ │ ├── application.yml │ │ │ └── schema.sql │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── customer │ │ └── AccountsApplicationTests.java ├── eazy-bom │ ├── .mvn │ │ └── wrapper │ │ │ └── maven-wrapper.properties │ ├── common │ │ ├── .gitignore │ │ ├── .mvn │ │ │ └── wrapper │ │ │ │ └── maven-wrapper.properties │ │ ├── mvnw │ │ ├── mvnw.cmd │ │ ├── pom.xml │ │ └── src │ │ │ ├── main │ │ │ ├── java │ │ │ │ └── com │ │ │ │ │ └── eazybytes │ │ │ │ │ └── common │ │ │ │ │ ├── command │ │ │ │ │ ├── RollbackAccntMobNumCommand.java │ │ │ │ │ ├── RollbackCardMobNumCommand.java │ │ │ │ │ ├── RollbackCusMobNumCommand.java │ │ │ │ │ ├── UpdateAccntMobileNumCommand.java │ │ │ │ │ ├── UpdateCardMobileNumCommand.java │ │ │ │ │ ├── UpdateCusMobNumCommand.java │ │ │ │ │ └── UpdateLoanMobileNumCommand.java │ │ │ │ │ ├── config │ │ │ │ │ └── AxonConfig.java │ │ │ │ │ ├── dto │ │ │ │ │ ├── ErrorResponseDto.java │ │ │ │ │ └── MobileNumberUpdateDto.java │ │ │ │ │ └── event │ │ │ │ │ ├── AccntMobNumRollbackedEvent.java │ │ │ │ │ ├── AccntMobileNumUpdatedEvent.java │ │ │ │ │ ├── CardMobNumRollbackedEvent.java │ │ │ │ │ ├── CardMobileNumUpdatedEvent.java │ │ │ │ │ ├── CusMobNumRollbackedEvent.java │ │ │ │ │ ├── CusMobNumUpdatedEvent.java │ │ │ │ │ └── LoanMobileNumUpdatedEvent.java │ │ │ └── resources │ │ │ │ └── application.properties │ │ │ └── test │ │ │ └── java │ │ │ └── com │ │ │ └── eazybytes │ │ │ └── common │ │ │ └── CommonApplicationTests.java │ ├── mvnw │ ├── mvnw.cmd │ └── pom.xml ├── eurekaserver │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── eurekaserver │ │ │ │ └── EurekaserverApplication.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── eurekaserver │ │ └── EurekaserverApplicationTests.java ├── gatewayserver │ ├── .mvn │ │ └── wrapper │ │ │ ├── maven-wrapper.jar │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── gatewayserver │ │ │ │ ├── GatewayserverApplication.java │ │ │ │ ├── config │ │ │ │ └── ClientConfig.java │ │ │ │ ├── dto │ │ │ │ ├── AccountsDto.java │ │ │ │ ├── CardsDto.java │ │ │ │ ├── CustomerDto.java │ │ │ │ ├── CustomerSummaryDto.java │ │ │ │ └── LoansDto.java │ │ │ │ ├── handler │ │ │ │ └── CustomerCompositeHandler.java │ │ │ │ ├── router │ │ │ │ └── CustomerCompositeRouter.java │ │ │ │ └── service │ │ │ │ └── client │ │ │ │ └── CustomerSummaryClient.java │ │ └── resources │ │ │ └── application.yml │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── gatewayserver │ │ └── GatewayserverApplicationTests.java └── loans │ ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties │ ├── README.md │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── eazybytes │ │ │ └── loans │ │ │ ├── LoansApplication.java │ │ │ ├── audit │ │ │ └── AuditAwareImpl.java │ │ │ ├── command │ │ │ ├── CreateLoanCommand.java │ │ │ ├── DeleteLoanCommand.java │ │ │ ├── UpdateLoanCommand.java │ │ │ ├── aggregate │ │ │ │ └── LoanAggregate.java │ │ │ ├── controller │ │ │ │ └── LoanCommandController.java │ │ │ ├── event │ │ │ │ ├── LoanCreatedEvent.java │ │ │ │ ├── LoanDeletedEvent.java │ │ │ │ └── LoanUpdatedEvent.java │ │ │ └── interceptor │ │ │ │ └── LoanCommandInterceptor.java │ │ │ ├── constants │ │ │ └── LoansConstants.java │ │ │ ├── dto │ │ │ ├── LoansDto.java │ │ │ └── ResponseDto.java │ │ │ ├── entity │ │ │ ├── BaseEntity.java │ │ │ └── Loans.java │ │ │ ├── exception │ │ │ ├── GlobalExceptionHandler.java │ │ │ ├── LoanAlreadyExistsException.java │ │ │ └── ResourceNotFoundException.java │ │ │ ├── mapper │ │ │ └── LoansMapper.java │ │ │ ├── query │ │ │ ├── FindLoanQuery.java │ │ │ ├── controller │ │ │ │ └── LoanQueryController.java │ │ │ ├── handler │ │ │ │ └── LoanQueryHandler.java │ │ │ └── projection │ │ │ │ └── LoanProjection.java │ │ │ ├── repository │ │ │ └── LoansRepository.java │ │ │ └── service │ │ │ ├── ILoansService.java │ │ │ └── impl │ │ │ └── LoansServiceImpl.java │ └── resources │ │ ├── application.yml │ │ └── schema.sql │ └── test │ └── java │ └── com │ └── eazybytes │ └── loans │ └── LoansApplicationTests.java └── section7 ├── accounts ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── eazybytes │ │ │ └── accounts │ │ │ ├── AccountsApplication.java │ │ │ ├── audit │ │ │ └── AuditAwareImpl.java │ │ │ ├── command │ │ │ ├── CreateAccountCommand.java │ │ │ ├── DeleteAccountCommand.java │ │ │ ├── UpdateAccountCommand.java │ │ │ ├── aggregate │ │ │ │ └── AccountsAggregate.java │ │ │ ├── controller │ │ │ │ └── AccountsCommandController.java │ │ │ ├── event │ │ │ │ ├── AccountCreatedEvent.java │ │ │ │ ├── AccountDeletedEvent.java │ │ │ │ └── AccountUpdatedEvent.java │ │ │ └── interceptor │ │ │ │ └── AccountsCommandInterceptor.java │ │ │ ├── constants │ │ │ └── AccountsConstants.java │ │ │ ├── dto │ │ │ ├── AccountsDto.java │ │ │ └── ResponseDto.java │ │ │ ├── entity │ │ │ ├── Accounts.java │ │ │ └── BaseEntity.java │ │ │ ├── exception │ │ │ ├── AccountAlreadyExistsException.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ └── ResourceNotFoundException.java │ │ │ ├── mapper │ │ │ └── AccountsMapper.java │ │ │ ├── query │ │ │ ├── FindAccountQuery.java │ │ │ ├── controller │ │ │ │ └── AccountsQueryController.java │ │ │ ├── handler │ │ │ │ └── AccountsQueryHandler.java │ │ │ └── projection │ │ │ │ └── AccountProjection.java │ │ │ ├── repository │ │ │ └── AccountsRepository.java │ │ │ └── service │ │ │ ├── IAccountsService.java │ │ │ └── impl │ │ │ └── AccountsServiceImpl.java │ └── resources │ │ ├── application.yml │ │ └── schema.sql │ └── test │ └── java │ └── com │ └── eazybytes │ └── accounts │ └── AccountsApplicationTests.java ├── cards ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── eazybytes │ │ │ └── cards │ │ │ ├── CardsApplication.java │ │ │ ├── audit │ │ │ └── AuditAwareImpl.java │ │ │ ├── command │ │ │ ├── CreateCardCommand.java │ │ │ ├── DeleteCardCommand.java │ │ │ ├── UpdateCardCommand.java │ │ │ ├── aggregate │ │ │ │ └── CardAggregate.java │ │ │ ├── controller │ │ │ │ └── CardCommandController.java │ │ │ ├── event │ │ │ │ ├── CardCreatedEvent.java │ │ │ │ ├── CardDeletedEvent.java │ │ │ │ └── CardUpdatedEvent.java │ │ │ └── interceptor │ │ │ │ └── CardCommandInterceptor.java │ │ │ ├── constants │ │ │ └── CardsConstants.java │ │ │ ├── dto │ │ │ ├── CardsDto.java │ │ │ └── ResponseDto.java │ │ │ ├── entity │ │ │ ├── BaseEntity.java │ │ │ └── Cards.java │ │ │ ├── exception │ │ │ ├── CardAlreadyExistsException.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ └── ResourceNotFoundException.java │ │ │ ├── mapper │ │ │ └── CardsMapper.java │ │ │ ├── query │ │ │ ├── FindCardQuery.java │ │ │ ├── controller │ │ │ │ └── CardQueryController.java │ │ │ ├── handler │ │ │ │ └── CardQueryHandler.java │ │ │ └── projection │ │ │ │ └── CardProjection.java │ │ │ ├── repository │ │ │ └── CardsRepository.java │ │ │ └── service │ │ │ ├── ICardsService.java │ │ │ └── impl │ │ │ └── CardsServiceImpl.java │ └── resources │ │ ├── application.yml │ │ └── schema.sql │ └── test │ └── java │ └── com │ └── eazybytes │ └── cards │ └── CardsApplicationTests.java ├── customer ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── eazybytes │ │ │ └── customer │ │ │ ├── CustomersApplication.java │ │ │ ├── audit │ │ │ └── AuditAwareImpl.java │ │ │ ├── command │ │ │ ├── CreateCustomerCommand.java │ │ │ ├── DeleteCustomerCommand.java │ │ │ ├── UpdateCustomerCommand.java │ │ │ ├── aggregate │ │ │ │ └── CustomerAggregate.java │ │ │ ├── controller │ │ │ │ └── CustomerCommandController.java │ │ │ ├── event │ │ │ │ ├── CustomerCreatedEvent.java │ │ │ │ ├── CustomerDeletedEvent.java │ │ │ │ └── CustomerUpdatedEvent.java │ │ │ └── interceptor │ │ │ │ └── CustomerCommandInterceptor.java │ │ │ ├── constants │ │ │ └── CustomerConstants.java │ │ │ ├── dto │ │ │ ├── CustomerDto.java │ │ │ └── ResponseDto.java │ │ │ ├── entity │ │ │ ├── BaseEntity.java │ │ │ └── Customer.java │ │ │ ├── exception │ │ │ ├── CustomerAlreadyExistsException.java │ │ │ ├── GlobalExceptionHandler.java │ │ │ └── ResourceNotFoundException.java │ │ │ ├── mapper │ │ │ └── CustomerMapper.java │ │ │ ├── query │ │ │ ├── FindCustomerQuery.java │ │ │ ├── controller │ │ │ │ └── CustomerQueryController.java │ │ │ ├── handler │ │ │ │ └── CustomerQueryHandler.java │ │ │ └── projection │ │ │ │ └── CustomerProjection.java │ │ │ ├── repository │ │ │ └── CustomerRepository.java │ │ │ └── service │ │ │ ├── ICustomerService.java │ │ │ └── impl │ │ │ └── CustomerServiceImpl.java │ └── resources │ │ ├── application.yml │ │ └── schema.sql │ └── test │ └── java │ └── com │ └── eazybytes │ └── customer │ └── AccountsApplicationTests.java ├── eazy-bom ├── .mvn │ └── wrapper │ │ └── maven-wrapper.properties ├── common │ ├── .gitignore │ ├── .mvn │ │ └── wrapper │ │ │ └── maven-wrapper.properties │ ├── mvnw │ ├── mvnw.cmd │ ├── pom.xml │ └── src │ │ ├── main │ │ ├── java │ │ │ └── com │ │ │ │ └── eazybytes │ │ │ │ └── common │ │ │ │ └── dto │ │ │ │ └── ErrorResponseDto.java │ │ └── resources │ │ │ └── application.properties │ │ └── test │ │ └── java │ │ └── com │ │ └── eazybytes │ │ └── common │ │ └── CommonApplicationTests.java ├── mvnw ├── mvnw.cmd └── pom.xml ├── eurekaserver ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── eazybytes │ │ │ └── eurekaserver │ │ │ └── EurekaserverApplication.java │ └── resources │ │ └── application.yml │ └── test │ └── java │ └── com │ └── eazybytes │ └── eurekaserver │ └── EurekaserverApplicationTests.java ├── gatewayserver ├── .mvn │ └── wrapper │ │ ├── maven-wrapper.jar │ │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src │ ├── main │ ├── java │ │ └── com │ │ │ └── eazybytes │ │ │ └── gatewayserver │ │ │ ├── GatewayserverApplication.java │ │ │ ├── config │ │ │ └── ClientConfig.java │ │ │ ├── dto │ │ │ ├── AccountsDto.java │ │ │ ├── CardsDto.java │ │ │ ├── CustomerDto.java │ │ │ ├── CustomerSummaryDto.java │ │ │ └── LoansDto.java │ │ │ ├── handler │ │ │ └── CustomerCompositeHandler.java │ │ │ ├── router │ │ │ └── CustomerCompositeRouter.java │ │ │ └── service │ │ │ └── client │ │ │ └── CustomerSummaryClient.java │ └── resources │ │ └── application.yml │ └── test │ └── java │ └── com │ └── eazybytes │ └── gatewayserver │ └── GatewayserverApplicationTests.java └── loans ├── .mvn └── wrapper │ ├── maven-wrapper.jar │ └── maven-wrapper.properties ├── mvnw ├── mvnw.cmd ├── pom.xml └── src ├── main ├── java │ └── com │ │ └── eazybytes │ │ └── loans │ │ ├── LoansApplication.java │ │ ├── audit │ │ └── AuditAwareImpl.java │ │ ├── command │ │ ├── CreateLoanCommand.java │ │ ├── DeleteLoanCommand.java │ │ ├── UpdateLoanCommand.java │ │ ├── aggregate │ │ │ └── LoanAggregate.java │ │ ├── controller │ │ │ └── LoanCommandController.java │ │ ├── event │ │ │ ├── LoanCreatedEvent.java │ │ │ ├── LoanDeletedEvent.java │ │ │ └── LoanUpdatedEvent.java │ │ └── interceptor │ │ │ └── LoanCommandInterceptor.java │ │ ├── constants │ │ └── LoansConstants.java │ │ ├── dto │ │ ├── LoansDto.java │ │ └── ResponseDto.java │ │ ├── entity │ │ ├── BaseEntity.java │ │ └── Loans.java │ │ ├── exception │ │ ├── GlobalExceptionHandler.java │ │ ├── LoanAlreadyExistsException.java │ │ └── ResourceNotFoundException.java │ │ ├── mapper │ │ └── LoansMapper.java │ │ ├── query │ │ ├── FindLoanQuery.java │ │ ├── controller │ │ │ └── LoanQueryController.java │ │ ├── handler │ │ │ └── LoanQueryHandler.java │ │ └── projection │ │ │ └── LoanProjection.java │ │ ├── repository │ │ └── LoansRepository.java │ │ └── service │ │ ├── ILoansService.java │ │ └── impl │ │ └── LoansServiceImpl.java └── resources │ ├── application.yml │ └── schema.sql └── test └── java └── com └── eazybytes └── loans └── LoansApplicationTests.java /.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | .DS_Store 22 | 23 | ### NetBeans ### 24 | /nbproject/private/ 25 | /nbbuild/ 26 | /dist/ 27 | /nbdist/ 28 | /.nb-gradle/ 29 | build/ 30 | !**/src/main/**/build/ 31 | !**/src/test/**/build/ 32 | -------------------------------------------------------------------------------- /edm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/edm.png -------------------------------------------------------------------------------- /section1/00_start/accounts/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section1/00_start/accounts/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section1/00_start/accounts/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section1/00_start/accounts/src/main/java/com/eazybytes/accounts/AccountsApplication.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.data.jpa.repository.config.EnableJpaAuditing; 6 | 7 | @SpringBootApplication 8 | @EnableJpaAuditing(auditorAwareRef = "auditAwareImpl") 9 | public class AccountsApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(AccountsApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section1/00_start/accounts/src/main/java/com/eazybytes/accounts/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/00_start/accounts/src/main/java/com/eazybytes/accounts/entity/Accounts.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.entity; 2 | 3 | import jakarta.persistence.Entity; 4 | import jakarta.persistence.Id; 5 | import lombok.*; 6 | 7 | @Entity 8 | @Getter 9 | @Setter 10 | @ToString 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | public class Accounts extends BaseEntity { 14 | 15 | @Id 16 | private Long accountNumber; 17 | private String accountType; 18 | private String branchAddress; 19 | private String mobileNumber; 20 | private boolean activeSw; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /section1/00_start/accounts/src/main/java/com/eazybytes/accounts/exception/AccountAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class AccountAlreadyExistsException extends RuntimeException { 8 | 9 | public AccountAlreadyExistsException(String message) { 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/00_start/accounts/src/main/java/com/eazybytes/accounts/repository/AccountsRepository.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.repository; 2 | 3 | import com.eazybytes.accounts.entity.Accounts; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.Optional; 8 | 9 | @Repository 10 | public interface AccountsRepository extends JpaRepository { 11 | 12 | Optional findByMobileNumberAndActiveSw(String mobileNumber, boolean active); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /section1/00_start/accounts/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `accounts` ( 2 | `account_number` int AUTO_INCREMENT PRIMARY KEY, 3 | `mobile_number` varchar(20) NOT NULL, 4 | `account_type` varchar(100) NOT NULL, 5 | `branch_address` varchar(200) NOT NULL, 6 | `active_sw` boolean NOT NULL default 0, 7 | `created_at` date NOT NULL, 8 | `created_by` varchar(20) NOT NULL, 9 | `updated_at` date DEFAULT NULL, 10 | `updated_by` varchar(20) DEFAULT NULL 11 | ); -------------------------------------------------------------------------------- /section1/00_start/accounts/src/test/java/com/eazybytes/accounts/AccountsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class AccountsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/00_start/cards/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section1/00_start/cards/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section1/00_start/cards/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section1/00_start/cards/src/main/java/com/eazybytes/cards/CardsApplication.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.data.jpa.repository.config.EnableJpaAuditing; 6 | 7 | @SpringBootApplication 8 | @EnableJpaAuditing(auditorAwareRef = "auditAwareImpl") 9 | public class CardsApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(CardsApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /section1/00_start/cards/src/main/java/com/eazybytes/cards/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/00_start/cards/src/main/java/com/eazybytes/cards/exception/CardAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class CardAlreadyExistsException extends RuntimeException { 8 | 9 | public CardAlreadyExistsException(String message){ 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/00_start/cards/src/main/java/com/eazybytes/cards/repository/CardsRepository.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.repository; 2 | 3 | import com.eazybytes.cards.entity.Cards; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.Optional; 8 | 9 | @Repository 10 | public interface CardsRepository extends JpaRepository { 11 | 12 | Optional findByMobileNumberAndActiveSw(String mobileNumber, boolean activeSw); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /section1/00_start/cards/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `cards` ( 2 | `card_id` int NOT NULL AUTO_INCREMENT, 3 | `mobile_number` varchar(15) NOT NULL, 4 | `card_number` varchar(100) NOT NULL, 5 | `card_type` varchar(100) NOT NULL, 6 | `total_limit` int NOT NULL, 7 | `amount_used` int NOT NULL, 8 | `available_amount` int NOT NULL, 9 | `active_sw` boolean NOT NULL default 0, 10 | `created_at` date NOT NULL, 11 | `created_by` varchar(20) NOT NULL, 12 | `updated_at` date DEFAULT NULL, 13 | `updated_by` varchar(20) DEFAULT NULL, 14 | PRIMARY KEY (`card_id`) 15 | ); -------------------------------------------------------------------------------- /section1/00_start/cards/src/test/java/com/eazybytes/cards/CardsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CardsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/00_start/customer/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section1/00_start/customer/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section1/00_start/customer/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section1/00_start/customer/src/main/java/com/eazybytes/customer/CustomersApplication.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.data.jpa.repository.config.EnableJpaAuditing; 6 | 7 | @SpringBootApplication 8 | @EnableJpaAuditing(auditorAwareRef = "auditAwareImpl") 9 | public class CustomersApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(CustomersApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section1/00_start/customer/src/main/java/com/eazybytes/customer/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/00_start/customer/src/main/java/com/eazybytes/customer/exception/CustomerAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class CustomerAlreadyExistsException extends RuntimeException { 8 | 9 | public CustomerAlreadyExistsException(String message) { 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/00_start/customer/src/main/java/com/eazybytes/customer/repository/CustomerRepository.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.repository; 2 | 3 | import com.eazybytes.customer.entity.Customer; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.Optional; 8 | 9 | @Repository 10 | public interface CustomerRepository extends JpaRepository { 11 | 12 | Optional findByMobileNumberAndActiveSw(String mobileNumber,boolean active); 13 | 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section1/00_start/customer/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `customer` ( 2 | `customer_id` varchar(100) PRIMARY KEY, 3 | `name` varchar(100) NOT NULL, 4 | `email` varchar(100) NOT NULL, 5 | `mobile_number` varchar(20) NOT NULL, 6 | `active_sw` boolean NOT NULL default 0, 7 | `created_at` date NOT NULL, 8 | `created_by` varchar(20) NOT NULL, 9 | `updated_at` date DEFAULT NULL, 10 | `updated_by` varchar(20) DEFAULT NULL 11 | ); -------------------------------------------------------------------------------- /section1/00_start/customer/src/test/java/com/eazybytes/customer/AccountsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CustomerApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/00_start/eazy-bom/common/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /section1/00_start/eazy-bom/common/src/main/java/com/eazybytes/common/dto/ErrorResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import org.springframework.http.HttpStatus; 6 | 7 | import java.time.LocalDateTime; 8 | 9 | @Data 10 | @AllArgsConstructor 11 | public class ErrorResponseDto { 12 | 13 | private String apiPath; 14 | 15 | private HttpStatus errorCode; 16 | 17 | private String errorMessage; 18 | 19 | private LocalDateTime errorTime; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /section1/00_start/eazy-bom/common/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section1/00_start/eazy-bom/common/src/main/resources/application.properties -------------------------------------------------------------------------------- /section1/00_start/eazy-bom/common/src/test/java/com/eazybytes/common/CommonApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CommonApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/00_start/eurekaserver/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section1/00_start/eurekaserver/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section1/00_start/eurekaserver/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.3/apache-maven-3.9.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section1/00_start/eurekaserver/src/main/java/com/eazybytes/eurekaserver/EurekaserverApplication.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.eurekaserver; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; 6 | 7 | @SpringBootApplication 8 | @EnableEurekaServer 9 | public class EurekaserverApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(EurekaserverApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section1/00_start/eurekaserver/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: "eurekaserver" 4 | server: 5 | port: 8070 6 | 7 | eureka: 8 | instance: 9 | hostname: localhost 10 | client: 11 | fetchRegistry: false 12 | registerWithEureka: false 13 | serviceUrl: 14 | defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/ 15 | 16 | logging: 17 | pattern: 18 | console: "%green(%d{HH:mm:ss.SSS}) %blue(%-5level) %red([%thread]) %yellow(%logger{15}) - %msg%n" -------------------------------------------------------------------------------- /section1/00_start/eurekaserver/src/test/java/com/eazybytes/eurekaserver/EurekaserverApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.eurekaserver; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class EurekaserverApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/00_start/gatewayserver/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section1/00_start/gatewayserver/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section1/00_start/gatewayserver/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.3/apache-maven-3.9.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section1/00_start/gatewayserver/src/test/java/com/eazybytes/gatewayserver/GatewayserverApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.gatewayserver; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class GatewayserverApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/00_start/loans/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section1/00_start/loans/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section1/00_start/loans/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section1/00_start/loans/src/main/java/com/eazybytes/loans/LoansApplication.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.data.jpa.repository.config.EnableJpaAuditing; 6 | 7 | @SpringBootApplication 8 | @EnableJpaAuditing(auditorAwareRef = "auditAwareImpl") 9 | public class LoansApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(LoansApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /section1/00_start/loans/src/main/java/com/eazybytes/loans/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/00_start/loans/src/main/java/com/eazybytes/loans/exception/LoanAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class LoanAlreadyExistsException extends RuntimeException { 8 | 9 | public LoanAlreadyExistsException(String message){ 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/00_start/loans/src/main/java/com/eazybytes/loans/repository/LoansRepository.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.repository; 2 | 3 | import com.eazybytes.loans.entity.Loans; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.Optional; 8 | 9 | @Repository 10 | public interface LoansRepository extends JpaRepository { 11 | 12 | Optional findByMobileNumberAndActiveSw(String mobileNumber, boolean activeSw); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /section1/00_start/loans/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `loans` ( 2 | `loan_number` int NOT NULL PRIMARY KEY, 3 | `mobile_number` varchar(20) NOT NULL, 4 | `loan_type` varchar(100) NOT NULL, 5 | `total_loan` int NOT NULL, 6 | `amount_paid` int NOT NULL, 7 | `outstanding_amount` int NOT NULL, 8 | `active_sw` boolean NOT NULL default 0, 9 | `created_at` date NOT NULL, 10 | `created_by` varchar(20) NOT NULL, 11 | `updated_at` date DEFAULT NULL, 12 | `updated_by` varchar(20) DEFAULT NULL 13 | ); -------------------------------------------------------------------------------- /section1/00_start/loans/src/test/java/com/eazybytes/loans/LoansApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LoansApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/01_end/accounts/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section1/01_end/accounts/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section1/01_end/accounts/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section1/01_end/accounts/src/main/java/com/eazybytes/accounts/AccountsApplication.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.data.jpa.repository.config.EnableJpaAuditing; 6 | 7 | @SpringBootApplication 8 | @EnableJpaAuditing(auditorAwareRef = "auditAwareImpl") 9 | public class AccountsApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(AccountsApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section1/01_end/accounts/src/main/java/com/eazybytes/accounts/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/01_end/accounts/src/main/java/com/eazybytes/accounts/entity/Accounts.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.entity; 2 | 3 | import jakarta.persistence.Entity; 4 | import jakarta.persistence.Id; 5 | import lombok.*; 6 | 7 | @Entity 8 | @Getter 9 | @Setter 10 | @ToString 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | public class Accounts extends BaseEntity { 14 | 15 | @Id 16 | private Long accountNumber; 17 | private String accountType; 18 | private String branchAddress; 19 | private String mobileNumber; 20 | private boolean activeSw; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /section1/01_end/accounts/src/main/java/com/eazybytes/accounts/exception/AccountAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class AccountAlreadyExistsException extends RuntimeException { 8 | 9 | public AccountAlreadyExistsException(String message) { 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/01_end/accounts/src/main/java/com/eazybytes/accounts/repository/AccountsRepository.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.repository; 2 | 3 | import com.eazybytes.accounts.entity.Accounts; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.Optional; 8 | 9 | @Repository 10 | public interface AccountsRepository extends JpaRepository { 11 | 12 | Optional findByMobileNumberAndActiveSw(String mobileNumber, boolean active); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /section1/01_end/accounts/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `accounts` ( 2 | `account_number` int AUTO_INCREMENT PRIMARY KEY, 3 | `mobile_number` varchar(20) NOT NULL, 4 | `account_type` varchar(100) NOT NULL, 5 | `branch_address` varchar(200) NOT NULL, 6 | `active_sw` boolean NOT NULL default 0, 7 | `created_at` date NOT NULL, 8 | `created_by` varchar(20) NOT NULL, 9 | `updated_at` date DEFAULT NULL, 10 | `updated_by` varchar(20) DEFAULT NULL 11 | ); -------------------------------------------------------------------------------- /section1/01_end/accounts/src/test/java/com/eazybytes/accounts/AccountsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class AccountsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/01_end/cards/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section1/01_end/cards/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section1/01_end/cards/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section1/01_end/cards/src/main/java/com/eazybytes/cards/CardsApplication.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.data.jpa.repository.config.EnableJpaAuditing; 6 | 7 | @SpringBootApplication 8 | @EnableJpaAuditing(auditorAwareRef = "auditAwareImpl") 9 | public class CardsApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(CardsApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /section1/01_end/cards/src/main/java/com/eazybytes/cards/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/01_end/cards/src/main/java/com/eazybytes/cards/exception/CardAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class CardAlreadyExistsException extends RuntimeException { 8 | 9 | public CardAlreadyExistsException(String message){ 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/01_end/cards/src/main/java/com/eazybytes/cards/repository/CardsRepository.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.repository; 2 | 3 | import com.eazybytes.cards.entity.Cards; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.Optional; 8 | 9 | @Repository 10 | public interface CardsRepository extends JpaRepository { 11 | 12 | Optional findByMobileNumberAndActiveSw(String mobileNumber, boolean activeSw); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /section1/01_end/cards/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `cards` ( 2 | `card_id` int NOT NULL AUTO_INCREMENT, 3 | `mobile_number` varchar(15) NOT NULL, 4 | `card_number` varchar(100) NOT NULL, 5 | `card_type` varchar(100) NOT NULL, 6 | `total_limit` int NOT NULL, 7 | `amount_used` int NOT NULL, 8 | `available_amount` int NOT NULL, 9 | `active_sw` boolean NOT NULL default 0, 10 | `created_at` date NOT NULL, 11 | `created_by` varchar(20) NOT NULL, 12 | `updated_at` date DEFAULT NULL, 13 | `updated_by` varchar(20) DEFAULT NULL, 14 | PRIMARY KEY (`card_id`) 15 | ); -------------------------------------------------------------------------------- /section1/01_end/cards/src/test/java/com/eazybytes/cards/CardsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CardsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/01_end/customer/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section1/01_end/customer/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section1/01_end/customer/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section1/01_end/customer/src/main/java/com/eazybytes/customer/CustomersApplication.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.data.jpa.repository.config.EnableJpaAuditing; 6 | 7 | @SpringBootApplication 8 | @EnableJpaAuditing(auditorAwareRef = "auditAwareImpl") 9 | public class CustomersApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(CustomersApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section1/01_end/customer/src/main/java/com/eazybytes/customer/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/01_end/customer/src/main/java/com/eazybytes/customer/exception/CustomerAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class CustomerAlreadyExistsException extends RuntimeException { 8 | 9 | public CustomerAlreadyExistsException(String message) { 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/01_end/customer/src/main/java/com/eazybytes/customer/repository/CustomerRepository.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.repository; 2 | 3 | import com.eazybytes.customer.entity.Customer; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.Optional; 8 | 9 | @Repository 10 | public interface CustomerRepository extends JpaRepository { 11 | 12 | Optional findByMobileNumberAndActiveSw(String mobileNumber,boolean active); 13 | 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section1/01_end/customer/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `customer` ( 2 | `customer_id` varchar(100) PRIMARY KEY, 3 | `name` varchar(100) NOT NULL, 4 | `email` varchar(100) NOT NULL, 5 | `mobile_number` varchar(20) NOT NULL, 6 | `active_sw` boolean NOT NULL default 0, 7 | `created_at` date NOT NULL, 8 | `created_by` varchar(20) NOT NULL, 9 | `updated_at` date DEFAULT NULL, 10 | `updated_by` varchar(20) DEFAULT NULL 11 | ); -------------------------------------------------------------------------------- /section1/01_end/customer/src/test/java/com/eazybytes/customer/AccountsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CustomerApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/01_end/eazy-bom/common/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /section1/01_end/eazy-bom/common/src/main/java/com/eazybytes/common/dto/ErrorResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import org.springframework.http.HttpStatus; 6 | 7 | import java.time.LocalDateTime; 8 | 9 | @Data 10 | @AllArgsConstructor 11 | public class ErrorResponseDto { 12 | 13 | private String apiPath; 14 | 15 | private HttpStatus errorCode; 16 | 17 | private String errorMessage; 18 | 19 | private LocalDateTime errorTime; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /section1/01_end/eazy-bom/common/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section1/01_end/eazy-bom/common/src/main/resources/application.properties -------------------------------------------------------------------------------- /section1/01_end/eazy-bom/common/src/test/java/com/eazybytes/common/CommonApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CommonApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/01_end/eurekaserver/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section1/01_end/eurekaserver/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section1/01_end/eurekaserver/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.3/apache-maven-3.9.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section1/01_end/eurekaserver/src/main/java/com/eazybytes/eurekaserver/EurekaserverApplication.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.eurekaserver; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; 6 | 7 | @SpringBootApplication 8 | @EnableEurekaServer 9 | public class EurekaserverApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(EurekaserverApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section1/01_end/eurekaserver/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: "eurekaserver" 4 | server: 5 | port: 8070 6 | 7 | eureka: 8 | instance: 9 | hostname: localhost 10 | client: 11 | fetchRegistry: false 12 | registerWithEureka: false 13 | serviceUrl: 14 | defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/ 15 | 16 | logging: 17 | pattern: 18 | console: "%green(%d{HH:mm:ss.SSS}) %blue(%-5level) %red([%thread]) %yellow(%logger{15}) - %msg%n" -------------------------------------------------------------------------------- /section1/01_end/eurekaserver/src/test/java/com/eazybytes/eurekaserver/EurekaserverApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.eurekaserver; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class EurekaserverApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/01_end/gatewayserver/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section1/01_end/gatewayserver/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section1/01_end/gatewayserver/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.3/apache-maven-3.9.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section1/01_end/gatewayserver/src/main/java/com/eazybytes/gatewayserver/dto/CustomerSummaryDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.gatewayserver.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class CustomerSummaryDto { 9 | 10 | private CustomerDto customer; 11 | private AccountsDto account; 12 | private LoansDto loan; 13 | private CardsDto card; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section1/01_end/gatewayserver/src/test/java/com/eazybytes/gatewayserver/GatewayserverApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.gatewayserver; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class GatewayserverApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/01_end/loans/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section1/01_end/loans/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section1/01_end/loans/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section1/01_end/loans/src/main/java/com/eazybytes/loans/LoansApplication.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.data.jpa.repository.config.EnableJpaAuditing; 6 | 7 | @SpringBootApplication 8 | @EnableJpaAuditing(auditorAwareRef = "auditAwareImpl") 9 | public class LoansApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(LoansApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /section1/01_end/loans/src/main/java/com/eazybytes/loans/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/01_end/loans/src/main/java/com/eazybytes/loans/exception/LoanAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class LoanAlreadyExistsException extends RuntimeException { 8 | 9 | public LoanAlreadyExistsException(String message){ 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section1/01_end/loans/src/main/java/com/eazybytes/loans/repository/LoansRepository.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.repository; 2 | 3 | import com.eazybytes.loans.entity.Loans; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.Optional; 8 | 9 | @Repository 10 | public interface LoansRepository extends JpaRepository { 11 | 12 | Optional findByMobileNumberAndActiveSw(String mobileNumber, boolean activeSw); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /section1/01_end/loans/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `loans` ( 2 | `loan_number` int NOT NULL PRIMARY KEY, 3 | `mobile_number` varchar(20) NOT NULL, 4 | `loan_type` varchar(100) NOT NULL, 5 | `total_loan` int NOT NULL, 6 | `amount_paid` int NOT NULL, 7 | `outstanding_amount` int NOT NULL, 8 | `active_sw` boolean NOT NULL default 0, 9 | `created_at` date NOT NULL, 10 | `created_by` varchar(20) NOT NULL, 11 | `updated_at` date DEFAULT NULL, 12 | `updated_by` varchar(20) DEFAULT NULL 13 | ); -------------------------------------------------------------------------------- /section1/01_end/loans/src/test/java/com/eazybytes/loans/LoansApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LoansApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section3/accounts/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section3/accounts/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section3/accounts/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section3/accounts/src/main/java/com/eazybytes/accounts/command/CreateAccountCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Builder 8 | @Data 9 | public class CreateAccountCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final Long accountNumber; 13 | private final String mobileNumber; 14 | private final String accountType; 15 | private final String branchAddress; 16 | private final boolean activeSw; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section3/accounts/src/main/java/com/eazybytes/accounts/command/DeleteAccountCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Builder 8 | @Data 9 | public class DeleteAccountCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final Long accountNumber; 13 | private final boolean activeSw; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section3/accounts/src/main/java/com/eazybytes/accounts/command/UpdateAccountCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Builder 8 | @Data 9 | public class UpdateAccountCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final Long accountNumber; 13 | private final String mobileNumber; 14 | private final String accountType; 15 | private final String branchAddress; 16 | private final boolean activeSw; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section3/accounts/src/main/java/com/eazybytes/accounts/command/event/AccountCreatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class AccountCreatedEvent { 7 | private Long accountNumber; 8 | private String mobileNumber; 9 | private String accountType; 10 | private String branchAddress; 11 | private boolean activeSw; 12 | } 13 | -------------------------------------------------------------------------------- /section3/accounts/src/main/java/com/eazybytes/accounts/command/event/AccountDeletedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class AccountDeletedEvent { 7 | 8 | private Long accountNumber; 9 | private boolean activeSw; 10 | 11 | } 12 | 13 | -------------------------------------------------------------------------------- /section3/accounts/src/main/java/com/eazybytes/accounts/command/event/AccountUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class AccountUpdatedEvent { 7 | 8 | private Long accountNumber; 9 | private String mobileNumber; 10 | private String accountType; 11 | private String branchAddress; 12 | private boolean activeSw; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /section3/accounts/src/main/java/com/eazybytes/accounts/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section3/accounts/src/main/java/com/eazybytes/accounts/entity/Accounts.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.entity; 2 | 3 | import jakarta.persistence.Entity; 4 | import jakarta.persistence.Id; 5 | import lombok.*; 6 | 7 | @Entity 8 | @Getter 9 | @Setter 10 | @ToString 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | public class Accounts extends BaseEntity { 14 | 15 | @Id 16 | private Long accountNumber; 17 | private String accountType; 18 | private String branchAddress; 19 | private String mobileNumber; 20 | private boolean activeSw; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /section3/accounts/src/main/java/com/eazybytes/accounts/exception/AccountAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class AccountAlreadyExistsException extends RuntimeException { 8 | 9 | public AccountAlreadyExistsException(String message) { 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section3/accounts/src/main/java/com/eazybytes/accounts/query/FindAccountQuery.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.query; 2 | 3 | import lombok.Value; 4 | 5 | @Value 6 | public class FindAccountQuery { 7 | private final String mobileNumber; 8 | } -------------------------------------------------------------------------------- /section3/accounts/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `accounts` ( 2 | `account_number` int AUTO_INCREMENT PRIMARY KEY, 3 | `mobile_number` varchar(20) NOT NULL, 4 | `account_type` varchar(100) NOT NULL, 5 | `branch_address` varchar(200) NOT NULL, 6 | `active_sw` boolean NOT NULL default 0, 7 | `created_at` date NOT NULL, 8 | `created_by` varchar(20) NOT NULL, 9 | `updated_at` date DEFAULT NULL, 10 | `updated_by` varchar(20) DEFAULT NULL 11 | ); -------------------------------------------------------------------------------- /section3/accounts/src/test/java/com/eazybytes/accounts/AccountsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class AccountsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section3/cards/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section3/cards/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section3/cards/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section3/cards/src/main/java/com/eazybytes/cards/command/DeleteCardCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Builder 8 | @Data 9 | public class DeleteCardCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final Long cardNumber; 13 | private final boolean activeSw; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section3/cards/src/main/java/com/eazybytes/cards/command/event/CardCreatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CardCreatedEvent { 7 | private Long cardNumber; 8 | private String mobileNumber; 9 | private String cardType; 10 | private int totalLimit; 11 | private int amountUsed; 12 | private int availableAmount; 13 | private boolean activeSw; 14 | } 15 | -------------------------------------------------------------------------------- /section3/cards/src/main/java/com/eazybytes/cards/command/event/CardDeletedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CardDeletedEvent { 7 | 8 | private Long cardNumber; 9 | private boolean activeSw; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /section3/cards/src/main/java/com/eazybytes/cards/command/event/CardUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CardUpdatedEvent { 7 | 8 | private Long cardNumber; 9 | private String mobileNumber; 10 | private String cardType; 11 | private int totalLimit; 12 | private int amountUsed; 13 | private int availableAmount; 14 | private boolean activeSw; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /section3/cards/src/main/java/com/eazybytes/cards/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section3/cards/src/main/java/com/eazybytes/cards/exception/CardAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class CardAlreadyExistsException extends RuntimeException { 8 | 9 | public CardAlreadyExistsException(String message){ 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section3/cards/src/main/java/com/eazybytes/cards/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.NOT_FOUND) 7 | public class ResourceNotFoundException extends RuntimeException { 8 | 9 | public ResourceNotFoundException(String resourceName, String fieldName, String fieldValue){ 10 | super(String.format("%s not found with the given input data %s : '%s'", resourceName, fieldName, fieldValue)); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /section3/cards/src/main/java/com/eazybytes/cards/query/FindCardQuery.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.query; 2 | 3 | import lombok.Value; 4 | 5 | @Value 6 | public class FindCardQuery { 7 | private final String mobileNumber; 8 | } 9 | -------------------------------------------------------------------------------- /section3/cards/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `cards` ( 2 | `card_id` int NOT NULL AUTO_INCREMENT, 3 | `mobile_number` varchar(15) NOT NULL, 4 | `card_number` varchar(100) NOT NULL, 5 | `card_type` varchar(100) NOT NULL, 6 | `total_limit` int NOT NULL, 7 | `amount_used` int NOT NULL, 8 | `available_amount` int NOT NULL, 9 | `active_sw` boolean NOT NULL default 0, 10 | `created_at` date NOT NULL, 11 | `created_by` varchar(20) NOT NULL, 12 | `updated_at` date DEFAULT NULL, 13 | `updated_by` varchar(20) DEFAULT NULL, 14 | PRIMARY KEY (`card_id`) 15 | ); -------------------------------------------------------------------------------- /section3/cards/src/test/java/com/eazybytes/cards/CardsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CardsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section3/customer/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section3/customer/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section3/customer/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section3/customer/src/main/java/com/eazybytes/customer/command/CreateCustomerCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Data 8 | @Builder 9 | public class CreateCustomerCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final String customerId; 13 | private final String name; 14 | private final String email; 15 | private final String mobileNumber; 16 | private final boolean activeSw; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section3/customer/src/main/java/com/eazybytes/customer/command/DeleteCustomerCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | /** 8 | * VERB+NOUN+Command 9 | */ 10 | @Data 11 | @Builder 12 | public class DeleteCustomerCommand { 13 | 14 | @TargetAggregateIdentifier 15 | private final String customerId; 16 | private final boolean activeSw; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section3/customer/src/main/java/com/eazybytes/customer/command/UpdateCustomerCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Data 8 | @Builder 9 | public class UpdateCustomerCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final String customerId; 13 | private final String name; 14 | private final String email; 15 | private final String mobileNumber; 16 | private final boolean activeSw; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section3/customer/src/main/java/com/eazybytes/customer/command/event/CustomerCreatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.command.event; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * NOUN+VERB(PastTense)+Event 7 | */ 8 | @Data 9 | public class CustomerCreatedEvent { 10 | 11 | private String customerId; 12 | private String name; 13 | private String email; 14 | private String mobileNumber; 15 | private boolean activeSw; 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section3/customer/src/main/java/com/eazybytes/customer/command/event/CustomerDeletedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CustomerDeletedEvent { 7 | 8 | private String customerId; 9 | private boolean activeSw; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /section3/customer/src/main/java/com/eazybytes/customer/command/event/CustomerUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CustomerUpdatedEvent { 7 | 8 | private String customerId; 9 | private String name; 10 | private String email; 11 | private String mobileNumber; 12 | private boolean activeSw; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /section3/customer/src/main/java/com/eazybytes/customer/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section3/customer/src/main/java/com/eazybytes/customer/exception/CustomerAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class CustomerAlreadyExistsException extends RuntimeException { 8 | 9 | public CustomerAlreadyExistsException(String message) { 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section3/customer/src/main/java/com/eazybytes/customer/query/FindCustomerQuery.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.query; 2 | 3 | import lombok.Value; 4 | 5 | /** 6 | * VERB+NOUN+Query 7 | */ 8 | @Value 9 | public class FindCustomerQuery { 10 | 11 | private final String mobileNumber; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section3/customer/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `customer` ( 2 | `customer_id` varchar(100) PRIMARY KEY, 3 | `name` varchar(100) NOT NULL, 4 | `email` varchar(100) NOT NULL, 5 | `mobile_number` varchar(20) NOT NULL, 6 | `active_sw` boolean NOT NULL default 0, 7 | `created_at` date NOT NULL, 8 | `created_by` varchar(20) NOT NULL, 9 | `updated_at` date DEFAULT NULL, 10 | `updated_by` varchar(20) DEFAULT NULL 11 | ); -------------------------------------------------------------------------------- /section3/customer/src/test/java/com/eazybytes/customer/AccountsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CustomerApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section3/eazy-bom/common/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /section3/eazy-bom/common/src/main/java/com/eazybytes/common/dto/ErrorResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import org.springframework.http.HttpStatus; 6 | 7 | import java.time.LocalDateTime; 8 | 9 | @Data 10 | @AllArgsConstructor 11 | public class ErrorResponseDto { 12 | 13 | private String apiPath; 14 | 15 | private HttpStatus errorCode; 16 | 17 | private String errorMessage; 18 | 19 | private LocalDateTime errorTime; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /section3/eazy-bom/common/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section3/eazy-bom/common/src/main/resources/application.properties -------------------------------------------------------------------------------- /section3/eazy-bom/common/src/test/java/com/eazybytes/common/CommonApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CommonApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section3/eurekaserver/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section3/eurekaserver/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section3/eurekaserver/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.3/apache-maven-3.9.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section3/eurekaserver/src/main/java/com/eazybytes/eurekaserver/EurekaserverApplication.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.eurekaserver; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; 6 | 7 | @SpringBootApplication 8 | @EnableEurekaServer 9 | public class EurekaserverApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(EurekaserverApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section3/eurekaserver/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: "eurekaserver" 4 | server: 5 | port: 8070 6 | 7 | eureka: 8 | instance: 9 | hostname: localhost 10 | client: 11 | fetchRegistry: false 12 | registerWithEureka: false 13 | serviceUrl: 14 | defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/ 15 | 16 | logging: 17 | pattern: 18 | console: "%green(%d{HH:mm:ss.SSS}) %blue(%-5level) %red([%thread]) %yellow(%logger{15}) - %msg%n" -------------------------------------------------------------------------------- /section3/eurekaserver/src/test/java/com/eazybytes/eurekaserver/EurekaserverApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.eurekaserver; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class EurekaserverApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section3/gatewayserver/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section3/gatewayserver/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section3/gatewayserver/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.3/apache-maven-3.9.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section3/gatewayserver/src/main/java/com/eazybytes/gatewayserver/dto/CustomerSummaryDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.gatewayserver.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class CustomerSummaryDto { 9 | 10 | private CustomerDto customer; 11 | private AccountsDto account; 12 | private LoansDto loan; 13 | private CardsDto card; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section3/gatewayserver/src/test/java/com/eazybytes/gatewayserver/GatewayserverApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.gatewayserver; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class GatewayserverApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section3/loans/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section3/loans/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section3/loans/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section3/loans/src/main/java/com/eazybytes/loans/command/DeleteLoanCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Builder 8 | @Data 9 | public class DeleteLoanCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final Long loanNumber; 13 | private final boolean activeSw; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section3/loans/src/main/java/com/eazybytes/loans/command/event/LoanCreatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class LoanCreatedEvent { 7 | private Long loanNumber; 8 | private String mobileNumber; 9 | private String loanType; 10 | private String loanStatus; 11 | private int totalLoan; 12 | private int amountPaid; 13 | private int outstandingAmount; 14 | private boolean activeSw; 15 | } 16 | -------------------------------------------------------------------------------- /section3/loans/src/main/java/com/eazybytes/loans/command/event/LoanDeletedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class LoanDeletedEvent { 7 | 8 | private Long loanNumber; 9 | private boolean activeSw; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /section3/loans/src/main/java/com/eazybytes/loans/command/event/LoanUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class LoanUpdatedEvent { 7 | 8 | private Long loanNumber; 9 | private String mobileNumber; 10 | private String loanType; 11 | private int totalLoan; 12 | private int amountPaid; 13 | private int outstandingAmount; 14 | private boolean activeSw; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /section3/loans/src/main/java/com/eazybytes/loans/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section3/loans/src/main/java/com/eazybytes/loans/exception/LoanAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class LoanAlreadyExistsException extends RuntimeException { 8 | 9 | public LoanAlreadyExistsException(String message){ 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section3/loans/src/main/java/com/eazybytes/loans/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.NOT_FOUND) 7 | public class ResourceNotFoundException extends RuntimeException { 8 | 9 | public ResourceNotFoundException(String resourceName, String fieldName, String fieldValue){ 10 | super(String.format("%s not found with the given input data %s : '%s'", resourceName, fieldName, fieldValue)); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /section3/loans/src/main/java/com/eazybytes/loans/query/FindLoanQuery.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.query; 2 | 3 | import lombok.Value; 4 | 5 | @Value 6 | public class FindLoanQuery { 7 | private final String mobileNumber; 8 | } 9 | -------------------------------------------------------------------------------- /section3/loans/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `loans` ( 2 | `loan_number` int NOT NULL PRIMARY KEY, 3 | `mobile_number` varchar(20) NOT NULL, 4 | `loan_type` varchar(100) NOT NULL, 5 | `total_loan` int NOT NULL, 6 | `amount_paid` int NOT NULL, 7 | `outstanding_amount` int NOT NULL, 8 | `active_sw` boolean NOT NULL default 0, 9 | `created_at` date NOT NULL, 10 | `created_by` varchar(20) NOT NULL, 11 | `updated_at` date DEFAULT NULL, 12 | `updated_by` varchar(20) DEFAULT NULL 13 | ); -------------------------------------------------------------------------------- /section3/loans/src/test/java/com/eazybytes/loans/LoansApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LoansApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section4/accounts/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section4/accounts/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section4/accounts/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section4/accounts/src/main/java/com/eazybytes/accounts/command/CreateAccountCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Builder 8 | @Data 9 | public class CreateAccountCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final Long accountNumber; 13 | private final String mobileNumber; 14 | private final String accountType; 15 | private final String branchAddress; 16 | private final boolean activeSw; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section4/accounts/src/main/java/com/eazybytes/accounts/command/DeleteAccountCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Builder 8 | @Data 9 | public class DeleteAccountCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final Long accountNumber; 13 | private final boolean activeSw; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section4/accounts/src/main/java/com/eazybytes/accounts/command/UpdateAccountCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Builder 8 | @Data 9 | public class UpdateAccountCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final Long accountNumber; 13 | private final String mobileNumber; 14 | private final String accountType; 15 | private final String branchAddress; 16 | private final boolean activeSw; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section4/accounts/src/main/java/com/eazybytes/accounts/command/event/AccountCreatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class AccountCreatedEvent { 7 | private Long accountNumber; 8 | private String mobileNumber; 9 | private String accountType; 10 | private String branchAddress; 11 | private boolean activeSw; 12 | } 13 | -------------------------------------------------------------------------------- /section4/accounts/src/main/java/com/eazybytes/accounts/command/event/AccountDeletedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class AccountDeletedEvent { 7 | 8 | private Long accountNumber; 9 | private boolean activeSw; 10 | 11 | } 12 | 13 | -------------------------------------------------------------------------------- /section4/accounts/src/main/java/com/eazybytes/accounts/command/event/AccountUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class AccountUpdatedEvent { 7 | 8 | private Long accountNumber; 9 | private String mobileNumber; 10 | private String accountType; 11 | private String branchAddress; 12 | private boolean activeSw; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /section4/accounts/src/main/java/com/eazybytes/accounts/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section4/accounts/src/main/java/com/eazybytes/accounts/entity/Accounts.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.entity; 2 | 3 | import jakarta.persistence.Entity; 4 | import jakarta.persistence.Id; 5 | import lombok.*; 6 | 7 | @Entity 8 | @Getter 9 | @Setter 10 | @ToString 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | public class Accounts extends BaseEntity { 14 | 15 | @Id 16 | private Long accountNumber; 17 | private String accountType; 18 | private String branchAddress; 19 | private String mobileNumber; 20 | private boolean activeSw; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /section4/accounts/src/main/java/com/eazybytes/accounts/exception/AccountAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class AccountAlreadyExistsException extends RuntimeException { 8 | 9 | public AccountAlreadyExistsException(String message) { 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section4/accounts/src/main/java/com/eazybytes/accounts/query/FindAccountQuery.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.query; 2 | 3 | import lombok.Value; 4 | 5 | @Value 6 | public class FindAccountQuery { 7 | private final String mobileNumber; 8 | } -------------------------------------------------------------------------------- /section4/accounts/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `accounts` ( 2 | `account_number` int AUTO_INCREMENT PRIMARY KEY, 3 | `mobile_number` varchar(20) NOT NULL, 4 | `account_type` varchar(100) NOT NULL, 5 | `branch_address` varchar(200) NOT NULL, 6 | `active_sw` boolean NOT NULL default 0, 7 | `created_at` date NOT NULL, 8 | `created_by` varchar(20) NOT NULL, 9 | `updated_at` date DEFAULT NULL, 10 | `updated_by` varchar(20) DEFAULT NULL 11 | ); -------------------------------------------------------------------------------- /section4/accounts/src/test/java/com/eazybytes/accounts/AccountsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class AccountsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section4/cards/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section4/cards/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section4/cards/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section4/cards/src/main/java/com/eazybytes/cards/command/DeleteCardCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Builder 8 | @Data 9 | public class DeleteCardCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final Long cardNumber; 13 | private final boolean activeSw; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section4/cards/src/main/java/com/eazybytes/cards/command/event/CardCreatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CardCreatedEvent { 7 | private Long cardNumber; 8 | private String mobileNumber; 9 | private String cardType; 10 | private int totalLimit; 11 | private int amountUsed; 12 | private int availableAmount; 13 | private boolean activeSw; 14 | } 15 | -------------------------------------------------------------------------------- /section4/cards/src/main/java/com/eazybytes/cards/command/event/CardDeletedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CardDeletedEvent { 7 | 8 | private Long cardNumber; 9 | private boolean activeSw; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /section4/cards/src/main/java/com/eazybytes/cards/command/event/CardUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CardUpdatedEvent { 7 | 8 | private Long cardNumber; 9 | private String mobileNumber; 10 | private String cardType; 11 | private int totalLimit; 12 | private int amountUsed; 13 | private int availableAmount; 14 | private boolean activeSw; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /section4/cards/src/main/java/com/eazybytes/cards/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section4/cards/src/main/java/com/eazybytes/cards/exception/CardAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class CardAlreadyExistsException extends RuntimeException { 8 | 9 | public CardAlreadyExistsException(String message){ 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section4/cards/src/main/java/com/eazybytes/cards/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.NOT_FOUND) 7 | public class ResourceNotFoundException extends RuntimeException { 8 | 9 | public ResourceNotFoundException(String resourceName, String fieldName, String fieldValue){ 10 | super(String.format("%s not found with the given input data %s : '%s'", resourceName, fieldName, fieldValue)); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /section4/cards/src/main/java/com/eazybytes/cards/query/FindCardQuery.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.query; 2 | 3 | import lombok.Value; 4 | 5 | @Value 6 | public class FindCardQuery { 7 | private final String mobileNumber; 8 | } 9 | -------------------------------------------------------------------------------- /section4/cards/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `cards` ( 2 | `card_id` int NOT NULL AUTO_INCREMENT, 3 | `mobile_number` varchar(15) NOT NULL, 4 | `card_number` varchar(100) NOT NULL, 5 | `card_type` varchar(100) NOT NULL, 6 | `total_limit` int NOT NULL, 7 | `amount_used` int NOT NULL, 8 | `available_amount` int NOT NULL, 9 | `active_sw` boolean NOT NULL default 0, 10 | `created_at` date NOT NULL, 11 | `created_by` varchar(20) NOT NULL, 12 | `updated_at` date DEFAULT NULL, 13 | `updated_by` varchar(20) DEFAULT NULL, 14 | PRIMARY KEY (`card_id`) 15 | ); -------------------------------------------------------------------------------- /section4/cards/src/test/java/com/eazybytes/cards/CardsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CardsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section4/customer/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section4/customer/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section4/customer/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section4/customer/src/main/java/com/eazybytes/customer/command/CreateCustomerCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Data 8 | @Builder 9 | public class CreateCustomerCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final String customerId; 13 | private final String name; 14 | private final String email; 15 | private final String mobileNumber; 16 | private final boolean activeSw; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section4/customer/src/main/java/com/eazybytes/customer/command/DeleteCustomerCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | /** 8 | * VERB+NOUN+Command 9 | */ 10 | @Data 11 | @Builder 12 | public class DeleteCustomerCommand { 13 | 14 | @TargetAggregateIdentifier 15 | private final String customerId; 16 | private final boolean activeSw; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section4/customer/src/main/java/com/eazybytes/customer/command/UpdateCustomerCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Data 8 | @Builder 9 | public class UpdateCustomerCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final String customerId; 13 | private final String name; 14 | private final String email; 15 | private final String mobileNumber; 16 | private final boolean activeSw; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section4/customer/src/main/java/com/eazybytes/customer/command/event/CustomerCreatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.command.event; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * NOUN+VERB(PastTense)+Event 7 | */ 8 | @Data 9 | public class CustomerCreatedEvent { 10 | 11 | private String customerId; 12 | private String name; 13 | private String email; 14 | private String mobileNumber; 15 | private boolean activeSw; 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section4/customer/src/main/java/com/eazybytes/customer/command/event/CustomerDeletedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CustomerDeletedEvent { 7 | 8 | private String customerId; 9 | private boolean activeSw; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /section4/customer/src/main/java/com/eazybytes/customer/command/event/CustomerUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CustomerUpdatedEvent { 7 | 8 | private String customerId; 9 | private String name; 10 | private String email; 11 | private String mobileNumber; 12 | private boolean activeSw; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /section4/customer/src/main/java/com/eazybytes/customer/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section4/customer/src/main/java/com/eazybytes/customer/exception/CustomerAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class CustomerAlreadyExistsException extends RuntimeException { 8 | 9 | public CustomerAlreadyExistsException(String message) { 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section4/customer/src/main/java/com/eazybytes/customer/query/FindCustomerQuery.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.query; 2 | 3 | import lombok.Value; 4 | 5 | /** 6 | * VERB+NOUN+Query 7 | */ 8 | @Value 9 | public class FindCustomerQuery { 10 | 11 | private final String mobileNumber; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section4/customer/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `customer` ( 2 | `customer_id` varchar(100) PRIMARY KEY, 3 | `name` varchar(100) NOT NULL, 4 | `email` varchar(100) NOT NULL, 5 | `mobile_number` varchar(20) NOT NULL, 6 | `active_sw` boolean NOT NULL default 0, 7 | `created_at` date NOT NULL, 8 | `created_by` varchar(20) NOT NULL, 9 | `updated_at` date DEFAULT NULL, 10 | `updated_by` varchar(20) DEFAULT NULL 11 | ); -------------------------------------------------------------------------------- /section4/customer/src/test/java/com/eazybytes/customer/AccountsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CustomerApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section4/eazy-bom/common/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /section4/eazy-bom/common/src/main/java/com/eazybytes/common/config/AxonConfig.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common.config; 2 | 3 | import com.thoughtworks.xstream.XStream; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | @Configuration 8 | public class AxonConfig { 9 | 10 | @Bean 11 | public XStream xStream() { 12 | XStream xStream = new XStream(); 13 | xStream.allowTypesByWildcard(new String[] { 14 | "com.eazybytes.**" 15 | }); 16 | return xStream; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /section4/eazy-bom/common/src/main/java/com/eazybytes/common/dto/ErrorResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import org.springframework.http.HttpStatus; 6 | 7 | import java.time.LocalDateTime; 8 | 9 | @Data 10 | @AllArgsConstructor 11 | public class ErrorResponseDto { 12 | 13 | private String apiPath; 14 | 15 | private HttpStatus errorCode; 16 | 17 | private String errorMessage; 18 | 19 | private LocalDateTime errorTime; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /section4/eazy-bom/common/src/main/java/com/eazybytes/common/event/AccountDataChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class AccountDataChangedEvent { 7 | 8 | private String mobileNumber; 9 | private Long accountNumber; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /section4/eazy-bom/common/src/main/java/com/eazybytes/common/event/CardDataChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CardDataChangedEvent { 7 | 8 | private String mobileNumber; 9 | private Long cardNumber; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /section4/eazy-bom/common/src/main/java/com/eazybytes/common/event/CustomerDataChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CustomerDataChangedEvent { 7 | 8 | private String name; 9 | private String mobileNumber; 10 | private boolean activeSw; 11 | 12 | } 13 | -------------------------------------------------------------------------------- /section4/eazy-bom/common/src/main/java/com/eazybytes/common/event/LoanDataChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class LoanDataChangedEvent { 7 | 8 | private String mobileNumber; 9 | private Long loanNumber; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /section4/eazy-bom/common/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section4/eazy-bom/common/src/main/resources/application.properties -------------------------------------------------------------------------------- /section4/eazy-bom/common/src/test/java/com/eazybytes/common/CommonApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CommonApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section4/eurekaserver/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section4/eurekaserver/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section4/eurekaserver/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.3/apache-maven-3.9.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section4/eurekaserver/src/main/java/com/eazybytes/eurekaserver/EurekaserverApplication.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.eurekaserver; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; 6 | 7 | @SpringBootApplication 8 | @EnableEurekaServer 9 | public class EurekaserverApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(EurekaserverApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section4/eurekaserver/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: "eurekaserver" 4 | server: 5 | port: 8070 6 | 7 | eureka: 8 | instance: 9 | hostname: localhost 10 | client: 11 | fetchRegistry: false 12 | registerWithEureka: false 13 | serviceUrl: 14 | defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/ 15 | 16 | logging: 17 | pattern: 18 | console: "%green(%d{HH:mm:ss.SSS}) %blue(%-5level) %red([%thread]) %yellow(%logger{15}) - %msg%n" -------------------------------------------------------------------------------- /section4/eurekaserver/src/test/java/com/eazybytes/eurekaserver/EurekaserverApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.eurekaserver; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class EurekaserverApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section4/gatewayserver/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section4/gatewayserver/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section4/gatewayserver/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.3/apache-maven-3.9.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section4/gatewayserver/src/main/java/com/eazybytes/gatewayserver/dto/CustomerSummaryDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.gatewayserver.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class CustomerSummaryDto { 9 | 10 | private CustomerDto customer; 11 | private AccountsDto account; 12 | private LoansDto loan; 13 | private CardsDto card; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section4/gatewayserver/src/test/java/com/eazybytes/gatewayserver/GatewayserverApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.gatewayserver; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class GatewayserverApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section4/loans/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section4/loans/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section4/loans/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section4/loans/src/main/java/com/eazybytes/loans/command/DeleteLoanCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Builder 8 | @Data 9 | public class DeleteLoanCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final Long loanNumber; 13 | private final boolean activeSw; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section4/loans/src/main/java/com/eazybytes/loans/command/event/LoanCreatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class LoanCreatedEvent { 7 | private Long loanNumber; 8 | private String mobileNumber; 9 | private String loanType; 10 | private String loanStatus; 11 | private int totalLoan; 12 | private int amountPaid; 13 | private int outstandingAmount; 14 | private boolean activeSw; 15 | } 16 | -------------------------------------------------------------------------------- /section4/loans/src/main/java/com/eazybytes/loans/command/event/LoanDeletedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class LoanDeletedEvent { 7 | 8 | private Long loanNumber; 9 | private boolean activeSw; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /section4/loans/src/main/java/com/eazybytes/loans/command/event/LoanUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class LoanUpdatedEvent { 7 | 8 | private Long loanNumber; 9 | private String mobileNumber; 10 | private String loanType; 11 | private int totalLoan; 12 | private int amountPaid; 13 | private int outstandingAmount; 14 | private boolean activeSw; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /section4/loans/src/main/java/com/eazybytes/loans/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section4/loans/src/main/java/com/eazybytes/loans/exception/LoanAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class LoanAlreadyExistsException extends RuntimeException { 8 | 9 | public LoanAlreadyExistsException(String message){ 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section4/loans/src/main/java/com/eazybytes/loans/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.NOT_FOUND) 7 | public class ResourceNotFoundException extends RuntimeException { 8 | 9 | public ResourceNotFoundException(String resourceName, String fieldName, String fieldValue){ 10 | super(String.format("%s not found with the given input data %s : '%s'", resourceName, fieldName, fieldValue)); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /section4/loans/src/main/java/com/eazybytes/loans/query/FindLoanQuery.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.query; 2 | 3 | import lombok.Value; 4 | 5 | @Value 6 | public class FindLoanQuery { 7 | private final String mobileNumber; 8 | } 9 | -------------------------------------------------------------------------------- /section4/loans/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `loans` ( 2 | `loan_number` int NOT NULL PRIMARY KEY, 3 | `mobile_number` varchar(20) NOT NULL, 4 | `loan_type` varchar(100) NOT NULL, 5 | `total_loan` int NOT NULL, 6 | `amount_paid` int NOT NULL, 7 | `outstanding_amount` int NOT NULL, 8 | `active_sw` boolean NOT NULL default 0, 9 | `created_at` date NOT NULL, 10 | `created_by` varchar(20) NOT NULL, 11 | `updated_at` date DEFAULT NULL, 12 | `updated_by` varchar(20) DEFAULT NULL 13 | ); -------------------------------------------------------------------------------- /section4/loans/src/test/java/com/eazybytes/loans/LoansApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LoansApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section4/profile/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section4/profile/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section4/profile/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section4/profile/src/main/java/com/eazybytes/profile/dto/ProfileDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.profile.dto; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class ProfileDto { 7 | 8 | private String name; 9 | private String mobileNumber; 10 | private long accountNumber; 11 | private long cardNumber; 12 | private long loanNumber; 13 | 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section4/profile/src/main/java/com/eazybytes/profile/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.profile.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section4/profile/src/main/java/com/eazybytes/profile/exception/CustomerAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.profile.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class CustomerAlreadyExistsException extends RuntimeException { 8 | 9 | public CustomerAlreadyExistsException(String message) { 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section4/profile/src/main/java/com/eazybytes/profile/query/FindProfileQuery.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.profile.query; 2 | 3 | import lombok.Value; 4 | 5 | /** 6 | * VERB+NOUN+Query 7 | */ 8 | @Value 9 | public class FindProfileQuery { 10 | 11 | private final String mobileNumber; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section4/profile/src/main/java/com/eazybytes/profile/repository/ProfileRepository.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.profile.repository; 2 | 3 | import com.eazybytes.profile.entity.Profile; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.Optional; 8 | 9 | @Repository 10 | public interface ProfileRepository extends JpaRepository { 11 | 12 | Optional findByMobileNumberAndActiveSw(String mobileNumber, boolean active); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /section4/profile/src/test/java/com/eazybytes/profile/ProfileApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.profile; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class ProfileApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section5/accounts/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section5/accounts/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section5/accounts/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section5/accounts/src/main/java/com/eazybytes/accounts/AccountsApplication.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.data.jpa.repository.config.EnableJpaAuditing; 6 | 7 | @SpringBootApplication 8 | @EnableJpaAuditing(auditorAwareRef = "auditAwareImpl") 9 | public class AccountsApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(AccountsApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section5/accounts/src/main/java/com/eazybytes/accounts/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section5/accounts/src/main/java/com/eazybytes/accounts/entity/Accounts.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.entity; 2 | 3 | import jakarta.persistence.Entity; 4 | import jakarta.persistence.Id; 5 | import lombok.*; 6 | 7 | @Entity 8 | @Getter 9 | @Setter 10 | @ToString 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | public class Accounts extends BaseEntity { 14 | 15 | @Id 16 | private Long accountNumber; 17 | private String accountType; 18 | private String branchAddress; 19 | private String mobileNumber; 20 | private boolean activeSw; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /section5/accounts/src/main/java/com/eazybytes/accounts/exception/AccountAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class AccountAlreadyExistsException extends RuntimeException { 8 | 9 | public AccountAlreadyExistsException(String message) { 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section5/accounts/src/main/java/com/eazybytes/accounts/repository/AccountsRepository.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.repository; 2 | 3 | import com.eazybytes.accounts.entity.Accounts; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.Optional; 8 | 9 | @Repository 10 | public interface AccountsRepository extends JpaRepository { 11 | 12 | Optional findByMobileNumberAndActiveSw(String mobileNumber, boolean active); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /section5/accounts/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `accounts` ( 2 | `account_number` int AUTO_INCREMENT PRIMARY KEY, 3 | `mobile_number` varchar(20) NOT NULL, 4 | `account_type` varchar(100) NOT NULL, 5 | `branch_address` varchar(200) NOT NULL, 6 | `active_sw` boolean NOT NULL default 0, 7 | `created_at` date NOT NULL, 8 | `created_by` varchar(20) NOT NULL, 9 | `updated_at` date DEFAULT NULL, 10 | `updated_by` varchar(20) DEFAULT NULL 11 | ); -------------------------------------------------------------------------------- /section5/accounts/src/test/java/com/eazybytes/accounts/AccountsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class AccountsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section5/cards/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section5/cards/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section5/cards/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section5/cards/src/main/java/com/eazybytes/cards/CardsApplication.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.data.jpa.repository.config.EnableJpaAuditing; 6 | 7 | @SpringBootApplication 8 | @EnableJpaAuditing(auditorAwareRef = "auditAwareImpl") 9 | public class CardsApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(CardsApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /section5/cards/src/main/java/com/eazybytes/cards/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section5/cards/src/main/java/com/eazybytes/cards/exception/CardAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class CardAlreadyExistsException extends RuntimeException { 8 | 9 | public CardAlreadyExistsException(String message){ 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section5/cards/src/main/java/com/eazybytes/cards/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.NOT_FOUND) 7 | public class ResourceNotFoundException extends RuntimeException { 8 | 9 | public ResourceNotFoundException(String resourceName, String fieldName, String fieldValue){ 10 | super(String.format("%s not found with the given input data %s : '%s'", resourceName, fieldName, fieldValue)); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /section5/cards/src/main/java/com/eazybytes/cards/repository/CardsRepository.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.repository; 2 | 3 | import com.eazybytes.cards.entity.Cards; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.Optional; 8 | 9 | @Repository 10 | public interface CardsRepository extends JpaRepository { 11 | 12 | Optional findByMobileNumberAndActiveSw(String mobileNumber, boolean activeSw); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /section5/cards/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `cards` ( 2 | `card_id` int NOT NULL AUTO_INCREMENT, 3 | `mobile_number` varchar(15) NOT NULL, 4 | `card_number` varchar(100) NOT NULL, 5 | `card_type` varchar(100) NOT NULL, 6 | `total_limit` int NOT NULL, 7 | `amount_used` int NOT NULL, 8 | `available_amount` int NOT NULL, 9 | `active_sw` boolean NOT NULL default 0, 10 | `created_at` date NOT NULL, 11 | `created_by` varchar(20) NOT NULL, 12 | `updated_at` date DEFAULT NULL, 13 | `updated_by` varchar(20) DEFAULT NULL, 14 | PRIMARY KEY (`card_id`) 15 | ); -------------------------------------------------------------------------------- /section5/cards/src/test/java/com/eazybytes/cards/CardsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CardsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section5/customer/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section5/customer/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section5/customer/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section5/customer/src/main/java/com/eazybytes/customer/CustomersApplication.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.data.jpa.repository.config.EnableJpaAuditing; 6 | 7 | @SpringBootApplication 8 | @EnableJpaAuditing(auditorAwareRef = "auditAwareImpl") 9 | public class CustomersApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(CustomersApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section5/customer/src/main/java/com/eazybytes/customer/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section5/customer/src/main/java/com/eazybytes/customer/exception/CustomerAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class CustomerAlreadyExistsException extends RuntimeException { 8 | 9 | public CustomerAlreadyExistsException(String message) { 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section5/customer/src/main/java/com/eazybytes/customer/repository/CustomerRepository.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.repository; 2 | 3 | import com.eazybytes.customer.entity.Customer; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.Optional; 8 | 9 | @Repository 10 | public interface CustomerRepository extends JpaRepository { 11 | 12 | Optional findByMobileNumberAndActiveSw(String mobileNumber,boolean active); 13 | 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section5/customer/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `customer` ( 2 | `customer_id` varchar(100) PRIMARY KEY, 3 | `name` varchar(100) NOT NULL, 4 | `email` varchar(100) NOT NULL, 5 | `mobile_number` varchar(20) NOT NULL, 6 | `active_sw` boolean NOT NULL default 0, 7 | `created_at` date NOT NULL, 8 | `created_by` varchar(20) NOT NULL, 9 | `updated_at` date DEFAULT NULL, 10 | `updated_by` varchar(20) DEFAULT NULL 11 | ); -------------------------------------------------------------------------------- /section5/customer/src/test/java/com/eazybytes/customer/AccountsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CustomerApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section5/eazy-bom/common/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /section5/eazy-bom/common/src/main/java/com/eazybytes/common/dto/ErrorResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import org.springframework.http.HttpStatus; 6 | 7 | import java.time.LocalDateTime; 8 | 9 | @Data 10 | @AllArgsConstructor 11 | public class ErrorResponseDto { 12 | 13 | private String apiPath; 14 | 15 | private HttpStatus errorCode; 16 | 17 | private String errorMessage; 18 | 19 | private LocalDateTime errorTime; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /section5/eazy-bom/common/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section5/eazy-bom/common/src/main/resources/application.properties -------------------------------------------------------------------------------- /section5/eazy-bom/common/src/test/java/com/eazybytes/common/CommonApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CommonApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section5/eurekaserver/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section5/eurekaserver/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section5/eurekaserver/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.3/apache-maven-3.9.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section5/eurekaserver/src/main/java/com/eazybytes/eurekaserver/EurekaserverApplication.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.eurekaserver; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; 6 | 7 | @SpringBootApplication 8 | @EnableEurekaServer 9 | public class EurekaserverApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(EurekaserverApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section5/eurekaserver/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: "eurekaserver" 4 | server: 5 | port: 8070 6 | 7 | eureka: 8 | instance: 9 | hostname: localhost 10 | client: 11 | fetchRegistry: false 12 | registerWithEureka: false 13 | serviceUrl: 14 | defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/ 15 | 16 | logging: 17 | pattern: 18 | console: "%green(%d{HH:mm:ss.SSS}) %blue(%-5level) %red([%thread]) %yellow(%logger{15}) - %msg%n" -------------------------------------------------------------------------------- /section5/eurekaserver/src/test/java/com/eazybytes/eurekaserver/EurekaserverApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.eurekaserver; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class EurekaserverApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section5/gatewayserver/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section5/gatewayserver/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section5/gatewayserver/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.3/apache-maven-3.9.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section5/gatewayserver/src/main/java/com/eazybytes/gatewayserver/dto/CustomerSummaryDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.gatewayserver.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class CustomerSummaryDto { 9 | 10 | private CustomerDto customer; 11 | private AccountsDto account; 12 | private LoansDto loan; 13 | private CardsDto card; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section5/gatewayserver/src/test/java/com/eazybytes/gatewayserver/GatewayserverApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.gatewayserver; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class GatewayserverApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section5/loans/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section5/loans/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section5/loans/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section5/loans/src/main/java/com/eazybytes/loans/LoansApplication.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.data.jpa.repository.config.EnableJpaAuditing; 6 | 7 | @SpringBootApplication 8 | @EnableJpaAuditing(auditorAwareRef = "auditAwareImpl") 9 | public class LoansApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(LoansApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /section5/loans/src/main/java/com/eazybytes/loans/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section5/loans/src/main/java/com/eazybytes/loans/exception/LoanAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class LoanAlreadyExistsException extends RuntimeException { 8 | 9 | public LoanAlreadyExistsException(String message){ 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section5/loans/src/main/java/com/eazybytes/loans/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.NOT_FOUND) 7 | public class ResourceNotFoundException extends RuntimeException { 8 | 9 | public ResourceNotFoundException(String resourceName, String fieldName, String fieldValue){ 10 | super(String.format("%s not found with the given input data %s : '%s'", resourceName, fieldName, fieldValue)); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /section5/loans/src/main/java/com/eazybytes/loans/repository/LoansRepository.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.repository; 2 | 3 | import com.eazybytes.loans.entity.Loans; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | import org.springframework.stereotype.Repository; 6 | 7 | import java.util.Optional; 8 | 9 | @Repository 10 | public interface LoansRepository extends JpaRepository { 11 | 12 | Optional findByMobileNumberAndActiveSw(String mobileNumber, boolean activeSw); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /section5/loans/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `loans` ( 2 | `loan_number` int NOT NULL PRIMARY KEY, 3 | `mobile_number` varchar(20) NOT NULL, 4 | `loan_type` varchar(100) NOT NULL, 5 | `total_loan` int NOT NULL, 6 | `amount_paid` int NOT NULL, 7 | `outstanding_amount` int NOT NULL, 8 | `active_sw` boolean NOT NULL default 0, 9 | `created_at` date NOT NULL, 10 | `created_by` varchar(20) NOT NULL, 11 | `updated_at` date DEFAULT NULL, 12 | `updated_by` varchar(20) DEFAULT NULL 13 | ); -------------------------------------------------------------------------------- /section5/loans/src/test/java/com/eazybytes/loans/LoansApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LoansApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section6/accounts/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section6/accounts/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section6/accounts/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section6/accounts/src/main/java/com/eazybytes/accounts/command/CreateAccountCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Builder 8 | @Data 9 | public class CreateAccountCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final Long accountNumber; 13 | private final String mobileNumber; 14 | private final String accountType; 15 | private final String branchAddress; 16 | private final boolean activeSw; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section6/accounts/src/main/java/com/eazybytes/accounts/command/DeleteAccountCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Builder 8 | @Data 9 | public class DeleteAccountCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final Long accountNumber; 13 | private final boolean activeSw; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section6/accounts/src/main/java/com/eazybytes/accounts/command/UpdateAccountCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Builder 8 | @Data 9 | public class UpdateAccountCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final Long accountNumber; 13 | private final String mobileNumber; 14 | private final String accountType; 15 | private final String branchAddress; 16 | private final boolean activeSw; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section6/accounts/src/main/java/com/eazybytes/accounts/command/event/AccountCreatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class AccountCreatedEvent { 7 | private Long accountNumber; 8 | private String mobileNumber; 9 | private String accountType; 10 | private String branchAddress; 11 | private boolean activeSw; 12 | } 13 | -------------------------------------------------------------------------------- /section6/accounts/src/main/java/com/eazybytes/accounts/command/event/AccountDeletedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class AccountDeletedEvent { 7 | 8 | private Long accountNumber; 9 | private boolean activeSw; 10 | 11 | } 12 | 13 | -------------------------------------------------------------------------------- /section6/accounts/src/main/java/com/eazybytes/accounts/command/event/AccountUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class AccountUpdatedEvent { 7 | 8 | private Long accountNumber; 9 | private String mobileNumber; 10 | private String accountType; 11 | private String branchAddress; 12 | private boolean activeSw; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /section6/accounts/src/main/java/com/eazybytes/accounts/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section6/accounts/src/main/java/com/eazybytes/accounts/entity/Accounts.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.entity; 2 | 3 | import jakarta.persistence.Entity; 4 | import jakarta.persistence.Id; 5 | import lombok.*; 6 | 7 | @Entity 8 | @Getter 9 | @Setter 10 | @ToString 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | public class Accounts extends BaseEntity { 14 | 15 | @Id 16 | private Long accountNumber; 17 | private String accountType; 18 | private String branchAddress; 19 | private String mobileNumber; 20 | private boolean activeSw; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /section6/accounts/src/main/java/com/eazybytes/accounts/exception/AccountAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class AccountAlreadyExistsException extends RuntimeException { 8 | 9 | public AccountAlreadyExistsException(String message) { 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section6/accounts/src/main/java/com/eazybytes/accounts/query/FindAccountQuery.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.query; 2 | 3 | import lombok.Value; 4 | 5 | @Value 6 | public class FindAccountQuery { 7 | private final String mobileNumber; 8 | } -------------------------------------------------------------------------------- /section6/accounts/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `accounts` ( 2 | `account_number` int AUTO_INCREMENT PRIMARY KEY, 3 | `mobile_number` varchar(20) NOT NULL, 4 | `account_type` varchar(100) NOT NULL, 5 | `branch_address` varchar(200) NOT NULL, 6 | `active_sw` boolean NOT NULL default 0, 7 | `created_at` date NOT NULL, 8 | `created_by` varchar(20) NOT NULL, 9 | `updated_at` date DEFAULT NULL, 10 | `updated_by` varchar(20) DEFAULT NULL 11 | ); -------------------------------------------------------------------------------- /section6/accounts/src/test/java/com/eazybytes/accounts/AccountsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class AccountsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section6/cards/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section6/cards/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section6/cards/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section6/cards/src/main/java/com/eazybytes/cards/command/DeleteCardCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Builder 8 | @Data 9 | public class DeleteCardCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final Long cardNumber; 13 | private final boolean activeSw; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section6/cards/src/main/java/com/eazybytes/cards/command/event/CardCreatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CardCreatedEvent { 7 | private Long cardNumber; 8 | private String mobileNumber; 9 | private String cardType; 10 | private int totalLimit; 11 | private int amountUsed; 12 | private int availableAmount; 13 | private boolean activeSw; 14 | } 15 | -------------------------------------------------------------------------------- /section6/cards/src/main/java/com/eazybytes/cards/command/event/CardDeletedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CardDeletedEvent { 7 | 8 | private Long cardNumber; 9 | private boolean activeSw; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /section6/cards/src/main/java/com/eazybytes/cards/command/event/CardUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CardUpdatedEvent { 7 | 8 | private Long cardNumber; 9 | private String mobileNumber; 10 | private String cardType; 11 | private int totalLimit; 12 | private int amountUsed; 13 | private int availableAmount; 14 | private boolean activeSw; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /section6/cards/src/main/java/com/eazybytes/cards/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section6/cards/src/main/java/com/eazybytes/cards/exception/CardAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class CardAlreadyExistsException extends RuntimeException { 8 | 9 | public CardAlreadyExistsException(String message){ 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section6/cards/src/main/java/com/eazybytes/cards/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.NOT_FOUND) 7 | public class ResourceNotFoundException extends RuntimeException { 8 | 9 | public ResourceNotFoundException(String resourceName, String fieldName, String fieldValue){ 10 | super(String.format("%s not found with the given input data %s : '%s'", resourceName, fieldName, fieldValue)); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /section6/cards/src/main/java/com/eazybytes/cards/query/FindCardQuery.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.query; 2 | 3 | import lombok.Value; 4 | 5 | @Value 6 | public class FindCardQuery { 7 | private final String mobileNumber; 8 | } 9 | -------------------------------------------------------------------------------- /section6/cards/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `cards` ( 2 | `card_id` int NOT NULL AUTO_INCREMENT, 3 | `mobile_number` varchar(15) NOT NULL, 4 | `card_number` varchar(100) NOT NULL, 5 | `card_type` varchar(100) NOT NULL, 6 | `total_limit` int NOT NULL, 7 | `amount_used` int NOT NULL, 8 | `available_amount` int NOT NULL, 9 | `active_sw` boolean NOT NULL default 0, 10 | `created_at` date NOT NULL, 11 | `created_by` varchar(20) NOT NULL, 12 | `updated_at` date DEFAULT NULL, 13 | `updated_by` varchar(20) DEFAULT NULL, 14 | PRIMARY KEY (`card_id`) 15 | ); -------------------------------------------------------------------------------- /section6/cards/src/test/java/com/eazybytes/cards/CardsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CardsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section6/customer/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section6/customer/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section6/customer/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section6/customer/src/main/java/com/eazybytes/customer/command/CreateCustomerCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Data 8 | @Builder 9 | public class CreateCustomerCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final String customerId; 13 | private final String name; 14 | private final String email; 15 | private final String mobileNumber; 16 | private final boolean activeSw; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section6/customer/src/main/java/com/eazybytes/customer/command/DeleteCustomerCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | /** 8 | * VERB+NOUN+Command 9 | */ 10 | @Data 11 | @Builder 12 | public class DeleteCustomerCommand { 13 | 14 | @TargetAggregateIdentifier 15 | private final String customerId; 16 | private final boolean activeSw; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section6/customer/src/main/java/com/eazybytes/customer/command/UpdateCustomerCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Data 8 | @Builder 9 | public class UpdateCustomerCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final String customerId; 13 | private final String name; 14 | private final String email; 15 | private final String mobileNumber; 16 | private final boolean activeSw; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section6/customer/src/main/java/com/eazybytes/customer/command/event/CustomerCreatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.command.event; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * NOUN+VERB(PastTense)+Event 7 | */ 8 | @Data 9 | public class CustomerCreatedEvent { 10 | 11 | private String customerId; 12 | private String name; 13 | private String email; 14 | private String mobileNumber; 15 | private boolean activeSw; 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section6/customer/src/main/java/com/eazybytes/customer/command/event/CustomerDeletedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CustomerDeletedEvent { 7 | 8 | private String customerId; 9 | private boolean activeSw; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /section6/customer/src/main/java/com/eazybytes/customer/command/event/CustomerUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CustomerUpdatedEvent { 7 | 8 | private String customerId; 9 | private String name; 10 | private String email; 11 | private String mobileNumber; 12 | private boolean activeSw; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /section6/customer/src/main/java/com/eazybytes/customer/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section6/customer/src/main/java/com/eazybytes/customer/exception/CustomerAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class CustomerAlreadyExistsException extends RuntimeException { 8 | 9 | public CustomerAlreadyExistsException(String message) { 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section6/customer/src/main/java/com/eazybytes/customer/query/FindCustomerQuery.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.query; 2 | 3 | import lombok.Value; 4 | 5 | /** 6 | * VERB+NOUN+Query 7 | */ 8 | @Value 9 | public class FindCustomerQuery { 10 | 11 | private final String mobileNumber; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section6/customer/src/main/java/com/eazybytes/customer/query/FindUpdateMobileSagaQuery.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.query; 2 | 3 | import lombok.Value; 4 | 5 | /** 6 | * VERB+NOUN+Query 7 | */ 8 | @Value 9 | public class FindUpdateMobileSagaQuery { 10 | 11 | } 12 | -------------------------------------------------------------------------------- /section6/customer/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `customer` ( 2 | `customer_id` varchar(100) PRIMARY KEY, 3 | `name` varchar(100) NOT NULL, 4 | `email` varchar(100) NOT NULL, 5 | `mobile_number` varchar(20) NOT NULL, 6 | `active_sw` boolean NOT NULL default 0, 7 | `created_at` date NOT NULL, 8 | `created_by` varchar(20) NOT NULL, 9 | `updated_at` date DEFAULT NULL, 10 | `updated_by` varchar(20) DEFAULT NULL 11 | ); -------------------------------------------------------------------------------- /section6/customer/src/test/java/com/eazybytes/customer/AccountsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CustomerApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section6/eazy-bom/common/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /section6/eazy-bom/common/src/main/java/com/eazybytes/common/command/RollbackAccntMobNumCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Data 8 | @Builder 9 | public class RollbackAccntMobNumCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final Long accountNumber; 13 | private final String customerId; 14 | private final String mobileNumber; 15 | private final String newMobileNumber; 16 | private final String errorMsg; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section6/eazy-bom/common/src/main/java/com/eazybytes/common/command/RollbackCusMobNumCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Data 8 | @Builder 9 | public class RollbackCusMobNumCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final String customerId; 13 | private final String mobileNumber; 14 | private final String newMobileNumber; 15 | private final String errorMsg; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /section6/eazy-bom/common/src/main/java/com/eazybytes/common/config/AxonConfig.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common.config; 2 | 3 | import com.thoughtworks.xstream.XStream; 4 | import org.springframework.context.annotation.Bean; 5 | import org.springframework.context.annotation.Configuration; 6 | 7 | @Configuration 8 | public class AxonConfig { 9 | 10 | @Bean 11 | public XStream xStream() { 12 | XStream xStream = new XStream(); 13 | xStream.allowTypesByWildcard(new String[] { 14 | "com.eazybytes.**" 15 | }); 16 | return xStream; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /section6/eazy-bom/common/src/main/java/com/eazybytes/common/dto/ErrorResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import org.springframework.http.HttpStatus; 6 | 7 | import java.time.LocalDateTime; 8 | 9 | @Data 10 | @AllArgsConstructor 11 | public class ErrorResponseDto { 12 | 13 | private String apiPath; 14 | 15 | private HttpStatus errorCode; 16 | 17 | private String errorMessage; 18 | 19 | private LocalDateTime errorTime; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /section6/eazy-bom/common/src/main/java/com/eazybytes/common/event/AccntMobNumRollbackedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class AccntMobNumRollbackedEvent { 7 | private String customerId; 8 | private Long accountNumber; 9 | private String mobileNumber; 10 | private String newMobileNumber; 11 | private String errorMsg; 12 | } 13 | -------------------------------------------------------------------------------- /section6/eazy-bom/common/src/main/java/com/eazybytes/common/event/AccntMobileNumUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class AccntMobileNumUpdatedEvent { 7 | 8 | private Long accountNumber; 9 | private Long loanNumber; 10 | private Long cardNumber; 11 | private String mobileNumber; 12 | private String newMobileNumber; 13 | private String customerId; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section6/eazy-bom/common/src/main/java/com/eazybytes/common/event/CardMobNumRollbackedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CardMobNumRollbackedEvent { 7 | private String customerId; 8 | private Long accountNumber; 9 | private Long cardNumber; 10 | private String mobileNumber; 11 | private String newMobileNumber; 12 | private String errorMsg; 13 | } 14 | -------------------------------------------------------------------------------- /section6/eazy-bom/common/src/main/java/com/eazybytes/common/event/CardMobileNumUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CardMobileNumUpdatedEvent { 7 | 8 | private Long accountNumber; 9 | private Long loanNumber; 10 | private Long cardNumber; 11 | private String mobileNumber; 12 | private String newMobileNumber; 13 | private String customerId; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section6/eazy-bom/common/src/main/java/com/eazybytes/common/event/CusMobNumRollbackedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CusMobNumRollbackedEvent { 7 | private String customerId; 8 | private String mobileNumber; 9 | private String newMobileNumber; 10 | private String errorMsg; 11 | } 12 | -------------------------------------------------------------------------------- /section6/eazy-bom/common/src/main/java/com/eazybytes/common/event/CusMobNumUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CusMobNumUpdatedEvent { 7 | private String customerId; 8 | private Long accountNumber; 9 | private Long loanNumber; 10 | private Long cardNumber; 11 | private String mobileNumber; 12 | private String newMobileNumber; 13 | } 14 | -------------------------------------------------------------------------------- /section6/eazy-bom/common/src/main/java/com/eazybytes/common/event/LoanMobileNumUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class LoanMobileNumUpdatedEvent { 7 | 8 | private Long accountNumber; 9 | private Long loanNumber; 10 | private Long cardNumber; 11 | private String mobileNumber; 12 | private String newMobileNumber; 13 | private String customerId; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section6/eazy-bom/common/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section6/eazy-bom/common/src/main/resources/application.properties -------------------------------------------------------------------------------- /section6/eazy-bom/common/src/test/java/com/eazybytes/common/CommonApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CommonApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section6/eurekaserver/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section6/eurekaserver/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section6/eurekaserver/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.3/apache-maven-3.9.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section6/eurekaserver/src/main/java/com/eazybytes/eurekaserver/EurekaserverApplication.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.eurekaserver; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; 6 | 7 | @SpringBootApplication 8 | @EnableEurekaServer 9 | public class EurekaserverApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(EurekaserverApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section6/eurekaserver/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: "eurekaserver" 4 | server: 5 | port: 8070 6 | 7 | eureka: 8 | instance: 9 | hostname: localhost 10 | client: 11 | fetchRegistry: false 12 | registerWithEureka: false 13 | serviceUrl: 14 | defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/ 15 | 16 | logging: 17 | pattern: 18 | console: "%green(%d{HH:mm:ss.SSS}) %blue(%-5level) %red([%thread]) %yellow(%logger{15}) - %msg%n" -------------------------------------------------------------------------------- /section6/eurekaserver/src/test/java/com/eazybytes/eurekaserver/EurekaserverApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.eurekaserver; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class EurekaserverApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section6/gatewayserver/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section6/gatewayserver/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section6/gatewayserver/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.3/apache-maven-3.9.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section6/gatewayserver/src/main/java/com/eazybytes/gatewayserver/dto/CustomerSummaryDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.gatewayserver.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class CustomerSummaryDto { 9 | 10 | private CustomerDto customer; 11 | private AccountsDto account; 12 | private LoansDto loan; 13 | private CardsDto card; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section6/gatewayserver/src/test/java/com/eazybytes/gatewayserver/GatewayserverApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.gatewayserver; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class GatewayserverApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section6/loans/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section6/loans/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section6/loans/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section6/loans/src/main/java/com/eazybytes/loans/command/DeleteLoanCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Builder 8 | @Data 9 | public class DeleteLoanCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final Long loanNumber; 13 | private final boolean activeSw; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section6/loans/src/main/java/com/eazybytes/loans/command/event/LoanCreatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class LoanCreatedEvent { 7 | private Long loanNumber; 8 | private String mobileNumber; 9 | private String loanType; 10 | private String loanStatus; 11 | private int totalLoan; 12 | private int amountPaid; 13 | private int outstandingAmount; 14 | private boolean activeSw; 15 | } 16 | -------------------------------------------------------------------------------- /section6/loans/src/main/java/com/eazybytes/loans/command/event/LoanDeletedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class LoanDeletedEvent { 7 | 8 | private Long loanNumber; 9 | private boolean activeSw; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /section6/loans/src/main/java/com/eazybytes/loans/command/event/LoanUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class LoanUpdatedEvent { 7 | 8 | private Long loanNumber; 9 | private String mobileNumber; 10 | private String loanType; 11 | private int totalLoan; 12 | private int amountPaid; 13 | private int outstandingAmount; 14 | private boolean activeSw; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /section6/loans/src/main/java/com/eazybytes/loans/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section6/loans/src/main/java/com/eazybytes/loans/exception/LoanAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class LoanAlreadyExistsException extends RuntimeException { 8 | 9 | public LoanAlreadyExistsException(String message){ 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section6/loans/src/main/java/com/eazybytes/loans/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.NOT_FOUND) 7 | public class ResourceNotFoundException extends RuntimeException { 8 | 9 | public ResourceNotFoundException(String resourceName, String fieldName, String fieldValue){ 10 | super(String.format("%s not found with the given input data %s : '%s'", resourceName, fieldName, fieldValue)); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /section6/loans/src/main/java/com/eazybytes/loans/query/FindLoanQuery.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.query; 2 | 3 | import lombok.Value; 4 | 5 | @Value 6 | public class FindLoanQuery { 7 | private final String mobileNumber; 8 | } 9 | -------------------------------------------------------------------------------- /section6/loans/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `loans` ( 2 | `loan_number` int NOT NULL PRIMARY KEY, 3 | `mobile_number` varchar(20) NOT NULL, 4 | `loan_type` varchar(100) NOT NULL, 5 | `total_loan` int NOT NULL, 6 | `amount_paid` int NOT NULL, 7 | `outstanding_amount` int NOT NULL, 8 | `active_sw` boolean NOT NULL default 0, 9 | `created_at` date NOT NULL, 10 | `created_by` varchar(20) NOT NULL, 11 | `updated_at` date DEFAULT NULL, 12 | `updated_by` varchar(20) DEFAULT NULL 13 | ); -------------------------------------------------------------------------------- /section6/loans/src/test/java/com/eazybytes/loans/LoansApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LoansApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section7/accounts/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section7/accounts/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section7/accounts/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section7/accounts/src/main/java/com/eazybytes/accounts/command/CreateAccountCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Builder 8 | @Data 9 | public class CreateAccountCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final Long accountNumber; 13 | private final String mobileNumber; 14 | private final String accountType; 15 | private final String branchAddress; 16 | private final boolean activeSw; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section7/accounts/src/main/java/com/eazybytes/accounts/command/DeleteAccountCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Builder 8 | @Data 9 | public class DeleteAccountCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final Long accountNumber; 13 | private final boolean activeSw; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section7/accounts/src/main/java/com/eazybytes/accounts/command/UpdateAccountCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Builder 8 | @Data 9 | public class UpdateAccountCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final Long accountNumber; 13 | private final String mobileNumber; 14 | private final String accountType; 15 | private final String branchAddress; 16 | private final boolean activeSw; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section7/accounts/src/main/java/com/eazybytes/accounts/command/event/AccountCreatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class AccountCreatedEvent { 7 | private Long accountNumber; 8 | private String mobileNumber; 9 | private String accountType; 10 | private String branchAddress; 11 | private boolean activeSw; 12 | } 13 | -------------------------------------------------------------------------------- /section7/accounts/src/main/java/com/eazybytes/accounts/command/event/AccountDeletedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class AccountDeletedEvent { 7 | 8 | private Long accountNumber; 9 | private boolean activeSw; 10 | 11 | } 12 | 13 | -------------------------------------------------------------------------------- /section7/accounts/src/main/java/com/eazybytes/accounts/command/event/AccountUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class AccountUpdatedEvent { 7 | 8 | private Long accountNumber; 9 | private String mobileNumber; 10 | private String accountType; 11 | private String branchAddress; 12 | private boolean activeSw; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /section7/accounts/src/main/java/com/eazybytes/accounts/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section7/accounts/src/main/java/com/eazybytes/accounts/entity/Accounts.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.entity; 2 | 3 | import jakarta.persistence.Entity; 4 | import jakarta.persistence.Id; 5 | import lombok.*; 6 | 7 | @Entity 8 | @Getter 9 | @Setter 10 | @ToString 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | public class Accounts extends BaseEntity { 14 | 15 | @Id 16 | private Long accountNumber; 17 | private String accountType; 18 | private String branchAddress; 19 | private String mobileNumber; 20 | private boolean activeSw; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /section7/accounts/src/main/java/com/eazybytes/accounts/exception/AccountAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class AccountAlreadyExistsException extends RuntimeException { 8 | 9 | public AccountAlreadyExistsException(String message) { 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section7/accounts/src/main/java/com/eazybytes/accounts/query/FindAccountQuery.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts.query; 2 | 3 | import lombok.Value; 4 | 5 | @Value 6 | public class FindAccountQuery { 7 | private final String mobileNumber; 8 | } -------------------------------------------------------------------------------- /section7/accounts/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `accounts` ( 2 | `account_number` int AUTO_INCREMENT PRIMARY KEY, 3 | `mobile_number` varchar(20) NOT NULL, 4 | `account_type` varchar(100) NOT NULL, 5 | `branch_address` varchar(200) NOT NULL, 6 | `active_sw` boolean NOT NULL default 0, 7 | `created_at` date NOT NULL, 8 | `created_by` varchar(20) NOT NULL, 9 | `updated_at` date DEFAULT NULL, 10 | `updated_by` varchar(20) DEFAULT NULL 11 | ); -------------------------------------------------------------------------------- /section7/accounts/src/test/java/com/eazybytes/accounts/AccountsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.accounts; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class AccountsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section7/cards/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section7/cards/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section7/cards/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section7/cards/src/main/java/com/eazybytes/cards/command/DeleteCardCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Builder 8 | @Data 9 | public class DeleteCardCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final Long cardNumber; 13 | private final boolean activeSw; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section7/cards/src/main/java/com/eazybytes/cards/command/event/CardCreatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CardCreatedEvent { 7 | private Long cardNumber; 8 | private String mobileNumber; 9 | private String cardType; 10 | private int totalLimit; 11 | private int amountUsed; 12 | private int availableAmount; 13 | private boolean activeSw; 14 | } 15 | -------------------------------------------------------------------------------- /section7/cards/src/main/java/com/eazybytes/cards/command/event/CardDeletedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CardDeletedEvent { 7 | 8 | private Long cardNumber; 9 | private boolean activeSw; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /section7/cards/src/main/java/com/eazybytes/cards/command/event/CardUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CardUpdatedEvent { 7 | 8 | private Long cardNumber; 9 | private String mobileNumber; 10 | private String cardType; 11 | private int totalLimit; 12 | private int amountUsed; 13 | private int availableAmount; 14 | private boolean activeSw; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /section7/cards/src/main/java/com/eazybytes/cards/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section7/cards/src/main/java/com/eazybytes/cards/exception/CardAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class CardAlreadyExistsException extends RuntimeException { 8 | 9 | public CardAlreadyExistsException(String message){ 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section7/cards/src/main/java/com/eazybytes/cards/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.NOT_FOUND) 7 | public class ResourceNotFoundException extends RuntimeException { 8 | 9 | public ResourceNotFoundException(String resourceName, String fieldName, String fieldValue){ 10 | super(String.format("%s not found with the given input data %s : '%s'", resourceName, fieldName, fieldValue)); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /section7/cards/src/main/java/com/eazybytes/cards/query/FindCardQuery.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards.query; 2 | 3 | import lombok.Value; 4 | 5 | @Value 6 | public class FindCardQuery { 7 | private final String mobileNumber; 8 | } 9 | -------------------------------------------------------------------------------- /section7/cards/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `cards` ( 2 | `card_id` int NOT NULL AUTO_INCREMENT, 3 | `mobile_number` varchar(15) NOT NULL, 4 | `card_number` varchar(100) NOT NULL, 5 | `card_type` varchar(100) NOT NULL, 6 | `total_limit` int NOT NULL, 7 | `amount_used` int NOT NULL, 8 | `available_amount` int NOT NULL, 9 | `active_sw` boolean NOT NULL default 0, 10 | `created_at` date NOT NULL, 11 | `created_by` varchar(20) NOT NULL, 12 | `updated_at` date DEFAULT NULL, 13 | `updated_by` varchar(20) DEFAULT NULL, 14 | PRIMARY KEY (`card_id`) 15 | ); -------------------------------------------------------------------------------- /section7/cards/src/test/java/com/eazybytes/cards/CardsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.cards; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CardsApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section7/customer/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section7/customer/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section7/customer/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section7/customer/src/main/java/com/eazybytes/customer/command/CreateCustomerCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Data 8 | @Builder 9 | public class CreateCustomerCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final String customerId; 13 | private final String name; 14 | private final String email; 15 | private final String mobileNumber; 16 | private final boolean activeSw; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section7/customer/src/main/java/com/eazybytes/customer/command/DeleteCustomerCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | /** 8 | * VERB+NOUN+Command 9 | */ 10 | @Data 11 | @Builder 12 | public class DeleteCustomerCommand { 13 | 14 | @TargetAggregateIdentifier 15 | private final String customerId; 16 | private final boolean activeSw; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section7/customer/src/main/java/com/eazybytes/customer/command/UpdateCustomerCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Data 8 | @Builder 9 | public class UpdateCustomerCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final String customerId; 13 | private final String name; 14 | private final String email; 15 | private final String mobileNumber; 16 | private final boolean activeSw; 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section7/customer/src/main/java/com/eazybytes/customer/command/event/CustomerCreatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.command.event; 2 | 3 | import lombok.Data; 4 | 5 | /** 6 | * NOUN+VERB(PastTense)+Event 7 | */ 8 | @Data 9 | public class CustomerCreatedEvent { 10 | 11 | private String customerId; 12 | private String name; 13 | private String email; 14 | private String mobileNumber; 15 | private boolean activeSw; 16 | 17 | 18 | } 19 | -------------------------------------------------------------------------------- /section7/customer/src/main/java/com/eazybytes/customer/command/event/CustomerDeletedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CustomerDeletedEvent { 7 | 8 | private String customerId; 9 | private boolean activeSw; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /section7/customer/src/main/java/com/eazybytes/customer/command/event/CustomerUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class CustomerUpdatedEvent { 7 | 8 | private String customerId; 9 | private String name; 10 | private String email; 11 | private String mobileNumber; 12 | private boolean activeSw; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /section7/customer/src/main/java/com/eazybytes/customer/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section7/customer/src/main/java/com/eazybytes/customer/exception/CustomerAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class CustomerAlreadyExistsException extends RuntimeException { 8 | 9 | public CustomerAlreadyExistsException(String message) { 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section7/customer/src/main/java/com/eazybytes/customer/query/FindCustomerQuery.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer.query; 2 | 3 | import lombok.Value; 4 | 5 | /** 6 | * VERB+NOUN+Query 7 | */ 8 | @Value 9 | public class FindCustomerQuery { 10 | 11 | private final String mobileNumber; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section7/customer/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `customer` ( 2 | `customer_id` varchar(100) PRIMARY KEY, 3 | `name` varchar(100) NOT NULL, 4 | `email` varchar(100) NOT NULL, 5 | `mobile_number` varchar(20) NOT NULL, 6 | `active_sw` boolean NOT NULL default 0, 7 | `created_at` date NOT NULL, 8 | `created_by` varchar(20) NOT NULL, 9 | `updated_at` date DEFAULT NULL, 10 | `updated_by` varchar(20) DEFAULT NULL 11 | ); -------------------------------------------------------------------------------- /section7/customer/src/test/java/com/eazybytes/customer/AccountsApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.customer; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CustomerApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section7/eazy-bom/common/.gitignore: -------------------------------------------------------------------------------- 1 | HELP.md 2 | target/ 3 | !.mvn/wrapper/maven-wrapper.jar 4 | !**/src/main/**/target/ 5 | !**/src/test/**/target/ 6 | 7 | ### STS ### 8 | .apt_generated 9 | .classpath 10 | .factorypath 11 | .project 12 | .settings 13 | .springBeans 14 | .sts4-cache 15 | 16 | ### IntelliJ IDEA ### 17 | .idea 18 | *.iws 19 | *.iml 20 | *.ipr 21 | 22 | ### NetBeans ### 23 | /nbproject/private/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ 28 | build/ 29 | !**/src/main/**/build/ 30 | !**/src/test/**/build/ 31 | 32 | ### VS Code ### 33 | .vscode/ 34 | -------------------------------------------------------------------------------- /section7/eazy-bom/common/src/main/java/com/eazybytes/common/dto/ErrorResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import org.springframework.http.HttpStatus; 6 | 7 | import java.time.LocalDateTime; 8 | 9 | @Data 10 | @AllArgsConstructor 11 | public class ErrorResponseDto { 12 | 13 | private String apiPath; 14 | 15 | private HttpStatus errorCode; 16 | 17 | private String errorMessage; 18 | 19 | private LocalDateTime errorTime; 20 | 21 | } 22 | -------------------------------------------------------------------------------- /section7/eazy-bom/common/src/main/resources/application.properties: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section7/eazy-bom/common/src/main/resources/application.properties -------------------------------------------------------------------------------- /section7/eazy-bom/common/src/test/java/com/eazybytes/common/CommonApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.common; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class CommonApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section7/eurekaserver/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section7/eurekaserver/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section7/eurekaserver/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.3/apache-maven-3.9.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section7/eurekaserver/src/main/java/com/eazybytes/eurekaserver/EurekaserverApplication.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.eurekaserver; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; 6 | 7 | @SpringBootApplication 8 | @EnableEurekaServer 9 | public class EurekaserverApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(EurekaserverApplication.class, args); 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section7/eurekaserver/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: "eurekaserver" 4 | server: 5 | port: 8070 6 | 7 | eureka: 8 | instance: 9 | hostname: localhost 10 | client: 11 | fetchRegistry: false 12 | registerWithEureka: false 13 | serviceUrl: 14 | defaultZone: http://${eureka.instance.hostname}:${server.port}/eureka/ 15 | 16 | logging: 17 | pattern: 18 | console: "%green(%d{HH:mm:ss.SSS}) %blue(%-5level) %red([%thread]) %yellow(%logger{15}) - %msg%n" -------------------------------------------------------------------------------- /section7/eurekaserver/src/test/java/com/eazybytes/eurekaserver/EurekaserverApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.eurekaserver; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class EurekaserverApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section7/gatewayserver/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section7/gatewayserver/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section7/gatewayserver/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.3/apache-maven-3.9.3-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section7/gatewayserver/src/main/java/com/eazybytes/gatewayserver/dto/CustomerSummaryDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.gatewayserver.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class CustomerSummaryDto { 9 | 10 | private CustomerDto customer; 11 | private AccountsDto account; 12 | private LoansDto loan; 13 | private CardsDto card; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section7/gatewayserver/src/test/java/com/eazybytes/gatewayserver/GatewayserverApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.gatewayserver; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class GatewayserverApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section7/loans/.mvn/wrapper/maven-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eazybytes/event-driven-microservices/19c179ce55a7545ec1e639119b8490d008895edc/section7/loans/.mvn/wrapper/maven-wrapper.jar -------------------------------------------------------------------------------- /section7/loans/.mvn/wrapper/maven-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.2/apache-maven-3.9.2-bin.zip 2 | wrapperUrl=https://repo.maven.apache.org/maven2/org/apache/maven/wrapper/maven-wrapper/3.2.0/maven-wrapper-3.2.0.jar 3 | -------------------------------------------------------------------------------- /section7/loans/src/main/java/com/eazybytes/loans/command/DeleteLoanCommand.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.command; 2 | 3 | import lombok.Builder; 4 | import lombok.Data; 5 | import org.axonframework.modelling.command.TargetAggregateIdentifier; 6 | 7 | @Builder 8 | @Data 9 | public class DeleteLoanCommand { 10 | 11 | @TargetAggregateIdentifier 12 | private final Long loanNumber; 13 | private final boolean activeSw; 14 | 15 | } 16 | -------------------------------------------------------------------------------- /section7/loans/src/main/java/com/eazybytes/loans/command/event/LoanCreatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class LoanCreatedEvent { 7 | private Long loanNumber; 8 | private String mobileNumber; 9 | private String loanType; 10 | private String loanStatus; 11 | private int totalLoan; 12 | private int amountPaid; 13 | private int outstandingAmount; 14 | private boolean activeSw; 15 | } 16 | -------------------------------------------------------------------------------- /section7/loans/src/main/java/com/eazybytes/loans/command/event/LoanDeletedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class LoanDeletedEvent { 7 | 8 | private Long loanNumber; 9 | private boolean activeSw; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /section7/loans/src/main/java/com/eazybytes/loans/command/event/LoanUpdatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.command.event; 2 | 3 | import lombok.Data; 4 | 5 | @Data 6 | public class LoanUpdatedEvent { 7 | 8 | private Long loanNumber; 9 | private String mobileNumber; 10 | private String loanType; 11 | private int totalLoan; 12 | private int amountPaid; 13 | private int outstandingAmount; 14 | private boolean activeSw; 15 | 16 | } 17 | -------------------------------------------------------------------------------- /section7/loans/src/main/java/com/eazybytes/loans/dto/ResponseDto.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | 6 | @Data 7 | @AllArgsConstructor 8 | public class ResponseDto { 9 | 10 | private String statusCode; 11 | private String statusMsg; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section7/loans/src/main/java/com/eazybytes/loans/exception/LoanAlreadyExistsException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.BAD_REQUEST) 7 | public class LoanAlreadyExistsException extends RuntimeException { 8 | 9 | public LoanAlreadyExistsException(String message){ 10 | super(message); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /section7/loans/src/main/java/com/eazybytes/loans/exception/ResourceNotFoundException.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.exception; 2 | 3 | import org.springframework.http.HttpStatus; 4 | import org.springframework.web.bind.annotation.ResponseStatus; 5 | 6 | @ResponseStatus(value = HttpStatus.NOT_FOUND) 7 | public class ResourceNotFoundException extends RuntimeException { 8 | 9 | public ResourceNotFoundException(String resourceName, String fieldName, String fieldValue){ 10 | super(String.format("%s not found with the given input data %s : '%s'", resourceName, fieldName, fieldValue)); 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /section7/loans/src/main/java/com/eazybytes/loans/query/FindLoanQuery.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans.query; 2 | 3 | import lombok.Value; 4 | 5 | @Value 6 | public class FindLoanQuery { 7 | private final String mobileNumber; 8 | } 9 | -------------------------------------------------------------------------------- /section7/loans/src/main/resources/schema.sql: -------------------------------------------------------------------------------- 1 | CREATE TABLE IF NOT EXISTS `loans` ( 2 | `loan_number` int NOT NULL PRIMARY KEY, 3 | `mobile_number` varchar(20) NOT NULL, 4 | `loan_type` varchar(100) NOT NULL, 5 | `total_loan` int NOT NULL, 6 | `amount_paid` int NOT NULL, 7 | `outstanding_amount` int NOT NULL, 8 | `active_sw` boolean NOT NULL default 0, 9 | `created_at` date NOT NULL, 10 | `created_by` varchar(20) NOT NULL, 11 | `updated_at` date DEFAULT NULL, 12 | `updated_by` varchar(20) DEFAULT NULL 13 | ); -------------------------------------------------------------------------------- /section7/loans/src/test/java/com/eazybytes/loans/LoansApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.eazybytes.loans; 2 | 3 | import org.junit.jupiter.api.Test; 4 | import org.springframework.boot.test.context.SpringBootTest; 5 | 6 | @SpringBootTest 7 | class LoansApplicationTests { 8 | 9 | @Test 10 | void contextLoads() { 11 | } 12 | 13 | } 14 | --------------------------------------------------------------------------------