├── .gitignore ├── config-files ├── discovery-server-docker.properties ├── api-gateway-docker.properties ├── notification-api-docker.properties ├── account-api-docker.properties ├── asset-management-api-docker.properties ├── transaction-api-docker.properties ├── discovery-server.properties ├── account-api.properties ├── asset-management-api.properties ├── notification-api.properties ├── transaction-api.properties └── api-gateway.properties ├── docs ├── javadoc │ ├── legal │ │ ├── LICENSE │ │ ├── COPYRIGHT │ │ ├── jqueryUI.md │ │ └── jquery.md │ ├── module-search-index.js │ ├── resources │ │ ├── x.png │ │ └── glass.png │ ├── tag-search-index.js │ ├── jquery-ui.overrides.css │ ├── overview-summary.html │ ├── element-list │ ├── package-search-index.js │ ├── script-dir │ │ └── jquery-ui.min.css │ ├── type-search-index.js │ └── com │ │ └── royal │ │ └── reserve │ │ └── bank │ │ ├── account │ │ └── api │ │ │ ├── package-use.html │ │ │ ├── util │ │ │ └── package-use.html │ │ │ ├── model │ │ │ └── package-use.html │ │ │ ├── config │ │ │ └── package-use.html │ │ │ ├── service │ │ │ └── package-use.html │ │ │ ├── controller │ │ │ └── package-use.html │ │ │ ├── repository │ │ │ └── package-use.html │ │ │ └── serializer │ │ │ └── package-use.html │ │ ├── api │ │ └── gateway │ │ │ ├── package-use.html │ │ │ └── config │ │ │ └── package-use.html │ │ ├── config │ │ └── server │ │ │ └── package-use.html │ │ ├── transaction │ │ └── api │ │ │ ├── package-use.html │ │ │ ├── event │ │ │ └── package-use.html │ │ │ ├── model │ │ │ └── package-use.html │ │ │ ├── client │ │ │ └── package-use.html │ │ │ ├── config │ │ │ └── package-use.html │ │ │ ├── service │ │ │ └── package-use.html │ │ │ ├── controller │ │ │ └── package-use.html │ │ │ └── repository │ │ │ └── package-use.html │ │ ├── discovery │ │ └── server │ │ │ ├── package-use.html │ │ │ └── config │ │ │ └── package-use.html │ │ ├── notification │ │ └── api │ │ │ └── package-use.html │ │ └── asset │ │ └── management │ │ └── api │ │ └── package-use.html └── readme-assets │ ├── building-icon.png │ ├── api-documentation.png │ ├── grafana-dashboard.png │ ├── prometheus-metrics.png │ ├── api-documentation-dark.png │ ├── grafana-dashboard-dark.png │ ├── high-level-architecture.png │ ├── prometheus-metrics-dark.png │ ├── royal-reserve-bank-logo.png │ ├── royal-reserve-bank-logo.psd │ ├── high-level-architecture-dark.png │ ├── manual-testing-with-postman.png │ ├── high-level-architecture-legend.png │ ├── manual-testing-with-postman-dark.png │ └── high-level-architecture-legend-dark.png ├── asset-management-api ├── src │ ├── main │ │ ├── resources │ │ │ ├── data.sql │ │ │ ├── application-docker.properties │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── royal │ │ │ └── reserve │ │ │ └── bank │ │ │ └── asset │ │ │ └── management │ │ │ └── api │ │ │ ├── service │ │ │ ├── package-info.java │ │ │ └── AssetManagementService.java │ │ │ ├── model │ │ │ ├── package-info.java │ │ │ └── Asset.java │ │ │ ├── util │ │ │ ├── package-info.java │ │ │ └── AssetTestData.java │ │ │ ├── package-info.java │ │ │ ├── repository │ │ │ ├── package-info.java │ │ │ └── AssetManagementRepository.java │ │ │ ├── controller │ │ │ ├── package-info.java │ │ │ └── AssetManagementController.java │ │ │ ├── dto │ │ │ ├── package-info.java │ │ │ └── AssetManagementResponse.java │ │ │ └── AssetManagementApiApplication.java │ └── test │ │ └── java │ │ └── com │ │ └── royal │ │ └── reserve │ │ └── bank │ │ └── asset │ │ └── management │ │ └── api │ │ ├── integration │ │ ├── AssetManagementApiApplicationIT.java │ │ ├── config │ │ │ └── TestConfig.java │ │ └── controller │ │ │ └── AssetManagementControllerIT.java │ │ └── unit │ │ ├── dto │ │ └── AssetManagementResponseTest.java │ │ ├── model │ │ └── AssetTest.java │ │ ├── repository │ │ └── AssetManagementRepositoryTest.java │ │ ├── service │ │ └── AssetManagementServiceTest.java │ │ └── controller │ │ └── AssetManagementControllerTest.java └── pom.xml ├── transaction-api ├── src │ ├── main │ │ ├── resources │ │ │ ├── data.sql │ │ │ ├── application-docker.properties │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── royal │ │ │ └── reserve │ │ │ └── bank │ │ │ └── transaction │ │ │ └── api │ │ │ ├── service │ │ │ └── package-info.java │ │ │ ├── event │ │ │ ├── package-info.java │ │ │ └── TransactionEvent.java │ │ │ ├── dto │ │ │ ├── package-info.java │ │ │ ├── TransactionRequest.java │ │ │ ├── AssetManagementResponse.java │ │ │ └── TransactionItemsDto.java │ │ │ ├── package-info.java │ │ │ ├── config │ │ │ ├── package-info.java │ │ │ └── WebClientConfig.java │ │ │ ├── repository │ │ │ ├── package-info.java │ │ │ └── TransactionRepository.java │ │ │ ├── model │ │ │ ├── package-info.java │ │ │ ├── TransactionItems.java │ │ │ └── Transaction.java │ │ │ ├── controller │ │ │ ├── package-info.java │ │ │ └── TransactionController.java │ │ │ ├── client │ │ │ ├── package-info.java │ │ │ └── AssetManagementClient.java │ │ │ └── TransactionApiApplication.java │ └── test │ │ └── java │ │ └── com │ │ └── royal │ │ └── reserve │ │ └── bank │ │ └── transaction │ │ └── api │ │ ├── integration │ │ ├── TransactionApiApplicationIT.java │ │ └── config │ │ │ └── TestConfig.java │ │ └── unit │ │ ├── event │ │ └── TransactionEventTest.java │ │ ├── dto │ │ ├── AssetManagementResponseTest.java │ │ ├── TransactionRequestTest.java │ │ └── TransactionItemsDtoTest.java │ │ ├── model │ │ ├── TransactionItemsTest.java │ │ └── TransactionTest.java │ │ └── controller │ │ └── TransactionControllerTest.java └── pom.xml ├── account-api ├── src │ ├── main │ │ ├── resources │ │ │ ├── application-docker.properties │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── royal │ │ │ └── reserve │ │ │ └── bank │ │ │ └── account │ │ │ └── api │ │ │ ├── config │ │ │ └── package-info.java │ │ │ ├── serializer │ │ │ ├── package-info.java │ │ │ └── CustomBigDecimalRedisSerializer.java │ │ │ ├── model │ │ │ ├── package-info.java │ │ │ └── Account.java │ │ │ ├── package-info.java │ │ │ ├── controller │ │ │ ├── package-info.java │ │ │ └── AccountController.java │ │ │ ├── repository │ │ │ ├── package-info.java │ │ │ └── AccountRepository.java │ │ │ ├── service │ │ │ └── package-info.java │ │ │ ├── util │ │ │ ├── package-info.java │ │ │ └── AccountTestData.java │ │ │ ├── dto │ │ │ ├── package-info.java │ │ │ ├── AccountRequest.java │ │ │ └── AccountResponse.java │ │ │ └── AccountApiApplication.java │ └── test │ │ └── java │ │ └── com │ │ └── royal │ │ └── reserve │ │ └── bank │ │ └── account │ │ └── api │ │ ├── integration │ │ ├── AccountApiApplicationIT.java │ │ └── config │ │ │ └── TestConfig.java │ │ └── unit │ │ ├── dto │ │ ├── AccountRequestTest.java │ │ └── AccountResponseTest.java │ │ ├── model │ │ └── AccountTest.java │ │ └── serializer │ │ └── CustomBigDecimalRedisSerializerTest.java └── pom.xml ├── api-gateway ├── src │ ├── main │ │ ├── resources │ │ │ ├── application-docker.properties │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── royal │ │ │ └── reserve │ │ │ └── bank │ │ │ └── api │ │ │ └── gateway │ │ │ ├── config │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ └── ApiGatewayApplication.java │ └── test │ │ └── java │ │ └── com │ │ └── royal │ │ └── reserve │ │ └── bank │ │ └── api │ │ └── gateway │ │ └── integration │ │ └── ApiGatewayApplicationIT.java └── pom.xml ├── discovery-server ├── src │ ├── main │ │ ├── resources │ │ │ ├── application-docker.properties │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── royal │ │ │ └── reserve │ │ │ └── bank │ │ │ └── discovery │ │ │ └── server │ │ │ ├── config │ │ │ ├── package-info.java │ │ │ └── SecurityConfig.java │ │ │ ├── package-info.java │ │ │ └── DiscoveryServerApplication.java │ └── test │ │ └── java │ │ └── com │ │ └── royal │ │ └── reserve │ │ └── bank │ │ └── discovery │ │ └── server │ │ └── integration │ │ └── DiscoveryServerApplicationIT.java └── pom.xml ├── notification-api ├── src │ ├── main │ │ ├── resources │ │ │ ├── application-docker.properties │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── royal │ │ │ └── reserve │ │ │ └── bank │ │ │ └── notification │ │ │ └── api │ │ │ ├── event │ │ │ ├── package-info.java │ │ │ └── TransactionEvent.java │ │ │ ├── package-info.java │ │ │ └── NotificationApiApplication.java │ └── test │ │ └── java │ │ └── com │ │ └── royal │ │ └── reserve │ │ └── bank │ │ └── notification │ │ └── api │ │ ├── integration │ │ └── NotificationApiApplicationIT.java │ │ └── unit │ │ └── event │ │ └── TransactionEventTest.java └── pom.xml ├── config-server ├── src │ ├── main │ │ ├── resources │ │ │ ├── application-docker.properties │ │ │ └── application.properties │ │ └── java │ │ │ └── com │ │ │ └── royal │ │ │ └── reserve │ │ │ └── bank │ │ │ └── config │ │ │ └── server │ │ │ ├── package-info.java │ │ │ └── ConfigServerApplication.java │ └── test │ │ └── java │ │ └── com │ │ └── royal │ │ └── reserve │ │ └── bank │ │ └── config │ │ └── server │ │ └── integration │ │ └── ConfigServerApplicationIT.java └── pom.xml ├── .github └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── postman └── postman-environment.json ├── LICENSE ├── prometheus-configuration.yml └── docker-compose-infrastructure-services.yml /.gitignore: -------------------------------------------------------------------------------- 1 | data 2 | .idea 3 | *.iml 4 | target/ 5 | -------------------------------------------------------------------------------- /config-files/discovery-server-docker.properties: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /docs/javadoc/legal/LICENSE: -------------------------------------------------------------------------------- 1 | Please see ..\java.base\LICENSE 2 | -------------------------------------------------------------------------------- /docs/javadoc/legal/COPYRIGHT: -------------------------------------------------------------------------------- 1 | Please see ..\java.base\COPYRIGHT 2 | -------------------------------------------------------------------------------- /docs/javadoc/module-search-index.js: -------------------------------------------------------------------------------- 1 | moduleSearchIndex = [];updateSearchResults(); -------------------------------------------------------------------------------- /asset-management-api/src/main/resources/data.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE IF NOT EXISTS 'mysql'; -------------------------------------------------------------------------------- /transaction-api/src/main/resources/data.sql: -------------------------------------------------------------------------------- 1 | CREATE DATABASE IF NOT EXISTS 'postgres'; -------------------------------------------------------------------------------- /docs/javadoc/resources/x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoltanvin/royal-reserve-bank/HEAD/docs/javadoc/resources/x.png -------------------------------------------------------------------------------- /account-api/src/main/resources/application-docker.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.uri=http://config-server:8888/config-server 2 | -------------------------------------------------------------------------------- /api-gateway/src/main/resources/application-docker.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.uri=http://config-server:8888/config-server 2 | -------------------------------------------------------------------------------- /docs/javadoc/resources/glass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoltanvin/royal-reserve-bank/HEAD/docs/javadoc/resources/glass.png -------------------------------------------------------------------------------- /discovery-server/src/main/resources/application-docker.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.uri=http://config-server:8888/config-server 2 | -------------------------------------------------------------------------------- /docs/javadoc/tag-search-index.js: -------------------------------------------------------------------------------- 1 | tagSearchIndex = [{"l":"Serialized Form","h":"","u":"serialized-form.html"}];updateSearchResults(); -------------------------------------------------------------------------------- /notification-api/src/main/resources/application-docker.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.uri=http://config-server:8888/config-server 2 | -------------------------------------------------------------------------------- /transaction-api/src/main/resources/application-docker.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.uri=http://config-server:8888/config-server 2 | -------------------------------------------------------------------------------- /asset-management-api/src/main/resources/application-docker.properties: -------------------------------------------------------------------------------- 1 | spring.cloud.config.uri=http://config-server:8888/config-server 2 | -------------------------------------------------------------------------------- /docs/readme-assets/building-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoltanvin/royal-reserve-bank/HEAD/docs/readme-assets/building-icon.png -------------------------------------------------------------------------------- /docs/readme-assets/api-documentation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoltanvin/royal-reserve-bank/HEAD/docs/readme-assets/api-documentation.png -------------------------------------------------------------------------------- /docs/readme-assets/grafana-dashboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoltanvin/royal-reserve-bank/HEAD/docs/readme-assets/grafana-dashboard.png -------------------------------------------------------------------------------- /docs/readme-assets/prometheus-metrics.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoltanvin/royal-reserve-bank/HEAD/docs/readme-assets/prometheus-metrics.png -------------------------------------------------------------------------------- /docs/readme-assets/api-documentation-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoltanvin/royal-reserve-bank/HEAD/docs/readme-assets/api-documentation-dark.png -------------------------------------------------------------------------------- /docs/readme-assets/grafana-dashboard-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoltanvin/royal-reserve-bank/HEAD/docs/readme-assets/grafana-dashboard-dark.png -------------------------------------------------------------------------------- /docs/readme-assets/high-level-architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoltanvin/royal-reserve-bank/HEAD/docs/readme-assets/high-level-architecture.png -------------------------------------------------------------------------------- /docs/readme-assets/prometheus-metrics-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoltanvin/royal-reserve-bank/HEAD/docs/readme-assets/prometheus-metrics-dark.png -------------------------------------------------------------------------------- /docs/readme-assets/royal-reserve-bank-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoltanvin/royal-reserve-bank/HEAD/docs/readme-assets/royal-reserve-bank-logo.png -------------------------------------------------------------------------------- /docs/readme-assets/royal-reserve-bank-logo.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoltanvin/royal-reserve-bank/HEAD/docs/readme-assets/royal-reserve-bank-logo.psd -------------------------------------------------------------------------------- /docs/readme-assets/high-level-architecture-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoltanvin/royal-reserve-bank/HEAD/docs/readme-assets/high-level-architecture-dark.png -------------------------------------------------------------------------------- /docs/readme-assets/manual-testing-with-postman.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoltanvin/royal-reserve-bank/HEAD/docs/readme-assets/manual-testing-with-postman.png -------------------------------------------------------------------------------- /docs/readme-assets/high-level-architecture-legend.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoltanvin/royal-reserve-bank/HEAD/docs/readme-assets/high-level-architecture-legend.png -------------------------------------------------------------------------------- /docs/readme-assets/manual-testing-with-postman-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoltanvin/royal-reserve-bank/HEAD/docs/readme-assets/manual-testing-with-postman-dark.png -------------------------------------------------------------------------------- /docs/readme-assets/high-level-architecture-legend-dark.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zoltanvin/royal-reserve-bank/HEAD/docs/readme-assets/high-level-architecture-legend-dark.png -------------------------------------------------------------------------------- /account-api/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=account-api 2 | spring.config.import=configserver: 3 | spring.cloud.config.uri=http://localhost:8888/config-server 4 | -------------------------------------------------------------------------------- /api-gateway/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=api-gateway 2 | spring.config.import=configserver: 3 | spring.cloud.config.uri=http://localhost:8888/config-server 4 | -------------------------------------------------------------------------------- /discovery-server/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=discovery-server 2 | spring.config.import=configserver: 3 | spring.cloud.config.uri=http://localhost:8888/config-server 4 | -------------------------------------------------------------------------------- /notification-api/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=notification-api 2 | spring.config.import=configserver: 3 | spring.cloud.config.uri=http://localhost:8888/config-server 4 | -------------------------------------------------------------------------------- /transaction-api/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=transaction-api 2 | spring.config.import=configserver: 3 | spring.cloud.config.uri=http://localhost:8888/config-server 4 | -------------------------------------------------------------------------------- /account-api/src/main/java/com/royal/reserve/bank/account/api/config/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Configuration classes for the Redis integration. 3 | */ 4 | package com.royal.reserve.bank.account.api.config; 5 | -------------------------------------------------------------------------------- /asset-management-api/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | spring.application.name=asset-management-api 2 | spring.config.import=configserver: 3 | spring.cloud.config.uri=http://localhost:8888/config-server 4 | -------------------------------------------------------------------------------- /config-server/src/main/resources/application-docker.properties: -------------------------------------------------------------------------------- 1 | eureka.client.serviceUrl.defaultZone=http://discovery-server:8761/eureka 2 | spring.cloud.config.server.native.searchLocations=classpath:config-files 3 | -------------------------------------------------------------------------------- /account-api/src/main/java/com/royal/reserve/bank/account/api/serializer/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides custom serializers for specific data types. 3 | */ 4 | package com.royal.reserve.bank.account.api.serializer; 5 | -------------------------------------------------------------------------------- /config-files/api-gateway-docker.properties: -------------------------------------------------------------------------------- 1 | server.port=8080 2 | eureka.client.serviceUrl.defaultZone=http://eureka:password@discovery-server:8761/eureka 3 | management.zipkin.tracing.endpoint=http://zipkin:9411/api/v2/spans 4 | -------------------------------------------------------------------------------- /api-gateway/src/main/java/com/royal/reserve/bank/api/gateway/config/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Configuration classes for security settings and JWT token handling. 3 | */ 4 | package com.royal.reserve.bank.api.gateway.config; 5 | -------------------------------------------------------------------------------- /account-api/src/main/java/com/royal/reserve/bank/account/api/model/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Model classes for defining the structure and attributes of a bank account. 3 | */ 4 | package com.royal.reserve.bank.account.api.model; 5 | -------------------------------------------------------------------------------- /transaction-api/src/main/java/com/royal/reserve/bank/transaction/api/service/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Service classes containing business logic for managing transactions. 3 | */ 4 | package com.royal.reserve.bank.transaction.api.service; 5 | -------------------------------------------------------------------------------- /asset-management-api/src/main/java/com/royal/reserve/bank/asset/management/api/service/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Service classes containing business logic for managing assets. 3 | */ 4 | package com.royal.reserve.bank.asset.management.api.service; 5 | -------------------------------------------------------------------------------- /asset-management-api/src/main/java/com/royal/reserve/bank/asset/management/api/model/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Model classes for defining the structure and attributes of various assets. 3 | */ 4 | package com.royal.reserve.bank.asset.management.api.model; 5 | -------------------------------------------------------------------------------- /account-api/src/main/java/com/royal/reserve/bank/account/api/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Detailed info about this module here. 3 | */ 4 | package com.royal.reserve.bank.account.api; 5 | -------------------------------------------------------------------------------- /api-gateway/src/main/java/com/royal/reserve/bank/api/gateway/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Detailed info about this module here. 3 | */ 4 | package com.royal.reserve.bank.api.gateway; 5 | -------------------------------------------------------------------------------- /asset-management-api/src/main/java/com/royal/reserve/bank/asset/management/api/util/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Utility classes for managing assets. It includes a test data population class. 3 | */ 4 | package com.royal.reserve.bank.asset.management.api.util; 5 | -------------------------------------------------------------------------------- /discovery-server/src/main/java/com/royal/reserve/bank/discovery/server/config/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Configuration classes for customizing and managing the security settings of the server. 3 | */ 4 | package com.royal.reserve.bank.discovery.server.config; 5 | -------------------------------------------------------------------------------- /transaction-api/src/main/java/com/royal/reserve/bank/transaction/api/event/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Event classes representing transactions between the Transaction API and the Notification API. 3 | */ 4 | package com.royal.reserve.bank.transaction.api.event; 5 | -------------------------------------------------------------------------------- /config-server/src/main/java/com/royal/reserve/bank/config/server/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Detailed info about this module here. 3 | */ 4 | package com.royal.reserve.bank.config.server; 5 | -------------------------------------------------------------------------------- /notification-api/src/main/java/com/royal/reserve/bank/notification/api/event/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Event classes representing transactions between the Transaction API and the Notification API. 3 | */ 4 | package com.royal.reserve.bank.notification.api.event; 5 | -------------------------------------------------------------------------------- /transaction-api/src/main/java/com/royal/reserve/bank/transaction/api/dto/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Data Transfer Object (DTO) classes for representing request and response payloads related to transactions. 3 | */ 4 | package com.royal.reserve.bank.transaction.api.dto; 5 | -------------------------------------------------------------------------------- /transaction-api/src/main/java/com/royal/reserve/bank/transaction/api/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Detailed info about this module here. 3 | */ 4 | package com.royal.reserve.bank.transaction.api; 5 | -------------------------------------------------------------------------------- /config-files/notification-api-docker.properties: -------------------------------------------------------------------------------- 1 | server.port=8080 2 | eureka.client.serviceUrl.defaultZone=http://discovery-server:8761/eureka 3 | spring.kafka.bootstrap-servers=notification-api-kafka:29092 4 | management.zipkin.tracing.endpoint=http://zipkin:9411/api/v2/spans 5 | -------------------------------------------------------------------------------- /discovery-server/src/main/java/com/royal/reserve/bank/discovery/server/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Detailed info about this module here. 3 | */ 4 | package com.royal.reserve.bank.discovery.server; 5 | -------------------------------------------------------------------------------- /notification-api/src/main/java/com/royal/reserve/bank/notification/api/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Detailed info about this module here. 3 | */ 4 | package com.royal.reserve.bank.notification.api; 5 | -------------------------------------------------------------------------------- /account-api/src/main/java/com/royal/reserve/bank/account/api/controller/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Controller classes that handle HTTP requests, provide endpoints for creating, retrieving, and deleting bank accounts. 3 | */ 4 | package com.royal.reserve.bank.account.api.controller; 5 | -------------------------------------------------------------------------------- /asset-management-api/src/main/java/com/royal/reserve/bank/asset/management/api/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Detailed info about this module here. 3 | */ 4 | package com.royal.reserve.bank.asset.management.api; 5 | -------------------------------------------------------------------------------- /transaction-api/src/main/java/com/royal/reserve/bank/transaction/api/config/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Configuration classes. WebClient configuration for making HTTP requests to other services in a load-balanced manner. 3 | */ 4 | package com.royal.reserve.bank.transaction.api.config; 5 | -------------------------------------------------------------------------------- /transaction-api/src/main/java/com/royal/reserve/bank/transaction/api/repository/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Repository interfaces and classes storing and managing transaction-related data and provide CRUD operations. 3 | */ 4 | package com.royal.reserve.bank.transaction.api.repository; 5 | -------------------------------------------------------------------------------- /asset-management-api/src/main/java/com/royal/reserve/bank/asset/management/api/repository/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Repository interfaces and classes storing and managing assets in the database and provide CRUD operations. 3 | */ 4 | package com.royal.reserve.bank.asset.management.api.repository; 5 | -------------------------------------------------------------------------------- /asset-management-api/src/main/java/com/royal/reserve/bank/asset/management/api/controller/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Controller classes that handle HTTP requests, provide endpoints for checking the availability status of assets. 3 | */ 4 | package com.royal.reserve.bank.asset.management.api.controller; 5 | -------------------------------------------------------------------------------- /transaction-api/src/main/java/com/royal/reserve/bank/transaction/api/model/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Model classes that represent transactions and transaction items. 3 | * These classes are used to store and retrieve transaction-related information. 4 | */ 5 | package com.royal.reserve.bank.transaction.api.model; 6 | -------------------------------------------------------------------------------- /config-files/account-api-docker.properties: -------------------------------------------------------------------------------- 1 | server.port=8080 2 | spring.data.mongodb.uri=mongodb://account-api-mongo:27017/account-api-mongo 3 | eureka.client.serviceUrl.defaultZone=http://discovery-server:8761/eureka 4 | management.zipkin.tracing.endpoint=http://zipkin:9411/api/v2/spans 5 | spring.data.redis.host=redis 6 | -------------------------------------------------------------------------------- /account-api/src/main/java/com/royal/reserve/bank/account/api/repository/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Repository interfaces and classes for storing bank accounts in the MongoDB database. 3 | * It includes the AccountRepository interface, which provides CRUD operations. 4 | */ 5 | package com.royal.reserve.bank.account.api.repository; 6 | -------------------------------------------------------------------------------- /account-api/src/main/java/com/royal/reserve/bank/account/api/service/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Service classes containing business logic for managing bank accounts. 3 | * It includes operations for creating accounts, retrieving account details, and deleting accounts. 4 | */ 5 | package com.royal.reserve.bank.account.api.service; 6 | -------------------------------------------------------------------------------- /account-api/src/main/java/com/royal/reserve/bank/account/api/util/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Utility classes used for managing and manipulating account-related functionality. 3 | * It includes helper classes and components that assist with tasks such as generating test data. 4 | */ 5 | package com.royal.reserve.bank.account.api.util; 6 | -------------------------------------------------------------------------------- /config-files/asset-management-api-docker.properties: -------------------------------------------------------------------------------- 1 | server.port=8080 2 | spring.datasource.url=jdbc:mysql://asset-management-api-mysql:3306/mysql 3 | eureka.client.serviceUrl.defaultZone=http://eureka:password@discovery-server:8761/eureka 4 | management.zipkin.tracing.endpoint=http://zipkin:9411/api/v2/spans 5 | spring.data.redis.host=redis 6 | -------------------------------------------------------------------------------- /account-api/src/main/java/com/royal/reserve/bank/account/api/dto/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Data Transfer Object (DTO) classes that represent the request and response payloads for bank account operations. 3 | * These classes are used to encapsulate and transfer data between different layers of the application. 4 | */ 5 | package com.royal.reserve.bank.account.api.dto; 6 | -------------------------------------------------------------------------------- /transaction-api/src/main/java/com/royal/reserve/bank/transaction/api/controller/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Controller classes that handle HTTP requests, provide endpoints for processing transactions. 3 | * Implementing circuit breaker and resilience patterns for handling exceptions and timeouts. 4 | */ 5 | package com.royal.reserve.bank.transaction.api.controller; 6 | -------------------------------------------------------------------------------- /asset-management-api/src/main/java/com/royal/reserve/bank/asset/management/api/dto/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Data Transfer Object (DTO) classes for representing response payloads related to asset management. 3 | * These DTOs are used to transfer asset-related information between different layers of the application. 4 | */ 5 | package com.royal.reserve.bank.asset.management.api.dto; 6 | -------------------------------------------------------------------------------- /config-files/transaction-api-docker.properties: -------------------------------------------------------------------------------- 1 | server.port=8080 2 | spring.datasource.url=jdbc:postgresql://transaction-api-postgres:5432/postgres 3 | eureka.client.serviceUrl.defaultZone=http://eureka:password@discovery-server:8761/eureka 4 | spring.kafka.bootstrap-servers=notification-api-kafka:29092 5 | management.zipkin.tracing.endpoint=http://zipkin:9411/api/v2/spans 6 | spring.data.redis.host=redis 7 | -------------------------------------------------------------------------------- /config-files/discovery-server.properties: -------------------------------------------------------------------------------- 1 | server.port=8761 2 | eureka.client.serviceUrl.defaultZone=http://localhost:8761/eureka 3 | spring.security.user.name=eureka 4 | spring.security.user.password=password 5 | eureka.instance.hostname=localhost 6 | eureka.client.register-with-eureka=false 7 | eureka.client.fetch-registry=false 8 | 9 | management.tracing.sampling.probability=1 10 | management.endpoints.web.exposure.include=prometheus 11 | -------------------------------------------------------------------------------- /transaction-api/src/main/java/com/royal/reserve/bank/transaction/api/client/package-info.java: -------------------------------------------------------------------------------- 1 | /** 2 | * Provides Feign client interfaces for interacting with Asset Management API. 3 | * It includes client interfaces for communicating with various microservices or external systems involved in 4 | * asset management, payment processing, and other transaction-related operations. 5 | */ 6 | package com.royal.reserve.bank.transaction.api.client; 7 | -------------------------------------------------------------------------------- /config-server/src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | server.port=8888 2 | spring.application.name=config-server 3 | eureka.client.serviceUrl.defaultZone=http://eureka:password@localhost:8761/eureka 4 | spring.profiles.include=native 5 | spring.cloud.config.server.native.searchLocations=file:./config-files 6 | spring.cloud.config.server.prefix=/config-server 7 | 8 | management.tracing.sampling.probability=1 9 | management.endpoints.web.exposure.include=prometheus 10 | -------------------------------------------------------------------------------- /transaction-api/src/main/java/com/royal/reserve/bank/transaction/api/event/TransactionEvent.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.transaction.api.event; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | /** 8 | * Represents a transaction event between Transaction API and Notification API. 9 | */ 10 | @Data 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | public class TransactionEvent { 14 | private String transactionId; 15 | } 16 | -------------------------------------------------------------------------------- /notification-api/src/main/java/com/royal/reserve/bank/notification/api/event/TransactionEvent.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.notification.api.event; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | /** 8 | * Represents a transaction event between Transaction API and Notification API. 9 | */ 10 | @Data 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | public class TransactionEvent { 14 | private String transactionId; 15 | } 16 | -------------------------------------------------------------------------------- /account-api/src/main/java/com/royal/reserve/bank/account/api/AccountApiApplication.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.account.api; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * Main class for the Account Api. 8 | */ 9 | @SpringBootApplication 10 | public class AccountApiApplication { 11 | 12 | public static void main(String[] args) { 13 | SpringApplication.run(AccountApiApplication.class, args); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /api-gateway/src/main/java/com/royal/reserve/bank/api/gateway/ApiGatewayApplication.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.api.gateway; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | 6 | /** 7 | * Main class for the Api Gateway. 8 | */ 9 | @SpringBootApplication 10 | public class ApiGatewayApplication { 11 | public static void main(String[] args) { 12 | SpringApplication.run(ApiGatewayApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /account-api/src/main/java/com/royal/reserve/bank/account/api/repository/AccountRepository.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.account.api.repository; 2 | 3 | import com.royal.reserve.bank.account.api.model.Account; 4 | import org.springframework.data.mongodb.repository.MongoRepository; 5 | 6 | /** 7 | * Repository interface for storing bank accounts in the MongoDB database. 8 | * It provides CRUD operations and other database-related functionality. 9 | */ 10 | public interface AccountRepository extends MongoRepository { 11 | } 12 | -------------------------------------------------------------------------------- /transaction-api/src/main/java/com/royal/reserve/bank/transaction/api/repository/TransactionRepository.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.transaction.api.repository; 2 | 3 | import com.royal.reserve.bank.transaction.api.model.Transaction; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | /** 7 | * Repository interface for storing assets in the database. 8 | * It provides CRUD operations and other database-related functionality. 9 | */ 10 | public interface TransactionRepository extends JpaRepository { 11 | } 12 | -------------------------------------------------------------------------------- /transaction-api/src/main/java/com/royal/reserve/bank/transaction/api/dto/TransactionRequest.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.transaction.api.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | import java.util.List; 8 | 9 | /** 10 | * Data Transfer Object (DTO) class that represents the request payload for a transaction. 11 | */ 12 | @Data 13 | @AllArgsConstructor 14 | @NoArgsConstructor 15 | public class TransactionRequest { 16 | private List transactionItemsDtoList; 17 | } 18 | -------------------------------------------------------------------------------- /config-files/account-api.properties: -------------------------------------------------------------------------------- 1 | server.port=0 2 | spring.data.mongodb.uri=mongodb://localhost:27017/account-api-mongo 3 | spring.jpa.hibernate.ddl-auto=create-drop 4 | eureka.client.serviceUrl.defaultZone=http://eureka:password@localhost:8761/eureka 5 | management.endpoints.web.exposure.include=prometheus 6 | management.tracing.sampling.probability=1 7 | spring.data.redis.host=localhost 8 | spring.data.redis.port=6379 9 | spring.cache.redis.time-to-live=300 10 | spring.redis.jedis.pool.max-active=10 11 | spring.redis.jedis.pool.max-idle=8 12 | spring.redis.jedis.pool.min-idle=2 13 | -------------------------------------------------------------------------------- /transaction-api/src/main/java/com/royal/reserve/bank/transaction/api/dto/AssetManagementResponse.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.transaction.api.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | /** 9 | * Data Transfer Object (DTO) class that represents the response payload for an asset. 10 | */ 11 | @Data 12 | @AllArgsConstructor 13 | @NoArgsConstructor 14 | @Builder 15 | public class AssetManagementResponse { 16 | private String assetCode; 17 | private boolean isAssetAvailable; 18 | } 19 | -------------------------------------------------------------------------------- /transaction-api/src/main/java/com/royal/reserve/bank/transaction/api/dto/TransactionItemsDto.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.transaction.api.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Data; 5 | import lombok.NoArgsConstructor; 6 | 7 | /** 8 | * Data Transfer Object (DTO) class that represents the response payload for a transaction. 9 | */ 10 | @Data 11 | @AllArgsConstructor 12 | @NoArgsConstructor 13 | public class TransactionItemsDto { 14 | private Long id; 15 | private String assetCode; 16 | private String assetName; 17 | private int value; 18 | } 19 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | title: '' 4 | 5 | --- 6 | 7 | **Describe the bug** 8 | A clear and concise description of what the bug is. 9 | 10 | **Steps To Reproduce** 11 | 12 | 1. 13 | 2. 14 | 3. 15 | 16 | **Expected behavior** 17 | A clear and concise description of what you expected to happen. 18 | 19 | **Screenshots** 20 | If applicable, add screenshots to help explain your problem. 21 | 22 | **Possible Solution** 23 | If you have any suggestions or ideas for a possible solution, include them here. 24 | 25 | **Additional context** 26 | Add any other context about the problem here. 27 | -------------------------------------------------------------------------------- /config-server/src/main/java/com/royal/reserve/bank/config/server/ConfigServerApplication.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.config.server; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.config.server.EnableConfigServer; 6 | 7 | /** 8 | * Main class for the Config Server. 9 | */ 10 | @SpringBootApplication 11 | @EnableConfigServer 12 | public class ConfigServerApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(ConfigServerApplication.class, args); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /discovery-server/src/main/java/com/royal/reserve/bank/discovery/server/DiscoveryServerApplication.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.discovery.server; 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 | /** 8 | * Main class for the Discovery Server. 9 | */ 10 | @SpringBootApplication 11 | @EnableEurekaServer 12 | public class DiscoveryServerApplication { 13 | public static void main(String[] args) { 14 | SpringApplication.run(DiscoveryServerApplication.class, args); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /asset-management-api/src/main/java/com/royal/reserve/bank/asset/management/api/repository/AssetManagementRepository.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.asset.management.api.repository; 2 | 3 | import com.royal.reserve.bank.asset.management.api.model.Asset; 4 | import org.springframework.data.jpa.repository.JpaRepository; 5 | 6 | import java.util.List; 7 | 8 | /** 9 | * Repository interface for storing assets in the database. 10 | * It provides CRUD operations and other database-related functionality. 11 | */ 12 | public interface AssetManagementRepository extends JpaRepository { 13 | List findByAssetCodeIn(List assetCode); 14 | } 15 | -------------------------------------------------------------------------------- /asset-management-api/src/main/java/com/royal/reserve/bank/asset/management/api/AssetManagementApiApplication.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.asset.management.api; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cache.annotation.EnableCaching; 6 | 7 | /** 8 | * Main class for the Asset Management Api. 9 | */ 10 | @EnableCaching 11 | @SpringBootApplication 12 | public class AssetManagementApiApplication { 13 | 14 | public static void main(String[] args) { 15 | SpringApplication.run(AssetManagementApiApplication.class, args); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /account-api/src/main/java/com/royal/reserve/bank/account/api/dto/AccountRequest.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.account.api.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | import java.math.BigDecimal; 9 | import java.util.Currency; 10 | 11 | /** 12 | * Data Transfer Object (DTO) class that represents the request payload for a bank account holder. 13 | */ 14 | @Data 15 | @Builder 16 | @AllArgsConstructor 17 | @NoArgsConstructor 18 | public class AccountRequest { 19 | private String accountHolderName; 20 | private BigDecimal balance; 21 | private Currency currency; 22 | } 23 | -------------------------------------------------------------------------------- /docs/javadoc/jquery-ui.overrides.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2020, 2022, Oracle and/or its affiliates. All rights reserved. 3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 4 | * 5 | * 6 | * 7 | * 8 | * 9 | * 10 | * 11 | * 12 | * 13 | * 14 | * 15 | * 16 | * 17 | * 18 | * 19 | * 20 | * 21 | * 22 | * 23 | * 24 | */ 25 | 26 | .ui-state-active, 27 | .ui-widget-content .ui-state-active, 28 | .ui-widget-header .ui-state-active, 29 | a.ui-button:active, 30 | .ui-button:active, 31 | .ui-button.ui-state-active:hover { 32 | /* Overrides the color of selection used in jQuery UI */ 33 | background: #F8981D; 34 | border: 1px solid #F8981D; 35 | } 36 | -------------------------------------------------------------------------------- /transaction-api/src/main/java/com/royal/reserve/bank/transaction/api/config/WebClientConfig.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.transaction.api.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.cloud.client.loadbalancer.LoadBalanced; 5 | import org.springframework.context.annotation.Configuration; 6 | import org.springframework.web.reactive.function.client.WebClient; 7 | 8 | /** 9 | * Configuration class for WebClient. 10 | */ 11 | @Configuration 12 | public class WebClientConfig { 13 | 14 | @Bean 15 | @LoadBalanced 16 | public WebClient.Builder webClientBuilder() { 17 | return WebClient.builder(); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /account-api/src/test/java/com/royal/reserve/bank/account/api/integration/AccountApiApplicationIT.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.account.api.integration; 2 | 3 | import com.royal.reserve.bank.account.api.AccountApiApplication; 4 | import org.junit.jupiter.api.Assertions; 5 | import org.junit.jupiter.api.Test; 6 | import org.springframework.boot.test.context.SpringBootTest; 7 | 8 | /** 9 | * Integration tests for the {@link AccountApiApplication} class. 10 | */ 11 | @SpringBootTest 12 | class AccountApiApplicationIT { 13 | @Test 14 | void contextLoads() { 15 | Assertions.assertDoesNotThrow(() -> { 16 | AccountApiApplication.main(new String[]{}); 17 | }); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /api-gateway/src/test/java/com/royal/reserve/bank/api/gateway/integration/ApiGatewayApplicationIT.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.api.gateway.integration; 2 | 3 | import com.royal.reserve.bank.api.gateway.ApiGatewayApplication; 4 | import org.junit.jupiter.api.Assertions; 5 | import org.junit.jupiter.api.Test; 6 | import org.springframework.boot.test.context.SpringBootTest; 7 | 8 | /** 9 | * Integration tests for the {@link ApiGatewayApplication} class. 10 | */ 11 | @SpringBootTest 12 | class ApiGatewayApplicationIT { 13 | @Test 14 | void contextLoads() { 15 | Assertions.assertDoesNotThrow(() -> { 16 | ApiGatewayApplication.main(new String[]{}); 17 | }); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /transaction-api/src/test/java/com/royal/reserve/bank/transaction/api/integration/TransactionApiApplicationIT.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.transaction.api.integration; 2 | 3 | import com.royal.reserve.bank.transaction.api.TransactionApiApplication; 4 | import org.junit.jupiter.api.Assertions; 5 | import org.junit.jupiter.api.Test; 6 | import org.springframework.boot.test.context.SpringBootTest; 7 | 8 | /** 9 | * Integration tests for the {@link TransactionApiApplication} class. 10 | */ 11 | @SpringBootTest 12 | class TransactionApiApplicationIT { 13 | @Test 14 | void contextLoads() { 15 | Assertions.assertDoesNotThrow(() -> { 16 | TransactionApiApplication.main(new String[]{}); 17 | }); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /config-files/asset-management-api.properties: -------------------------------------------------------------------------------- 1 | server.port=0 2 | spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver 3 | spring.datasource.url=jdbc:mysql://localhost:3306/mysql 4 | spring.datasource.username=admin 5 | spring.datasource.password=pwd 6 | spring.jpa.hibernate.ddl-auto=create-drop 7 | eureka.client.serviceUrl.defaultZone=http://eureka:password@localhost:8761/eureka 8 | 9 | management.tracing.sampling.probability=1 10 | management.endpoints.web.exposure.include=prometheus 11 | spring.data.redis.host=localhost 12 | spring.data.redis.port=6379 13 | spring.cache.redis.time-to-live=300 14 | spring.redis.jedis.pool.max-active=10 15 | spring.redis.jedis.pool.max-idle=8 16 | spring.redis.jedis.pool.min-idle=2 17 | 18 | -------------------------------------------------------------------------------- /transaction-api/src/main/java/com/royal/reserve/bank/transaction/api/TransactionApiApplication.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.transaction.api; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cache.annotation.EnableCaching; 6 | import org.springframework.cloud.openfeign.EnableFeignClients; 7 | 8 | /** 9 | * Main class for the Transaction Api. 10 | */ 11 | @SpringBootApplication 12 | @EnableFeignClients 13 | @EnableCaching 14 | public class TransactionApiApplication { 15 | 16 | public static void main(String[] args) { 17 | SpringApplication.run(TransactionApiApplication.class, args); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /config-server/src/test/java/com/royal/reserve/bank/config/server/integration/ConfigServerApplicationIT.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.config.server.integration; 2 | 3 | import com.royal.reserve.bank.config.server.ConfigServerApplication; 4 | import org.junit.jupiter.api.Assertions; 5 | import org.junit.jupiter.api.Test; 6 | import org.springframework.boot.test.context.SpringBootTest; 7 | 8 | /** 9 | * Integration tests for the {@link ConfigServerApplication} class. 10 | */ 11 | @SpringBootTest 12 | class ConfigServerApplicationIT { 13 | @Test 14 | void contextLoads() { 15 | Assertions.assertDoesNotThrow(() -> { 16 | ConfigServerApplication.main(new String[]{}); 17 | }); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /asset-management-api/src/main/java/com/royal/reserve/bank/asset/management/api/dto/AssetManagementResponse.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.asset.management.api.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | import java.io.Serializable; 9 | 10 | /** 11 | * Data Transfer Object (DTO) class that represents the response payload for an asset. 12 | *

13 | * The class needs to be serializable to allow caching. 14 | */ 15 | @Data 16 | @AllArgsConstructor 17 | @NoArgsConstructor 18 | @Builder 19 | public class AssetManagementResponse implements Serializable { 20 | private String assetCode; 21 | private boolean isAssetAvailable; 22 | } 23 | -------------------------------------------------------------------------------- /transaction-api/src/main/java/com/royal/reserve/bank/transaction/api/model/TransactionItems.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.transaction.api.model; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | import lombok.NoArgsConstructor; 6 | import lombok.Setter; 7 | 8 | import jakarta.persistence.*; 9 | 10 | /** 11 | * Represents a transaction item. 12 | */ 13 | @Entity 14 | @Table(name = "t_transaction_items") 15 | @Getter 16 | @Setter 17 | @AllArgsConstructor 18 | @NoArgsConstructor 19 | public class TransactionItems { 20 | @Id 21 | @GeneratedValue(strategy = GenerationType.IDENTITY) 22 | private Long id; 23 | private String assetCode; 24 | private String assetName; 25 | private int value; 26 | } 27 | -------------------------------------------------------------------------------- /account-api/src/main/java/com/royal/reserve/bank/account/api/dto/AccountResponse.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.account.api.dto; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | 8 | import java.math.BigDecimal; 9 | import java.util.Currency; 10 | 11 | /** 12 | * Data Transfer Object (DTO) class that represents the response payload for a bank account holder. 13 | */ 14 | @Data 15 | @Builder 16 | @AllArgsConstructor 17 | @NoArgsConstructor 18 | public class AccountResponse { 19 | private String id; 20 | private String accountNumber; 21 | private String accountHolderName; 22 | private BigDecimal balance; 23 | private Currency currency; 24 | } 25 | -------------------------------------------------------------------------------- /discovery-server/src/test/java/com/royal/reserve/bank/discovery/server/integration/DiscoveryServerApplicationIT.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.discovery.server.integration; 2 | 3 | import com.royal.reserve.bank.discovery.server.DiscoveryServerApplication; 4 | import org.junit.jupiter.api.Assertions; 5 | import org.junit.jupiter.api.Test; 6 | import org.springframework.boot.test.context.SpringBootTest; 7 | 8 | /** 9 | * Integration tests for the {@link DiscoveryServerApplication} class. 10 | */ 11 | @SpringBootTest 12 | class DiscoveryServerApplicationIT { 13 | @Test 14 | void contextLoads() { 15 | Assertions.assertDoesNotThrow(() -> { 16 | DiscoveryServerApplication.main(new String[]{}); 17 | }); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /notification-api/src/test/java/com/royal/reserve/bank/notification/api/integration/NotificationApiApplicationIT.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.notification.api.integration; 2 | 3 | import com.royal.reserve.bank.notification.api.NotificationApiApplication; 4 | import org.junit.jupiter.api.Assertions; 5 | import org.junit.jupiter.api.Test; 6 | import org.springframework.boot.test.context.SpringBootTest; 7 | 8 | /** 9 | * Integration tests for the {@link NotificationApiApplication} class. 10 | */ 11 | @SpringBootTest 12 | class NotificationApiApplicationIT { 13 | @Test 14 | void contextLoads() { 15 | Assertions.assertDoesNotThrow(() -> { 16 | NotificationApiApplication.main(new String[]{}); 17 | }); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /asset-management-api/src/test/java/com/royal/reserve/bank/asset/management/api/integration/AssetManagementApiApplicationIT.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.asset.management.api.integration; 2 | 3 | import com.royal.reserve.bank.asset.management.api.AssetManagementApiApplication; 4 | import org.junit.jupiter.api.Assertions; 5 | import org.junit.jupiter.api.Test; 6 | import org.springframework.boot.test.context.SpringBootTest; 7 | 8 | /** 9 | * Integration tests for the {@link AssetManagementApiApplication} class. 10 | */ 11 | @SpringBootTest 12 | class AssetManagementApiApplicationIT { 13 | @Test 14 | void contextLoads() { 15 | Assertions.assertDoesNotThrow(() -> { 16 | AssetManagementApiApplication.main(new String[]{}); 17 | }); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /config-files/notification-api.properties: -------------------------------------------------------------------------------- 1 | server.port=0 2 | eureka.client.serviceUrl.defaultZone=http://eureka:password@localhost:8761/eureka 3 | 4 | management.tracing.sampling.probability=1 5 | management.endpoints.web.exposure.include=prometheus 6 | 7 | # Kafka Properties 8 | spring.kafka.bootstrap-servers=localhost:9092 9 | spring.kafka.template.default-topic=notificationTopic 10 | spring.kafka.consumer.group-id= notificationId 11 | spring.kafka.consumer.key-deserializer=org.apache.kafka.common.serialization.StringDeserializer 12 | spring.kafka.consumer.value-deserializer=org.springframework.kafka.support.serializer.JsonDeserializer 13 | spring.kafka.consumer.properties.spring.json.type.mapping=event:com.royal.reserve.bank.notification.api.event.TransactionEvent 14 | -------------------------------------------------------------------------------- /transaction-api/src/main/java/com/royal/reserve/bank/transaction/api/model/Transaction.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.transaction.api.model; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | import lombok.NoArgsConstructor; 6 | import lombok.Setter; 7 | 8 | import jakarta.persistence.*; 9 | import java.util.List; 10 | 11 | /** 12 | * Represents a transaction. 13 | */ 14 | @Entity 15 | @Table(name = "t_transaction") 16 | @Getter 17 | @Setter 18 | @NoArgsConstructor 19 | @AllArgsConstructor 20 | public class Transaction { 21 | @Id 22 | @GeneratedValue(strategy = GenerationType.IDENTITY) 23 | private Long id; 24 | private String transactionId; 25 | @OneToMany(cascade = CascadeType.ALL) 26 | private List transactionItemsList; 27 | } 28 | -------------------------------------------------------------------------------- /account-api/src/main/java/com/royal/reserve/bank/account/api/model/Account.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.account.api.model; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Builder; 5 | import lombok.Data; 6 | import lombok.NoArgsConstructor; 7 | import org.springframework.data.annotation.Id; 8 | import org.springframework.data.mongodb.core.mapping.Document; 9 | 10 | import java.math.BigDecimal; 11 | import java.util.Currency; 12 | 13 | /** 14 | * Represents a bank account. 15 | */ 16 | @Document(value = "account") 17 | @AllArgsConstructor 18 | @NoArgsConstructor 19 | @Builder 20 | @Data 21 | public class Account { 22 | @Id 23 | private String id; 24 | private String accountNumber; 25 | private String accountHolderName; 26 | private BigDecimal balance; 27 | private Currency currency; 28 | } 29 | -------------------------------------------------------------------------------- /transaction-api/src/test/java/com/royal/reserve/bank/transaction/api/unit/event/TransactionEventTest.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.transaction.api.unit.event; 2 | 3 | import com.royal.reserve.bank.transaction.api.event.TransactionEvent; 4 | import org.junit.jupiter.api.Assertions; 5 | import org.junit.jupiter.api.Test; 6 | 7 | /** 8 | * Unit tests for {@link TransactionEvent} class. 9 | */ 10 | class TransactionEventTest { 11 | 12 | /** 13 | * Test for the {@link TransactionEvent#TransactionEvent(String)} constructor. 14 | */ 15 | @Test 16 | void testTransactionEvent() { 17 | // Given 18 | String expectedTransactionId = "876463547"; 19 | 20 | // When 21 | TransactionEvent event = new TransactionEvent(expectedTransactionId); 22 | 23 | // Then 24 | Assertions.assertEquals(expectedTransactionId, event.getTransactionId()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /notification-api/src/test/java/com/royal/reserve/bank/notification/api/unit/event/TransactionEventTest.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.notification.api.unit.event; 2 | 3 | 4 | import com.royal.reserve.bank.notification.api.event.TransactionEvent; 5 | import org.junit.jupiter.api.Assertions; 6 | import org.junit.jupiter.api.Test; 7 | 8 | /** 9 | * Unit tests for {@link TransactionEvent} class. 10 | */ 11 | class TransactionEventTest { 12 | 13 | /** 14 | * Test for the {@link TransactionEvent#TransactionEvent(String)} constructor. 15 | */ 16 | @Test 17 | void testTransactionEvent() { 18 | // Given 19 | String expectedTransactionId = "13645940"; 20 | 21 | // When 22 | TransactionEvent event = new TransactionEvent(expectedTransactionId); 23 | 24 | // Then 25 | Assertions.assertEquals(expectedTransactionId, event.getTransactionId()); 26 | } 27 | } 28 | 29 | -------------------------------------------------------------------------------- /config-server/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | royal-reserve-bank 7 | org.royal-reserve-bank 8 | 1.0 9 | 10 | 4.0.0 11 | 12 | config-server 13 | 14 | 15 | 16 | org.springframework.cloud 17 | spring-cloud-config-server 18 | 19 | 20 | org.springframework.cloud 21 | spring-cloud-starter-netflix-eureka-client 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /docs/javadoc/overview-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | royal-reserve-bank 1.0 API 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 |

20 | 23 |

index.html

24 |
25 | 26 | 27 | -------------------------------------------------------------------------------- /postman/postman-environment.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "798deb34-93fd-4cd4-b026-43c898424c51", 3 | "name": "Royal Reserve Bank", 4 | "values": [ 5 | { 6 | "key": "oidc_provider", 7 | "value": "https://dev-w4tsg2n64xw88mjb.us.auth0.com/oauth/token", 8 | "type": "default", 9 | "enabled": true 10 | }, 11 | { 12 | "key": "url", 13 | "value": "http://localhost:8080", 14 | "type": "default", 15 | "enabled": true 16 | }, 17 | { 18 | "key": "secret", 19 | "value": "e5qQhoxUuG9_f_2FMlSiNkdix7R4BALqecMNb-SAKTGd123j8IrzpspKTr1dcWkS", 20 | "type": "default", 21 | "enabled": true 22 | }, 23 | { 24 | "key": "client_id", 25 | "value": "o9BivpkKvTVVzCTp5cbBy7CqJ2fpDoEA", 26 | "type": "default", 27 | "enabled": true 28 | }, 29 | { 30 | "key": "audience", 31 | "value": "23425532", 32 | "type": "default", 33 | "enabled": true 34 | } 35 | ], 36 | "_postman_variable_scope": "environment", 37 | "_postman_exported_at": "2023-05-11T20:21:42.881Z", 38 | "_postman_exported_using": "Postman/10.13.5" 39 | } -------------------------------------------------------------------------------- /account-api/src/test/java/com/royal/reserve/bank/account/api/integration/config/TestConfig.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.account.api.integration.config; 2 | 3 | import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; 4 | import org.springframework.boot.test.context.TestConfiguration; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.test.web.servlet.MockMvc; 7 | import org.springframework.test.web.servlet.setup.MockMvcBuilders; 8 | import org.springframework.web.context.WebApplicationContext; 9 | 10 | /** 11 | * Test configuration for the integration tests. 12 | */ 13 | @TestConfiguration 14 | @AutoConfigureMockMvc 15 | public class TestConfig { 16 | /** 17 | * Creates a {@link MockMvc} instance. 18 | * 19 | * @param webApplicationContext the web application context 20 | * @return the {@link MockMvc} instance 21 | */ 22 | @Bean 23 | public MockMvc mockMvc(WebApplicationContext webApplicationContext) { 24 | return MockMvcBuilders.webAppContextSetup(webApplicationContext).build(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /asset-management-api/src/test/java/com/royal/reserve/bank/asset/management/api/integration/config/TestConfig.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.asset.management.api.integration.config; 2 | 3 | import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; 4 | import org.springframework.boot.test.context.TestConfiguration; 5 | import org.springframework.context.annotation.Bean; 6 | import org.springframework.test.web.servlet.MockMvc; 7 | import org.springframework.test.web.servlet.setup.MockMvcBuilders; 8 | import org.springframework.web.context.WebApplicationContext; 9 | 10 | /** 11 | * Test configuration for the integration tests. 12 | */ 13 | @TestConfiguration 14 | @AutoConfigureMockMvc 15 | public class TestConfig { 16 | /** 17 | * Creates a {@link MockMvc} instance. 18 | * 19 | * @param webApplicationContext the web application context 20 | * @return the {@link MockMvc} instance 21 | */ 22 | @Bean 23 | public MockMvc mockMvc(WebApplicationContext webApplicationContext) { 24 | return MockMvcBuilders.webAppContextSetup(webApplicationContext).build(); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /transaction-api/src/test/java/com/royal/reserve/bank/transaction/api/unit/dto/AssetManagementResponseTest.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.transaction.api.unit.dto; 2 | 3 | import com.royal.reserve.bank.transaction.api.dto.AssetManagementResponse; 4 | import org.junit.jupiter.api.Assertions; 5 | import org.junit.jupiter.api.Test; 6 | 7 | /** 8 | * Unit tests for the {@link AssetManagementResponse} class. 9 | */ 10 | class AssetManagementResponseTest { 11 | 12 | /** 13 | * Test the constructors. 14 | */ 15 | @Test 16 | void testAssetManagementResponse() { 17 | // Given 18 | String expectedAssetCode = "F"; 19 | boolean expectedIsAssetAvailable = true; 20 | 21 | // When 22 | AssetManagementResponse response = AssetManagementResponse.builder() 23 | .assetCode(expectedAssetCode) 24 | .isAssetAvailable(expectedIsAssetAvailable) 25 | .build(); 26 | 27 | // Then 28 | Assertions.assertEquals(expectedAssetCode, response.getAssetCode()); 29 | Assertions.assertTrue(response.isAssetAvailable()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 zoltanvin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /asset-management-api/src/test/java/com/royal/reserve/bank/asset/management/api/unit/dto/AssetManagementResponseTest.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.asset.management.api.unit.dto; 2 | 3 | import com.royal.reserve.bank.asset.management.api.dto.AssetManagementResponse; 4 | import org.junit.jupiter.api.Assertions; 5 | import org.junit.jupiter.api.Test; 6 | 7 | /** 8 | * Unit tests for the {@link AssetManagementResponse} class. 9 | */ 10 | class AssetManagementResponseTest { 11 | 12 | /** 13 | * Test the constructors. 14 | */ 15 | @Test 16 | void testAssetManagementResponse() { 17 | // Given 18 | String expectedAssetCode = "USDT"; 19 | boolean expectedIsAssetAvailable = true; 20 | 21 | // When 22 | AssetManagementResponse response = AssetManagementResponse.builder() 23 | .assetCode(expectedAssetCode) 24 | .isAssetAvailable(expectedIsAssetAvailable) 25 | .build(); 26 | 27 | // Then 28 | Assertions.assertEquals(expectedAssetCode, response.getAssetCode()); 29 | Assertions.assertTrue(response.isAssetAvailable()); 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | title: '' 4 | 5 | --- 6 | 7 | **Description** 8 | Provide a clear and concise description of the feature you are requesting. 9 | 10 | **Use Case** 11 | Explain the use case or scenario where this feature would be beneficial or necessary. 12 | 13 | **Possible Solution** 14 | If you have any suggestions or ideas for a possible solution, include them here. 15 | 16 | **Additional Information** 17 | Include any additional information, references, or examples that might be helpful for understanding and implementing the feature. 18 | 19 | **Impact** 20 | Discuss the potential impact of the feature on existing functionality, performance, or user experience. 21 | 22 | **Dependencies** 23 | List any dependencies or prerequisites that are required for implementing this feature. 24 | 25 | **Related Issues** 26 | If applicable, mention any related issues that are associated with this feature request. 27 | 28 | **Screenshots or Mockups** 29 | If applicable, include any screenshots, design mockups, or visual representations of the feature. 30 | 31 | **Additional Context** 32 | Add any other context about the problem here. 33 | -------------------------------------------------------------------------------- /transaction-api/src/main/java/com/royal/reserve/bank/transaction/api/client/AssetManagementClient.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.transaction.api.client; 2 | 3 | import com.royal.reserve.bank.transaction.api.dto.AssetManagementResponse; 4 | import io.github.resilience4j.retry.annotation.Retry; 5 | import org.springframework.cloud.openfeign.FeignClient; 6 | import org.springframework.web.bind.annotation.GetMapping; 7 | import org.springframework.web.bind.annotation.RequestParam; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * A Feign client interface for interacting with the Asset Management API. 13 | */ 14 | @FeignClient(name = "asset-management-api") 15 | @Retry(name = "asset-management") 16 | public interface AssetManagementClient { 17 | 18 | /** 19 | * 20 | *Retrieves asset availability information from the Asset Management API. 21 | *@param assetCode The list of asset codes to check availability for. 22 | *@return A list of AssetManagementResponse objects containing asset availability information. 23 | */ 24 | @GetMapping("/api/asset-management") 25 | List checkAssetAvailability(@RequestParam List assetCode); 26 | } -------------------------------------------------------------------------------- /transaction-api/src/test/java/com/royal/reserve/bank/transaction/api/unit/dto/TransactionRequestTest.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.transaction.api.unit.dto; 2 | 3 | import com.royal.reserve.bank.transaction.api.dto.TransactionItemsDto; 4 | import com.royal.reserve.bank.transaction.api.dto.TransactionRequest; 5 | import org.junit.jupiter.api.Assertions; 6 | import org.junit.jupiter.api.Test; 7 | 8 | import java.util.Arrays; 9 | import java.util.List; 10 | 11 | /** 12 | * Unit tests for the {@link TransactionRequest} class. 13 | */ 14 | class TransactionRequestTest { 15 | 16 | /** 17 | * Test the constructors. 18 | */ 19 | @Test 20 | void testTransactionRequest() { 21 | // Given 22 | TransactionItemsDto item1 = new TransactionItemsDto(1L, "EDE", "Eden Innovations Ltd.", 100); 23 | TransactionItemsDto item2 = new TransactionItemsDto(2L, "T", "AT&T Inc.", 200); 24 | List expectedItemList = Arrays.asList(item1, item2); 25 | 26 | // When 27 | TransactionRequest request = new TransactionRequest(expectedItemList); 28 | 29 | // Then 30 | Assertions.assertEquals(expectedItemList, request.getTransactionItemsDtoList()); 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /notification-api/src/main/java/com/royal/reserve/bank/notification/api/NotificationApiApplication.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.notification.api; 2 | 3 | import com.royal.reserve.bank.notification.api.event.TransactionEvent; 4 | import org.springframework.boot.SpringApplication; 5 | import org.springframework.boot.autoconfigure.SpringBootApplication; 6 | import lombok.extern.slf4j.Slf4j; 7 | import org.springframework.kafka.annotation.KafkaListener; 8 | 9 | /** 10 | * Main class for the Notification Api. 11 | */ 12 | @SpringBootApplication 13 | @Slf4j 14 | public class NotificationApiApplication { 15 | 16 | public static void main(String[] args) { 17 | SpringApplication.run(NotificationApiApplication.class, args); 18 | } 19 | 20 | /** 21 | *This method is a Kafka message listener for the "notificationTopic" topic. 22 | *It handles incoming messages and processes the TransactionEvent object. 23 | *@param transactionEvent The TransactionEvent object received from the Kafka message. 24 | */ 25 | @KafkaListener(topics = "notificationTopic") 26 | public void handleNotification(TransactionEvent transactionEvent) { 27 | log.info("Received notification for transaction: {}", transactionEvent.getTransactionId()); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /transaction-api/src/test/java/com/royal/reserve/bank/transaction/api/unit/dto/TransactionItemsDtoTest.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.transaction.api.unit.dto; 2 | 3 | import com.royal.reserve.bank.transaction.api.dto.TransactionItemsDto; 4 | import org.junit.jupiter.api.Assertions; 5 | import org.junit.jupiter.api.Test; 6 | 7 | /** 8 | * Unit tests for the {@link TransactionItemsDto} class. 9 | */ 10 | class TransactionItemsDtoTest { 11 | 12 | /** 13 | * Test the constructors. 14 | */ 15 | @Test 16 | void testTransactionItemsDto() { 17 | // Given 18 | Long expectedId = 1L; 19 | String expectedAssetCode = "IBM"; 20 | String expectedAssetName = "International Business Machines Corporation"; 21 | int expectedValue = 942200; 22 | 23 | // When 24 | TransactionItemsDto dto = new TransactionItemsDto(expectedId, expectedAssetCode, expectedAssetName, expectedValue); 25 | 26 | // Then 27 | Assertions.assertEquals(expectedId, dto.getId()); 28 | Assertions.assertEquals(expectedAssetCode, dto.getAssetCode()); 29 | Assertions.assertEquals(expectedAssetName, dto.getAssetName()); 30 | Assertions.assertEquals(expectedValue, dto.getValue()); 31 | } 32 | } 33 | 34 | -------------------------------------------------------------------------------- /discovery-server/src/main/java/com/royal/reserve/bank/discovery/server/config/SecurityConfig.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.discovery.server.config; 2 | 3 | import org.springframework.context.annotation.Bean; 4 | import org.springframework.context.annotation.Configuration; 5 | import org.springframework.security.config.annotation.web.builders.HttpSecurity; 6 | import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity; 7 | import org.springframework.security.web.SecurityFilterChain; 8 | 9 | /** 10 | * Configuration class for web security. 11 | */ 12 | @EnableWebSecurity 13 | @Configuration 14 | public class SecurityConfig { 15 | 16 | /** 17 | *Configures the security filter chain for the application. Ignore the /eureka/** path from CSRF protection. 18 | *@param httpSecurity the HttpSecurity object used for configuring the security filter chain 19 | *@return the configured SecurityFilterChain object 20 | *@throws Exception if an error occurs during configuration 21 | */ 22 | @Bean 23 | public SecurityFilterChain securityFilterChain(HttpSecurity httpSecurity) throws Exception { 24 | httpSecurity.csrf().ignoringRequestMatchers("/eureka/**"); 25 | return httpSecurity.build(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /asset-management-api/src/test/java/com/royal/reserve/bank/asset/management/api/unit/model/AssetTest.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.asset.management.api.unit.model; 2 | 3 | import com.royal.reserve.bank.asset.management.api.model.Asset; 4 | import org.junit.jupiter.api.Test; 5 | 6 | import static org.junit.jupiter.api.Assertions.assertEquals; 7 | import static org.junit.jupiter.api.Assertions.assertNotEquals; 8 | 9 | /** 10 | * Unit tests for the {@link Asset} class. 11 | */ 12 | class AssetTest { 13 | 14 | /** 15 | * Test for the {@link Asset#equals(Object)} and {@link Asset#hashCode()} methods. 16 | */ 17 | @Test 18 | void testEqualsAndHashCode() { 19 | // Given 20 | Asset asset1 = new Asset(); 21 | asset1.setAssetCode("RUT"); 22 | asset1.setAssetName("Russel 2000"); 23 | asset1.setValue(1000); 24 | 25 | Asset asset2 = new Asset(); 26 | asset2.setAssetCode("RUT"); 27 | asset2.setAssetName("Russel 2000"); 28 | asset2.setValue(1000); 29 | 30 | // When and Then 31 | assertEquals(asset1, asset2); 32 | assertEquals(asset1.hashCode(), asset2.hashCode()); 33 | 34 | asset2.setValue(2000); 35 | assertNotEquals(asset1, asset2); 36 | assertNotEquals(asset1.hashCode(), asset2.hashCode()); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /discovery-server/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | royal-reserve-bank 7 | org.royal-reserve-bank 8 | 1.0 9 | 10 | 4.0.0 11 | 12 | discovery-server 13 | 14 | 15 | 16 | org.springframework.cloud 17 | spring-cloud-starter-netflix-eureka-server 18 | 19 | 20 | org.springframework.boot 21 | spring-boot-starter-security 22 | 23 | 24 | org.springframework.security 25 | spring-security-web 26 | 27 | 28 | org.springframework.cloud 29 | spring-cloud-config-client 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /notification-api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | royal-reserve-bank 9 | org.royal-reserve-bank 10 | 1.0 11 | 12 | 13 | notification-api 14 | 15 | 16 | 17 | org.springframework.boot 18 | spring-boot-starter-web 19 | 20 | 21 | org.springframework.kafka 22 | spring-kafka 23 | 24 | 25 | org.springframework.cloud 26 | spring-cloud-starter-netflix-eureka-client 27 | 28 | 29 | org.springframework.kafka 30 | spring-kafka-test 31 | test 32 | 33 | 34 | org.springframework.cloud 35 | spring-cloud-starter-config 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /account-api/src/test/java/com/royal/reserve/bank/account/api/unit/dto/AccountRequestTest.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.account.api.unit.dto; 2 | 3 | 4 | import com.royal.reserve.bank.account.api.dto.AccountRequest; 5 | import org.junit.jupiter.api.Assertions; 6 | import org.junit.jupiter.api.Test; 7 | 8 | import java.math.BigDecimal; 9 | import java.util.Currency; 10 | 11 | /** 12 | * Unit tests for the {@link AccountRequest} class. 13 | */ 14 | class AccountRequestTest { 15 | 16 | /** 17 | * Test the constructors. 18 | */ 19 | @Test 20 | void testAccountRequest() { 21 | // Given 22 | String expectedAccountHolderName = "Steve Jobs"; 23 | BigDecimal expectedBalance = new BigDecimal("13000.00"); 24 | Currency expectedCurrency = Currency.getInstance("RUB"); 25 | 26 | // When 27 | AccountRequest request = AccountRequest.builder() 28 | .accountHolderName(expectedAccountHolderName) 29 | .balance(expectedBalance) 30 | .currency(expectedCurrency) 31 | .build(); 32 | 33 | // Then 34 | Assertions.assertEquals(expectedAccountHolderName, request.getAccountHolderName()); 35 | Assertions.assertEquals(expectedBalance, request.getBalance()); 36 | Assertions.assertEquals(expectedCurrency, request.getCurrency()); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /prometheus-configuration.yml: -------------------------------------------------------------------------------- 1 | global: 2 | scrape_interval: 10s 3 | evaluation_interval: 10s 4 | 5 | scrape_configs: 6 | - job_name: 'account-api' 7 | metrics_path: '/actuator/prometheus' 8 | static_configs: 9 | - targets: ['account-api:8080'] 10 | labels: 11 | application: 'Account-API' 12 | - job_name: 'transaction-api' 13 | metrics_path: '/actuator/prometheus' 14 | static_configs: 15 | - targets: ['transaction-api:8080'] 16 | labels: 17 | application: 'Transaction-API' 18 | - job_name: 'asset-management-api' 19 | metrics_path: '/actuator/prometheus' 20 | static_configs: 21 | - targets: ['asset-management-api:8080'] 22 | labels: 23 | application: 'Asset-management-API' 24 | - job_name: 'notification-api' 25 | metrics_path: '/actuator/prometheus' 26 | static_configs: 27 | - targets: ['notification-api:8080'] 28 | labels: 29 | application: 'Notification-API' 30 | - job_name: 'discovery-server' 31 | metrics_path: '/actuator/prometheus' 32 | static_configs: 33 | - targets: ['discovery-server:8761'] 34 | labels: 35 | application: 'Discovery-Server' 36 | - job_name: 'config-server' 37 | metrics_path: '/actuator/prometheus' 38 | static_configs: 39 | - targets: ['config-server:8888'] 40 | labels: 41 | application: 'Config-Server' 42 | -------------------------------------------------------------------------------- /transaction-api/src/test/java/com/royal/reserve/bank/transaction/api/integration/config/TestConfig.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.transaction.api.integration.config; 2 | 3 | import com.fasterxml.jackson.databind.ObjectMapper; 4 | import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc; 5 | import org.springframework.boot.test.context.TestConfiguration; 6 | import org.springframework.context.annotation.Bean; 7 | import org.springframework.http.converter.json.Jackson2ObjectMapperBuilder; 8 | import org.springframework.test.web.servlet.MockMvc; 9 | import org.springframework.test.web.servlet.setup.MockMvcBuilders; 10 | import org.springframework.web.context.WebApplicationContext; 11 | 12 | /** 13 | * Test configuration for the integration tests. 14 | */ 15 | @TestConfiguration 16 | @AutoConfigureMockMvc 17 | public class TestConfig { 18 | /** 19 | * Creates a {@link MockMvc} instance. 20 | * 21 | * @param webApplicationContext the web application context 22 | * @return the {@link MockMvc} instance 23 | */ 24 | @Bean 25 | public MockMvc mockMvc(WebApplicationContext webApplicationContext) { 26 | return MockMvcBuilders.webAppContextSetup(webApplicationContext).build(); 27 | } 28 | 29 | /** 30 | * Creates an {@link ObjectMapper} bean. 31 | * 32 | * @return the {@link ObjectMapper} bean 33 | */ 34 | @Bean 35 | public ObjectMapper objectMapper() { 36 | return Jackson2ObjectMapperBuilder.json().build(); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /asset-management-api/src/main/java/com/royal/reserve/bank/asset/management/api/controller/AssetManagementController.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.asset.management.api.controller; 2 | 3 | import com.royal.reserve.bank.asset.management.api.dto.AssetManagementResponse; 4 | import com.royal.reserve.bank.asset.management.api.service.AssetManagementService; 5 | import lombok.RequiredArgsConstructor; 6 | import lombok.extern.slf4j.Slf4j; 7 | import org.springframework.http.HttpStatus; 8 | import org.springframework.web.bind.annotation.*; 9 | 10 | import java.util.List; 11 | 12 | /** 13 | * Controller class that handles HTTP requests related to asset management. 14 | */ 15 | @RestController 16 | @RequestMapping("/api/asset-management") 17 | @RequiredArgsConstructor 18 | @Slf4j 19 | public class AssetManagementController { 20 | 21 | private final AssetManagementService assetManagementService; 22 | 23 | /** 24 | * 25 | *Retrieves the availability status of assets based on their codes. 26 | *@param assetCode The list of asset codes to check availability for. 27 | *@return The list of asset management responses containing the availability status for each asset code. 28 | */ 29 | @GetMapping 30 | @ResponseStatus(HttpStatus.OK) 31 | public List isAssetAvailable(@RequestParam List assetCode) { 32 | log.info("Received asset availability check request for asset code: {}", assetCode); 33 | return assetManagementService.isAssetAvailable(assetCode); 34 | } 35 | } 36 | 37 | -------------------------------------------------------------------------------- /docs/javadoc/element-list: -------------------------------------------------------------------------------- 1 | com.royal.reserve.bank.account.api 2 | com.royal.reserve.bank.account.api.config 3 | com.royal.reserve.bank.account.api.controller 4 | com.royal.reserve.bank.account.api.dto 5 | com.royal.reserve.bank.account.api.model 6 | com.royal.reserve.bank.account.api.repository 7 | com.royal.reserve.bank.account.api.serializer 8 | com.royal.reserve.bank.account.api.service 9 | com.royal.reserve.bank.account.api.util 10 | com.royal.reserve.bank.api.gateway 11 | com.royal.reserve.bank.api.gateway.config 12 | com.royal.reserve.bank.asset.management.api 13 | com.royal.reserve.bank.asset.management.api.controller 14 | com.royal.reserve.bank.asset.management.api.dto 15 | com.royal.reserve.bank.asset.management.api.model 16 | com.royal.reserve.bank.asset.management.api.repository 17 | com.royal.reserve.bank.asset.management.api.service 18 | com.royal.reserve.bank.asset.management.api.util 19 | com.royal.reserve.bank.config.server 20 | com.royal.reserve.bank.discovery.server 21 | com.royal.reserve.bank.discovery.server.config 22 | com.royal.reserve.bank.notification.api 23 | com.royal.reserve.bank.notification.api.event 24 | com.royal.reserve.bank.transaction.api 25 | com.royal.reserve.bank.transaction.api.client 26 | com.royal.reserve.bank.transaction.api.config 27 | com.royal.reserve.bank.transaction.api.controller 28 | com.royal.reserve.bank.transaction.api.dto 29 | com.royal.reserve.bank.transaction.api.event 30 | com.royal.reserve.bank.transaction.api.model 31 | com.royal.reserve.bank.transaction.api.repository 32 | com.royal.reserve.bank.transaction.api.service 33 | -------------------------------------------------------------------------------- /asset-management-api/src/test/java/com/royal/reserve/bank/asset/management/api/unit/repository/AssetManagementRepositoryTest.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.asset.management.api.unit.repository; 2 | import com.royal.reserve.bank.asset.management.api.model.Asset; 3 | import com.royal.reserve.bank.asset.management.api.repository.AssetManagementRepository; 4 | import org.junit.jupiter.api.Test; 5 | import org.junit.jupiter.api.extension.ExtendWith; 6 | import org.mockito.Mock; 7 | import org.mockito.junit.jupiter.MockitoExtension; 8 | 9 | import java.util.Arrays; 10 | import java.util.List; 11 | 12 | import static org.junit.jupiter.api.Assertions.assertEquals; 13 | import static org.mockito.Mockito.when; 14 | 15 | /** 16 | * Unit tests for the {@link AssetManagementRepository} class. 17 | */ 18 | @ExtendWith(MockitoExtension.class) 19 | class AssetManagementRepositoryTest { 20 | 21 | @Mock 22 | private AssetManagementRepository assetManagementRepository; 23 | 24 | /** 25 | * Test for the {@link AssetManagementRepository#findByAssetCodeIn(List)} method. 26 | */ 27 | @Test 28 | void testFindByAssetCodeIn() { 29 | // Given 30 | List assetCodes = Arrays.asList("78231", "24722"); 31 | List expectedAssets = Arrays.asList( 32 | new Asset(1L, "78231", "a", 25400), 33 | new Asset(2L, "24722", "b", 52000) 34 | ); 35 | 36 | // When 37 | when(assetManagementRepository.findByAssetCodeIn(assetCodes)).thenReturn(expectedAssets); 38 | List actualAssets = assetManagementRepository.findByAssetCodeIn(assetCodes); 39 | 40 | // Then 41 | assertEquals(expectedAssets, actualAssets); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /account-api/src/test/java/com/royal/reserve/bank/account/api/unit/dto/AccountResponseTest.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.account.api.unit.dto; 2 | 3 | import com.royal.reserve.bank.account.api.dto.AccountResponse; 4 | import org.junit.jupiter.api.Assertions; 5 | import org.junit.jupiter.api.Test; 6 | 7 | import java.math.BigDecimal; 8 | import java.util.Currency; 9 | 10 | /** 11 | * Unit tests for the {@link AccountResponse} class. 12 | */ 13 | class AccountResponseTest { 14 | 15 | /** 16 | * Test the constructors. 17 | */ 18 | @Test 19 | void testAccountResponse() { 20 | // Given 21 | String expectedId = "52342"; 22 | String expectedAccountNumber = "BN12-4123-1235-7653-8576"; 23 | String expectedAccountHolderName = "Nelson Mandela"; 24 | BigDecimal expectedBalance = new BigDecimal("610345.00"); 25 | Currency expectedCurrency = Currency.getInstance("EUR"); 26 | 27 | // When 28 | AccountResponse response = AccountResponse.builder() 29 | .id(expectedId) 30 | .accountNumber(expectedAccountNumber) 31 | .accountHolderName(expectedAccountHolderName) 32 | .balance(expectedBalance) 33 | .currency(expectedCurrency) 34 | .build(); 35 | 36 | // Then 37 | Assertions.assertEquals(expectedId, response.getId()); 38 | Assertions.assertEquals(expectedAccountNumber, response.getAccountNumber()); 39 | Assertions.assertEquals(expectedAccountHolderName, response.getAccountHolderName()); 40 | Assertions.assertEquals(expectedBalance, response.getBalance()); 41 | Assertions.assertEquals(expectedCurrency, response.getCurrency()); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /asset-management-api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | royal-reserve-bank 9 | org.royal-reserve-bank 10 | 1.0 11 | 12 | 13 | asset-management-api 14 | 15 | 16 | 17 | org.springframework.boot 18 | spring-boot-starter-data-jpa 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-web 23 | 24 | 25 | org.springframework.cloud 26 | spring-cloud-starter-netflix-eureka-client 27 | 28 | 29 | com.mysql 30 | mysql-connector-j 31 | runtime 32 | 33 | 34 | org.springframework.cloud 35 | spring-cloud-config-client 36 | 37 | 38 | org.springframework.boot 39 | spring-boot-starter-data-redis 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /docs/javadoc/package-search-index.js: -------------------------------------------------------------------------------- 1 | packageSearchIndex = [{"l":"All Packages","u":"allpackages-index.html"},{"l":"com.royal.reserve.bank.account.api"},{"l":"com.royal.reserve.bank.account.api.config"},{"l":"com.royal.reserve.bank.account.api.controller"},{"l":"com.royal.reserve.bank.account.api.dto"},{"l":"com.royal.reserve.bank.account.api.model"},{"l":"com.royal.reserve.bank.account.api.repository"},{"l":"com.royal.reserve.bank.account.api.serializer"},{"l":"com.royal.reserve.bank.account.api.service"},{"l":"com.royal.reserve.bank.account.api.util"},{"l":"com.royal.reserve.bank.api.gateway"},{"l":"com.royal.reserve.bank.api.gateway.config"},{"l":"com.royal.reserve.bank.asset.management.api"},{"l":"com.royal.reserve.bank.asset.management.api.controller"},{"l":"com.royal.reserve.bank.asset.management.api.dto"},{"l":"com.royal.reserve.bank.asset.management.api.model"},{"l":"com.royal.reserve.bank.asset.management.api.repository"},{"l":"com.royal.reserve.bank.asset.management.api.service"},{"l":"com.royal.reserve.bank.asset.management.api.util"},{"l":"com.royal.reserve.bank.config.server"},{"l":"com.royal.reserve.bank.discovery.server"},{"l":"com.royal.reserve.bank.discovery.server.config"},{"l":"com.royal.reserve.bank.notification.api"},{"l":"com.royal.reserve.bank.notification.api.event"},{"l":"com.royal.reserve.bank.transaction.api"},{"l":"com.royal.reserve.bank.transaction.api.client"},{"l":"com.royal.reserve.bank.transaction.api.config"},{"l":"com.royal.reserve.bank.transaction.api.controller"},{"l":"com.royal.reserve.bank.transaction.api.dto"},{"l":"com.royal.reserve.bank.transaction.api.event"},{"l":"com.royal.reserve.bank.transaction.api.model"},{"l":"com.royal.reserve.bank.transaction.api.repository"},{"l":"com.royal.reserve.bank.transaction.api.service"}];updateSearchResults(); -------------------------------------------------------------------------------- /docs/javadoc/script-dir/jquery-ui.min.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.13.1 - 2022-05-12 2 | * http://jqueryui.com 3 | * Includes: core.css, autocomplete.css, menu.css 4 | * Copyright jQuery Foundation and other contributors; Licensed MIT */ 5 | 6 | .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;-ms-filter:"alpha(opacity=0)"}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0} -------------------------------------------------------------------------------- /asset-management-api/src/main/java/com/royal/reserve/bank/asset/management/api/service/AssetManagementService.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.asset.management.api.service; 2 | 3 | import com.royal.reserve.bank.asset.management.api.dto.AssetManagementResponse; 4 | import com.royal.reserve.bank.asset.management.api.repository.AssetManagementRepository; 5 | import lombok.RequiredArgsConstructor; 6 | import lombok.SneakyThrows; 7 | import lombok.extern.slf4j.Slf4j; 8 | import org.springframework.cache.annotation.Cacheable; 9 | import org.springframework.stereotype.Service; 10 | import org.springframework.transaction.annotation.Transactional; 11 | 12 | import java.util.List; 13 | 14 | /** 15 | * Service class that provides operations for managing assets. 16 | */ 17 | @Service 18 | @RequiredArgsConstructor 19 | @Slf4j 20 | public class AssetManagementService { 21 | 22 | private final AssetManagementRepository assetManagementRepository; 23 | 24 | /** 25 | * 26 | *Checks the availability of assets based on their codes. 27 | *@param assetCode The list of asset codes to check. 28 | *@return A list of AssetManagementResponse objects indicating the availability of each asset. 29 | */ 30 | @Transactional(readOnly = true) 31 | @SneakyThrows 32 | @Cacheable("assetAvailability") 33 | public List isAssetAvailable(List assetCode) { 34 | log.info("Checking asset availability"); 35 | return assetManagementRepository.findByAssetCodeIn(assetCode).stream() 36 | .map(asset -> 37 | AssetManagementResponse.builder() 38 | .assetCode(asset.getAssetCode()) 39 | .isAssetAvailable(asset.getValue() > 0) 40 | .build() 41 | ).toList(); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /account-api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | royal-reserve-bank 9 | org.royal-reserve-bank 10 | 1.0 11 | 12 | 13 | account-api 14 | 15 | 16 | 17 | org.springframework.boot 18 | spring-boot-starter-data-mongodb 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-web 23 | 24 | 25 | org.springframework.cloud 26 | spring-cloud-starter-netflix-eureka-client 27 | 28 | 29 | org.testcontainers 30 | mongodb 31 | test 32 | 33 | 34 | org.testcontainers 35 | junit-jupiter 36 | test 37 | 38 | 39 | org.springframework.cloud 40 | spring-cloud-config-client 41 | 42 | 43 | org.springframework.boot 44 | spring-boot-starter-data-redis 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /account-api/src/test/java/com/royal/reserve/bank/account/api/unit/model/AccountTest.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.account.api.unit.model; 2 | 3 | import com.royal.reserve.bank.account.api.model.Account; 4 | import org.junit.jupiter.api.Assertions; 5 | import org.junit.jupiter.api.Test; 6 | import org.junit.jupiter.api.extension.ExtendWith; 7 | import org.mockito.Mock; 8 | import org.mockito.junit.jupiter.MockitoExtension; 9 | 10 | import java.math.BigDecimal; 11 | import java.util.Currency; 12 | 13 | import static org.mockito.Mockito.when; 14 | 15 | /** 16 | * Unit tests for the {@link Account} class. 17 | */ 18 | @ExtendWith(MockitoExtension.class) 19 | class AccountTest { 20 | 21 | @Mock 22 | private Account account; 23 | 24 | /** 25 | * Test the constructors. 26 | */ 27 | @Test 28 | void testAccount() { 29 | // Given 30 | String expectedId = "2742431"; 31 | String expectedAccountNumber = "GR46-4391-5577-4195-4725"; 32 | String expectedAccountHolderName = "Matt Damon"; 33 | BigDecimal expectedBalance = new BigDecimal("211000.00"); 34 | Currency expectedCurrency = Currency.getInstance("USD"); 35 | 36 | // When 37 | when(account.getId()).thenReturn(expectedId); 38 | when(account.getAccountNumber()).thenReturn(expectedAccountNumber); 39 | when(account.getAccountHolderName()).thenReturn(expectedAccountHolderName); 40 | when(account.getBalance()).thenReturn(expectedBalance); 41 | when(account.getCurrency()).thenReturn(expectedCurrency); 42 | 43 | // Then 44 | Assertions.assertEquals(expectedId, account.getId()); 45 | Assertions.assertEquals(expectedAccountNumber, account.getAccountNumber()); 46 | Assertions.assertEquals(expectedAccountHolderName, account.getAccountHolderName()); 47 | Assertions.assertEquals(expectedBalance, account.getBalance()); 48 | Assertions.assertEquals(expectedCurrency, account.getCurrency()); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /asset-management-api/src/main/java/com/royal/reserve/bank/asset/management/api/model/Asset.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.asset.management.api.model; 2 | 3 | import lombok.AllArgsConstructor; 4 | import lombok.Getter; 5 | import lombok.NoArgsConstructor; 6 | import lombok.Setter; 7 | 8 | import jakarta.persistence.*; 9 | 10 | import java.util.Objects; 11 | 12 | /** 13 | * Represents an asset. 14 | */ 15 | @Entity 16 | @Table(name = "t_asset") 17 | @Getter 18 | @Setter 19 | @AllArgsConstructor 20 | @NoArgsConstructor 21 | public class Asset { 22 | 23 | @Id 24 | @GeneratedValue(strategy = GenerationType.IDENTITY) 25 | private Long id; 26 | private String assetCode; 27 | private String assetName; 28 | private int value; 29 | 30 | /** 31 | * Overrides the equals method to provide custom comparison logic for testing purposes. 32 | *

33 | * This override ensures that the expected and actual Asset objects are considered equal 34 | * when they have the same assetCode, assetName, and value properties. 35 | *

36 | * This is necessary to resolve the error where the expected and actual Asset 37 | * objects were not considered equal due to reference inequality. 38 | * 39 | * @param obj the object to compare for equality 40 | * @return {@code true} if the objects are considered equal based on their properties, {@code false} otherwise 41 | */ 42 | @Override 43 | public boolean equals(Object obj) { 44 | if (this == obj) { 45 | return true; 46 | } 47 | if (obj == null || getClass() != obj.getClass()) { 48 | return false; 49 | } 50 | Asset other = (Asset) obj; 51 | return Objects.equals(assetCode, other.assetCode) && 52 | Objects.equals(assetName, other.assetName) && 53 | value == other.value; 54 | } 55 | 56 | @Override 57 | public int hashCode() { 58 | return Objects.hash(assetCode, assetName, value); 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /docs/javadoc/legal/jqueryUI.md: -------------------------------------------------------------------------------- 1 | ## jQuery UI v1.12.1 2 | 3 | ### jQuery UI License 4 | ``` 5 | Copyright jQuery Foundation and other contributors, https://jquery.org/ 6 | 7 | This software consists of voluntary contributions made by many 8 | individuals. For exact contribution history, see the revision history 9 | available at https://github.com/jquery/jquery-ui 10 | 11 | The following license applies to all parts of this software except as 12 | documented below: 13 | 14 | ==== 15 | 16 | Permission is hereby granted, free of charge, to any person obtaining 17 | a copy of this software and associated documentation files (the 18 | "Software"), to deal in the Software without restriction, including 19 | without limitation the rights to use, copy, modify, merge, publish, 20 | distribute, sublicense, and/or sell copies of the Software, and to 21 | permit persons to whom the Software is furnished to do so, subject to 22 | the following conditions: 23 | 24 | The above copyright notice and this permission notice shall be 25 | included in all copies or substantial portions of the Software. 26 | 27 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 28 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 29 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 30 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 31 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 32 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 33 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 34 | 35 | ==== 36 | 37 | Copyright and related rights for sample code are waived via CC0. Sample 38 | code is defined as all source code contained within the demos directory. 39 | 40 | CC0: http://creativecommons.org/publicdomain/zero/1.0/ 41 | 42 | ==== 43 | 44 | All files located in the node_modules and external directories are 45 | externally maintained libraries used by this software which have their 46 | own licenses; we recommend you read them, as their terms may differ from 47 | the terms above. 48 | 49 | ``` 50 | -------------------------------------------------------------------------------- /account-api/src/main/java/com/royal/reserve/bank/account/api/serializer/CustomBigDecimalRedisSerializer.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.account.api.serializer; 2 | 3 | import org.springframework.data.redis.serializer.RedisSerializer; 4 | import org.springframework.data.redis.serializer.SerializationException; 5 | 6 | import java.math.BigDecimal; 7 | import java.nio.charset.StandardCharsets; 8 | 9 | /** 10 | * Custom serializer for BigDecimal values. 11 | */ 12 | public class CustomBigDecimalRedisSerializer implements RedisSerializer { 13 | 14 | private final RedisSerializer jsonSerializer; 15 | 16 | /** 17 | * Creates a new instance of CustomBigDecimalRedisSerializer. 18 | * 19 | * @param jsonSerializer The JSON serializer. 20 | */ 21 | public CustomBigDecimalRedisSerializer(RedisSerializer jsonSerializer) { 22 | this.jsonSerializer = jsonSerializer; 23 | } 24 | 25 | /** 26 | * Serializes the given value to a byte array. 27 | * 28 | * @param value The value to serialize. 29 | * @return The serialized value. 30 | * @throws SerializationException If the value cannot be serialized. 31 | */ 32 | @Override 33 | public byte[] serialize(Object value) throws SerializationException { 34 | if (value instanceof BigDecimal) { 35 | return value.toString().getBytes(StandardCharsets.UTF_8); 36 | } 37 | return jsonSerializer.serialize(value); 38 | } 39 | 40 | /** 41 | * Deserializes the given byte array to an object. 42 | * 43 | * @param bytes The byte array to deserialize. 44 | * @return The deserialized object. 45 | * @throws SerializationException If the byte array cannot be deserialized. 46 | */ 47 | @Override 48 | public Object deserialize(byte[] bytes) throws SerializationException { 49 | if (bytes == null) { 50 | return null; 51 | } 52 | 53 | try { 54 | return new BigDecimal(new String(bytes, StandardCharsets.UTF_8)); 55 | } catch (NumberFormatException e) { 56 | return jsonSerializer.deserialize(bytes); 57 | } 58 | } 59 | } 60 | 61 | -------------------------------------------------------------------------------- /api-gateway/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | royal-reserve-bank 9 | org.royal-reserve-bank 10 | 1.0 11 | 12 | 13 | api-gateway 14 | 15 | 16 | 17 | org.springframework.cloud 18 | spring-cloud-starter-gateway 19 | 20 | 21 | org.springframework.cloud 22 | spring-cloud-starter-netflix-eureka-client 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-oauth2-resource-server 27 | 28 | 29 | org.springframework.boot 30 | spring-boot-starter-security 31 | 32 | 33 | org.springframework.security 34 | spring-security-oauth2-jose 35 | 36 | 37 | org.springframework.security 38 | spring-security-oauth2-resource-server 39 | 40 | 41 | com.auth0 42 | java-jwt 43 | 44 | 45 | com.auth0 46 | jwks-rsa 47 | 48 | 49 | org.springframework.cloud 50 | spring-cloud-config-client 51 | 52 | 53 | 54 | -------------------------------------------------------------------------------- /config-files/transaction-api.properties: -------------------------------------------------------------------------------- 1 | server.port=4000 2 | spring.datasource.driver-class-name=org.postgresql.Driver 3 | spring.datasource.url=jdbc:postgresql://localhost:5432/postgres 4 | spring.datasource.username=root 5 | spring.datasource.password=admin 6 | spring.jpa.hibernate.ddl-auto=update 7 | eureka.client.serviceUrl.defaultZone=http://eureka:password@localhost:8761/eureka 8 | management.tracing.sampling.probability=1 9 | 10 | #Circular Breaker Properties 11 | management.health.circuitbreakers.enabled=true 12 | management.endpoints.web.exposure.include=* 13 | management.endpoint.health.show-details=always 14 | 15 | #Resilinece4j Properties 16 | resilience4j.circuitbreaker.instances.inventory.registerHealthIndicator=true 17 | resilience4j.circuitbreaker.instances.inventory.event-consumer-buffer-size=10 18 | resilience4j.circuitbreaker.instances.inventory.slidingWindowType=COUNT_BASED 19 | resilience4j.circuitbreaker.instances.inventory.slidingWindowSize=5 20 | resilience4j.circuitbreaker.instances.inventory.failureRateThreshold=50 21 | resilience4j.circuitbreaker.instances.inventory.waitDurationInOpenState=5s 22 | resilience4j.circuitbreaker.instances.inventory.permittedNumberOfCallsInHalfOpenState=3 23 | resilience4j.circuitbreaker.instances.inventory.automaticTransitionFromOpenToHalfOpenEnabled=true 24 | 25 | #Resilience4J Timeout And Retry Properties 26 | resilience4j.timelimiter.instances.inventory.timeout-duration=3s 27 | resilience4j.retry.instances.inventory.max-attempts=3 28 | resilience4j.retry.instances.inventory.wait-duration=5s 29 | 30 | # Kafka Properties 31 | spring.kafka.bootstrap-servers=localhost:9092 32 | spring.kafka.template.default-topic=notificationTopic 33 | spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer 34 | spring.kafka.producer.value-serializer=org.springframework.kafka.support.serializer.JsonSerializer 35 | spring.kafka.producer.properties.spring.json.type.mapping=event:com.royal.reserve.bank.transaction.api.event.TransactionEvent 36 | 37 | spring.data.redis.host=localhost 38 | spring.data.redis.port=6379 39 | spring.cache.redis.time-to-live=300 40 | spring.redis.jedis.pool.max-active=10 41 | spring.redis.jedis.pool.max-idle=8 42 | spring.redis.jedis.pool.min-idle=2 43 | -------------------------------------------------------------------------------- /asset-management-api/src/main/java/com/royal/reserve/bank/asset/management/api/util/AssetTestData.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.asset.management.api.util; 2 | 3 | import com.royal.reserve.bank.asset.management.api.repository.AssetManagementRepository; 4 | import com.royal.reserve.bank.asset.management.api.model.Asset; 5 | import lombok.RequiredArgsConstructor; 6 | import org.springframework.boot.CommandLineRunner; 7 | import org.springframework.stereotype.Component; 8 | 9 | import java.util.ArrayList; 10 | import java.util.List; 11 | 12 | /** 13 | * The AssetTestData class is a component that implements the CommandLineRunner interface. 14 | * It is responsible for populating test data into the AssetManagementRepository. 15 | */ 16 | @Component 17 | @RequiredArgsConstructor 18 | public class AssetTestData implements CommandLineRunner { 19 | private final AssetManagementRepository assetManagementRepository; 20 | 21 | @Override 22 | public void run(String... args) { 23 | List assetList = new ArrayList<>(); 24 | 25 | Asset assetItem1 = new Asset(); 26 | assetItem1.setAssetCode("SEC"); 27 | assetItem1.setAssetName("Corporate bonds"); 28 | assetItem1.setValue(250000); 29 | assetList.add(assetItem1); 30 | 31 | Asset assetItem2 = new Asset(); 32 | assetItem2.setAssetCode("BTC"); 33 | assetItem2.setAssetName("Bitcoin"); 34 | assetItem2.setValue(1000000); 35 | assetList.add(assetItem2); 36 | 37 | Asset assetItem3 = new Asset(); 38 | assetItem3.setAssetCode("INV"); 39 | assetItem3.setAssetName("Stocks"); 40 | assetItem3.setValue(750000); 41 | assetList.add(assetItem3); 42 | 43 | Asset assetItem4 = new Asset(); 44 | assetItem4.setAssetCode("DERIV"); 45 | assetItem4.setAssetName("Options contracts"); 46 | assetItem4.setValue(0); 47 | assetList.add(assetItem4); 48 | 49 | Asset assetItem5 = new Asset(); 50 | assetItem5.setAssetCode("LEASE"); 51 | assetItem5.setAssetName("Lease agreements"); 52 | assetItem5.setValue(150000); 53 | assetList.add(assetItem5); 54 | 55 | assetManagementRepository.saveAll(assetList); 56 | } 57 | } 58 | 59 | -------------------------------------------------------------------------------- /asset-management-api/src/test/java/com/royal/reserve/bank/asset/management/api/unit/service/AssetManagementServiceTest.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.asset.management.api.unit.service; 2 | 3 | import com.royal.reserve.bank.asset.management.api.dto.AssetManagementResponse; 4 | import com.royal.reserve.bank.asset.management.api.model.Asset; 5 | import com.royal.reserve.bank.asset.management.api.repository.AssetManagementRepository; 6 | import com.royal.reserve.bank.asset.management.api.service.AssetManagementService; 7 | import org.junit.jupiter.api.Test; 8 | import org.junit.jupiter.api.extension.ExtendWith; 9 | import org.mockito.Mock; 10 | import org.mockito.junit.jupiter.MockitoExtension; 11 | 12 | import java.util.Arrays; 13 | import java.util.List; 14 | 15 | import static org.junit.jupiter.api.Assertions.*; 16 | import static org.mockito.Mockito.when; 17 | 18 | /** 19 | * Unit tests for the {@link AssetManagementService} class. 20 | */ 21 | @ExtendWith(MockitoExtension.class) 22 | class AssetManagementServiceTest { 23 | 24 | @Mock 25 | private AssetManagementRepository assetManagementRepository; 26 | 27 | /** 28 | * Test for the {@link AssetManagementService#isAssetAvailable(List)} method. 29 | */ 30 | @Test 31 | void testIsAssetAvailable() { 32 | // Given 33 | AssetManagementService assetManagementService = new AssetManagementService(assetManagementRepository); 34 | List assetCodes = Arrays.asList("387223", "081293"); 35 | Asset asset1 = new Asset(813L, "387223", "QQQ", 12000); 36 | Asset asset2 = new Asset(114L, "081293", "KD", 3000); 37 | List assets = Arrays.asList(asset1, asset2); 38 | when(assetManagementRepository.findByAssetCodeIn(assetCodes)).thenReturn(assets); 39 | 40 | // When 41 | List response = assetManagementService.isAssetAvailable(assetCodes); 42 | 43 | // Then 44 | assertEquals(2, response.size()); 45 | AssetManagementResponse response1 = response.get(0); 46 | assertEquals("387223", response1.getAssetCode()); 47 | assertTrue(response1.isAssetAvailable()); 48 | AssetManagementResponse response2 = response.get(1); 49 | assertEquals("081293", response2.getAssetCode()); 50 | assertTrue(response2.isAssetAvailable()); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /docker-compose-infrastructure-services.yml: -------------------------------------------------------------------------------- 1 | version: "3.8" 2 | services: 3 | account-api-mongo: 4 | image: mongo:6.0.5 5 | container_name: account-api-mongo 6 | ports: 7 | - "27017:27017" 8 | expose: 9 | - "27017" 10 | volumes: 11 | - ./data/account-api-mongo:/data/mongo 12 | 13 | asset-management-api-mysql: 14 | container_name: asset-management-api-mysql 15 | image: mysql:8.0.33 16 | ports: 17 | - "3306:3306" 18 | expose: 19 | - "3306" 20 | environment: 21 | MYSQL_DATABASE: mysql 22 | MYSQL_USER: admin 23 | MYSQL_PASSWORD: pwd 24 | MYSQL_ROOT_PASSWORD: pwd 25 | command: --default-authentication-plugin=mysql_native_password 26 | volumes: 27 | - ./data/asset-management-api-mysql:/data/mysql 28 | 29 | notification-api-kafka: 30 | image: confluentinc/cp-kafka:7.4.0 31 | container_name: notification-api-kafka 32 | ports: 33 | - "9092:9092" 34 | environment: 35 | KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 36 | KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1 37 | KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1 38 | KAFKA_NODE_ID: 1 39 | CLUSTER_ID: MkU3OEVANTcwNTJENDM2Qk 40 | KAFKA_PROCESS_ROLES: broker,controller 41 | KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,PLAINTEXT:PLAINTEXT,HOST:PLAINTEXT 42 | KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://notification-api-kafka:29092,HOST://localhost:9092 43 | KAFKA_LISTENERS: PLAINTEXT://notification-api-kafka:29092,CONTROLLER://notification-api-kafka:29093,HOST://0.0.0.0:9092 44 | KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER 45 | KAFKA_CONTROLLER_QUORUM_VOTERS: 1@notification-api-kafka:29093 46 | 47 | redis: 48 | image: redis:7.0.11 49 | container_name: redis 50 | ports: 51 | - "6379:6379" 52 | 53 | transaction-api-postgres: 54 | image: postgres:15.2 55 | container_name: transaction-api-postgres 56 | ports: 57 | - "5432:5432" 58 | expose: 59 | - "5432" 60 | environment: 61 | POSTGRES_DB: postgres 62 | POSTGRES_USER: root 63 | POSTGRES_PASSWORD: admin 64 | volumes: 65 | - ./data/transaction-api-postgres:/data/postgres 66 | 67 | zipkin: 68 | image: openzipkin/zipkin:2.24.0 69 | container_name: zipkin 70 | ports: 71 | - "9411:9411" 72 | -------------------------------------------------------------------------------- /transaction-api/src/test/java/com/royal/reserve/bank/transaction/api/unit/model/TransactionItemsTest.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.transaction.api.unit.model; 2 | 3 | import com.royal.reserve.bank.transaction.api.model.TransactionItems; 4 | import org.junit.jupiter.api.BeforeEach; 5 | import org.junit.jupiter.api.Test; 6 | import static org.junit.jupiter.api.Assertions.assertEquals; 7 | 8 | /** 9 | * Unit tests for the {@link TransactionItems} class. 10 | */ 11 | class TransactionItemsTest { 12 | 13 | private TransactionItems transactionItems; 14 | 15 | @BeforeEach 16 | void setUp() { 17 | transactionItems = new TransactionItems(); 18 | transactionItems.setId(1L); 19 | transactionItems.setAssetCode("NDAQ"); 20 | transactionItems.setAssetName("NASDAQ"); 21 | transactionItems.setValue(11000); 22 | } 23 | 24 | /** 25 | * Test the constructors. 26 | */ 27 | @Test 28 | void testGetId() { 29 | // When and Then 30 | assertEquals(1L, transactionItems.getId()); 31 | } 32 | 33 | @Test 34 | void testGetAssetCode() { 35 | // When and Then 36 | assertEquals("NDAQ", transactionItems.getAssetCode()); 37 | } 38 | 39 | @Test 40 | void testGetAssetName() { 41 | // When and Then 42 | assertEquals("NASDAQ", transactionItems.getAssetName()); 43 | } 44 | 45 | @Test 46 | void testGetValue() { 47 | // When and Then 48 | assertEquals(11000, transactionItems.getValue()); 49 | } 50 | 51 | @Test 52 | void testSetId() { 53 | // When 54 | transactionItems.setId(2L); 55 | 56 | // Then 57 | assertEquals(2L, transactionItems.getId()); 58 | } 59 | 60 | @Test 61 | void testSetAssetCode() { 62 | // When 63 | transactionItems.setAssetCode("DXY"); 64 | 65 | // Then 66 | assertEquals("DXY", transactionItems.getAssetCode()); 67 | } 68 | 69 | @Test 70 | void testSetAssetName() { 71 | // When 72 | transactionItems.setAssetName("Walt Disney Company"); 73 | 74 | // Then 75 | assertEquals("Walt Disney Company", transactionItems.getAssetName()); 76 | } 77 | 78 | @Test 79 | void testSetValue() { 80 | // When 81 | transactionItems.setValue(200); 82 | 83 | // Then 84 | assertEquals(200, transactionItems.getValue()); 85 | } 86 | } 87 | 88 | -------------------------------------------------------------------------------- /transaction-api/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | 8 | royal-reserve-bank 9 | org.royal-reserve-bank 10 | 1.0 11 | 12 | 13 | transaction-api 14 | 15 | 16 | 17 | org.springframework.boot 18 | spring-boot-starter-data-jpa 19 | 20 | 21 | org.springframework.boot 22 | spring-boot-starter-web 23 | 24 | 25 | org.springframework.boot 26 | spring-boot-starter-webflux 27 | 28 | 29 | org.springframework.cloud 30 | spring-cloud-starter-netflix-eureka-client 31 | 32 | 33 | org.springframework.cloud 34 | spring-cloud-starter-circuitbreaker-resilience4j 35 | 36 | 37 | org.postgresql 38 | postgresql 39 | runtime 40 | 41 | 42 | org.springframework.cloud 43 | spring-cloud-starter-openfeign 44 | 45 | 46 | org.springframework.kafka 47 | spring-kafka 48 | 49 | 50 | org.springframework.cloud 51 | spring-cloud-config-client 52 | 53 | 54 | org.springframework.boot 55 | spring-boot-starter-data-redis 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /transaction-api/src/main/java/com/royal/reserve/bank/transaction/api/controller/TransactionController.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.transaction.api.controller; 2 | 3 | import com.royal.reserve.bank.transaction.api.dto.TransactionRequest; 4 | import com.royal.reserve.bank.transaction.api.service.TransactionService; 5 | import io.github.resilience4j.circuitbreaker.annotation.CircuitBreaker; 6 | import io.github.resilience4j.retry.annotation.Retry; 7 | import io.github.resilience4j.timelimiter.annotation.TimeLimiter; 8 | import lombok.RequiredArgsConstructor; 9 | import lombok.extern.slf4j.Slf4j; 10 | import org.springframework.http.HttpStatus; 11 | import org.springframework.web.bind.annotation.*; 12 | 13 | import java.util.concurrent.CompletableFuture; 14 | 15 | /** 16 | * Controller class that handles HTTP requests related to transactions. 17 | */ 18 | @RestController 19 | @RequestMapping("/api/transaction") 20 | @RequiredArgsConstructor 21 | @Slf4j 22 | public class TransactionController { 23 | 24 | private final TransactionService transactionService; 25 | 26 | /** 27 | * 28 | *Processes a transaction asynchronously. 29 | *@param transactionRequest The transaction request object received in the request body. 30 | *@return A CompletableFuture representing the result of the transaction processing. 31 | */ 32 | @PostMapping 33 | @ResponseStatus(HttpStatus.CREATED) 34 | @CircuitBreaker(name = "asset-management", fallbackMethod = "fallbackMethod") 35 | @TimeLimiter(name = "asset-management") 36 | @Retry(name = "asset-management") 37 | public CompletableFuture processTransaction(@RequestBody TransactionRequest transactionRequest) { 38 | log.info("Transaction processed."); 39 | return CompletableFuture.supplyAsync(() -> transactionService.processTransaction(transactionRequest)); 40 | } 41 | 42 | /** 43 | * 44 | *Circuit breaker implementation. Fallback method to handle exceptions during transaction processing. 45 | *@param transactionRequest The transaction request object. 46 | *@param runtimeException The exception that occurred during transaction processing. 47 | *@return A CompletableFuture representing a fallback message. 48 | */ 49 | public CompletableFuture fallbackMethod(TransactionRequest transactionRequest, RuntimeException runtimeException) { 50 | log.info("Transaction can't be processed. Executing fallback logic."); 51 | return CompletableFuture.supplyAsync(() -> "Oops! Something went wrong, please try again later!"); 52 | } 53 | } -------------------------------------------------------------------------------- /config-files/api-gateway.properties: -------------------------------------------------------------------------------- 1 | server.port=8080 2 | logging.level.root=INFO 3 | logging.level.org.springframework.cloud.gateway.route.RouteDefinitionRouteLocator=INFO 4 | eureka.client.serviceUrl.defaultZone=http://eureka:password@localhost:8761/eureka 5 | management.tracing.sampling.probability=1 6 | 7 | spring.security.oauth2.resourceserver.jwt.jwk-set-uri=https://dev-w4tsg2n64xw88mjb.us.auth0.com/.well-known/jwks.json 8 | encodedJwt=eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IktlN01JanlYemt5VG40R19TT3RBcSJ9.eyJpc3MiOiJodHRwczovL2Rldi13NHRzZzJuNjR4dzg4bWpiLnVzLmF1dGgwLmNvbS8iLCJzdWIiOiJvOUJpdnBrS3ZUVlZ6Q1RwNWNiQnk3Q3FKMmZwRG9FQUBjbGllbnRzIiwiYXVkIjoiMjM0MjU1MzIiLCJpYXQiOjE2ODM0OTA1NzAsImV4cCI6MTY4MzU3Njk3MCwiYXpwIjoibzlCaXZwa0t2VFZWekNUcDVjYkJ5N0NxSjJmcERvRUEiLCJndHkiOiJjbGllbnQtY3JlZGVudGlhbHMifQ.RiwVbAtZBOS8ggOqFbvHJtSHvA7Xt0FnQXvmDVy1G_Ne1zVUHcyBDCDZt4v2E6Z3uZj0boHrCGdYmmS-4sboBWYeZZsEpCV8qCt6b_jOOZaGBc8JsoHFYC_i8hA6-tbam6bFShdG50xgR2juFNq8kKWh2CZ3y6VJMB79dkQs8XVrYJ9ewuLwXRLsQ4cnsgUZLI5lHxt6m2K6-aQ_LeJlngF_AuG6g1LyR_QyDo4K0QQphPETheUuhNDh8QTQbPEuP-j8T6T-UXod191N3QQkY1JXWmZbMPF9r4ctqzoQKiUsRFuz7sc-96Aj_zcSEpUiMSvbPuh9ttSY2EVDRLVN0A 9 | 10 | #Account-API route 11 | spring.cloud.gateway.routes[0].id=account-api 12 | spring.cloud.gateway.routes[0].uri=lb://account-api 13 | spring.cloud.gateway.routes[0].predicates[0]=Path=/api/account 14 | 15 | #Transaction-API route 16 | spring.cloud.gateway.routes[1].id=transaction-api 17 | spring.cloud.gateway.routes[1].uri=lb://transaction-api 18 | spring.cloud.gateway.routes[1].predicates[0]=Path=/api/transaction 19 | 20 | #Discovery-Server route 21 | spring.cloud.gateway.routes[2].id=discovery-server 22 | spring.cloud.gateway.routes[2].uri=http://localhost:8761 23 | spring.cloud.gateway.routes[2].predicates[0]=Path=/discovery-server 24 | spring.cloud.gateway.routes[2].filters[0]=SetPath=/ 25 | 26 | ## Discover Server Static Resources Route 27 | spring.cloud.gateway.routes[3].id=discovery-server-static 28 | spring.cloud.gateway.routes[3].uri=http://localhost:8761 29 | spring.cloud.gateway.routes[3].predicates[0]=Path=/eureka/** 30 | 31 | ## Config Server Route 32 | spring.cloud.gateway.routes[4].id=config-server 33 | spring.cloud.gateway.routes[4].uri=http://localhost:8888 34 | spring.cloud.gateway.routes[4].predicates[0]=Path=/config-server/** 35 | 36 | spring.cloud.gateway.routes[5].id=api-gateway 37 | spring.cloud.gateway.routes[5].uri=http://localhost:8080 38 | spring.cloud.gateway.routes[5].predicates[0]=Path=/ 39 | 40 | ## Asset-Management-API Route 41 | spring.cloud.gateway.routes[6].id=asset-management-api 42 | spring.cloud.gateway.routes[6].uri=lb://asset-management-api 43 | spring.cloud.gateway.routes[6].predicates[0]=Path=/api/asset-management 44 | -------------------------------------------------------------------------------- /asset-management-api/src/test/java/com/royal/reserve/bank/asset/management/api/integration/controller/AssetManagementControllerIT.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.asset.management.api.integration.controller; 2 | 3 | import com.royal.reserve.bank.asset.management.api.controller.AssetManagementController; 4 | import com.royal.reserve.bank.asset.management.api.dto.AssetManagementResponse; 5 | import com.royal.reserve.bank.asset.management.api.service.AssetManagementService; 6 | import org.junit.jupiter.api.Test; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest; 9 | import org.springframework.boot.test.mock.mockito.MockBean; 10 | import org.springframework.http.MediaType; 11 | import org.springframework.test.web.servlet.MockMvc; 12 | import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; 13 | import org.springframework.test.web.servlet.result.MockMvcResultMatchers; 14 | 15 | import java.util.Arrays; 16 | import java.util.List; 17 | 18 | import static org.mockito.Mockito.when; 19 | import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath; 20 | 21 | /** 22 | * Integration tests for the {@link AssetManagementController} class. 23 | */ 24 | @WebMvcTest 25 | class AssetManagementControllerIntegrationTest { 26 | 27 | @Autowired 28 | private MockMvc mockMvc; 29 | 30 | @MockBean 31 | private AssetManagementService assetManagementService; 32 | 33 | /** 34 | * Test for the {@link AssetManagementController#isAssetAvailable(List)} method. 35 | * 36 | * @throws Exception if an exception occurs during the test 37 | */ 38 | @Test 39 | void testIsAssetAvailable() throws Exception { 40 | // Given 41 | List assetCodes = Arrays.asList("NVDA", "NFLX"); 42 | List mockResponse = Arrays.asList( 43 | new AssetManagementResponse("NVDA", true), 44 | new AssetManagementResponse("NFLX", false) 45 | ); 46 | when(assetManagementService.isAssetAvailable(assetCodes)).thenReturn(mockResponse); 47 | 48 | // When and Then 49 | mockMvc.perform(MockMvcRequestBuilders.get("/api/asset-management") 50 | .param("assetCode", "NVDA", "NFLX") 51 | .contentType(MediaType.APPLICATION_JSON)) 52 | .andExpect(MockMvcResultMatchers.status().isOk()) 53 | .andExpect(jsonPath("$[0].assetCode").value("NVDA")) 54 | .andExpect(jsonPath("$[0].assetAvailable").value(true)) 55 | .andExpect(jsonPath("$[1].assetCode").value("NFLX")) 56 | .andExpect(jsonPath("$[1].assetAvailable").value(false)); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /account-api/src/main/java/com/royal/reserve/bank/account/api/util/AccountTestData.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.account.api.util; 2 | 3 | import com.royal.reserve.bank.account.api.model.Account; 4 | import com.royal.reserve.bank.account.api.repository.AccountRepository; 5 | import lombok.RequiredArgsConstructor; 6 | import org.springframework.boot.CommandLineRunner; 7 | import org.springframework.stereotype.Component; 8 | 9 | import java.math.BigDecimal; 10 | import java.util.ArrayList; 11 | import java.util.Currency; 12 | import java.util.List; 13 | 14 | /** 15 | * The AccountTestData class is a component that implements the CommandLineRunner interface. 16 | * It is responsible for populating test data into the AccountRepository. 17 | */ 18 | @Component 19 | @RequiredArgsConstructor 20 | public class AccountTestData implements CommandLineRunner { 21 | private final AccountRepository accountRepository; 22 | @Override 23 | public void run(String... args) { 24 | List accountList = new ArrayList<>(); 25 | Account accountItem1 = new Account(); 26 | accountItem1.setId("8d7b1ef68a240c93f6e5d82c"); 27 | accountItem1.setAccountNumber("CZ61-5051-2543-6888-5372"); 28 | accountItem1.setAccountHolderName("Bruce Willis"); 29 | accountItem1.setBalance(BigDecimal.valueOf(1340238)); 30 | accountItem1.setCurrency(Currency.getInstance("EUR")); 31 | accountList.add(accountItem1); 32 | 33 | Account accountItem2 = new Account(); 34 | accountItem2.setId("644d736d24862f0104ae52f7"); 35 | accountItem2.setAccountNumber("GB46-4754-5577-4195-4725"); 36 | accountItem2.setAccountHolderName("Harrison Ford"); 37 | accountItem2.setBalance(BigDecimal.valueOf(25843)); 38 | accountItem2.setCurrency(Currency.getInstance("GBP")); 39 | accountList.add(accountItem2); 40 | 41 | Account accountItem3 = new Account(); 42 | accountItem3.setId("9f36a8e2b1d0c47b5e81c93d"); 43 | accountItem3.setAccountNumber("FR59-1273-9000-5016-6948"); 44 | accountItem3.setAccountHolderName("Scarlett Johansson"); 45 | accountItem3.setBalance(BigDecimal.valueOf(14324)); 46 | accountItem3.setCurrency(Currency.getInstance("EUR")); 47 | accountList.add(accountItem3); 48 | 49 | Account accountItem4 = new Account(); 50 | accountItem4.setId("5e6f7c1d3a8b49h2k0j7m4n9"); 51 | accountItem4.setAccountNumber("HU73-0472-9861-1757-7419"); 52 | accountItem4.setAccountHolderName("Ryan Gosling"); 53 | accountItem4.setBalance(BigDecimal.valueOf(8927382)); 54 | accountItem4.setCurrency(Currency.getInstance("HUF")); 55 | accountList.add(accountItem4); 56 | 57 | accountRepository.saveAll(accountList); 58 | } 59 | } 60 | 61 | -------------------------------------------------------------------------------- /transaction-api/src/test/java/com/royal/reserve/bank/transaction/api/unit/model/TransactionTest.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.transaction.api.unit.model; 2 | 3 | import com.royal.reserve.bank.transaction.api.model.Transaction; 4 | import com.royal.reserve.bank.transaction.api.model.TransactionItems; 5 | import org.junit.jupiter.api.BeforeEach; 6 | import org.junit.jupiter.api.Test; 7 | import org.mockito.Mock; 8 | 9 | import java.util.Arrays; 10 | import java.util.List; 11 | 12 | import static org.junit.jupiter.api.Assertions.assertEquals; 13 | 14 | /** 15 | * Unit tests for the {@link Transaction} class. 16 | */ 17 | class TransactionTest { 18 | 19 | @Mock 20 | private TransactionItems mockTransactionItems1; 21 | 22 | @Mock 23 | private TransactionItems mockTransactionItems2; 24 | 25 | private Transaction transaction; 26 | 27 | @BeforeEach 28 | void setUp() { 29 | transaction = new Transaction(); 30 | transaction.setId(1L); 31 | transaction.setTransactionId("9823427342"); 32 | List transactionItemsList = 33 | Arrays.asList(mockTransactionItems1, mockTransactionItems2); 34 | transaction.setTransactionItemsList(transactionItemsList); 35 | } 36 | 37 | /** 38 | * Test the constructors. 39 | */ 40 | @Test 41 | void testGetId() { 42 | // When and Then 43 | assertEquals(1L, transaction.getId()); 44 | } 45 | 46 | @Test 47 | void testGetTransactionId() { 48 | // When and Then 49 | assertEquals("9823427342", transaction.getTransactionId()); 50 | } 51 | 52 | @Test 53 | void testGetTransactionItemsList() { 54 | // Given 55 | List expectedItemsList = Arrays.asList(mockTransactionItems1, mockTransactionItems2); 56 | 57 | // When and Then 58 | assertEquals(expectedItemsList, transaction.getTransactionItemsList()); 59 | } 60 | 61 | @Test 62 | void testSetId() { 63 | // When 64 | transaction.setId(2L); 65 | 66 | // Then 67 | assertEquals(2L, transaction.getId()); 68 | } 69 | 70 | @Test 71 | void testSetTransactionId() { 72 | // When 73 | transaction.setTransactionId("987654321"); 74 | 75 | // Then 76 | assertEquals("987654321", transaction.getTransactionId()); 77 | } 78 | 79 | @Test 80 | void testSetTransactionItemsList() { 81 | // Given 82 | List newItemsList = 83 | Arrays.asList(mockTransactionItems1, mockTransactionItems2); 84 | 85 | // When 86 | transaction.setTransactionItemsList(newItemsList); 87 | 88 | // Then 89 | assertEquals(newItemsList, transaction.getTransactionItemsList()); 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /docs/javadoc/type-search-index.js: -------------------------------------------------------------------------------- 1 | typeSearchIndex = [{"p":"com.royal.reserve.bank.account.api.model","l":"Account"},{"p":"com.royal.reserve.bank.account.api","l":"AccountApiApplication"},{"p":"com.royal.reserve.bank.account.api.controller","l":"AccountController"},{"p":"com.royal.reserve.bank.account.api.repository","l":"AccountRepository"},{"p":"com.royal.reserve.bank.account.api.dto","l":"AccountRequest"},{"p":"com.royal.reserve.bank.account.api.dto","l":"AccountResponse"},{"p":"com.royal.reserve.bank.account.api.service","l":"AccountService"},{"p":"com.royal.reserve.bank.account.api.util","l":"AccountTestData"},{"l":"All Classes and Interfaces","u":"allclasses-index.html"},{"p":"com.royal.reserve.bank.api.gateway","l":"ApiGatewayApplication"},{"p":"com.royal.reserve.bank.asset.management.api.model","l":"Asset"},{"p":"com.royal.reserve.bank.asset.management.api","l":"AssetManagementApiApplication"},{"p":"com.royal.reserve.bank.transaction.api.client","l":"AssetManagementClient"},{"p":"com.royal.reserve.bank.asset.management.api.controller","l":"AssetManagementController"},{"p":"com.royal.reserve.bank.asset.management.api.repository","l":"AssetManagementRepository"},{"p":"com.royal.reserve.bank.asset.management.api.dto","l":"AssetManagementResponse"},{"p":"com.royal.reserve.bank.transaction.api.dto","l":"AssetManagementResponse"},{"p":"com.royal.reserve.bank.asset.management.api.service","l":"AssetManagementService"},{"p":"com.royal.reserve.bank.asset.management.api.util","l":"AssetTestData"},{"p":"com.royal.reserve.bank.config.server","l":"ConfigServerApplication"},{"p":"com.royal.reserve.bank.account.api.serializer","l":"CustomBigDecimalRedisSerializer"},{"p":"com.royal.reserve.bank.discovery.server","l":"DiscoveryServerApplication"},{"p":"com.royal.reserve.bank.notification.api","l":"NotificationApiApplication"},{"p":"com.royal.reserve.bank.account.api.config","l":"RedisConfig"},{"p":"com.royal.reserve.bank.api.gateway.config","l":"SecurityConfig"},{"p":"com.royal.reserve.bank.discovery.server.config","l":"SecurityConfig"},{"p":"com.royal.reserve.bank.transaction.api.model","l":"Transaction"},{"p":"com.royal.reserve.bank.transaction.api","l":"TransactionApiApplication"},{"p":"com.royal.reserve.bank.transaction.api.controller","l":"TransactionController"},{"p":"com.royal.reserve.bank.notification.api.event","l":"TransactionEvent"},{"p":"com.royal.reserve.bank.transaction.api.event","l":"TransactionEvent"},{"p":"com.royal.reserve.bank.transaction.api.model","l":"TransactionItems"},{"p":"com.royal.reserve.bank.transaction.api.dto","l":"TransactionItemsDto"},{"p":"com.royal.reserve.bank.transaction.api.repository","l":"TransactionRepository"},{"p":"com.royal.reserve.bank.transaction.api.dto","l":"TransactionRequest"},{"p":"com.royal.reserve.bank.transaction.api.service","l":"TransactionService"},{"p":"com.royal.reserve.bank.transaction.api.config","l":"WebClientConfig"}];updateSearchResults(); -------------------------------------------------------------------------------- /asset-management-api/src/test/java/com/royal/reserve/bank/asset/management/api/unit/controller/AssetManagementControllerTest.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.asset.management.api.unit.controller; 2 | 3 | import com.royal.reserve.bank.asset.management.api.controller.AssetManagementController; 4 | import com.royal.reserve.bank.asset.management.api.dto.AssetManagementResponse; 5 | import com.royal.reserve.bank.asset.management.api.service.AssetManagementService; 6 | import org.junit.jupiter.api.Test; 7 | import org.junit.jupiter.api.extension.ExtendWith; 8 | import org.mockito.Mock; 9 | import org.mockito.junit.jupiter.MockitoExtension; 10 | import org.springframework.http.HttpStatus; 11 | import org.springframework.http.ResponseEntity; 12 | 13 | import java.util.Arrays; 14 | import java.util.List; 15 | 16 | import static org.junit.jupiter.api.Assertions.*; 17 | import static org.mockito.Mockito.*; 18 | 19 | /** 20 | * Unit tests for the {@link AssetManagementController} class. 21 | */ 22 | @ExtendWith(MockitoExtension.class) 23 | class AssetManagementControllerTest { 24 | 25 | @Mock 26 | private AssetManagementService assetManagementService; 27 | 28 | /** 29 | * Test for the {@link AssetManagementController#isAssetAvailable(List)} method. 30 | */ 31 | @Test 32 | void testIsAssetAvailableReturnsOk() { 33 | // Given 34 | AssetManagementController assetManagementController = new AssetManagementController(assetManagementService); 35 | List assetCodes = Arrays.asList("8917", "1355"); 36 | List expectedResponse = Arrays.asList( 37 | new AssetManagementResponse("8917", true), 38 | new AssetManagementResponse("1355", false) 39 | ); 40 | when(assetManagementService.isAssetAvailable(assetCodes)).thenReturn(expectedResponse); 41 | 42 | // When 43 | ResponseEntity> response = 44 | ResponseEntity.ok(assetManagementController.isAssetAvailable(assetCodes)); 45 | 46 | // Then 47 | verify(assetManagementService, times(1)).isAssetAvailable(assetCodes); 48 | assertEquals(HttpStatus.OK, response.getStatusCode()); 49 | assertEquals(expectedResponse, response.getBody()); 50 | } 51 | 52 | /** 53 | * Test for the {@link AssetManagementController#isAssetAvailable(List)} method. 54 | */ 55 | @Test 56 | void testIsAssetAvailableWithEmptyAssetCodeList() { 57 | // Given 58 | AssetManagementController assetManagementController = new AssetManagementController(assetManagementService); 59 | List emptyAssetCodes = List.of(); 60 | 61 | // When 62 | List response = assetManagementController.isAssetAvailable(emptyAssetCodes); 63 | 64 | // Then 65 | assertTrue(response.isEmpty()); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /account-api/src/main/java/com/royal/reserve/bank/account/api/controller/AccountController.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.account.api.controller; 2 | 3 | import com.royal.reserve.bank.account.api.service.AccountService; 4 | import com.royal.reserve.bank.account.api.dto.AccountResponse; 5 | import com.royal.reserve.bank.account.api.dto.AccountRequest; 6 | import lombok.RequiredArgsConstructor; 7 | import org.springframework.http.HttpStatus; 8 | import org.springframework.http.ResponseEntity; 9 | import org.springframework.web.bind.annotation.*; 10 | 11 | import java.util.List; 12 | 13 | /** 14 | * Controller class that handles HTTP requests related to bank accounts. 15 | */ 16 | @RestController 17 | @RequestMapping("/api/account") 18 | @RequiredArgsConstructor 19 | public class AccountController { 20 | 21 | private final AccountService accountService; 22 | 23 | /** 24 | * Creates a new bank account. 25 | * 26 | * @param accountRequest The account request containing account details. 27 | * @return A ResponseEntity with a success message and HTTP status code 201 if the account was created successfully. 28 | */ 29 | @PostMapping 30 | public ResponseEntity createAccount(@RequestBody AccountRequest accountRequest) { 31 | accountService.createAccount(accountRequest); 32 | return ResponseEntity.status(HttpStatus.CREATED).body 33 | ("Successfully set up a new bank account for " + 34 | accountRequest.getAccountHolderName() + "."); 35 | } 36 | 37 | /** 38 | * Retrieves all bank accounts. 39 | * 40 | * @return A list of AccountResponse objects representing the bank accounts. 41 | */ 42 | @GetMapping 43 | @ResponseStatus(HttpStatus.OK) 44 | public List getAllAccounts() { 45 | return accountService.getAllAccounts(); 46 | } 47 | 48 | /** 49 | * Deletes a bank account based on the account holder name. 50 | * 51 | * @param accountRequest The account request containing the account holder name. 52 | * @return A ResponseEntity with a success message and HTTP status code 200 if the account was deleted successfully, 53 | * or a ResponseEntity with an error message and HTTP status code 404 if the account was not found. 54 | */ 55 | @DeleteMapping 56 | public ResponseEntity deleteAccount(@RequestBody AccountRequest accountRequest) { 57 | try { 58 | accountService.deleteAccountByAccountHolderName(accountRequest.getAccountHolderName()); 59 | return ResponseEntity.status(HttpStatus.OK).body("Successfully deleted " + 60 | accountRequest.getAccountHolderName() + "'s account."); 61 | } catch (RuntimeException runtimeException) { 62 | return ResponseEntity.status(HttpStatus.NOT_FOUND).body(runtimeException.getMessage()); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /account-api/src/test/java/com/royal/reserve/bank/account/api/unit/serializer/CustomBigDecimalRedisSerializerTest.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.account.api.unit.serializer; 2 | 3 | import com.royal.reserve.bank.account.api.serializer.CustomBigDecimalRedisSerializer; 4 | import org.junit.jupiter.api.BeforeEach; 5 | import org.junit.jupiter.api.Test; 6 | import org.mockito.Mock; 7 | import org.springframework.data.redis.serializer.RedisSerializer; 8 | 9 | import java.math.BigDecimal; 10 | 11 | import static org.junit.jupiter.api.Assertions.*; 12 | import static org.mockito.Mockito.*; 13 | 14 | /** 15 | * Unit tests for {@link CustomBigDecimalRedisSerializer} class. 16 | */ 17 | class CustomBigDecimalRedisSerializerTest { 18 | private CustomBigDecimalRedisSerializer serializer; 19 | 20 | @Mock 21 | private RedisSerializer jsonSerializer; 22 | 23 | @BeforeEach 24 | @SuppressWarnings("unchecked") 25 | void setUp() { 26 | jsonSerializer = mock(RedisSerializer.class); 27 | serializer = new CustomBigDecimalRedisSerializer(jsonSerializer); 28 | } 29 | 30 | /** 31 | * Test the constructors. 32 | */ 33 | @Test 34 | void serializeWithBigDecimal() { 35 | // Given 36 | BigDecimal value = new BigDecimal("10.50"); 37 | byte[] expectedBytes = "10.50".getBytes(); 38 | 39 | // When 40 | byte[] result = serializer.serialize(value); 41 | 42 | // Then 43 | assertArrayEquals(expectedBytes, result); 44 | } 45 | 46 | @Test 47 | void serializeWithNonBigDecimal() { 48 | // Given 49 | Object value = "test"; 50 | byte[] expectedBytes = "serialized".getBytes(); 51 | when(jsonSerializer.serialize(value)).thenReturn(expectedBytes); 52 | 53 | // When 54 | byte[] result = serializer.serialize(value); 55 | 56 | // Then 57 | assertArrayEquals(expectedBytes, result); 58 | } 59 | 60 | @Test 61 | void deserializeWithValidBytes() { 62 | // Given 63 | byte[] bytes = "10.50".getBytes(); 64 | BigDecimal expectedValue = new BigDecimal("10.50"); 65 | 66 | // When 67 | Object result = serializer.deserialize(bytes); 68 | 69 | // Then 70 | assertEquals(expectedValue, result); 71 | } 72 | 73 | @Test 74 | void deserializeWithInvalidBytes() { 75 | // Given 76 | byte[] bytes = "invalid".getBytes(); 77 | Object expectedValue = "deserialized"; 78 | when(jsonSerializer.deserialize(bytes)).thenReturn(expectedValue); 79 | 80 | // When 81 | Object result = serializer.deserialize(bytes); 82 | 83 | // Then 84 | assertEquals(expectedValue, result); 85 | } 86 | 87 | @Test 88 | void deserializeWithNullBytes() { 89 | // When 90 | Object result = serializer.deserialize(null); 91 | 92 | // Then 93 | assertNull(result); 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /docs/javadoc/com/royal/reserve/bank/account/api/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Package com.royal.reserve.bank.account.api (royal-reserve-bank 1.0 API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 49 |
50 |
51 |
52 |

Uses of Package
com.royal.reserve.bank.account.api

53 |
54 | No usage of com.royal.reserve.bank.account.api
55 |
56 |
57 | 58 |
59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /docs/javadoc/com/royal/reserve/bank/api/gateway/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Package com.royal.reserve.bank.api.gateway (royal-reserve-bank 1.0 API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 49 |
50 |
51 |
52 |

Uses of Package
com.royal.reserve.bank.api.gateway

53 |
54 | No usage of com.royal.reserve.bank.api.gateway
55 |
56 |
57 | 58 |
59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /docs/javadoc/com/royal/reserve/bank/config/server/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Package com.royal.reserve.bank.config.server (royal-reserve-bank 1.0 API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 49 |
50 |
51 |
52 |

Uses of Package
com.royal.reserve.bank.config.server

53 |
54 | No usage of com.royal.reserve.bank.config.server
55 |
56 |
57 | 58 |
59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /transaction-api/src/test/java/com/royal/reserve/bank/transaction/api/unit/controller/TransactionControllerTest.java: -------------------------------------------------------------------------------- 1 | package com.royal.reserve.bank.transaction.api.unit.controller; 2 | 3 | import com.royal.reserve.bank.transaction.api.controller.TransactionController; 4 | import com.royal.reserve.bank.transaction.api.dto.TransactionItemsDto; 5 | import com.royal.reserve.bank.transaction.api.dto.TransactionRequest; 6 | import com.royal.reserve.bank.transaction.api.service.TransactionService; 7 | import org.junit.jupiter.api.Assertions; 8 | import org.junit.jupiter.api.BeforeEach; 9 | import org.junit.jupiter.api.Test; 10 | import org.junit.jupiter.api.extension.ExtendWith; 11 | import org.mockito.InjectMocks; 12 | import org.mockito.Mock; 13 | import org.mockito.junit.jupiter.MockitoExtension; 14 | 15 | import java.util.Arrays; 16 | import java.util.List; 17 | import java.util.concurrent.CompletableFuture; 18 | 19 | import static org.mockito.ArgumentMatchers.any; 20 | import static org.mockito.Mockito.when; 21 | 22 | /** 23 | * Unit tests for the {@link TransactionController} class. 24 | */ 25 | @ExtendWith(MockitoExtension.class) 26 | class TransactionControllerTest { 27 | 28 | @Mock 29 | private TransactionService transactionService; 30 | 31 | @InjectMocks 32 | private TransactionController transactionController; 33 | 34 | private TransactionRequest request; 35 | 36 | @BeforeEach 37 | void setup() { 38 | TransactionItemsDto item1 = new TransactionItemsDto(1L, "AAPL", "Apple Inc.", 39 | 19000); 40 | TransactionItemsDto item2 = new TransactionItemsDto(2L, "GOOGL", "Alphabet Inc.", 41 | 10200); 42 | List transactionItemList = Arrays.asList(item1, item2); 43 | request = new TransactionRequest(transactionItemList); 44 | } 45 | 46 | /** 47 | * Test for the {@link TransactionController#processTransaction(TransactionRequest)} method. 48 | */ 49 | @Test 50 | void testProcessTransaction() { 51 | // Given 52 | String expectedResponse = "Transaction processed."; 53 | when(transactionService.processTransaction(any(TransactionRequest.class))).thenReturn(expectedResponse); 54 | 55 | // When 56 | CompletableFuture result = transactionController.processTransaction(request); 57 | 58 | // Then 59 | Assertions.assertEquals(expectedResponse, result.join()); 60 | } 61 | 62 | /** 63 | * Test for the {@link TransactionController#fallbackMethod(TransactionRequest, RuntimeException)} method. 64 | */ 65 | @Test 66 | void testFallbackMethod() { 67 | // Given 68 | RuntimeException exception = new RuntimeException("Error occurred during transaction processing"); 69 | String expectedFallbackResponse = "Oops! Something went wrong, please try again later!"; 70 | 71 | // When 72 | CompletableFuture result = transactionController.fallbackMethod(request, exception); 73 | 74 | // Then 75 | Assertions.assertEquals(expectedFallbackResponse, result.join()); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /docs/javadoc/com/royal/reserve/bank/transaction/api/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Package com.royal.reserve.bank.transaction.api (royal-reserve-bank 1.0 API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 49 |
50 |
51 |
52 |

Uses of Package
com.royal.reserve.bank.transaction.api

53 |
54 | No usage of com.royal.reserve.bank.transaction.api
55 |
56 |
57 | 58 |
59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /docs/javadoc/com/royal/reserve/bank/discovery/server/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Package com.royal.reserve.bank.discovery.server (royal-reserve-bank 1.0 API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 49 |
50 |
51 |
52 |

Uses of Package
com.royal.reserve.bank.discovery.server

53 |
54 | No usage of com.royal.reserve.bank.discovery.server
55 |
56 |
57 | 58 |
59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /docs/javadoc/com/royal/reserve/bank/notification/api/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Package com.royal.reserve.bank.notification.api (royal-reserve-bank 1.0 API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 49 |
50 |
51 |
52 |

Uses of Package
com.royal.reserve.bank.notification.api

53 |
54 | No usage of com.royal.reserve.bank.notification.api
55 |
56 |
57 | 58 |
59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /docs/javadoc/com/royal/reserve/bank/account/api/util/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Package com.royal.reserve.bank.account.api.util (royal-reserve-bank 1.0 API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 49 |
50 |
51 |
52 |

Uses of Package
com.royal.reserve.bank.account.api.util

53 |
54 | No usage of com.royal.reserve.bank.account.api.util
55 |
56 |
57 | 58 |
59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /docs/javadoc/com/royal/reserve/bank/account/api/model/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Package com.royal.reserve.bank.account.api.model (royal-reserve-bank 1.0 API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 49 |
50 |
51 |
52 |

Uses of Package
com.royal.reserve.bank.account.api.model

53 |
54 | No usage of com.royal.reserve.bank.account.api.model
55 |
56 |
57 | 58 |
59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /docs/javadoc/com/royal/reserve/bank/account/api/config/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Package com.royal.reserve.bank.account.api.config (royal-reserve-bank 1.0 API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 49 |
50 |
51 |
52 |

Uses of Package
com.royal.reserve.bank.account.api.config

53 |
54 | No usage of com.royal.reserve.bank.account.api.config
55 |
56 |
57 | 58 |
59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /docs/javadoc/com/royal/reserve/bank/api/gateway/config/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Package com.royal.reserve.bank.api.gateway.config (royal-reserve-bank 1.0 API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 49 |
50 |
51 |
52 |

Uses of Package
com.royal.reserve.bank.api.gateway.config

53 |
54 | No usage of com.royal.reserve.bank.api.gateway.config
55 |
56 |
57 | 58 |
59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /docs/javadoc/com/royal/reserve/bank/account/api/service/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Package com.royal.reserve.bank.account.api.service (royal-reserve-bank 1.0 API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 49 |
50 |
51 |
52 |

Uses of Package
com.royal.reserve.bank.account.api.service

53 |
54 | No usage of com.royal.reserve.bank.account.api.service
55 |
56 |
57 | 58 |
59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /docs/javadoc/com/royal/reserve/bank/asset/management/api/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Package com.royal.reserve.bank.asset.management.api (royal-reserve-bank 1.0 API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 49 |
50 |
51 |
52 |

Uses of Package
com.royal.reserve.bank.asset.management.api

53 |
54 | No usage of com.royal.reserve.bank.asset.management.api
55 |
56 |
57 | 58 |
59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /docs/javadoc/com/royal/reserve/bank/transaction/api/event/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Package com.royal.reserve.bank.transaction.api.event (royal-reserve-bank 1.0 API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 49 |
50 |
51 |
52 |

Uses of Package
com.royal.reserve.bank.transaction.api.event

53 |
54 | No usage of com.royal.reserve.bank.transaction.api.event
55 |
56 |
57 | 58 |
59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /docs/javadoc/com/royal/reserve/bank/transaction/api/model/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Package com.royal.reserve.bank.transaction.api.model (royal-reserve-bank 1.0 API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 49 |
50 |
51 |
52 |

Uses of Package
com.royal.reserve.bank.transaction.api.model

53 |
54 | No usage of com.royal.reserve.bank.transaction.api.model
55 |
56 |
57 | 58 |
59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /docs/javadoc/com/royal/reserve/bank/account/api/controller/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Package com.royal.reserve.bank.account.api.controller (royal-reserve-bank 1.0 API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 49 |
50 |
51 |
52 |

Uses of Package
com.royal.reserve.bank.account.api.controller

53 |
54 | No usage of com.royal.reserve.bank.account.api.controller
55 |
56 |
57 | 58 |
59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /docs/javadoc/com/royal/reserve/bank/account/api/repository/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Package com.royal.reserve.bank.account.api.repository (royal-reserve-bank 1.0 API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 49 |
50 |
51 |
52 |

Uses of Package
com.royal.reserve.bank.account.api.repository

53 |
54 | No usage of com.royal.reserve.bank.account.api.repository
55 |
56 |
57 | 58 |
59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /docs/javadoc/com/royal/reserve/bank/account/api/serializer/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Package com.royal.reserve.bank.account.api.serializer (royal-reserve-bank 1.0 API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 49 |
50 |
51 |
52 |

Uses of Package
com.royal.reserve.bank.account.api.serializer

53 |
54 | No usage of com.royal.reserve.bank.account.api.serializer
55 |
56 |
57 | 58 |
59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /docs/javadoc/com/royal/reserve/bank/transaction/api/client/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Package com.royal.reserve.bank.transaction.api.client (royal-reserve-bank 1.0 API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 49 |
50 |
51 |
52 |

Uses of Package
com.royal.reserve.bank.transaction.api.client

53 |
54 | No usage of com.royal.reserve.bank.transaction.api.client
55 |
56 |
57 | 58 |
59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /docs/javadoc/com/royal/reserve/bank/transaction/api/config/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Package com.royal.reserve.bank.transaction.api.config (royal-reserve-bank 1.0 API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 49 |
50 |
51 |
52 |

Uses of Package
com.royal.reserve.bank.transaction.api.config

53 |
54 | No usage of com.royal.reserve.bank.transaction.api.config
55 |
56 |
57 | 58 |
59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /docs/javadoc/com/royal/reserve/bank/discovery/server/config/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Package com.royal.reserve.bank.discovery.server.config (royal-reserve-bank 1.0 API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 49 |
50 |
51 |
52 |

Uses of Package
com.royal.reserve.bank.discovery.server.config

53 |
54 | No usage of com.royal.reserve.bank.discovery.server.config
55 |
56 |
57 | 58 |
59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /docs/javadoc/com/royal/reserve/bank/transaction/api/service/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Package com.royal.reserve.bank.transaction.api.service (royal-reserve-bank 1.0 API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 49 |
50 |
51 |
52 |

Uses of Package
com.royal.reserve.bank.transaction.api.service

53 |
54 | No usage of com.royal.reserve.bank.transaction.api.service
55 |
56 |
57 | 58 |
59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /docs/javadoc/com/royal/reserve/bank/transaction/api/controller/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Package com.royal.reserve.bank.transaction.api.controller (royal-reserve-bank 1.0 API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 49 |
50 |
51 |
52 |

Uses of Package
com.royal.reserve.bank.transaction.api.controller

53 |
54 | No usage of com.royal.reserve.bank.transaction.api.controller
55 |
56 |
57 | 58 |
59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /docs/javadoc/com/royal/reserve/bank/transaction/api/repository/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Uses of Package com.royal.reserve.bank.transaction.api.repository (royal-reserve-bank 1.0 API) 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 21 | 24 |
25 | 49 |
50 |
51 |
52 |

Uses of Package
com.royal.reserve.bank.transaction.api.repository

53 |
54 | No usage of com.royal.reserve.bank.transaction.api.repository
55 | 59 |
60 |
61 | 62 | 63 | -------------------------------------------------------------------------------- /docs/javadoc/legal/jquery.md: -------------------------------------------------------------------------------- 1 | ## jQuery v3.6.0 2 | 3 | ### jQuery License 4 | ``` 5 | jQuery v 3.6.0 6 | Copyright OpenJS Foundation and other contributors, https://openjsf.org/ 7 | 8 | Permission is hereby granted, free of charge, to any person obtaining 9 | a copy of this software and associated documentation files (the 10 | "Software"), to deal in the Software without restriction, including 11 | without limitation the rights to use, copy, modify, merge, publish, 12 | distribute, sublicense, and/or sell copies of the Software, and to 13 | permit persons to whom the Software is furnished to do so, subject to 14 | the following conditions: 15 | 16 | The above copyright notice and this permission notice shall be 17 | included in all copies or substantial portions of the Software. 18 | 19 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 20 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 22 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 23 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 24 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 25 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | 27 | ****************************************** 28 | 29 | The jQuery JavaScript Library v3.6.0 also includes Sizzle.js 30 | 31 | Sizzle.js includes the following license: 32 | 33 | Copyright JS Foundation and other contributors, https://js.foundation/ 34 | 35 | This software consists of voluntary contributions made by many 36 | individuals. For exact contribution history, see the revision history 37 | available at https://github.com/jquery/sizzle 38 | 39 | The following license applies to all parts of this software except as 40 | documented below: 41 | 42 | ==== 43 | 44 | Permission is hereby granted, free of charge, to any person obtaining 45 | a copy of this software and associated documentation files (the 46 | "Software"), to deal in the Software without restriction, including 47 | without limitation the rights to use, copy, modify, merge, publish, 48 | distribute, sublicense, and/or sell copies of the Software, and to 49 | permit persons to whom the Software is furnished to do so, subject to 50 | the following conditions: 51 | 52 | The above copyright notice and this permission notice shall be 53 | included in all copies or substantial portions of the Software. 54 | 55 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 56 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 57 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 58 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 59 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 60 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 61 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 62 | 63 | ==== 64 | 65 | All files located in the node_modules and external directories are 66 | externally maintained libraries used by this software which have their 67 | own licenses; we recommend you read them, as their terms may differ from 68 | the terms above. 69 | 70 | ********************* 71 | 72 | ``` 73 | --------------------------------------------------------------------------------