diff --git a/.env b/.env index 29e102fd..7871f551 100644 --- a/.env +++ b/.env @@ -1,15 +1,16 @@ ## Mojaloop Docker Image Versions - -ML_API_ADAPTER_VERSION=v14.0.0 -## ALS initial baseline +ML_API_ADAPTER_VERSION=v14.0.1 +## ALS initial baseline with version included in Mojaloop v15.1.0 Helm Release # ACCOUNT_LOOKUP_SERVICE_VERSION=v14.2.2 ## ALS published version with included fix: JSON.stringify disabled in logResponse function -# ACCOUNT_LOOKUP_SERVICE_VERSION=v14.2.3 -## ALS with local fix: v14.2.3 + caching for validateParticipant and resolve Participants via Oracles -ACCOUNT_LOOKUP_SERVICE_VERSION=v14.2.4-snapshot.3 +ACCOUNT_LOOKUP_SERVICE_VERSION=v14.2.3 +## ALS snapshot release with fix: v14.2.3 + caching for validateParticipant and resolve Participants via Oracles +# ACCOUNT_LOOKUP_SERVICE_VERSION=v14.2.4-snapshot.3 QUOTING_SERVICE_VERSION=v15.0.2 +## CL initial baseline with version included in Mojaloop v15.1.0 Helm Release CENTRAL_LEDGER_VERSION=v17.0.3 - +## CL snapshot release with included fix: JSON.stringify disabled in logResponse function +# CENTRAL_LEDGER_VERSION=v17.0.4-snapshot.0 ## Monitoring Docker Image Versions GRAFANA_VERSION=10.0.2 diff --git a/.gitignore b/.gitignore index 8052142f..25161e30 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ # General Ignore **/*IGNORE* + +**/results/** + +automate_perf.env diff --git a/README.md b/README.md index 95f6dc04..2d7f667e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,8 @@ Run `Mojaloop` in your local machine using docker-compose without need for a `Kubernetes` cluster. -## Pre-requisites: +## Pre-requisites + - git - docker - docker-compose @@ -11,7 +12,7 @@ Run `Mojaloop` in your local machine using docker-compose without need for a `Ku Execute the following commands to run mojaloop in local machine -``` +```bash git clone https://github.com/mojaloop/ml-core-test-harness.git cd ml-core-test-harness docker-compose --profile all-services --profile ttk-provisioning --profile ttk-tests up @@ -22,7 +23,7 @@ You can check the status of the containers using the command `docker ps`. You should see the following output after some time. That means all your mojaloop services are up and test FSPs are onboarded successfully. Now you can run a P2P transfer. -``` +```log ┌───────────────────────────────────────────────────┐ │ SUMMARY │ ├───────────────────┬───────────────────────────────┤ @@ -52,7 +53,7 @@ You can see all the test reports at http://localhost:9660/admin/reports and late After all services been started, if you want to execute the P2P transfer from the command line again, use the following command in a separate terminal session. -``` +```bash docker-compose --project-name ttk-test-only --profile ttk-tests up --no-deps ``` @@ -92,61 +93,74 @@ http://localhost:9660/mobilesimulator | agreement | Services used for agreement | - | | transfer | Services used for transfer | - | - ## Running various services with different profile combinations ### Core services without provisioning -``` + +```bash docker-compose --profile all-services up ``` ### Core services with debug utilities -``` + +```bash docker-compose --profile all-services --profile debug up ``` ### Central ledger -``` + +```bash docker-compose --profile central-ledger up ``` ### Quoting Service -``` + +```bash docker-compose --profile quoting-service --profile central-ledger up ``` + Note: We need to include central-ledger profile also here because its a dependency for quoting service ### Account lookup service -``` + +```bash docker-compose --profile account-lookup-service --profile central-ledger up ``` + Note: We need to include central-ledger profile also here because its a dependency for account lookup service ### ML API Adapter -``` + +```bash docker-compose --profile ml-api-adapter --profile central-ledger up ``` + Note: We need to include central-ledger profile also here because its a dependency for ml-api-adapter ### Discovery -``` + +```bash docker-compose --profile discovery up ``` ### Agreement -``` + +```bash docker-compose --profile agreement up ``` ### Transfer -``` + +```bash docker-compose --profile transfer up ``` ### Settlements + TODO: Add settlement related services ### Bulk + TODO: Add bulk related services ## Functional tests inside CICD @@ -172,13 +186,27 @@ ls reports/ttk-func-tests-report.html reports/ttk-provisioning-report.html ### Running ALS with dependencies ```bash -docker compose --project-name ml-core -f docker-compose-perf.yml --profile all-services --profile ttk-provisioning up -d +docker compose --project-name ml-core -f docker-compose-perf.yml --profile als-test --profile ttk-provisioning-als up -d ``` Stop Services ```bash -docker compose --project-name ml-core -f docker-compose-perf.yml --profile all-services down -v +docker compose --project-name ml-core -f docker-compose-perf.yml --profile als-test down -v +``` + +> NOTE: `-v` argument is optional, and it will delete any volume data created by the monitoring docker compose + +### Running Services for Transfers characterization + +```bash +docker compose --project-name ml-core -f docker-compose-perf.yml --profile transfers-test --profile 8dfsp --profile ttk-provisioning-transfers up -d +``` + +Stop Services + +```bash +docker compose --project-name ml-core -f docker-compose-perf.yml --profile transfers-test --profile 8dfsp down -v ``` > NOTE: `-v` argument is optional, and it will delete any volume data created by the monitoring docker compose @@ -186,6 +214,7 @@ docker compose --project-name ml-core -f docker-compose-perf.yml --profile all-s ### Monitoring Start Monitoring Services stack which uses: + - [Prometheus](https://prometheus.io) for time series data store - [Grafana](https://grafana.com/) for visualization dashboards - [Node Exporter](https://github.com/prometheus/node_exporter) to instrument the Host machine @@ -198,26 +227,62 @@ docker compose --project-name monitoring -f docker-compose-monitoring.yml up -d Stop Monitoring Services ```bash -docker compose --project-name monitoring -f docker-compose-monitoring.yml down -v +docker compose --project-name monitoring --profile als-test -f docker-compose-monitoring.yml down -v +``` + +Start monitoring with account lookup service mysql exporter + +```bash +docker compose --project-name monitoring --profile als-test -f docker-compose-monitoring.yml up -d +``` + +Start monitoring with central ledger mysql exporter + +```bash +docker compose --project-name monitoring --profile transfers-test -f docker-compose-monitoring.yml up -d ``` > NOTE: `-v` argument is optional, and it will delete any volume data created by the monitoring docker compose TODO: + - add note about network being created by docker-compose-perf.yml, or it can be done manually. ### Load Tests [K6](https://k6.io) is being used to execute performance tests, with metrics being captured by [Prometheus](https://k6.io/docs/results-output/real-time/prometheus-remote-write) and displayed using [Grafana](https://k6.io/docs/results-output/real-time/prometheus-remote-write/#time-series-visualization). -Tests can be defined in the [./docker/k6/scripts/test.js](./docker/k6/scripts/test.js), refer to [API load testing guide](https://k6.io/docs/testing-guides/api-load-testing/) for more information. +Tests can be defined in the [./packages/k6-tests/scripts/test.js](./packages/k6-tests/scripts/test.js), refer to [API load testing guide](https://k6.io/docs/testing-guides/api-load-testing/) for more information. + +Env configs are stored in the [./perf.env](./perf.env) environment configuration file.. + +Note: Transfer testing + +Depending on the profile you started the performance docker compose with i.e `--profile transfers-test --profile {2/4/8}dfsp` +You will need to edit `K6_SCRIPT_FSPIOP_FSP_POOL` json string in `./perf.env` to contain 2/4/8 dfsps depending on your test. +For reference here are the provisioned dfsps with an associated partyId available for use. -Env configs are stored in the [./docker/k6/.env](./docker/k6/.env) environment configuration file, which can be referenced in by the [./docker/k6/scripts/test.js](./docker/k6/scripts/test.js). +```json +[ + {"partyId":19012345001,"fspId":"perffsp1","wsUrl":"ws://sim-perffsp1:3002"}, + {"partyId":19012345002,"fspId":"perffsp2","wsUrl":"ws://sim-perffsp2:3002"}, + {"partyId":19012345003,"fspId":"perffsp3","wsUrl":"ws://sim-perffsp3:3002"}, + {"partyId":19012345004,"fspId":"perffsp4","wsUrl":"ws://sim-perffsp4:3002"}, + {"partyId":19012345005,"fspId":"perffsp5","wsUrl":"ws://sim-perffsp5:3002"}, + {"partyId":19012345006,"fspId":"perffsp6","wsUrl":"ws://sim-perffsp6:3002"}, + {"partyId":19012345007,"fspId":"perffsp7","wsUrl":"ws://sim-perffsp7:3002"}, + {"partyId":19012345008,"fspId":"perffsp8","wsUrl":"ws://sim-perffsp8:3002"}, +] +``` Start tests ```bash -docker compose --project-name load -f docker-compose-load.yml up +env K6_SCRIPT_CONFIG_FILE_NAME=fspiopTransfers.json docker compose --project-name load -f docker-compose-load.yml up +( or ) +env K6_SCRIPT_CONFIG_FILE_NAME=fspiopTransfersUnidirectional.json docker compose --project-name load -f docker-compose-load.yml up +( or ) +env K6_SCRIPT_CONFIG_FILE_NAME=fspiopDiscovery.json docker compose --project-name load -f docker-compose-load.yml up ``` Cleanup tests @@ -225,3 +290,25 @@ Cleanup tests ```bash docker compose --project-name load -f docker-compose-load.yml down -v ``` + +### Automate Load Tests + +This section describes the process to automate capturing of grafana rendered dashboards after running the performance testing scenarios. + +The main script that contains the logic for this is automate_perf.sh. Before running this script, the required variables are provided as environment variables that are defined in automate_perf.env. As this file contains login credentials, to avoid credential exposure a sample file called automate_perf_sample.env is available at the root level. Make a copy of this file, rename it to automate_perf.env and update the variable values. + +Once automate_perf.env is ready, the next step is to make sure that the services for test harness and monitoring are up and running. The relevant docker-compose commands for these 2 steps are listed above in Performance Characterization section. + +Once the required services are up and running, run automate_perf.sh from terminal. Once the script is completed successfully, a results folder is created at the main root level. In there another folder based on date is created and it creates subfolders for the different scenarios that are executed. The different dashboards that will be collected are specified in the script itself. + +Run the script: + +```bash +./automate_perf.sh +``` + +To capture results without running tests, use the following command + +```bash +./automate_perf.sh -c -f -t +``` diff --git a/automate_perf.sh b/automate_perf.sh new file mode 100755 index 00000000..cd9956e3 --- /dev/null +++ b/automate_perf.sh @@ -0,0 +1,183 @@ +#!/bin/bash + +Help() +{ + # Display Help + echo "Usage: automate_perf.sh [ -c | --capture-results-only ] + [ -f | --capture-from-time ] + [ -t | --capture-to-time ] + [ -h | --help ]" + echo "options:" + echo "-c | --capture-results-only Capture dashboards only, skip test execution." + echo "-f | --capture-from-time From time for capturing results" + echo "-t | --capture-to-time To time for capturing results" + echo "h Print this Help." + exit; +} + +SHORT=c,f:,t:,h +LONG=capture-results-only,capture-from-time:,capture-to-time:,help +OPTS=$(getopt -a -n automate_perf.sh --options $SHORT --longoptions $LONG -- "$@") + +VALID_ARGUMENTS=$# # Returns the count of arguments that are in short or long options + +# Replace 'your_container_name' with the actual name of your Docker container +CONTAINER_NAME="load-k6-1" + +# if [ "$VALID_ARGUMENTS" -eq 0 ]; then +# Help +# fi + +eval set -- "$OPTS" + +while : +do + case "$1" in + -c | --capture-results-only ) + captureResultsOnly="true" + shift 1 + ;; + -f | --capture-from-time ) + captureFromTime="$2" + shift 2 + ;; + -t | --capture-to-time ) + captureToTime="$2" + shift 2 + ;; + -h | --help) + Help + ;; + --) + shift; + break; + ;; + *) + echo "ERROR: Unexpected option: $1" + echo + Help + ;; + esac +done + +if [ "$captureResultsOnly" ] && ([ -z "$captureFromTime" ] || [ -z "$captureToTime" ]) +then + echo "ERROR: capture-from-time and capture-to-time should be provided in capture-result-only mode" + echo + Help +fi + +source ./automate_perf.env + +# define the list of dashboards +declare -a dashboards=(\ + "dashboard-account-lookup-service" \ + "Central%20Ledger%20DB" \ + "Kafka%20Exporter%20Overview" \ + "mojaloop-central-ledger" \ + "Mojaloop%20-%20Central-Ledger%20-%20Performance%20Characterization" \ + "Mojaloop%20-%20ML-API" \ + "Docker%20Prometheus%20Monitoring" \ + "NodeJS%20Application%20Dashboard" \ + "Official%20k6%20Test%20Result" \ + "MySQL%20Overview" \ + "Supporting%20Services%20-%20Callback%20Hander%20Service" + ) + +# # create a directory to store the results with date timestamp in the name, check if the directory exists +resultsSubDir="$(date +"%Y%m%d")" + +if [ ! -d "results/$resultsSubDir/$K6_SCENARIO_NAME" ]; then + mkdir -p results/$resultsSubDir/$K6_SCENARIO_NAME +fi + +if [ -z "$captureResultsOnly" ] +then + # store current time in a variable + echo "Start Time : $(date +"%T")" + startTestSeconds=$(date +"%s") + # get milliseconds + echo "Epoch Start Time : $(date +"%s%3N")" + startTestMilliseconds=$(date +"%s%3N") + + if [ ! -d "results/$resultsSubDir/$K6_SCENARIO_NAME/logs" ]; then + mkdir -p results/$resultsSubDir/$K6_SCENARIO_NAME/logs + fi + env K6_SCRIPT_CONFIG_FILE_NAME=$K6_SCENARIO_CONFIG docker compose --project-name load -f docker-compose-load.yml up > results/$resultsSubDir/$K6_SCENARIO_NAME/logs/$CONTAINER_NAME.log + + # Interval in seconds between status checks + CHECK_INTERVAL=1 + + while true; do + # Check if the container is running + if docker ps --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; then + echo "Container '${CONTAINER_NAME}' is running." + else + # Check if the container is stopped + if docker ps -a --format '{{.Names}}' | grep -q "^${CONTAINER_NAME}$"; then + echo "Container '${CONTAINER_NAME}' is stopped." + echo "End Time : $(date +"%T")" + endTestSeconds=$(date +"%s") + # get milliseconds + echo "Epoch End Time plus 2 minutes : $(date +"%s%3N")" + endTestMilliseconds=$(date -d '+2 minutes' +"%s%3N") + break + else + echo "Container '${CONTAINER_NAME}' not found." + break + fi + fi + + # Wait for the specified interval before checking again + sleep $CHECK_INTERVAL + done + + # Calculate the difference in seconds + difference=$((endTestSeconds - startTestSeconds)) + + + s=$difference + ((h=s/3600)) + ((m=s%3600/60)) + ((s=s%60)) + printf "Time taken to run the test := %d:%02d:%02d\n" $h $m $s + # echo "Difference between timestamps: $difference seconds." + + + # Add sleep 10s for grafana to catchup with the metrics + sleep 10 +else + startTestMilliseconds=$captureFromTime + endTestMilliseconds=$captureToTime +fi + +if [ ! -d "results/$resultsSubDir/$K6_SCENARIO_NAME/images" ]; then + mkdir -p results/$resultsSubDir/$K6_SCENARIO_NAME/images +fi +# loop through the array +for dashboard in "${dashboards[@]}" +do + echo "$dashboard" + dashboard_string=$(echo $dashboard | sed 's/%20/ /g' | tr -d ' ') + # printf -v dashboard_string "%b" "${dashboard//\%/\\x}" + echo "$dashboard_string" + dashboardUrl=$(curl "http://$GRAFANA_USERNAME:$GRAFANA_PASSWORD@$GRAFANA_HOSTNAME:$GRAFANA_PORT/api/search?query=$dashboard" | jq -r '.[].url') + #check if dashboard is NodeJSApplicationDashboard + if [[ $dashboard_string == *"NodeJSApplicationDashboard"* ]]; then + curl "http://$GRAFANA_USERNAME:$GRAFANA_PASSWORD@$GRAFANA_HOSTNAME:$GRAFANA_PORT/render$dashboardUrl?height=5000&width=2000&from=$startTestMilliseconds&to=$endTestMilliseconds&var-prefix=moja_als&var-instance=All&var-serviceName=All&var-podName=All" > ./results/$resultsSubDir/$K6_SCENARIO_NAME/images/$dashboard_string-moja_als.png + curl "http://$GRAFANA_USERNAME:$GRAFANA_PASSWORD@$GRAFANA_HOSTNAME:$GRAFANA_PORT/render$dashboardUrl?height=5000&width=2000&from=$startTestMilliseconds&to=$endTestMilliseconds&var-prefix=moja_cl&var-instance=All&var-serviceName=All&var-podName=All" > ./results/$resultsSubDir/$K6_SCENARIO_NAME/images/$dashboard_string-moja_cl.png + curl "http://$GRAFANA_USERNAME:$GRAFANA_PASSWORD@$GRAFANA_HOSTNAME:$GRAFANA_PORT/render$dashboardUrl?height=5000&width=2000&from=$startTestMilliseconds&to=$endTestMilliseconds&var-prefix=moja_ml&var-instance=All&var-serviceName=All&var-podName=All" > ./results/$resultsSubDir/$K6_SCENARIO_NAME/images/$dashboard_string-moja_ml.png + curl "http://$GRAFANA_USERNAME:$GRAFANA_PASSWORD@$GRAFANA_HOSTNAME:$GRAFANA_PORT/render$dashboardUrl?height=5000&width=2000&from=$startTestMilliseconds&to=$endTestMilliseconds&var-prefix=cbs&var-instance=All&var-serviceName=All&var-podName=All" > ./results/$resultsSubDir/$K6_SCENARIO_NAME/images/$dashboard_string-cbs.png + elif [[ $dashboard_string == *"MySQLOverview"* ]]; then + curl "http://$GRAFANA_USERNAME:$GRAFANA_PASSWORD@$GRAFANA_HOSTNAME:$GRAFANA_PORT/render$dashboardUrl?height=6500&width=2000&from=$startTestMilliseconds&to=$endTestMilliseconds" > ./results/$resultsSubDir/$K6_SCENARIO_NAME/images/$dashboard_string.png + else + curl "http://$GRAFANA_USERNAME:$GRAFANA_PASSWORD@$GRAFANA_HOSTNAME:$GRAFANA_PORT/render$dashboardUrl?height=5000&width=2000&from=$startTestMilliseconds&to=$endTestMilliseconds" > ./results/$resultsSubDir/$K6_SCENARIO_NAME/images/$dashboard_string.png + fi +done + +# Generate an empty README +echo "# Scenario ${K6_SCENARIO_NAME}: ${K6_SCENARIO_DESCRIPTION} +Params: &from=${startTestMilliseconds}&to=${endTestMilliseconds} +" > ./results/$resultsSubDir/$K6_SCENARIO_NAME/README.md + +echo "Epoch &from=${startTestMilliseconds}&to=${endTestMilliseconds}" diff --git a/automate_perf_sample.env b/automate_perf_sample.env new file mode 100644 index 00000000..f2dec733 --- /dev/null +++ b/automate_perf_sample.env @@ -0,0 +1,6 @@ +export GRAFANA_HOSTNAME=localhost +export GRAFANA_PORT=9999 +export GRAFANA_USERNAME=REPLACE_ME +export GRAFANA_PASSWORD=REPLACE_ME +export K6_SCENARIO_NAME=REPLACE_ME +export K6_SCENARIO_CONFIG=REPLACE_ME // Allowed values are fspiopDiscovery.json/fspiopTransfers.json/fspiopTransfersUnidirectional.json diff --git a/docker-compose-load.yml b/docker-compose-load.yml index 3ba88295..20471ef1 100644 --- a/docker-compose-load.yml +++ b/docker-compose-load.yml @@ -30,7 +30,8 @@ services: - mojaloop-net ports: - "6565:6565" - environment: {} + environment: + - K6_SCRIPT_CONFIG_FILE_NAME=${K6_SCRIPT_CONFIG_FILE_NAME:-test.json} # - K6_PROMETHEUS_RW_SERVER_URL=http://prometheus:9090/api/v1/write # Ref: https://k6.io/docs/results-output/real-time/prometheus-remote-write/#options # - K6_PROMETHEUS_RW_TREND_AS_NATIVE_HISTOGRAM=true # Ref: https://k6.io/docs/results-output/real-time/prometheus-remote-write/#options # - K6_OUT=experimental-prometheus-rw # Ref: https://k6.io/docs/results-output/real-time/prometheus-remote-write/ diff --git a/docker-compose-monitoring.yml b/docker-compose-monitoring.yml index 1bb54aea..5fb6d811 100644 --- a/docker-compose-monitoring.yml +++ b/docker-compose-monitoring.yml @@ -112,6 +112,8 @@ services: env_file: - ./docker/grafana/config.env environment: + GF_SECURITY_DATA_SOURCE_PROXY_WHITELIST: mysql-cl:3306 + GRAFANA_CL_MYSQL_PASSWORD: password GF_RENDERING_SERVER_URL: http://renderer:8081/render GF_RENDERING_CALLBACK_URL: http://grafana:3000/ GF_LOG_FILTERS: rendering:debug @@ -150,6 +152,23 @@ services: command: - --mysqld.address=mysql-als:3306 - --mysqld.username=exporter + profiles: + - als-test + + mysqlexporter-cl: + image: prom/mysqld-exporter:v0.15.0 + # ports: + # - "9104:9104" + networks: + - mojaloop-net + - monitoring-net + environment: + - MYSQLD_EXPORTER_PASSWORD=password + command: + - --mysqld.address=mysql-cl:3306 + - --mysqld.username=exporter + profiles: + - transfers-test kafka-exporter: image: danielqsj/kafka-exporter:latest diff --git a/docker-compose-perf.yml b/docker-compose-perf.yml index bc29291a..6134fd8e 100644 --- a/docker-compose-perf.yml +++ b/docker-compose-perf.yml @@ -19,9 +19,9 @@ services: environment: ## Wait 4 Config script - WAIT4_CONFIG=./wait4.config.perf-als.js - - LOG_LEVEL=info - ## Disable Logging by setting LOG_LEVEL to error # - LOG_LEVEL=error + ## Disable Logging by setting LOG_LEVEL to error + - LOG_LEVEL=error ## Configuration for EVENT SDK ASYNC OVERRIDES - https://github.com/mojaloop/event-sdk#configuration # - EVENT_SDK_ASYNC_OVERRIDE_EVENTS="" # - EVENT_SDK_ASYNC_OVERRIDE_EVENTS=log,audit,trace @@ -56,6 +56,7 @@ services: - account-lookup-service - discovery - all-services + - als-test mysql-als: image: mysql/mysql-server @@ -84,10 +85,537 @@ services: - account-lookup-service - discovery - all-services + - als-test + ## In memory storage - Ref: https://docs.docker.com/storage/tmpfs/ + tmpfs: + - /var/lib/mysql + + ## Services for Transfer tests + central-ledger-migrator: + image: mojaloop/central-ledger:${CENTRAL_LEDGER_VERSION} + env_file: + - .env + - perf.env + scale: 1 + command: sh -c "npm run migrate" + # ports: + # - "3001:3001" + volumes: + - ./docker/wait4:/opt/app/wait4 + - ./docker/config-modifier:/opt/app/config-modifier + environment: + ## Wait 4 Config script + - WAIT4_CONFIG=./wait4.config.perf-cl.js + # - LOG_LEVEL=error + - CLEDG_MONGODB__DISABLED=true + - EVENT_SDK_TRACEID_PER_VENDOR=false + networks: + - mojaloop-net + depends_on: + mysql-cl: + condition: service_healthy + kafka: + condition: service_started + # objstore: + # condition: service_started + user: root + profiles: + - central-ledger + - transfer + - discovery + - agreement + - all-services + - transfers-test + + central-ledger: + image: mojaloop/central-ledger:${CENTRAL_LEDGER_VERSION} + env_file: + - .env + - perf.env + scale: 4 + command: sh -c "/opt/app/config-modifier/run.js /opt/app/config/default.json /opt/app/config-modifier/configs/central-ledger-disabled-handlers.js /opt/app/config/default.json && /opt/app/wait4/wait4.js central-ledger && node src/api/index.js" + # ports: + # - "3001:3001" + volumes: + - ./docker/wait4:/opt/app/wait4 + - ./docker/config-modifier:/opt/app/config-modifier + environment: + ## Wait 4 Config script + - WAIT4_CONFIG=./wait4.config.perf-cl.js + # - LOG_LEVEL=error + - CLEDG_MONGODB__DISABLED=true + - EVENT_SDK_TRACEID_PER_VENDOR=false + # - CLEDG_CACHE__CACHE_ENABLED=false + networks: + - mojaloop-net + depends_on: + mysql-cl: + condition: service_healthy + kafka: + condition: service_started + central-ledger-migrator: + condition: service_completed_successfully + # objstore: + # condition: service_started + healthcheck: + test: wget -q http://localhost:3001/health -O /dev/null || exit 1 + timeout: 20s + retries: 30 + interval: 30s + start_period: 30s + user: root + profiles: + - central-ledger + - transfer + - discovery + - agreement + - all-services + - transfers-test + + central-handler-prepare: + image: mojaloop/central-ledger:${CENTRAL_LEDGER_VERSION} + env_file: + - .env + - perf.env + scale: 4 + command: sh -c "/opt/app/config-modifier/run.js /opt/app/config/default.json /opt/app/config-modifier/configs/central-handlers.js /opt/app/config/default.json && /opt/app/wait4/wait4.js central-ledger && node src/handlers/index.js handler --prepare" + # ports: + # - "3001:3001" + volumes: + - ./docker/wait4:/opt/app/wait4 + - ./docker/config-modifier:/opt/app/config-modifier + environment: + # - LOG_LEVEL=error + - CLEDG_MONGODB__DISABLED=true + - EVENT_SDK_TRACEID_PER_VENDOR=false + networks: + - mojaloop-net + depends_on: + central-ledger: + condition: service_healthy + mysql-cl: + condition: service_healthy + kafka: + condition: service_started + # objstore: + # condition: service_started + healthcheck: + test: wget -q http://localhost:3001/health -O /dev/null || exit 1 + timeout: 20s + retries: 30 + interval: 30s + start_period: 30s + user: root + profiles: + - central-ledger + - transfer + - discovery + - agreement + - all-services + - transfers-test + + central-handler-position: + image: mojaloop/central-ledger:${CENTRAL_LEDGER_VERSION} + env_file: + - .env + - perf.env + scale: 8 + command: sh -c "/opt/app/config-modifier/run.js /opt/app/config/default.json /opt/app/config-modifier/configs/central-handlers.js /opt/app/config/default.json && /opt/app/wait4/wait4.js central-ledger && node src/handlers/index.js handler --position" + # ports: + # - "3001:3001" + volumes: + - ./docker/wait4:/opt/app/wait4 + - ./docker/config-modifier:/opt/app/config-modifier + environment: + # - LOG_LEVEL=error + - CLEDG_MONGODB__DISABLED=true + - EVENT_SDK_TRACEID_PER_VENDOR=false + networks: + - mojaloop-net + depends_on: + central-ledger: + condition: service_healthy + mysql-cl: + condition: service_healthy + kafka: + condition: service_started + # objstore: + # condition: service_started + healthcheck: + test: wget -q http://localhost:3001/health -O /dev/null || exit 1 + timeout: 20s + retries: 30 + interval: 30s + start_period: 30s + user: root + profiles: + - central-ledger + - transfer + - discovery + - agreement + - all-services + - transfers-test + + central-handler-fulfil: + image: mojaloop/central-ledger:${CENTRAL_LEDGER_VERSION} + env_file: + - .env + - perf.env + scale: 4 + command: sh -c "/opt/app/config-modifier/run.js /opt/app/config/default.json /opt/app/config-modifier/configs/central-handlers.js /opt/app/config/default.json && /opt/app/wait4/wait4.js central-ledger && node src/handlers/index.js handler --fulfil" + # ports: + # - "3001:3001" + volumes: + - ./docker/wait4:/opt/app/wait4 + - ./docker/config-modifier:/opt/app/config-modifier + environment: + # - LOG_LEVEL=error + - CLEDG_MONGODB__DISABLED=true + - EVENT_SDK_TRACEID_PER_VENDOR=false + networks: + - mojaloop-net + depends_on: + central-ledger: + condition: service_healthy + mysql-cl: + condition: service_healthy + kafka: + condition: service_started + # objstore: + # condition: service_started + healthcheck: + test: wget -q http://localhost:3001/health -O /dev/null || exit 1 + timeout: 20s + retries: 30 + interval: 30s + start_period: 30s + user: root + profiles: + - central-ledger + - transfer + - discovery + - agreement + - all-services + - transfers-test + + + # central-handler-timeout: + # image: mojaloop/central-ledger:${CENTRAL_LEDGER_VERSION} + # command: sh -c "/opt/app/config-modifier/run.js /opt/app/config/default.json /opt/app/config-modifier/configs/central-handlers.js /opt/app/config/default.json && /opt/app/wait4/wait4.js central-ledger && node src/handlers/index.js handler --timeout" + # # ports: + # # - "3001:3001" + # volumes: + # - ./docker/wait4:/opt/app/wait4 + # - ./docker/config-modifier:/opt/app/config-modifier + # environment: + # - LOG_LEVEL=error + # - CLEDG_MONGODB__DISABLED=true + # - EVENT_SDK_TRACEID_PER_VENDOR=false + # networks: + # - mojaloop-net + # depends_on: + # central-ledger: + # condition: service_healthy + # mysql-cl: + # condition: service_healthy + # kafka: + # condition: service_started + # # objstore: + # # condition: service_started + # healthcheck: + # test: wget -q http://localhost:3001/health -O /dev/null || exit 1 + # timeout: 20s + # retries: 30 + # interval: 30s + # start_period: 30s + # user: root + # profiles: + # - central-ledger + # - transfer + # - discovery + # - agreement + # - all-services + # - transfers-test + + # central-handler-get: + # image: mojaloop/central-ledger:${CENTRAL_LEDGER_VERSION} + # command: sh -c "/opt/app/config-modifier/run.js /opt/app/config/default.json /opt/app/config-modifier/configs/central-handlers.js /opt/app/config/default.json && /opt/app/wait4/wait4.js central-ledger && node src/handlers/index.js handler --get" + # # ports: + # # - "3001:3001" + # volumes: + # - ./docker/wait4:/opt/app/wait4 + # - ./docker/config-modifier:/opt/app/config-modifier + # environment: + # - LOG_LEVEL=error + # - CLEDG_MONGODB__DISABLED=true + # - EVENT_SDK_TRACEID_PER_VENDOR=false + # networks: + # - mojaloop-net + # depends_on: + # central-ledger: + # condition: service_healthy + # mysql-cl: + # condition: service_healthy + # kafka: + # condition: service_started + # # objstore: + # # condition: service_started + # healthcheck: + # test: wget -q http://localhost:3001/health -O /dev/null || exit 1 + # timeout: 20s + # retries: 30 + # interval: 30s + # start_period: 30s + # user: root + # profiles: + # - central-ledger + # - transfer + # - discovery + # - agreement + # - all-services + # - transfers-test + + central-handler-admin: + image: mojaloop/central-ledger:${CENTRAL_LEDGER_VERSION} + env_file: + - .env + - perf.env + scale: 1 # We dont need to scale this unless we are testing funds-in/out + command: sh -c "/opt/app/config-modifier/run.js /opt/app/config/default.json /opt/app/config-modifier/configs/central-handlers.js /opt/app/config/default.json && /opt/app/wait4/wait4.js central-ledger && node src/handlers/index.js handler --admin" + # ports: + # - "3001:3001" + volumes: + - ./docker/wait4:/opt/app/wait4 + - ./docker/config-modifier:/opt/app/config-modifier + environment: + # - LOG_LEVEL=error + - CLEDG_MONGODB__DISABLED=true + - EVENT_SDK_TRACEID_PER_VENDOR=false + networks: + - mojaloop-net + depends_on: + central-ledger: + condition: service_healthy + mysql-cl: + condition: service_healthy + kafka: + condition: service_started + # objstore: + # condition: service_started + healthcheck: + test: wget -q http://localhost:3001/health -O /dev/null || exit 1 + timeout: 20s + retries: 30 + interval: 30s + start_period: 30s + user: root + profiles: + - central-ledger + - transfer + - discovery + - agreement + - all-services + - transfers-test + + # objstore: + # image: mongo:6.0.5 + # container_name: objstore + # ports: + # - "27017:27017" + # networks: + # - mojaloop-net + # healthcheck: + # test: echo 'db.runCommand("ping").ok' | mongosh localhost:27017/test --quiet + # interval: 10s + # timeout: 10s + # retries: 5 + # start_period: 40s + # profiles: + # - central-ledger + # - transfer + # - discovery + # - agreement + # - all-services + # - transfers-test + + kafka-provisioning: + container_name: kafka-provisioning + networks: + - mojaloop-net + image: docker.io/bitnami/kafka:3.4.0 + env_file: + - perf.env + depends_on: + - kafka + entrypoint: [ '/bin/sh', '-c' ] + command: | + " + # blocks until kafka is reachable + kafka-topics.sh --bootstrap-server kafka:29092 --list + echo -e 'Creating kafka topics' + kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-transfer-prepare --replication-factor 1 --partitions $$KAFKA_PARTITIONS_NUM + kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-transfer-position --replication-factor 1 --partitions $$KAFKA_PARTITIONS_NUM + kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-transfer-fulfil --replication-factor 1 --partitions $$KAFKA_PARTITIONS_NUM + kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-notification-event --replication-factor 1 --partitions $$KAFKA_PARTITIONS_NUM + kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-transfer-get --replication-factor 1 --partitions $$KAFKA_PARTITIONS_NUM + kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-admin-transfer --replication-factor 1 --partitions $$KAFKA_PARTITIONS_NUM + # kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-bulk-prepare --replication-factor 1 --partitions $$KAFKA_PARTITIONS_NUM + # kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-bulk-fulfil --replication-factor 1 --partitions $$KAFKA_PARTITIONS_NUM + # kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-bulk-processing --replication-factor 1 --partitions $$KAFKA_PARTITIONS_NUM + # kafka-topics.sh --bootstrap-server kafka:29092 --create --if-not-exists --topic topic-bulk-get --replication-factor 1 --partitions $$KAFKA_PARTITIONS_NUM + echo -e 'Successfully created the following topics:' + kafka-topics.sh --bootstrap-server kafka:29092 --list + " + profiles: + - central-ledger + - transfer + - discovery + - agreement + - all-services + - transfers-test + + kafka: + networks: + - mojaloop-net + image: docker.io/bitnami/kafka:3.4.0 + container_name: kafka + # ports: + # - "9092:9092" + environment: + # BITNAMI_DEBUG: "yes" + ALLOW_PLAINTEXT_LISTENER: "yes" + KAFKA_ADVERTISED_HOST_NAME: kafka + KAFKA_CFG_LISTENERS: CONTROLLER://:9093,LISTENER_DOCKER://kafka:29092,LISTENER_EXTERN://:9092 + KAFKA_CFG_ADVERTISED_LISTENERS: LISTENER_DOCKER://kafka:29092,LISTENER_EXTERN://:9092 + KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: CONTROLLER:PLAINTEXT,LISTENER_DOCKER:PLAINTEXT,LISTENER_EXTERN:PLAINTEXT + KAFKA_CFG_INTER_BROKER_LISTENER_NAME: LISTENER_DOCKER + KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 + KAFKA_CFG_MESSAGE_MAX_BYTES: 200000000 + KAFKA_CFG_NODE_ID: 1 + KAFKA_CFG_PROCESS_ROLES: broker,controller + KAFKA_CFG_CONTROLLER_LISTENER_NAMES: CONTROLLER + KAFKA_CFG_CONTROLLER_QUORUM_VOTERS: 1@127.0.0.1:9093 + KAFKA_ENABLE_KRAFT: "true" + healthcheck: + test: ["CMD" ,"/opt/bitnami/kafka/bin/kafka-broker-api-versions.sh","--bootstrap-server","kafka:9092"] + timeout: 20s + retries: 10 + start_period: 40s + interval: 30s + profiles: + - central-ledger + - transfer + - discovery + - agreement + - all-services + - transfers-test + + mysql-cl: + image: mysql/mysql-server + container_name: mysql-cl + # ports: + # - "3306:3306" + # command: "--log-output=TABLE --slow-query-log=1 --long-query-time=0.01" + command: "--disable-log-bin" + volumes: + # Note: this fixes the permissions issue, but docker-compose up will fail on first attempt + - ./docker/sql-cl-init/:/docker-entrypoint-initdb.d/ + environment: + - MYSQL_USER=${DBUSER:-central_ledger} + - MYSQL_PASSWORD=${DBPASS:-password} + - MYSQL_DATABASE=${DBUSER:-central_ledger} + - MYSQL_ALLOW_EMPTY_PASSWORD=true + networks: + - mojaloop-net + healthcheck: + test: ["CMD", "mysqladmin" ,"ping", "-h", "mysql-cl"] + timeout: 20s + retries: 10 + start_period: 40s + interval: 30s + profiles: + - central-ledger + - transfer + - discovery + - agreement + - all-services + - transfers-test ## In memory storage - Ref: https://docs.docker.com/storage/tmpfs/ tmpfs: - /var/lib/mysql + ml-api-adapter: + image: mojaloop/ml-api-adapter:${ML_API_ADAPTER_VERSION} + env_file: + - .env + - perf.env + scale: 4 + # container_name: ml-api-adapter + command: sh -c "/opt/app/config-modifier/run.js /opt/app/config/default.json /opt/app/config-modifier/configs/ml-api-adapter-disabled-handlers.js /opt/app/config/default.json && /opt/app/wait4/wait4.js ml-api-adapter && node src/api/index.js" + # ports: + # - "3000:3000" + volumes: + - ./docker/wait4:/opt/app/wait4 + - ./docker/config-modifier:/opt/app/config-modifier + environment: + # - LOG_LEVEL=error + - EVENT_SDK_TRACEID_PER_VENDOR=false + # - MLAPI_TRANSFERS__SEND_TRANSFER_CONFIRMATION_TO_PAYEE=false + networks: + - mojaloop-net + depends_on: + kafka: + condition: service_healthy + central-ledger: + condition: service_healthy + healthcheck: + test: wget -q http://localhost:3000/health -O /dev/null || exit 1 + timeout: 30s + retries: 30 + interval: 30s + start_period: 30s + user: root + profiles: + - ml-api-adapter + - transfer + - all-services + - transfers-test + + ml-handler-notification: + image: mojaloop/ml-api-adapter:${ML_API_ADAPTER_VERSION} + env_file: + - .env + - perf.env + scale: 4 + command: sh -c "/opt/app/config-modifier/run.js /opt/app/config/default.json /opt/app/config-modifier/configs/ml-handler-notification.js /opt/app/config/default.json && /opt/app/wait4/wait4.js ml-api-adapter && node src/handlers/index.js handler --notification" + # ports: + # - "3000:3000" + # - "9229:9229" + volumes: + - ./docker/wait4:/opt/app/wait4 + - ./docker/config-modifier:/opt/app/config-modifier + environment: {} + # - LOG_LEVEL=error + networks: + - mojaloop-net + depends_on: + kafka: + condition: service_started + central-ledger: + condition: service_started + healthcheck: + test: wget -q http://localhost:3000/health -O /dev/null || exit 1 + timeout: 30s + retries: 30 + interval: 30s + start_period: 30s + user: root + profiles: + - ml-api-adapter + - transfer + - all-services + - transfers-test + ## Testing Toolkit mojaloop-testing-toolkit: image: mojaloop/ml-testing-toolkit:v16.1.1 @@ -116,6 +644,8 @@ services: profiles: - testing-toolkit - all-services + - als-test + - transfers-test mojaloop-testing-toolkit-ui: image: mojaloop/ml-testing-toolkit-ui:v15.3.0 @@ -135,8 +665,10 @@ services: profiles: - testing-toolkit - all-services + - als-test + - transfers-test - ttk-provisioning: + ttk-provisioning-als: image: mojaloop/ml-testing-toolkit-client-lib:v1.2.0 env_file: - .env @@ -158,41 +690,47 @@ services: - "npm run cli -- -u http://mojaloop-testing-toolkit:5050 -l 2 -i collections/provisioning-perf-als -e environments/default-env.json --save-report --report-format html --report-target file://reports/ttk-provisioning-report.html" user: root profiles: - - ttk-provisioning - - ## Generic Callback Handler Service - # callback-handler-svc: - # # scale: 1 - # scale: 4 - # image: mojaloop/callback-handler-svc:local - # env_file: - # - .env - # - perf.env - # build: - # context: ./packages/callback-handler-svc - # cache_from: - # - mojaloop/callback-handler-svc:local - # # ports: - # # - "3001:3001" - # networks: - # - mojaloop-net - # volumes: - # - ./packages/callback-handler-svc/config:/opt/app/config - # - ./packages/callback-handler-svc/handlers:/opt/app/handlers - # environment: - # - LOG_LEVEL=info - # healthcheck: - # test: wget -q http://localhost:3001/health -O /dev/null || exit 1 - # timeout: 20s - # retries: 30 - # interval: 15s - # user: root - # profiles: - # - simulators - # - callback-handler - # - all-services + - ttk-provisioning-als - callback-handler-svc-payee-sim: + ttk-provisioning-transfers: + image: mojaloop/ml-testing-toolkit-client-lib:v1.2.0 + env_file: + - .env + - perf.env + volumes: + - "./docker/ml-testing-toolkit/test-cases/collections:/opt/app/collections" + - "./docker/ml-testing-toolkit/test-cases/environments:/opt/app/environments" + - "./reports:/opt/app/reports" + depends_on: + mojaloop-testing-toolkit: + condition: service_healthy + ml-api-adapter: + condition: service_healthy + central-ledger: + condition: service_healthy + central-handler-prepare: + condition: service_healthy + central-handler-fulfil: + condition: service_healthy + central-handler-position: + condition: service_healthy + # central-handler-timeout: + # condition: service_healthy + # central-handler-get: + # condition: service_healthy + central-handler-admin: + condition: service_healthy + networks: + - mojaloop-net + command: + - sh + - -c + - "npm run cli -- -u http://mojaloop-testing-toolkit:5050 -l 2 -i collections/provisioning -e environments/default-env.json --save-report --report-format html --report-target file://reports/ttk-provisioning-report.html" + user: root + profiles: + - ttk-provisioning-transfers + + callback-handler-svc-oracle-sim: scale: 1 image: mojaloop/callback-handler-svc:local env_file: @@ -209,8 +747,8 @@ services: volumes: - ./packages/callback-handler-svc/config:/opt/app/config - ./packages/callback-handler-svc/handlers:/opt/app/handlers - environment: - - LOG_LEVEL=info + environment: {} + # - LOG_LEVEL=error healthcheck: test: wget -q http://localhost:3001/health -O /dev/null || exit 1 timeout: 20s @@ -221,13 +759,14 @@ services: - simulators - callback-handler - all-services + - als-test - callback-handler-svc-oracle-sim: + callback-handler-svc-cl-sim: scale: 1 image: mojaloop/callback-handler-svc:local env_file: - .env - - perf.env + - ./envs/cl-sim.env build: context: ./packages/callback-handler-svc cache_from: @@ -239,8 +778,8 @@ services: volumes: - ./packages/callback-handler-svc/config:/opt/app/config - ./packages/callback-handler-svc/handlers:/opt/app/handlers - environment: - - LOG_LEVEL=info + environment: {} + # - LOG_LEVEL=error healthcheck: test: wget -q http://localhost:3001/health -O /dev/null || exit 1 timeout: 20s @@ -251,13 +790,15 @@ services: - simulators - callback-handler - all-services + - als-test + - transfers-test - callback-handler-svc-cl-sim: + sim-perffsp1: scale: 1 image: mojaloop/callback-handler-svc:local env_file: - .env - - perf.env + - ./envs/perffsp1.env build: context: ./packages/callback-handler-svc cache_from: @@ -269,8 +810,8 @@ services: volumes: - ./packages/callback-handler-svc/config:/opt/app/config - ./packages/callback-handler-svc/handlers:/opt/app/handlers - environment: - - LOG_LEVEL=info + environment: {} + # - LOG_LEVEL=error healthcheck: test: wget -q http://localhost:3001/health -O /dev/null || exit 1 timeout: 20s @@ -281,13 +822,17 @@ services: - simulators - callback-handler - all-services + - als-test + - 2dfsp + - 4dfsp + - 8dfsp - callback-handler-svc-payer-sim: + sim-perffsp2: scale: 1 image: mojaloop/callback-handler-svc:local env_file: - .env - - perf.env + - ./envs/perffsp2.env build: context: ./packages/callback-handler-svc cache_from: @@ -299,8 +844,8 @@ services: volumes: - ./packages/callback-handler-svc/config:/opt/app/config - ./packages/callback-handler-svc/handlers:/opt/app/handlers - environment: - - LOG_LEVEL=info + environment: {} + # - LOG_LEVEL=error healthcheck: test: wget -q http://localhost:3001/health -O /dev/null || exit 1 timeout: 20s @@ -311,3 +856,197 @@ services: - simulators - callback-handler - all-services + - als-test + - 2dfsp + - 4dfsp + - 8dfsp + + sim-perffsp3: + scale: 1 + image: mojaloop/callback-handler-svc:local + env_file: + - .env + - ./envs/perffsp3.env + build: + context: ./packages/callback-handler-svc + cache_from: + - mojaloop/callback-handler-svc:local + # ports: + # - "3001:3001" + networks: + - mojaloop-net + volumes: + - ./packages/callback-handler-svc/config:/opt/app/config + - ./packages/callback-handler-svc/handlers:/opt/app/handlers + environment: {} + # - LOG_LEVEL=error + healthcheck: + test: wget -q http://localhost:3001/health -O /dev/null || exit 1 + timeout: 20s + retries: 30 + interval: 15s + user: root + profiles: + - 4dfsp + - 8dfsp + + sim-perffsp4: + scale: 1 + image: mojaloop/callback-handler-svc:local + env_file: + - .env + - ./envs/perffsp4.env + build: + context: ./packages/callback-handler-svc + cache_from: + - mojaloop/callback-handler-svc:local + # ports: + # - "3001:3001" + networks: + - mojaloop-net + volumes: + - ./packages/callback-handler-svc/config:/opt/app/config + - ./packages/callback-handler-svc/handlers:/opt/app/handlers + environment: {} + # - LOG_LEVEL=error + healthcheck: + test: wget -q http://localhost:3001/health -O /dev/null || exit 1 + timeout: 20s + retries: 30 + interval: 15s + user: root + profiles: + - 4dfsp + - 8dfsp + + sim-perffsp5: + scale: 1 + image: mojaloop/callback-handler-svc:local + env_file: + - .env + - ./envs/perffsp5.env + build: + context: ./packages/callback-handler-svc + cache_from: + - mojaloop/callback-handler-svc:local + # ports: + # - "3001:3001" + networks: + - mojaloop-net + volumes: + - ./packages/callback-handler-svc/config:/opt/app/config + - ./packages/callback-handler-svc/handlers:/opt/app/handlers + environment: {} + # - LOG_LEVEL=error + healthcheck: + test: wget -q http://localhost:3001/health -O /dev/null || exit 1 + timeout: 20s + retries: 30 + interval: 15s + user: root + profiles: + - 8dfsp + + sim-perffsp6: + scale: 1 + image: mojaloop/callback-handler-svc:local + env_file: + - .env + - ./envs/perffsp6.env + build: + context: ./packages/callback-handler-svc + cache_from: + - mojaloop/callback-handler-svc:local + # ports: + # - "3001:3001" + networks: + - mojaloop-net + volumes: + - ./packages/callback-handler-svc/config:/opt/app/config + - ./packages/callback-handler-svc/handlers:/opt/app/handlers + environment: {} + # - LOG_LEVEL=error + healthcheck: + test: wget -q http://localhost:3001/health -O /dev/null || exit 1 + timeout: 20s + retries: 30 + interval: 15s + user: root + profiles: + - 8dfsp + + sim-perffsp7: + scale: 1 + image: mojaloop/callback-handler-svc:local + env_file: + - .env + - ./envs/perffsp7.env + build: + context: ./packages/callback-handler-svc + cache_from: + - mojaloop/callback-handler-svc:local + # ports: + # - "3001:3001" + networks: + - mojaloop-net + volumes: + - ./packages/callback-handler-svc/config:/opt/app/config + - ./packages/callback-handler-svc/handlers:/opt/app/handlers + environment: {} + # - LOG_LEVEL=error + healthcheck: + test: wget -q http://localhost:3001/health -O /dev/null || exit 1 + timeout: 20s + retries: 30 + interval: 15s + user: root + profiles: + - 8dfsp + + sim-perffsp8: + scale: 1 + image: mojaloop/callback-handler-svc:local + env_file: + - .env + - ./envs/perffsp8.env + build: + context: ./packages/callback-handler-svc + cache_from: + - mojaloop/callback-handler-svc:local + # ports: + # - "3001:3001" + networks: + - mojaloop-net + volumes: + - ./packages/callback-handler-svc/config:/opt/app/config + - ./packages/callback-handler-svc/handlers:/opt/app/handlers + environment: {} + # - LOG_LEVEL=error + healthcheck: + test: wget -q http://localhost:3001/health -O /dev/null || exit 1 + timeout: 20s + retries: 30 + interval: 15s + user: root + profiles: + - 8dfsp + + + ## Debug utilities + kafka-debug-console: + # image: quay.io/cloudhut/kowl:v1.4.0 + image: docker.redpanda.com/redpandadata/console:latest + deploy: + replicas: 1 + restart: on-failure + hostname: kafka-debug-console + ports: + - "9080:8080" + networks: + - mojaloop-net + environment: + - KAFKA_BROKERS=kafka:29092 + depends_on: + - kafka + profiles: + - debug \ No newline at end of file diff --git a/docker/config-modifier/configs/central-handlers.js b/docker/config-modifier/configs/central-handlers.js new file mode 100644 index 00000000..ca464ac7 --- /dev/null +++ b/docker/config-modifier/configs/central-handlers.js @@ -0,0 +1,143 @@ +module.exports = { + "HOSTNAME": "http://central-ledger", + "DATABASE": { + "HOST": "mysql-cl" + }, + "MIGRATIONS": { + "DISABLED": true, + "RUN_DATA_MIGRATIONS": true + }, + "MONGODB": { + "DISABLED": true, + "HOST": "objstore", + "PORT": 27017, + "USER": "", + "PASSWORD": "", + "DATABASE": "mlos" + }, + "KAFKA": { + "CONSUMER": { + "BULK": { + "PREPARE": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + }, + "PROCESSING": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + }, + "FULFIL": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + }, + "GET": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + } + }, + "TRANSFER": { + "PREPARE": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + }, + "GET": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + }, + "FULFIL": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + }, + "POSITION": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + } + }, + "ADMIN": { + "TRANSFER": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + } + } + }, + "PRODUCER": { + "BULK": { + "PROCESSING": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + } + }, + "TRANSFER": { + "PREPARE": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + }, + "FULFIL": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + }, + "POSITION": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + } + }, + "NOTIFICATION": { + "EVENT": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + } + }, + "ADMIN": { + "TRANSFER": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + } + } + } + } +} diff --git a/docker/config-modifier/configs/central-ledger-disabled-handlers.js b/docker/config-modifier/configs/central-ledger-disabled-handlers.js new file mode 100644 index 00000000..cd39bf75 --- /dev/null +++ b/docker/config-modifier/configs/central-ledger-disabled-handlers.js @@ -0,0 +1,154 @@ +module.exports = { + "HOSTNAME": "http://central-ledger", + "DATABASE": { + "HOST": "mysql-cl" + }, + "MIGRATIONS": { + "DISABLED": true, + "RUN_DATA_MIGRATIONS": true + }, + "MONGODB": { + "DISABLED": true, + "HOST": "objstore", + "PORT": 27017, + "USER": "", + "PASSWORD": "", + "DATABASE": "mlos" + }, + "HANDLERS": { + "DISABLED": true, + "API": { + "DISABLED": false + }, + "TIMEOUT": { + "DISABLED": true, + "TIMEXP": "*/15 * * * * *", + "TIMEZONE": "UTC" + } + }, + "KAFKA": { + "CONSUMER": { + "BULK": { + "PREPARE": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + }, + "PROCESSING": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + }, + "FULFIL": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + }, + "GET": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + } + }, + "TRANSFER": { + "PREPARE": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + }, + "GET": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + }, + "FULFIL": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + }, + "POSITION": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + } + }, + "ADMIN": { + "TRANSFER": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + } + } + }, + "PRODUCER": { + "BULK": { + "PROCESSING": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + } + }, + "TRANSFER": { + "PREPARE": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + }, + "FULFIL": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + }, + "POSITION": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + } + }, + "NOTIFICATION": { + "EVENT": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + } + }, + "ADMIN": { + "TRANSFER": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + } + } + } + } +} diff --git a/docker/config-modifier/configs/ml-api-adapter-disabled-handlers.js b/docker/config-modifier/configs/ml-api-adapter-disabled-handlers.js new file mode 100644 index 00000000..9d1d08bb --- /dev/null +++ b/docker/config-modifier/configs/ml-api-adapter-disabled-handlers.js @@ -0,0 +1,49 @@ +module.exports = { + "HOSTNAME": "http://ml-api-adapter", + "ENDPOINT_SOURCE_URL": "http://central-ledger:3001", + "ENDPOINT_HEALTH_URL": "http://central-ledger:3001/health", + "HANDLERS": { + "DISABLED": true, + "API": { + "DISABLED": false + } + }, + "KAFKA": { + "CONSUMER": { + "NOTIFICATION": { + "EVENT": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + } + } + }, + "PRODUCER": { + "TRANSFER": { + "PREPARE": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + }, + "FULFIL": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + }, + "GET": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + } + } + } + } +} diff --git a/docker/config-modifier/configs/ml-handler-notification.js b/docker/config-modifier/configs/ml-handler-notification.js new file mode 100644 index 00000000..76afbd1c --- /dev/null +++ b/docker/config-modifier/configs/ml-handler-notification.js @@ -0,0 +1,46 @@ +module.exports = { + "HOSTNAME": "http://ml-handler-notification", + "ENDPOINT_SOURCE_URL": "http://central-ledger:3001", + "ENDPOINT_HEALTH_URL": "http://central-ledger:3001/health", + "TRANSFERS": { + "SEND_TRANSFER_CONFIRMATION_TO_PAYEE": false + }, + "KAFKA": { + "CONSUMER": { + "NOTIFICATION": { + "EVENT": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + } + } + }, + "PRODUCER": { + "TRANSFER": { + "PREPARE": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + }, + "FULFIL": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + }, + "GET": { + "config": { + "rdkafkaConf": { + "metadata.broker.list": "kafka:29092" + } + } + } + } + } + } +} diff --git a/docker/grafana/provisioning/dashboards/Supporting Services - Callback Hander Service-1689261777383.json b/docker/grafana/provisioning/dashboards/Supporting Services - Callback Hander Service-1689261777383.json index dd515b5b..d404aaaf 100644 --- a/docker/grafana/provisioning/dashboards/Supporting Services - Callback Hander Service-1689261777383.json +++ b/docker/grafana/provisioning/dashboards/Supporting Services - Callback Hander Service-1689261777383.json @@ -29,7 +29,7 @@ "title": "Image render", "tooltip": "Image Render", "type": "link", - "url": "/render/d/${__dashboard.uid}/${__dashboard}?height=2000&width=2000" + "url": "/render/d/${__dashboard.uid}/${__dashboard}?height=3000&width=2000" } ], "liveNow": false, @@ -94,7 +94,7 @@ }, "gridPos": { "h": 12, - "w": 12, + "w": 24, "x": 0, "y": 0 }, @@ -108,8 +108,10 @@ "lastNotNull" ], "displayMode": "table", - "placement": "bottom", - "showLegend": true + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true }, "tooltip": { "mode": "single", @@ -123,9 +125,9 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum(rate(cbs_ing_callbackHandler_sum[$__rate_interval]) / rate(cbs_ing_callbackHandler_count[$__rate_interval]) >=0) by (operation, success)", + "expr": "sum(rate(cbs_ing_callbackHandler_sum[$__rate_interval]) / rate(cbs_ing_callbackHandler_count[$__rate_interval]) >=0) by (operation, success, instance)", "instant": false, - "legendFormat": "op: {{operation}} success: {{success}}", + "legendFormat": "{{instance}} op: {{operation}} success: {{success}}", "range": true, "refId": "A" } @@ -192,10 +194,10 @@ "overrides": [] }, "gridPos": { - "h": 12, - "w": 12, - "x": 12, - "y": 0 + "h": 13, + "w": 24, + "x": 0, + "y": 12 }, "id": 123135, "options": { @@ -207,8 +209,10 @@ "lastNotNull" ], "displayMode": "table", - "placement": "bottom", - "showLegend": true + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true }, "tooltip": { "mode": "single", @@ -222,9 +226,9 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum(rate(cbs_ing_callbackHandler_count[$__rate_interval])) by (operation, success)", + "expr": "sum(rate(cbs_ing_callbackHandler_count[$__rate_interval])) by (operation, success, instance)", "instant": false, - "legendFormat": "op:{{operation}} success: {{success}}", + "legendFormat": "{{instance}} op:{{operation}} success: {{success}}", "range": true, "refId": "A" } @@ -291,10 +295,10 @@ "overrides": [] }, "gridPos": { - "h": 10, - "w": 12, + "h": 12, + "w": 24, "x": 0, - "y": 12 + "y": 25 }, "id": 123134, "options": { @@ -306,8 +310,10 @@ "lastNotNull" ], "displayMode": "table", - "placement": "bottom", - "showLegend": true + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true }, "tooltip": { "mode": "single", @@ -321,9 +327,9 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum(rate(cbs_egress_callbackHandler_sum[$__rate_interval]) / rate(cbs_egress_callbackHandler_count[$__rate_interval]) >=0) by (operation, success)", + "expr": "sum(rate(cbs_egress_callbackHandler_sum[$__rate_interval]) / rate(cbs_egress_callbackHandler_count[$__rate_interval]) >=0) by (operation, success, instance)", "instant": false, - "legendFormat": "op: {{operation}} success: {{success}}", + "legendFormat": "{{instance}} op: {{operation}} success: {{success}}", "range": true, "refId": "A" } @@ -391,9 +397,9 @@ }, "gridPos": { "h": 10, - "w": 12, - "x": 12, - "y": 12 + "w": 24, + "x": 0, + "y": 37 }, "id": 123131, "options": { @@ -405,8 +411,10 @@ "lastNotNull" ], "displayMode": "table", - "placement": "bottom", - "showLegend": true + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true }, "tooltip": { "mode": "single", @@ -420,9 +428,9 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum(rate(cbs_egress_callbackHandler_count[$__rate_interval])) by (operation, success)", + "expr": "sum(rate(cbs_egress_callbackHandler_count[$__rate_interval])) by (operation, success, instance)", "instant": false, - "legendFormat": "op:{{operation}} success: {{success}}", + "legendFormat": "{{instance}} op:{{operation}} success: {{success}}", "range": true, "refId": "A" } @@ -532,10 +540,10 @@ ] }, "gridPos": { - "h": 9, + "h": 11, "w": 24, "x": 0, - "y": 22 + "y": 47 }, "hideTimeOverride": false, "id": 123127, @@ -550,7 +558,9 @@ ], "displayMode": "table", "placement": "right", - "showLegend": true + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true }, "tooltip": { "mode": "multi", @@ -565,9 +575,9 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "sum(rate(cbs_tx_cb_perf_count[$__rate_interval])) by (operation, success)", + "expr": "sum(rate(cbs_tx_cb_perf_count[$__rate_interval])) by (operation, success, instance)", "hide": false, - "legendFormat": "op:{{operation}} - success:{{success}}", + "legendFormat": "{{instance}} op:{{operation}} - success:{{success}}", "range": true, "refId": "A" } @@ -635,10 +645,10 @@ "overrides": [] }, "gridPos": { - "h": 9, + "h": 11, "w": 24, "x": 0, - "y": 31 + "y": 58 }, "id": 123130, "links": [], @@ -652,7 +662,9 @@ ], "displayMode": "table", "placement": "right", - "showLegend": true + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true }, "tooltip": { "mode": "multi", @@ -668,12 +680,12 @@ }, "editorMode": "code", "exemplar": false, - "expr": "sum(rate(cbs_tx_cb_perf_sum[$__rate_interval]) / rate(cbs_tx_cb_perf_count[$__rate_interval]) >= 0) by (operation, success)", + "expr": "sum(rate(cbs_tx_cb_perf_sum[$__rate_interval]) / rate(cbs_tx_cb_perf_count[$__rate_interval]) >= 0) by (operation, success, instance)", "format": "time_series", "hide": false, "interval": "", "intervalFactor": 1, - "legendFormat": "op:{{operation}} - Success {{success}}", + "legendFormat": "{{instance}} op:{{operation}} - Success {{success}}", "range": true, "refId": "A" } @@ -682,7 +694,7 @@ "type": "timeseries" } ], - "refresh": false, + "refresh": "5s", "schemaVersion": 38, "style": "dark", "tags": [], @@ -690,8 +702,8 @@ "list": [] }, "time": { - "from": "2023-07-26T10:28:17.867Z", - "to": "2023-07-26T10:50:35.328Z" + "from": "now-1h", + "to": "now" }, "timepicker": { "hidden": false, @@ -723,6 +735,6 @@ "timezone": "browser", "title": "Supporting Services - Callback Hander Service", "uid": "afe9dda2-878b-40c8-90df-072e7ecaaaee", - "version": 1, + "version": 2, "weekStart": "" -} \ No newline at end of file +} diff --git a/docker/grafana/provisioning/dashboards/dashboard-central-ledger-db.json b/docker/grafana/provisioning/dashboards/dashboard-central-ledger-db.json new file mode 100644 index 00000000..c87603ca --- /dev/null +++ b/docker/grafana/provisioning/dashboards/dashboard-central-ledger-db.json @@ -0,0 +1,422 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "grafana", + "uid": "-- Grafana --" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "editable": true, + "fiscalYearStartMonth": 0, + "graphTooltip": 0, + "id": 5, + "links": [ + { + "asDropdown": false, + "icon": "external link", + "includeVars": false, + "keepTime": true, + "tags": [], + "targetBlank": true, + "title": "Image render", + "tooltip": "Image Render", + "type": "link", + "url": "/render/d/${__dashboard.uid}/${__dashboard}?height=1000&width=2000" + } + ], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 0 + }, + "id": 1, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "dataset": "central_ledger", + "datasource": { + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT COUNT(t1.transferId) \nFROM central_ledger.transferStateChange t1 \nWHERE transferStateId = 'COMMITTED' \nAND createdDate between $__timeFrom() \nAND $__timeTo() AND t1.createdDate = (\n SELECT MAX(t2.createdDate)\n FROM central_ledger.transferStateChange t2\n WHERE t2.transferId = t1.transferId\n)\n ", + "refId": "A", + "sql": { + "columns": [ + { + "name": "COUNT", + "parameters": [ + { + "name": "transferStateId", + "type": "functionParameter" + } + ], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "name": "transferStateId", + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + }, + "table": "transferStateChange" + } + ], + "title": "COMMITED State Changes In DB between time range", + "type": "stat" + }, + { + "datasource": { + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 0 + }, + "id": 2, + "options": { + "colorMode": "value", + "graphMode": "area", + "justifyMode": "auto", + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "textMode": "auto" + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "datasource": { + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT COUNT(transferId) FROM central_ledger.transferStateChange WHERE transferStateId != 'COMMITTED' AND createdDate between $__timeFrom() AND $__timeTo()", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Transfer state changes excluding COMMITTED between time range", + "type": "stat" + }, + { + "datasource": { + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 0, + "y": 8 + }, + "id": 3, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "frameIndex": 1, + "showHeader": true + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "datasource": { + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" + }, + "editorMode": "code", + "format": "table", + "hide": false, + "rawQuery": true, + "rawSql": "ANALYZE TABLE transfer;", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + }, + { + "dataset": "performance_schema", + "datasource": { + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT table_schema \"DB Name\",\n ROUND(SUM(data_length + index_length) / 1024 / 1024, 1) \"DB Size in MB\" \nFROM information_schema.tables \nGROUP BY table_schema; ", + "refId": "B", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Panel Title", + "type": "table" + }, + { + "datasource": { + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "custom": { + "align": "auto", + "cellOptions": { + "type": "auto" + }, + "inspect": false + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 8, + "w": 12, + "x": 12, + "y": 8 + }, + "id": 4, + "options": { + "cellHeight": "sm", + "footer": { + "countRows": false, + "fields": "", + "reducer": [ + "sum" + ], + "show": false + }, + "showHeader": true + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "datasource": { + "type": "mysql", + "uid": "e6f1763f-dc6a-4521-8254-0dbe1515b837" + }, + "editorMode": "code", + "format": "table", + "rawQuery": true, + "rawSql": "SELECT COUNT(central_ledger.transfer.transferId), central_ledger.transferStateChange.transferStateId\nFROM central_ledger.transfer \nLEFT JOIN central_ledger.transferStateChange ON central_ledger.transfer.transferId=central_ledger.transferStateChange.transferId \nWHERE central_ledger.transferStateChange.transferStateChangeId IN (\n SELECT MAX(central_ledger.transferStateChange.transferStateChangeId)\n FROM central_ledger.transfer \n LEFT JOIN central_ledger.transferStateChange ON central_ledger.transfer.transferId=central_ledger.transferStateChange.transferId \n WHERE central_ledger.transferStateChange.createdDate between $__timeFrom() AND $__timeTo() \n GROUP BY central_ledger.transfer.transferId\n) \nGROUP BY central_ledger.transferStateChange.transferStateId", + "refId": "A", + "sql": { + "columns": [ + { + "parameters": [], + "type": "function" + } + ], + "groupBy": [ + { + "property": { + "type": "string" + }, + "type": "groupBy" + } + ], + "limit": 50 + } + } + ], + "title": "Last Transfer State Count", + "type": "table" + } + ], + "refresh": false, + "schemaVersion": 38, + "style": "dark", + "tags": [], + "templating": { + "list": [] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": {}, + "timezone": "", + "title": "Central Ledger DB", + "uid": "d17cf1dd-8fbc-4841-a957-214387249f19", + "version": 1, + "weekStart": "" +} diff --git a/docker/grafana/provisioning/dashboards/dashboard-central-services-characterization.json b/docker/grafana/provisioning/dashboards/dashboard-central-services-characterization.json index 09376081..31ae2585 100644 --- a/docker/grafana/provisioning/dashboards/dashboard-central-services-characterization.json +++ b/docker/grafana/provisioning/dashboards/dashboard-central-services-characterization.json @@ -2642,10 +2642,12 @@ "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "expr": "avg(moja_cl_nodejs_eventloop_lag_seconds{serviceName=~\"central.*\"}) by (serviceName)", + "editorMode": "code", + "expr": "avg(moja_cl_nodejs_eventloop_lag_seconds{serviceName=~\"central.*\"}) by (instance, serviceName)", "format": "time_series", "intervalFactor": 1, - "legendFormat": "{{serviceName}}", + "legendFormat": "{{instance}} {{serviceName}}", + "range": true, "refId": "B" } ], diff --git a/docker/grafana/provisioning/dashboards/dashboard-central-services.json b/docker/grafana/provisioning/dashboards/dashboard-central-services.json index 426057eb..a234f01a 100644 --- a/docker/grafana/provisioning/dashboards/dashboard-central-services.json +++ b/docker/grafana/provisioning/dashboards/dashboard-central-services.json @@ -806,11 +806,11 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "avg(rate(moja_cl_transfer_prepare_sum{serviceName=~\"central-handler-prepare|central-service\"}[$__rate_interval]) / rate(moja_cl_transfer_prepare_count{serviceName=~\"central-handler-prepare|central-service\"}[$__rate_interval]) >=0) by (kubernetes_pod_name, success)", + "expr": "avg(rate(moja_cl_transfer_prepare_sum{serviceName=~\"central-handler-prepare|central-service\"}[$__rate_interval]) / rate(moja_cl_transfer_prepare_count{serviceName=~\"central-handler-prepare|central-service\"}[$__rate_interval]) >=0) by (kubernetes_pod_name, success, instance)", "format": "time_series", "hide": false, "intervalFactor": 1, - "legendFormat": "Transfer Prepare - {{kubernetes_pod_name}} success:{{success}}", + "legendFormat": "Transfer Prepare - {{kubernetes_pod_name}} {{instance}} success:{{success}}", "range": true, "refId": "A" }, @@ -820,11 +820,11 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "avg(rate(moja_cl_transfer_position_sum{serviceName=~\"central-handler-position|central-service\"}[$__rate_interval]) / rate(moja_cl_transfer_position_count{serviceName=~\"central-handler-position|central-service\"}[$__rate_interval]) >=0) by (kubernetes_pod_name, success)", + "expr": "avg(rate(moja_cl_transfer_position_sum{serviceName=~\"central-handler-position|central-service\"}[$__rate_interval]) / rate(moja_cl_transfer_position_count{serviceName=~\"central-handler-position|central-service\"}[$__rate_interval]) >=0) by (kubernetes_pod_name, success, instance)", "format": "time_series", "hide": false, "intervalFactor": 1, - "legendFormat": "Transfer Position - {{kubernetes_pod_name}} success:{{success}}", + "legendFormat": "Transfer Position - {{kubernetes_pod_name}} {{instance}} success:{{success}}", "range": true, "refId": "E" }, @@ -834,9 +834,9 @@ "uid": "PBFA97CFB590B2093" }, "editorMode": "code", - "expr": "avg(rate(moja_cl_transfer_fulfil_sum{serviceName=~\"central-handler-fulfil|central-service\"}[$__rate_interval]) / rate(moja_cl_transfer_fulfil_count{serviceName=~\"central-handler-fulfil|central-service\"}[$__rate_interval]) >=0) by (kubernetes_pod_name, success)", + "expr": "avg(rate(moja_cl_transfer_fulfil_sum{serviceName=~\"central-handler-fulfil|central-service\"}[$__rate_interval]) / rate(moja_cl_transfer_fulfil_count{serviceName=~\"central-handler-fulfil|central-service\"}[$__rate_interval]) >=0) by (kubernetes_pod_name, success, instance)", "hide": false, - "legendFormat": "Transfer Fulfil - {{kubernetes_pod_name}} success:{{success}}", + "legendFormat": "Transfer Fulfil - {{kubernetes_pod_name}} {{instance}} success:{{success}}", "range": true, "refId": "F" } @@ -1818,7 +1818,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -1840,9 +1841,14 @@ "links": [], "options": { "legend": { - "calcs": [], - "displayMode": "list", - "placement": "bottom", + "calcs": [ + "min", + "mean", + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", "showLegend": true }, "tooltip": { @@ -1857,10 +1863,12 @@ "type": "prometheus", "uid": "PBFA97CFB590B2093" }, - "expr": "avg(moja_cl_nodejs_eventloop_lag_seconds{serviceName=~\"central.*\"}) by (serviceName)", + "editorMode": "code", + "expr": "avg(moja_cl_nodejs_eventloop_lag_seconds{serviceName=~\"central.*\"}) by (serviceName, instance)", "format": "time_series", "intervalFactor": 1, - "legendFormat": "{{serviceName}}", + "legendFormat": "{{serviceName}} {{instance}}", + "range": true, "refId": "B" } ], @@ -1914,7 +1922,8 @@ "mode": "absolute", "steps": [ { - "color": "green" + "color": "green", + "value": null }, { "color": "red", @@ -1977,7 +1986,7 @@ "list": [] }, "time": { - "from": "now-5m", + "from": "now-15m", "to": "now" }, "timepicker": { @@ -2006,7 +2015,7 @@ ] }, "timezone": "", - "title": "Mojaloop - Central-Ledger", + "title": "mojaloop-central-ledger", "uid": "5z9mkZ-pr", "version": 2, "weekStart": "" diff --git a/docker/grafana/provisioning/dashboards/dashboard-k6-monitoring.json b/docker/grafana/provisioning/dashboards/dashboard-k6-monitoring.json index de22fae3..e11615c1 100644 --- a/docker/grafana/provisioning/dashboards/dashboard-k6-monitoring.json +++ b/docker/grafana/provisioning/dashboards/dashboard-k6-monitoring.json @@ -37,7 +37,7 @@ "title": "Image render", "tooltip": "Image Render", "type": "link", - "url": "/render/d/${__dashboard.uid}/${__dashboard}?height=4500&width=4000" + "url": "/render/d/${__dashboard.uid}/${__dashboard}?height=5000&width=4000" } ], "liveNow": true, @@ -910,7 +910,7 @@ { "matcher": { "id": "byFrameRefID", - "options": "F" + "options": "G" }, "properties": [ { @@ -922,7 +922,7 @@ ] }, "gridPos": { - "h": 17, + "h": 28, "w": 24, "x": 0, "y": 6 @@ -955,9 +955,9 @@ "type": "prometheus", "uid": "${DS_PROMETHEUS}" }, - "editorMode": "builder", + "editorMode": "code", "exemplar": false, - "expr": "k6_vus{testid=~\"$testid\"}", + "expr": "avg by(testid) (k6_vus{testid=~\"$testid\"})", "hide": false, "instant": false, "interval": "", @@ -1002,7 +1002,7 @@ }, "editorMode": "code", "exemplar": false, - "expr": "(histogram_sum(rate(k6_http_req_duration_seconds{testid=~\"$testid\"}[$__rate_interval]))\n/\nhistogram_count(rate(k6_http_req_duration_seconds{testid=~\"$testid\"}[$__rate_interval]))) ", + "expr": "avg by(testid) ((histogram_sum(rate(k6_http_req_duration_seconds{testid=~\"$testid\"}[$__rate_interval]))\n/\nhistogram_count(rate(k6_http_req_duration_seconds{testid=~\"$testid\"}[$__rate_interval]))))", "hide": false, "legendFormat": "Response Time (avg) - {{testid}} - {{scenario}} - {{name}}", "range": true, @@ -1014,7 +1014,7 @@ "uid": "${DS_PROMETHEUS}" }, "editorMode": "code", - "expr": "(histogram_sum(rate(k6_iteration_duration_seconds{testid=~\"$testid\"}[$__rate_interval]))\n/\nhistogram_count(rate(k6_iteration_duration_seconds{testid=~\"$testid\"}[$__rate_interval]))) ", + "expr": "avg by(testid) ((histogram_sum(rate(k6_iteration_duration_seconds{testid=~\"$testid\"}[$__rate_interval]))\n/\nhistogram_count(rate(k6_iteration_duration_seconds{testid=~\"$testid\"}[$__rate_interval]))) )", "hide": false, "instant": false, "legendFormat": "Iteration Duration (avg) - {{testid}} - {{scenario}} - {{name}}", @@ -1033,6 +1033,38 @@ "legendFormat": "Iteration Rate - {{testid}} - {{scenario}}", "range": true, "refId": "F" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum by(testid, payeeFspId) (rate(k6_http_reqs_total{testid=~\"$testid\"}[$__rate_interval]))", + "format": "time_series", + "hide": false, + "instant": false, + "interval": "", + "legendFormat": "Requests Rate - {{testid}} -> {{payeeFspId}}", + "range": true, + "refId": "G" + }, + { + "datasource": { + "type": "prometheus", + "uid": "${DS_PROMETHEUS}" + }, + "editorMode": "code", + "exemplar": true, + "expr": "sum by(testid, payerFspId, payeeFspId) (rate(k6_http_reqs_total{testid=~\"$testid\"}[$__rate_interval]))", + "format": "time_series", + "hide": true, + "instant": false, + "interval": "", + "legendFormat": "Requests Rate - {{testid}} - {{payerFspId}} -> {{payeeFspId}}", + "range": true, + "refId": "H" } ], "type": "timeseries" @@ -1094,7 +1126,7 @@ "h": 5, "w": 4, "x": 0, - "y": 23 + "y": 34 }, "id": 85, "interval": "1s", @@ -1222,7 +1254,7 @@ "h": 10, "w": 9, "x": 4, - "y": 23 + "y": 34 }, "id": 18, "interval": "5s", @@ -1375,7 +1407,7 @@ "h": 10, "w": 11, "x": 13, - "y": 23 + "y": 34 }, "id": 78, "interval": "5", @@ -1491,7 +1523,7 @@ "h": 5, "w": 4, "x": 0, - "y": 28 + "y": 39 }, "id": 92, "interval": "1s", @@ -1555,8 +1587,7 @@ "mode": "absolute", "steps": [ { - "color": "red", - "value": null + "color": "red" }, { "color": "#EAB839", @@ -1625,7 +1656,7 @@ "h": 7, "w": 13, "x": 0, - "y": 33 + "y": 44 }, "id": 104, "interval": "1", @@ -1782,8 +1813,7 @@ "mode": "absolute", "steps": [ { - "color": "green", - "value": null + "color": "green" }, { "color": "red", @@ -1835,7 +1865,7 @@ "h": 7, "w": 11, "x": 13, - "y": 33 + "y": 44 }, "id": 107, "interval": "1", @@ -1963,7 +1993,7 @@ "h": 1, "w": 24, "x": 0, - "y": 40 + "y": 51 }, "id": 32, "panels": [], @@ -2510,7 +2540,7 @@ "h": 9, "w": 24, "x": 0, - "y": 41 + "y": 52 }, "id": 43, "interval": "1", @@ -2784,7 +2814,7 @@ "h": 11, "w": 24, "x": 0, - "y": 50 + "y": 61 }, "id": 41, "interval": "1s", @@ -2979,7 +3009,7 @@ "h": 11, "w": 24, "x": 0, - "y": 61 + "y": 72 }, "id": 121, "interval": "1s", @@ -3132,7 +3162,7 @@ "h": 7, "w": 24, "x": 0, - "y": 72 + "y": 83 }, "id": 54, "interval": "5s", @@ -3338,7 +3368,7 @@ "h": 1, "w": 24, "x": 0, - "y": 79 + "y": 90 }, "id": 35, "panels": [], @@ -3450,7 +3480,7 @@ "h": 7, "w": 24, "x": 0, - "y": 80 + "y": 91 }, "id": 116, "interval": "5s", @@ -4178,7 +4208,7 @@ "h": 7, "w": 24, "x": 0, - "y": 87 + "y": 98 }, "id": 122, "interval": "1", @@ -4644,7 +4674,7 @@ "h": 13, "w": 24, "x": 0, - "y": 94 + "y": 105 }, "id": 117, "interval": "5", @@ -4761,9 +4791,13 @@ { "allValue": ".*", "current": { - "selected": false, - "text": "All", - "value": "$__all" + "selected": true, + "text": [ + "All" + ], + "value": [ + "$__all" + ] }, "datasource": { "type": "prometheus", @@ -4886,6 +4920,6 @@ "timezone": "", "title": "Official k6 Test Result", "uid": "01npcT44k", - "version": 1, + "version": 4, "weekStart": "" } \ No newline at end of file diff --git a/docker/grafana/provisioning/dashboards/dashboard-kafka.json b/docker/grafana/provisioning/dashboards/dashboard-kafka.json new file mode 100644 index 00000000..e3ace017 --- /dev/null +++ b/docker/grafana/provisioning/dashboards/dashboard-kafka.json @@ -0,0 +1,1093 @@ +{ + "annotations": { + "list": [ + { + "builtIn": 1, + "datasource": { + "type": "datasource", + "uid": "grafana" + }, + "enable": true, + "hide": true, + "iconColor": "rgba(0, 211, 255, 1)", + "name": "Annotations & Alerts", + "type": "dashboard" + } + ] + }, + "description": "Kafka resource usage and throughput", + "editable": true, + "fiscalYearStartMonth": 0, + "gnetId": 7589, + "graphTooltip": 0, + "links": [ + { + "asDropdown": false, + "icon": "external link", + "includeVars": false, + "keepTime": true, + "tags": [], + "targetBlank": true, + "title": "Image render", + "tooltip": "Image Render", + "type": "link", + "url": "/render/d/${__dashboard.uid}/${__dashboard}?height=2000&width=2000" + } + ], + "liveNow": false, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "thresholds" + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + } + }, + "overrides": [] + }, + "gridPos": { + "h": 7, + "w": 24, + "x": 0, + "y": 0 + }, + "id": 8, + "links": [], + "options": { + "displayMode": "gradient", + "minVizHeight": 10, + "minVizWidth": 0, + "orientation": "auto", + "reduceOptions": { + "calcs": [ + "lastNotNull" + ], + "fields": "", + "values": false + }, + "showUnfilled": true, + "valueMode": "color" + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "expr": "sum by(topic) (kafka_topic_partitions{instance=\"$instance\",topic=~\"$topic\"})", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{topic}}", + "refId": "A" + } + ], + "title": "Partitions per Topic", + "type": "bargauge" + }, + { + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 7 + }, + "id": 21, + "title": "Per Second", + "type": "row" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 24, + "x": 0, + "y": 8 + }, + "id": 14, + "links": [], + "options": { + "legend": { + "calcs": [ + "min", + "mean", + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true, + "width": 480 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "expr": "sum(rate(kafka_topic_partition_current_offset{instance=\"$instance\", topic=~\"$topic\"}[1m])) by (topic)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{topic}}", + "refId": "B" + } + ], + "title": "Message in per second", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 10, + "w": 24, + "x": 0, + "y": 18 + }, + "id": 23, + "links": [], + "options": { + "legend": { + "calcs": [ + "min", + "mean", + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true, + "width": 480 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(rate(kafka_topic_partition_current_offset{instance=\"$instance\", topic=~\"$topic\"}[1m])) by (topic, partition)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{topic}} [{{partition}}]", + "range": true, + "refId": "B" + } + ], + "title": "Message in per second by partition", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 28 + }, + "id": 12, + "links": [], + "options": { + "legend": { + "calcs": [ + "min", + "mean", + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(kafka_consumergroup_lag{instance=\"$instance\",topic=~\"$topic\"}) by (consumergroup, topic) ", + "format": "time_series", + "instant": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{consumergroup}} (topic: {{topic}})", + "refId": "A" + } + ], + "title": "Lag by Consumer Group", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "min": 0, + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 37 + }, + "id": 19, + "links": [], + "options": { + "legend": { + "calcs": [ + "min", + "mean", + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "desc" + } + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(kafka_consumergroup_lag{instance=\"$instance\",topic=~\"$topic\"}) by (consumergroup, topic, partition) ", + "format": "time_series", + "instant": false, + "interval": "", + "intervalFactor": 1, + "legendFormat": "{{consumergroup}} (topic: {{topic}}) [{{partition}}]", + "refId": "A" + } + ], + "title": "Lag by Consumer Group by Partition", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 46 + }, + "id": 18, + "links": [], + "options": { + "legend": { + "calcs": [ + "min", + "mean", + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(delta(kafka_consumergroup_current_offset{instance=~'$instance',topic=~\"$topic\"}[1m])) by (consumergroup, topic)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{consumergroup}} (topic: {{topic}})", + "range": true, + "refId": "A" + } + ], + "title": "Message consume per second", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green", + "value": null + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 55 + }, + "id": 24, + "links": [], + "options": { + "legend": { + "calcs": [ + "min", + "mean", + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "editorMode": "code", + "expr": "sum(delta(kafka_consumergroup_current_offset{instance=~'$instance',topic=~\"$topic\"}[1m])) by (consumergroup, topic, partition)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{consumergroup}} (topic: {{topic}}) [{{partition}}]", + "range": true, + "refId": "A" + } + ], + "title": "Message consume per second by partition", + "type": "timeseries" + }, + { + "collapsed": true, + "gridPos": { + "h": 1, + "w": 24, + "x": 0, + "y": 64 + }, + "id": 20, + "panels": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 65 + }, + "id": 16, + "links": [], + "options": { + "legend": { + "calcs": [ + "min", + "mean", + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true, + "width": 480 + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "expr": "sum(delta(kafka_topic_partition_current_offset{instance=~'$instance', topic=~\"$topic\"}[5m])/5) by (topic)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{topic}}", + "refId": "A" + } + ], + "title": "Message in per minute", + "type": "timeseries" + }, + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "fieldConfig": { + "defaults": { + "color": { + "mode": "palette-classic" + }, + "custom": { + "axisCenteredZero": false, + "axisColorMode": "text", + "axisLabel": "", + "axisPlacement": "auto", + "barAlignment": 0, + "drawStyle": "line", + "fillOpacity": 0, + "gradientMode": "none", + "hideFrom": { + "legend": false, + "tooltip": false, + "viz": false + }, + "lineInterpolation": "linear", + "lineWidth": 1, + "pointSize": 5, + "scaleDistribution": { + "type": "linear" + }, + "showPoints": "never", + "spanNulls": true, + "stacking": { + "group": "A", + "mode": "none" + }, + "thresholdsStyle": { + "mode": "off" + } + }, + "mappings": [], + "thresholds": { + "mode": "absolute", + "steps": [ + { + "color": "green" + }, + { + "color": "red", + "value": 80 + } + ] + }, + "unit": "short" + }, + "overrides": [] + }, + "gridPos": { + "h": 9, + "w": 24, + "x": 0, + "y": 74 + }, + "id": 22, + "links": [], + "options": { + "legend": { + "calcs": [ + "min", + "mean", + "max", + "lastNotNull" + ], + "displayMode": "table", + "placement": "right", + "showLegend": true, + "sortBy": "Mean", + "sortDesc": true + }, + "tooltip": { + "mode": "multi", + "sort": "none" + } + }, + "pluginVersion": "10.0.2", + "targets": [ + { + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "expr": "sum(delta(kafka_consumergroup_current_offset{instance=~'$instance',topic=~\"$topic\"}[5m])/5) by (consumergroup, topic)", + "format": "time_series", + "intervalFactor": 1, + "legendFormat": "{{consumergroup}} (topic: {{topic}})", + "refId": "A" + } + ], + "title": "Message consume per minute", + "type": "timeseries" + } + ], + "title": "Per Minute", + "type": "row" + } + ], + "refresh": "5s", + "schemaVersion": 38, + "style": "dark", + "tags": [ + "Kafka" + ], + "templating": { + "list": [ + { + "current": { + "selected": false, + "text": "mojaloop-services", + "value": "mojaloop-services" + }, + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "definition": "", + "hide": 0, + "includeAll": false, + "label": "Job", + "multi": false, + "name": "job", + "options": [], + "query": "label_values(kafka_consumergroup_current_offset, job)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "current": { + "selected": false, + "text": "kafka-exporter:9308", + "value": "kafka-exporter:9308" + }, + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "definition": "", + "hide": 0, + "includeAll": false, + "label": "Instance", + "multi": false, + "name": "instance", + "options": [], + "query": "label_values(kafka_consumergroup_current_offset{job=~\"$job\"}, instance)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 0, + "tagValuesQuery": "", + "tagsQuery": "", + "type": "query", + "useTags": false + }, + { + "current": { + "selected": true, + "text": [ + "All" + ], + "value": [ + "$__all" + ] + }, + "datasource": { + "type": "prometheus", + "uid": "PBFA97CFB590B2093" + }, + "definition": "", + "hide": 0, + "includeAll": true, + "label": "Topic", + "multi": true, + "name": "topic", + "options": [], + "query": "label_values(kafka_topic_partition_current_offset{instance='$instance',topic!='__consumer_offsets',topic!='--kafka'}, topic)", + "refresh": 1, + "regex": "", + "skipUrlSync": false, + "sort": 1, + "tagValuesQuery": "", + "type": "query", + "useTags": false + } + ] + }, + "time": { + "from": "now-5m", + "to": "now" + }, + "timepicker": { + "refresh_intervals": [ + "5s", + "10s", + "30s", + "1m", + "5m", + "15m", + "30m", + "1h", + "2h", + "1d" + ], + "time_options": [ + "5m", + "15m", + "1h", + "6h", + "12h", + "24h", + "2d", + "7d", + "30d" + ] + }, + "timezone": "browser", + "title": "Kafka Exporter Overview", + "uid": "jwPKIsniz", + "version": 2, + "weekStart": "" +} \ No newline at end of file diff --git a/docker/grafana/provisioning/datasources/datasource.yml b/docker/grafana/provisioning/datasources/datasource.yml index c02bb38b..0ab5485f 100644 --- a/docker/grafana/provisioning/datasources/datasource.yml +++ b/docker/grafana/provisioning/datasources/datasource.yml @@ -48,3 +48,12 @@ datasources: version: 1 # allow users to edit datasources from the UI. editable: true +- name: MySQL + type: mysql + url: mysql-cl:3306 + user: central_ledger + uid: e6f1763f-dc6a-4521-8254-0dbe1515b837 + jsonData: + database: central_ledger + secureJsonData: + password: ${GRAFANA_CL_MYSQL_PASSWORD} diff --git a/docker/ml-testing-toolkit/test-cases/collections/provisioning/participant_perffsp3.json b/docker/ml-testing-toolkit/test-cases/collections/provisioning/participant_perffsp3.json new file mode 100644 index 00000000..5738585f --- /dev/null +++ b/docker/ml-testing-toolkit/test-cases/collections/provisioning/participant_perffsp3.json @@ -0,0 +1,1535 @@ +{ + "name": "multi", + "test_cases": [ + { + "id": 1, + "name": "perffsp3 provisioning", + "meta": { + "info": "perffsp3 provisioning" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Add participant" + }, + "description": "Add participant", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "{$inputs.PERF_FSP3_ID}", + "currency": "{$inputs.currency}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Add initial position and limits" + }, + "description": "Add initial position and limits", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/{$inputs.PERF_FSP3_ID}/initialPositionAndLimits", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "body": { + "currency": "{$inputs.currency}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 3, + "meta": { + "info": "Add callback - PARTICIPANT PUT" + }, + "description": "Add callback - PARTICIPANT PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP3_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT", + "value": "{$inputs.PERF_FSP3_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 4, + "meta": { + "info": "Add callback - PARTICIPANT PUT Error" + }, + "description": "Add callback - PARTICIPANT PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP3_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT_ERROR", + "value": "{$inputs.PERF_FSP3_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 5, + "meta": { + "info": "Add callback - PARTIES GET" + }, + "description": "Add callback - PARTIES GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP3_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_GET", + "value": "{$inputs.PERF_FSP3_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 6, + "meta": { + "info": "Add callback - PARTIES PUT" + }, + "description": "Add callback - PARTIES PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP3_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT", + "value": "{$inputs.PERF_FSP3_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 7, + "meta": { + "info": "Add callback - QUOTES PUT" + }, + "description": "Add callback - QUOTES PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP3_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_QUOTES", + "value": "{$inputs.PERF_FSP3_CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 8, + "meta": { + "info": "Add callback - TRANSFERS POST" + }, + "description": "Add callback - TRANSFERS POST", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP3_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_POST", + "value": "{$inputs.PERF_FSP3_CALLBACK_ENDPOINT_BASE_URL}/transfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 9, + "meta": { + "info": "Add callback - TRANSFERS PUT" + }, + "description": "Add callback - TRANSFERS PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP3_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_PUT", + "value": "{$inputs.PERF_FSP3_CALLBACK_ENDPOINT_BASE_URL}/transfers/{{transferId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 10, + "meta": { + "info": "Add callback - TRANSFERS ERROR" + }, + "description": "Add callback - TRANSFERS ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP3_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_ERROR", + "value": "{$inputs.PERF_FSP3_CALLBACK_ENDPOINT_BASE_URL}/transfers/{{transferId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 11, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID PUT" + }, + "description": "Add callback - PARTICIPANT SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP3_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT", + "value": "{$inputs.PERF_FSP3_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 12, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID PUT Error" + }, + "description": "Add callback - PARTICIPANT SUB-ID PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP3_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT_ERROR", + "value": "{$inputs.PERF_FSP3_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 13, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID DELETE" + }, + "description": "Add callback - PARTICIPANT SUB-ID DELETE", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP3_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_DELETE", + "value": "{$inputs.PERF_FSP3_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 14, + "meta": { + "info": "Add callback - PARTIES SUB-ID GET" + }, + "description": "Add callback - PARTIES SUB-ID GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP3_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_GET", + "value": "{$inputs.PERF_FSP3_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 15, + "meta": { + "info": "Add callback - PARTIES SUB-ID PUT" + }, + "description": "Add callback - PARTIES SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP3_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT", + "value": "{$inputs.PERF_FSP3_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 16, + "meta": { + "info": "Add callback - PARTIES SUB-ID ERROR PUT" + }, + "description": "Add callback - PARTIES SUB-ID ERROR PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP3_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT_ERROR", + "value": "{$inputs.PERF_FSP3_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 17, + "meta": { + "info": "Add callback - FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE" + }, + "description": "Add callback - FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP3_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE", + "value": "{$inputs.PERF_FSP3_CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 18, + "meta": { + "info": "Set Endpoint-NET_DEBIT_CAP_ADJUSTMENT_EMAIL" + }, + "description": "Set Endpoint-NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP3_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 19, + "meta": { + "info": "Set Endpoint-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL" + }, + "description": "Set Endpoint-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP3_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 20, + "meta": { + "info": "DFSP Endpoint-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL" + }, + "description": "DFSP Endpoint-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP3_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 21, + "meta": { + "info": "Setup Bulk POST endpoint" + }, + "description": "Setup Bulk POST endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP3_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_POST", + "value": "{$inputs.PERF_FSP3_CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 22, + "meta": { + "info": "Setup Bulk PUT endpoint" + }, + "description": "Setup Bulk PUT endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP3_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_PUT", + "value": "{$inputs.PERF_FSP3_CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers/{{id}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 23, + "meta": { + "info": "Setup Bulk PUT /error endpoint" + }, + "description": "Setup Bulk PUT /error endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP3_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_ERROR", + "value": "{$inputs.PERF_FSP3_CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers/{{id}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 24, + "meta": { + "info": "Add sender callback - PARTICIPANT PUT Batch" + }, + "description": "Add sender callback - PARTICIPANT PUT Batch", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP3_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT", + "value": "{$inputs.PERF_FSP3_CALLBACK_ENDPOINT_BASE_URL}/participants/{{requestId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 25, + "meta": { + "info": "Add sender callback - PARTICIPANT PUT Batch Error" + }, + "description": "Add sender callback - PARTICIPANT PUT Batch Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP3_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT_ERROR", + "value": "{$inputs.PERF_FSP3_CALLBACK_ENDPOINT_BASE_URL}/participants/{{requestId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 26, + "meta": { + "info": "Add callback - PARTIES PUT ERROR" + }, + "description": "Add callback - PARTIES PUT ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP3_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT_ERROR", + "value": "{$inputs.PERF_FSP3_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 27, + "meta": { + "info": "Add participant with second currency" + }, + "description": "Add participant with second currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "{$inputs.PERF_FSP3_ID}", + "currency": "{$inputs.currency2}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 28, + "meta": { + "info": "Add initial position and limits with second currency" + }, + "description": "Add initial position and limits with second currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/{$inputs.PERF_FSP3_ID}/initialPositionAndLimits", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "body": { + "currency": "{$inputs.currency2}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 29, + "description": "Add participant with second currency CGS", + "meta": { + "info": "Add participant with second currency" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "{$inputs.PERF_FSP3_ID}", + "currency": "{$inputs.cgscurrency}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 30, + "description": "Add initial position and limits with second currency CGS", + "meta": { + "info": "Add initial position and limits with second currency" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/{$inputs.PERF_FSP3_ID}/initialPositionAndLimits", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "body": { + "currency": "{$inputs.cgscurrency}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + } + ] + }, + { + "id": 2, + "name": "sender fundsin", + "meta": { + "info": "sender fundsin" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "sender Get Status Request before deposit" + }, + "description": "sender Get Status Request before deposit", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PERF_FSP3_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency')) {", + " pm.environment.set(\"senderSettlementAccountId\", jsonData[i].id)", + " pm.environment.set(\"senderSettlementAccountBalanceBeforeFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 2, + "meta": { + "info": "Deposit Funds in Settlement Account - sender" + }, + "description": "Deposit Funds in Settlement Account - sender", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts/{id}", + "path": "/participants/{$inputs.PERF_FSP3_ID}/accounts/{$environment.senderSettlementAccountId}", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}", + "id": "{$environment.senderSettlementAccountId}" + }, + "body": { + "transferId": "{$environment.senderfundsInPrepareTransferId}", + "externalReference": "string", + "action": "recordFundsIn", + "reason": "string", + "amount": { + "amount": "{$environment.senderfundsInPrepareAmount}", + "currency": "{$inputs.currency}" + }, + "extensionList": { + "extension": [ + { + "key": "string", + "value": "string" + } + ] + } + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "var uuid = require('uuid');", + "pm.environment.set('senderfundsInPrepareTransferId', uuid.v4())", + "pm.environment.set('senderfundsInPrepareAmount', 5000000);" + ] + } + } + }, + { + "id": 3, + "meta": { + "info": "sender Get Status Request after deposit" + }, + "description": "sender Get Status Request after deposit", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PERF_FSP3_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "sender Settlement Account Balance After FundsIn should be equal to the balance before plus the transfer amount", + "exec": [ + "expect(+environment.senderSettlementAccountBalanceAfterFundsIn).to.equal(+environment.senderSettlementAccountBalanceBeforeFundsIn - +environment.senderfundsInPrepareAmount)" + ] + } + ] + }, + "delay": "500", + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency')) {", + " pm.environment.set(\"senderSettlementAccountBalanceAfterFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 4, + "description": "Get Status Request before deposit for currency2", + "meta": { + "info": "Get Status Request before deposit" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PERF_FSP3_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency2')) {", + " pm.environment.set(\"senderCurrency2SettlementAccountId\", jsonData[i].id)", + " pm.environment.set(\"senderCurrency2SettlementAccountBalanceBeforeFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 5, + "description": "Deposit Funds in Settlement Account currency2", + "meta": { + "info": "Deposit Funds in Settlement Account" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts/{id}", + "path": "/participants/{$inputs.PERF_FSP3_ID}/accounts/{$environment.senderCurrency2SettlementAccountId}", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP3_ID}", + "id": "{$environment.senderCurrency2SettlementAccountId}" + }, + "body": { + "transferId": "{$environment.senderfundsInPrepareTransferId}", + "externalReference": "string", + "action": "recordFundsIn", + "reason": "string", + "amount": { + "amount": "{$environment.senderfundsInPrepareAmountCurrency2}", + "currency": "{$inputs.currency2}" + }, + "extensionList": { + "extension": [ + { + "key": "string", + "value": "string" + } + ] + } + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "var uuid = require('uuid');", + "pm.environment.set('senderfundsInPrepareTransferId', uuid.v4())", + "pm.environment.set('senderfundsInPrepareAmountCurrency2', 5000000);" + ] + } + } + }, + { + "id": 6, + "description": "Get Status Request after deposit for currency2", + "meta": { + "info": "Get Status Request after deposit" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PERF_FSP3_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PERF_FSP3_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Settlement Account Balance After FundsIn should be equal to the balance before plus the transfer amount", + "exec": [ + "expect(+environment.senderCurrency2SettlementAccountBalanceAfterFundsIn).to.equal(+environment.senderCurrency2SettlementAccountBalanceBeforeFundsIn - +environment.senderfundsInPrepareAmountCurrency2)" + ] + } + ] + }, + "delay": "500", + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency2')) {", + " pm.environment.set(\"senderCurrency2SettlementAccountBalanceAfterFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + } + ] + }, + { + "id": 3, + "name": "Add parties to Oracle", + "meta": { + "info": "Add parties to Oracle." + }, + "fileInfo": { + "labels": [] + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "This request allows us to add a new participant to Account Lookup Service." + }, + "description": "Add Participant to ALS", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "operationPath": "/participants/{Type}/{ID}", + "path": "/participants/{$inputs.toIdType}/{$inputs.PERF_FSP3_MSISDN}", + "method": "post", + "params": { + "Type": "{$inputs.toIdType}", + "ID": "{$inputs.PERF_FSP3_MSISDN}" + }, + "headers": { + "FSPIOP-Source": "{$inputs.PERF_FSP3_ID}", + "Authorization": "{$inputs.PAYEE_BEARER_TOKEN}", + "Accept": "{$inputs.acceptParticipants}", + "Content-Type": "{$inputs.contentTypeParticipants}", + "Date": "{$function.generic.curDate}" + }, + "body": { + "fspId": "{$inputs.PERF_FSP3_ID}", + "currency": "{$inputs.currency}" + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "ignoreCallbacks": true + } + ] + } + ] +} diff --git a/docker/ml-testing-toolkit/test-cases/collections/provisioning/participant_perffsp4.json b/docker/ml-testing-toolkit/test-cases/collections/provisioning/participant_perffsp4.json new file mode 100644 index 00000000..9f39767d --- /dev/null +++ b/docker/ml-testing-toolkit/test-cases/collections/provisioning/participant_perffsp4.json @@ -0,0 +1,1535 @@ +{ + "name": "multi", + "test_cases": [ + { + "id": 1, + "name": "perffsp4 provisioning", + "meta": { + "info": "perffsp4 provisioning" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Add participant" + }, + "description": "Add participant", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "{$inputs.PERF_FSP4_ID}", + "currency": "{$inputs.currency}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Add initial position and limits" + }, + "description": "Add initial position and limits", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/{$inputs.PERF_FSP4_ID}/initialPositionAndLimits", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "body": { + "currency": "{$inputs.currency}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 3, + "meta": { + "info": "Add callback - PARTICIPANT PUT" + }, + "description": "Add callback - PARTICIPANT PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP4_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT", + "value": "{$inputs.PERF_FSP4_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 4, + "meta": { + "info": "Add callback - PARTICIPANT PUT Error" + }, + "description": "Add callback - PARTICIPANT PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP4_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT_ERROR", + "value": "{$inputs.PERF_FSP4_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 5, + "meta": { + "info": "Add callback - PARTIES GET" + }, + "description": "Add callback - PARTIES GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP4_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_GET", + "value": "{$inputs.PERF_FSP4_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 6, + "meta": { + "info": "Add callback - PARTIES PUT" + }, + "description": "Add callback - PARTIES PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP4_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT", + "value": "{$inputs.PERF_FSP4_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 7, + "meta": { + "info": "Add callback - QUOTES PUT" + }, + "description": "Add callback - QUOTES PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP4_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_QUOTES", + "value": "{$inputs.PERF_FSP4_CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 8, + "meta": { + "info": "Add callback - TRANSFERS POST" + }, + "description": "Add callback - TRANSFERS POST", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP4_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_POST", + "value": "{$inputs.PERF_FSP4_CALLBACK_ENDPOINT_BASE_URL}/transfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 9, + "meta": { + "info": "Add callback - TRANSFERS PUT" + }, + "description": "Add callback - TRANSFERS PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP4_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_PUT", + "value": "{$inputs.PERF_FSP4_CALLBACK_ENDPOINT_BASE_URL}/transfers/{{transferId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 10, + "meta": { + "info": "Add callback - TRANSFERS ERROR" + }, + "description": "Add callback - TRANSFERS ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP4_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_ERROR", + "value": "{$inputs.PERF_FSP4_CALLBACK_ENDPOINT_BASE_URL}/transfers/{{transferId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 11, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID PUT" + }, + "description": "Add callback - PARTICIPANT SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP4_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT", + "value": "{$inputs.PERF_FSP4_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 12, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID PUT Error" + }, + "description": "Add callback - PARTICIPANT SUB-ID PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP4_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT_ERROR", + "value": "{$inputs.PERF_FSP4_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 13, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID DELETE" + }, + "description": "Add callback - PARTICIPANT SUB-ID DELETE", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP4_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_DELETE", + "value": "{$inputs.PERF_FSP4_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 14, + "meta": { + "info": "Add callback - PARTIES SUB-ID GET" + }, + "description": "Add callback - PARTIES SUB-ID GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP4_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_GET", + "value": "{$inputs.PERF_FSP4_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 15, + "meta": { + "info": "Add callback - PARTIES SUB-ID PUT" + }, + "description": "Add callback - PARTIES SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP4_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT", + "value": "{$inputs.PERF_FSP4_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 16, + "meta": { + "info": "Add callback - PARTIES SUB-ID ERROR PUT" + }, + "description": "Add callback - PARTIES SUB-ID ERROR PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP4_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT_ERROR", + "value": "{$inputs.PERF_FSP4_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 17, + "meta": { + "info": "Add callback - FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE" + }, + "description": "Add callback - FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP4_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE", + "value": "{$inputs.PERF_FSP4_CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 18, + "meta": { + "info": "Set Endpoint-NET_DEBIT_CAP_ADJUSTMENT_EMAIL" + }, + "description": "Set Endpoint-NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP4_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 19, + "meta": { + "info": "Set Endpoint-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL" + }, + "description": "Set Endpoint-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP4_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 20, + "meta": { + "info": "DFSP Endpoint-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL" + }, + "description": "DFSP Endpoint-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP4_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 21, + "meta": { + "info": "Setup Bulk POST endpoint" + }, + "description": "Setup Bulk POST endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP4_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_POST", + "value": "{$inputs.PERF_FSP4_CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 22, + "meta": { + "info": "Setup Bulk PUT endpoint" + }, + "description": "Setup Bulk PUT endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP4_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_PUT", + "value": "{$inputs.PERF_FSP4_CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers/{{id}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 23, + "meta": { + "info": "Setup Bulk PUT /error endpoint" + }, + "description": "Setup Bulk PUT /error endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP4_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_ERROR", + "value": "{$inputs.PERF_FSP4_CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers/{{id}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 24, + "meta": { + "info": "Add sender callback - PARTICIPANT PUT Batch" + }, + "description": "Add sender callback - PARTICIPANT PUT Batch", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP4_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT", + "value": "{$inputs.PERF_FSP4_CALLBACK_ENDPOINT_BASE_URL}/participants/{{requestId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 25, + "meta": { + "info": "Add sender callback - PARTICIPANT PUT Batch Error" + }, + "description": "Add sender callback - PARTICIPANT PUT Batch Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP4_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT_ERROR", + "value": "{$inputs.PERF_FSP4_CALLBACK_ENDPOINT_BASE_URL}/participants/{{requestId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 26, + "meta": { + "info": "Add callback - PARTIES PUT ERROR" + }, + "description": "Add callback - PARTIES PUT ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP4_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT_ERROR", + "value": "{$inputs.PERF_FSP4_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 27, + "meta": { + "info": "Add participant with second currency" + }, + "description": "Add participant with second currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "{$inputs.PERF_FSP4_ID}", + "currency": "{$inputs.currency2}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 28, + "meta": { + "info": "Add initial position and limits with second currency" + }, + "description": "Add initial position and limits with second currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/{$inputs.PERF_FSP4_ID}/initialPositionAndLimits", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "body": { + "currency": "{$inputs.currency2}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 29, + "description": "Add participant with second currency CGS", + "meta": { + "info": "Add participant with second currency" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "{$inputs.PERF_FSP4_ID}", + "currency": "{$inputs.cgscurrency}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 30, + "description": "Add initial position and limits with second currency CGS", + "meta": { + "info": "Add initial position and limits with second currency" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/{$inputs.PERF_FSP4_ID}/initialPositionAndLimits", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "body": { + "currency": "{$inputs.cgscurrency}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + } + ] + }, + { + "id": 2, + "name": "sender fundsin", + "meta": { + "info": "sender fundsin" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "sender Get Status Request before deposit" + }, + "description": "sender Get Status Request before deposit", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PERF_FSP4_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency')) {", + " pm.environment.set(\"senderSettlementAccountId\", jsonData[i].id)", + " pm.environment.set(\"senderSettlementAccountBalanceBeforeFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 2, + "meta": { + "info": "Deposit Funds in Settlement Account - sender" + }, + "description": "Deposit Funds in Settlement Account - sender", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts/{id}", + "path": "/participants/{$inputs.PERF_FSP4_ID}/accounts/{$environment.senderSettlementAccountId}", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}", + "id": "{$environment.senderSettlementAccountId}" + }, + "body": { + "transferId": "{$environment.senderfundsInPrepareTransferId}", + "externalReference": "string", + "action": "recordFundsIn", + "reason": "string", + "amount": { + "amount": "{$environment.senderfundsInPrepareAmount}", + "currency": "{$inputs.currency}" + }, + "extensionList": { + "extension": [ + { + "key": "string", + "value": "string" + } + ] + } + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "var uuid = require('uuid');", + "pm.environment.set('senderfundsInPrepareTransferId', uuid.v4())", + "pm.environment.set('senderfundsInPrepareAmount', 5000000);" + ] + } + } + }, + { + "id": 3, + "meta": { + "info": "sender Get Status Request after deposit" + }, + "description": "sender Get Status Request after deposit", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PERF_FSP4_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "sender Settlement Account Balance After FundsIn should be equal to the balance before plus the transfer amount", + "exec": [ + "expect(+environment.senderSettlementAccountBalanceAfterFundsIn).to.equal(+environment.senderSettlementAccountBalanceBeforeFundsIn - +environment.senderfundsInPrepareAmount)" + ] + } + ] + }, + "delay": "500", + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency')) {", + " pm.environment.set(\"senderSettlementAccountBalanceAfterFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 4, + "description": "Get Status Request before deposit for currency2", + "meta": { + "info": "Get Status Request before deposit" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PERF_FSP4_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency2')) {", + " pm.environment.set(\"senderCurrency2SettlementAccountId\", jsonData[i].id)", + " pm.environment.set(\"senderCurrency2SettlementAccountBalanceBeforeFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 5, + "description": "Deposit Funds in Settlement Account currency2", + "meta": { + "info": "Deposit Funds in Settlement Account" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts/{id}", + "path": "/participants/{$inputs.PERF_FSP4_ID}/accounts/{$environment.senderCurrency2SettlementAccountId}", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP4_ID}", + "id": "{$environment.senderCurrency2SettlementAccountId}" + }, + "body": { + "transferId": "{$environment.senderfundsInPrepareTransferId}", + "externalReference": "string", + "action": "recordFundsIn", + "reason": "string", + "amount": { + "amount": "{$environment.senderfundsInPrepareAmountCurrency2}", + "currency": "{$inputs.currency2}" + }, + "extensionList": { + "extension": [ + { + "key": "string", + "value": "string" + } + ] + } + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "var uuid = require('uuid');", + "pm.environment.set('senderfundsInPrepareTransferId', uuid.v4())", + "pm.environment.set('senderfundsInPrepareAmountCurrency2', 5000000);" + ] + } + } + }, + { + "id": 6, + "description": "Get Status Request after deposit for currency2", + "meta": { + "info": "Get Status Request after deposit" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PERF_FSP4_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PERF_FSP4_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Settlement Account Balance After FundsIn should be equal to the balance before plus the transfer amount", + "exec": [ + "expect(+environment.senderCurrency2SettlementAccountBalanceAfterFundsIn).to.equal(+environment.senderCurrency2SettlementAccountBalanceBeforeFundsIn - +environment.senderfundsInPrepareAmountCurrency2)" + ] + } + ] + }, + "delay": "500", + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency2')) {", + " pm.environment.set(\"senderCurrency2SettlementAccountBalanceAfterFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + } + ] + }, + { + "id": 3, + "name": "Add parties to Oracle", + "meta": { + "info": "Add parties to Oracle." + }, + "fileInfo": { + "labels": [] + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "This request allows us to add a new participant to Account Lookup Service." + }, + "description": "Add Participant to ALS", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "operationPath": "/participants/{Type}/{ID}", + "path": "/participants/{$inputs.toIdType}/{$inputs.PERF_FSP4_MSISDN}", + "method": "post", + "params": { + "Type": "{$inputs.toIdType}", + "ID": "{$inputs.PERF_FSP4_MSISDN}" + }, + "headers": { + "FSPIOP-Source": "{$inputs.PERF_FSP4_ID}", + "Authorization": "{$inputs.PAYEE_BEARER_TOKEN}", + "Accept": "{$inputs.acceptParticipants}", + "Content-Type": "{$inputs.contentTypeParticipants}", + "Date": "{$function.generic.curDate}" + }, + "body": { + "fspId": "{$inputs.PERF_FSP4_ID}", + "currency": "{$inputs.currency}" + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "ignoreCallbacks": true + } + ] + } + ] +} diff --git a/docker/ml-testing-toolkit/test-cases/collections/provisioning/participant_perffsp5.json b/docker/ml-testing-toolkit/test-cases/collections/provisioning/participant_perffsp5.json new file mode 100644 index 00000000..b8ce73bc --- /dev/null +++ b/docker/ml-testing-toolkit/test-cases/collections/provisioning/participant_perffsp5.json @@ -0,0 +1,1535 @@ +{ + "name": "multi", + "test_cases": [ + { + "id": 1, + "name": "perffsp5 provisioning", + "meta": { + "info": "perffsp5 provisioning" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Add participant" + }, + "description": "Add participant", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "{$inputs.PERF_FSP5_ID}", + "currency": "{$inputs.currency}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Add initial position and limits" + }, + "description": "Add initial position and limits", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/{$inputs.PERF_FSP5_ID}/initialPositionAndLimits", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "body": { + "currency": "{$inputs.currency}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 3, + "meta": { + "info": "Add callback - PARTICIPANT PUT" + }, + "description": "Add callback - PARTICIPANT PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP5_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT", + "value": "{$inputs.PERF_FSP5_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 4, + "meta": { + "info": "Add callback - PARTICIPANT PUT Error" + }, + "description": "Add callback - PARTICIPANT PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP5_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT_ERROR", + "value": "{$inputs.PERF_FSP5_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 5, + "meta": { + "info": "Add callback - PARTIES GET" + }, + "description": "Add callback - PARTIES GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP5_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_GET", + "value": "{$inputs.PERF_FSP5_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 6, + "meta": { + "info": "Add callback - PARTIES PUT" + }, + "description": "Add callback - PARTIES PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP5_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT", + "value": "{$inputs.PERF_FSP5_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 7, + "meta": { + "info": "Add callback - QUOTES PUT" + }, + "description": "Add callback - QUOTES PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP5_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_QUOTES", + "value": "{$inputs.PERF_FSP5_CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 8, + "meta": { + "info": "Add callback - TRANSFERS POST" + }, + "description": "Add callback - TRANSFERS POST", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP5_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_POST", + "value": "{$inputs.PERF_FSP5_CALLBACK_ENDPOINT_BASE_URL}/transfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 9, + "meta": { + "info": "Add callback - TRANSFERS PUT" + }, + "description": "Add callback - TRANSFERS PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP5_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_PUT", + "value": "{$inputs.PERF_FSP5_CALLBACK_ENDPOINT_BASE_URL}/transfers/{{transferId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 10, + "meta": { + "info": "Add callback - TRANSFERS ERROR" + }, + "description": "Add callback - TRANSFERS ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP5_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_ERROR", + "value": "{$inputs.PERF_FSP5_CALLBACK_ENDPOINT_BASE_URL}/transfers/{{transferId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 11, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID PUT" + }, + "description": "Add callback - PARTICIPANT SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP5_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT", + "value": "{$inputs.PERF_FSP5_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 12, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID PUT Error" + }, + "description": "Add callback - PARTICIPANT SUB-ID PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP5_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT_ERROR", + "value": "{$inputs.PERF_FSP5_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 13, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID DELETE" + }, + "description": "Add callback - PARTICIPANT SUB-ID DELETE", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP5_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_DELETE", + "value": "{$inputs.PERF_FSP5_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 14, + "meta": { + "info": "Add callback - PARTIES SUB-ID GET" + }, + "description": "Add callback - PARTIES SUB-ID GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP5_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_GET", + "value": "{$inputs.PERF_FSP5_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 15, + "meta": { + "info": "Add callback - PARTIES SUB-ID PUT" + }, + "description": "Add callback - PARTIES SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP5_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT", + "value": "{$inputs.PERF_FSP5_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 16, + "meta": { + "info": "Add callback - PARTIES SUB-ID ERROR PUT" + }, + "description": "Add callback - PARTIES SUB-ID ERROR PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP5_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT_ERROR", + "value": "{$inputs.PERF_FSP5_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 17, + "meta": { + "info": "Add callback - FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE" + }, + "description": "Add callback - FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP5_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE", + "value": "{$inputs.PERF_FSP5_CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 18, + "meta": { + "info": "Set Endpoint-NET_DEBIT_CAP_ADJUSTMENT_EMAIL" + }, + "description": "Set Endpoint-NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP5_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 19, + "meta": { + "info": "Set Endpoint-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL" + }, + "description": "Set Endpoint-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP5_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 20, + "meta": { + "info": "DFSP Endpoint-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL" + }, + "description": "DFSP Endpoint-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP5_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 21, + "meta": { + "info": "Setup Bulk POST endpoint" + }, + "description": "Setup Bulk POST endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP5_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_POST", + "value": "{$inputs.PERF_FSP5_CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 22, + "meta": { + "info": "Setup Bulk PUT endpoint" + }, + "description": "Setup Bulk PUT endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP5_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_PUT", + "value": "{$inputs.PERF_FSP5_CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers/{{id}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 23, + "meta": { + "info": "Setup Bulk PUT /error endpoint" + }, + "description": "Setup Bulk PUT /error endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP5_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_ERROR", + "value": "{$inputs.PERF_FSP5_CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers/{{id}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 24, + "meta": { + "info": "Add sender callback - PARTICIPANT PUT Batch" + }, + "description": "Add sender callback - PARTICIPANT PUT Batch", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP5_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT", + "value": "{$inputs.PERF_FSP5_CALLBACK_ENDPOINT_BASE_URL}/participants/{{requestId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 25, + "meta": { + "info": "Add sender callback - PARTICIPANT PUT Batch Error" + }, + "description": "Add sender callback - PARTICIPANT PUT Batch Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP5_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT_ERROR", + "value": "{$inputs.PERF_FSP5_CALLBACK_ENDPOINT_BASE_URL}/participants/{{requestId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 26, + "meta": { + "info": "Add callback - PARTIES PUT ERROR" + }, + "description": "Add callback - PARTIES PUT ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP5_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT_ERROR", + "value": "{$inputs.PERF_FSP5_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 27, + "meta": { + "info": "Add participant with second currency" + }, + "description": "Add participant with second currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "{$inputs.PERF_FSP5_ID}", + "currency": "{$inputs.currency2}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 28, + "meta": { + "info": "Add initial position and limits with second currency" + }, + "description": "Add initial position and limits with second currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/{$inputs.PERF_FSP5_ID}/initialPositionAndLimits", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "body": { + "currency": "{$inputs.currency2}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 29, + "description": "Add participant with second currency CGS", + "meta": { + "info": "Add participant with second currency" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "{$inputs.PERF_FSP5_ID}", + "currency": "{$inputs.cgscurrency}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 30, + "description": "Add initial position and limits with second currency CGS", + "meta": { + "info": "Add initial position and limits with second currency" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/{$inputs.PERF_FSP5_ID}/initialPositionAndLimits", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "body": { + "currency": "{$inputs.cgscurrency}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + } + ] + }, + { + "id": 2, + "name": "sender fundsin", + "meta": { + "info": "sender fundsin" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "sender Get Status Request before deposit" + }, + "description": "sender Get Status Request before deposit", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PERF_FSP5_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency')) {", + " pm.environment.set(\"senderSettlementAccountId\", jsonData[i].id)", + " pm.environment.set(\"senderSettlementAccountBalanceBeforeFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 2, + "meta": { + "info": "Deposit Funds in Settlement Account - sender" + }, + "description": "Deposit Funds in Settlement Account - sender", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts/{id}", + "path": "/participants/{$inputs.PERF_FSP5_ID}/accounts/{$environment.senderSettlementAccountId}", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}", + "id": "{$environment.senderSettlementAccountId}" + }, + "body": { + "transferId": "{$environment.senderfundsInPrepareTransferId}", + "externalReference": "string", + "action": "recordFundsIn", + "reason": "string", + "amount": { + "amount": "{$environment.senderfundsInPrepareAmount}", + "currency": "{$inputs.currency}" + }, + "extensionList": { + "extension": [ + { + "key": "string", + "value": "string" + } + ] + } + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "var uuid = require('uuid');", + "pm.environment.set('senderfundsInPrepareTransferId', uuid.v4())", + "pm.environment.set('senderfundsInPrepareAmount', 5000000);" + ] + } + } + }, + { + "id": 3, + "meta": { + "info": "sender Get Status Request after deposit" + }, + "description": "sender Get Status Request after deposit", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PERF_FSP5_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "sender Settlement Account Balance After FundsIn should be equal to the balance before plus the transfer amount", + "exec": [ + "expect(+environment.senderSettlementAccountBalanceAfterFundsIn).to.equal(+environment.senderSettlementAccountBalanceBeforeFundsIn - +environment.senderfundsInPrepareAmount)" + ] + } + ] + }, + "delay": "500", + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency')) {", + " pm.environment.set(\"senderSettlementAccountBalanceAfterFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 4, + "description": "Get Status Request before deposit for currency2", + "meta": { + "info": "Get Status Request before deposit" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PERF_FSP5_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency2')) {", + " pm.environment.set(\"senderCurrency2SettlementAccountId\", jsonData[i].id)", + " pm.environment.set(\"senderCurrency2SettlementAccountBalanceBeforeFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 5, + "description": "Deposit Funds in Settlement Account currency2", + "meta": { + "info": "Deposit Funds in Settlement Account" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts/{id}", + "path": "/participants/{$inputs.PERF_FSP5_ID}/accounts/{$environment.senderCurrency2SettlementAccountId}", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP5_ID}", + "id": "{$environment.senderCurrency2SettlementAccountId}" + }, + "body": { + "transferId": "{$environment.senderfundsInPrepareTransferId}", + "externalReference": "string", + "action": "recordFundsIn", + "reason": "string", + "amount": { + "amount": "{$environment.senderfundsInPrepareAmountCurrency2}", + "currency": "{$inputs.currency2}" + }, + "extensionList": { + "extension": [ + { + "key": "string", + "value": "string" + } + ] + } + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "var uuid = require('uuid');", + "pm.environment.set('senderfundsInPrepareTransferId', uuid.v4())", + "pm.environment.set('senderfundsInPrepareAmountCurrency2', 5000000);" + ] + } + } + }, + { + "id": 6, + "description": "Get Status Request after deposit for currency2", + "meta": { + "info": "Get Status Request after deposit" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PERF_FSP5_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PERF_FSP5_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Settlement Account Balance After FundsIn should be equal to the balance before plus the transfer amount", + "exec": [ + "expect(+environment.senderCurrency2SettlementAccountBalanceAfterFundsIn).to.equal(+environment.senderCurrency2SettlementAccountBalanceBeforeFundsIn - +environment.senderfundsInPrepareAmountCurrency2)" + ] + } + ] + }, + "delay": "500", + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency2')) {", + " pm.environment.set(\"senderCurrency2SettlementAccountBalanceAfterFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + } + ] + }, + { + "id": 3, + "name": "Add parties to Oracle", + "meta": { + "info": "Add parties to Oracle." + }, + "fileInfo": { + "labels": [] + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "This request allows us to add a new participant to Account Lookup Service." + }, + "description": "Add Participant to ALS", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "operationPath": "/participants/{Type}/{ID}", + "path": "/participants/{$inputs.toIdType}/{$inputs.PERF_FSP5_MSISDN}", + "method": "post", + "params": { + "Type": "{$inputs.toIdType}", + "ID": "{$inputs.PERF_FSP5_MSISDN}" + }, + "headers": { + "FSPIOP-Source": "{$inputs.PERF_FSP5_ID}", + "Authorization": "{$inputs.PAYEE_BEARER_TOKEN}", + "Accept": "{$inputs.acceptParticipants}", + "Content-Type": "{$inputs.contentTypeParticipants}", + "Date": "{$function.generic.curDate}" + }, + "body": { + "fspId": "{$inputs.PERF_FSP5_ID}", + "currency": "{$inputs.currency}" + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "ignoreCallbacks": true + } + ] + } + ] +} diff --git a/docker/ml-testing-toolkit/test-cases/collections/provisioning/participant_perffsp6.json b/docker/ml-testing-toolkit/test-cases/collections/provisioning/participant_perffsp6.json new file mode 100644 index 00000000..50579855 --- /dev/null +++ b/docker/ml-testing-toolkit/test-cases/collections/provisioning/participant_perffsp6.json @@ -0,0 +1,1535 @@ +{ + "name": "multi", + "test_cases": [ + { + "id": 1, + "name": "perffsp6 provisioning", + "meta": { + "info": "perffsp6 provisioning" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Add participant" + }, + "description": "Add participant", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "{$inputs.PERF_FSP6_ID}", + "currency": "{$inputs.currency}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Add initial position and limits" + }, + "description": "Add initial position and limits", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/{$inputs.PERF_FSP6_ID}/initialPositionAndLimits", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "body": { + "currency": "{$inputs.currency}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 3, + "meta": { + "info": "Add callback - PARTICIPANT PUT" + }, + "description": "Add callback - PARTICIPANT PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP6_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT", + "value": "{$inputs.PERF_FSP6_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 4, + "meta": { + "info": "Add callback - PARTICIPANT PUT Error" + }, + "description": "Add callback - PARTICIPANT PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP6_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT_ERROR", + "value": "{$inputs.PERF_FSP6_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 5, + "meta": { + "info": "Add callback - PARTIES GET" + }, + "description": "Add callback - PARTIES GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP6_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_GET", + "value": "{$inputs.PERF_FSP6_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 6, + "meta": { + "info": "Add callback - PARTIES PUT" + }, + "description": "Add callback - PARTIES PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP6_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT", + "value": "{$inputs.PERF_FSP6_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 7, + "meta": { + "info": "Add callback - QUOTES PUT" + }, + "description": "Add callback - QUOTES PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP6_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_QUOTES", + "value": "{$inputs.PERF_FSP6_CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 8, + "meta": { + "info": "Add callback - TRANSFERS POST" + }, + "description": "Add callback - TRANSFERS POST", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP6_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_POST", + "value": "{$inputs.PERF_FSP6_CALLBACK_ENDPOINT_BASE_URL}/transfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 9, + "meta": { + "info": "Add callback - TRANSFERS PUT" + }, + "description": "Add callback - TRANSFERS PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP6_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_PUT", + "value": "{$inputs.PERF_FSP6_CALLBACK_ENDPOINT_BASE_URL}/transfers/{{transferId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 10, + "meta": { + "info": "Add callback - TRANSFERS ERROR" + }, + "description": "Add callback - TRANSFERS ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP6_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_ERROR", + "value": "{$inputs.PERF_FSP6_CALLBACK_ENDPOINT_BASE_URL}/transfers/{{transferId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 11, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID PUT" + }, + "description": "Add callback - PARTICIPANT SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP6_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT", + "value": "{$inputs.PERF_FSP6_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 12, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID PUT Error" + }, + "description": "Add callback - PARTICIPANT SUB-ID PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP6_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT_ERROR", + "value": "{$inputs.PERF_FSP6_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 13, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID DELETE" + }, + "description": "Add callback - PARTICIPANT SUB-ID DELETE", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP6_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_DELETE", + "value": "{$inputs.PERF_FSP6_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 14, + "meta": { + "info": "Add callback - PARTIES SUB-ID GET" + }, + "description": "Add callback - PARTIES SUB-ID GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP6_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_GET", + "value": "{$inputs.PERF_FSP6_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 15, + "meta": { + "info": "Add callback - PARTIES SUB-ID PUT" + }, + "description": "Add callback - PARTIES SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP6_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT", + "value": "{$inputs.PERF_FSP6_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 16, + "meta": { + "info": "Add callback - PARTIES SUB-ID ERROR PUT" + }, + "description": "Add callback - PARTIES SUB-ID ERROR PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP6_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT_ERROR", + "value": "{$inputs.PERF_FSP6_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 17, + "meta": { + "info": "Add callback - FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE" + }, + "description": "Add callback - FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP6_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE", + "value": "{$inputs.PERF_FSP6_CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 18, + "meta": { + "info": "Set Endpoint-NET_DEBIT_CAP_ADJUSTMENT_EMAIL" + }, + "description": "Set Endpoint-NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP6_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 19, + "meta": { + "info": "Set Endpoint-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL" + }, + "description": "Set Endpoint-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP6_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 20, + "meta": { + "info": "DFSP Endpoint-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL" + }, + "description": "DFSP Endpoint-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP6_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 21, + "meta": { + "info": "Setup Bulk POST endpoint" + }, + "description": "Setup Bulk POST endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP6_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_POST", + "value": "{$inputs.PERF_FSP6_CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 22, + "meta": { + "info": "Setup Bulk PUT endpoint" + }, + "description": "Setup Bulk PUT endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP6_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_PUT", + "value": "{$inputs.PERF_FSP6_CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers/{{id}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 23, + "meta": { + "info": "Setup Bulk PUT /error endpoint" + }, + "description": "Setup Bulk PUT /error endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP6_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_ERROR", + "value": "{$inputs.PERF_FSP6_CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers/{{id}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 24, + "meta": { + "info": "Add sender callback - PARTICIPANT PUT Batch" + }, + "description": "Add sender callback - PARTICIPANT PUT Batch", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP6_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT", + "value": "{$inputs.PERF_FSP6_CALLBACK_ENDPOINT_BASE_URL}/participants/{{requestId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 25, + "meta": { + "info": "Add sender callback - PARTICIPANT PUT Batch Error" + }, + "description": "Add sender callback - PARTICIPANT PUT Batch Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP6_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT_ERROR", + "value": "{$inputs.PERF_FSP6_CALLBACK_ENDPOINT_BASE_URL}/participants/{{requestId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 26, + "meta": { + "info": "Add callback - PARTIES PUT ERROR" + }, + "description": "Add callback - PARTIES PUT ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP6_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT_ERROR", + "value": "{$inputs.PERF_FSP6_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 27, + "meta": { + "info": "Add participant with second currency" + }, + "description": "Add participant with second currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "{$inputs.PERF_FSP6_ID}", + "currency": "{$inputs.currency2}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 28, + "meta": { + "info": "Add initial position and limits with second currency" + }, + "description": "Add initial position and limits with second currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/{$inputs.PERF_FSP6_ID}/initialPositionAndLimits", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "body": { + "currency": "{$inputs.currency2}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 29, + "description": "Add participant with second currency CGS", + "meta": { + "info": "Add participant with second currency" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "{$inputs.PERF_FSP6_ID}", + "currency": "{$inputs.cgscurrency}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 30, + "description": "Add initial position and limits with second currency CGS", + "meta": { + "info": "Add initial position and limits with second currency" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/{$inputs.PERF_FSP6_ID}/initialPositionAndLimits", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "body": { + "currency": "{$inputs.cgscurrency}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + } + ] + }, + { + "id": 2, + "name": "sender fundsin", + "meta": { + "info": "sender fundsin" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "sender Get Status Request before deposit" + }, + "description": "sender Get Status Request before deposit", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PERF_FSP6_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency')) {", + " pm.environment.set(\"senderSettlementAccountId\", jsonData[i].id)", + " pm.environment.set(\"senderSettlementAccountBalanceBeforeFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 2, + "meta": { + "info": "Deposit Funds in Settlement Account - sender" + }, + "description": "Deposit Funds in Settlement Account - sender", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts/{id}", + "path": "/participants/{$inputs.PERF_FSP6_ID}/accounts/{$environment.senderSettlementAccountId}", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}", + "id": "{$environment.senderSettlementAccountId}" + }, + "body": { + "transferId": "{$environment.senderfundsInPrepareTransferId}", + "externalReference": "string", + "action": "recordFundsIn", + "reason": "string", + "amount": { + "amount": "{$environment.senderfundsInPrepareAmount}", + "currency": "{$inputs.currency}" + }, + "extensionList": { + "extension": [ + { + "key": "string", + "value": "string" + } + ] + } + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "var uuid = require('uuid');", + "pm.environment.set('senderfundsInPrepareTransferId', uuid.v4())", + "pm.environment.set('senderfundsInPrepareAmount', 5000000);" + ] + } + } + }, + { + "id": 3, + "meta": { + "info": "sender Get Status Request after deposit" + }, + "description": "sender Get Status Request after deposit", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PERF_FSP6_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "sender Settlement Account Balance After FundsIn should be equal to the balance before plus the transfer amount", + "exec": [ + "expect(+environment.senderSettlementAccountBalanceAfterFundsIn).to.equal(+environment.senderSettlementAccountBalanceBeforeFundsIn - +environment.senderfundsInPrepareAmount)" + ] + } + ] + }, + "delay": "500", + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency')) {", + " pm.environment.set(\"senderSettlementAccountBalanceAfterFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 4, + "description": "Get Status Request before deposit for currency2", + "meta": { + "info": "Get Status Request before deposit" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PERF_FSP6_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency2')) {", + " pm.environment.set(\"senderCurrency2SettlementAccountId\", jsonData[i].id)", + " pm.environment.set(\"senderCurrency2SettlementAccountBalanceBeforeFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 5, + "description": "Deposit Funds in Settlement Account currency2", + "meta": { + "info": "Deposit Funds in Settlement Account" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts/{id}", + "path": "/participants/{$inputs.PERF_FSP6_ID}/accounts/{$environment.senderCurrency2SettlementAccountId}", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP6_ID}", + "id": "{$environment.senderCurrency2SettlementAccountId}" + }, + "body": { + "transferId": "{$environment.senderfundsInPrepareTransferId}", + "externalReference": "string", + "action": "recordFundsIn", + "reason": "string", + "amount": { + "amount": "{$environment.senderfundsInPrepareAmountCurrency2}", + "currency": "{$inputs.currency2}" + }, + "extensionList": { + "extension": [ + { + "key": "string", + "value": "string" + } + ] + } + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "var uuid = require('uuid');", + "pm.environment.set('senderfundsInPrepareTransferId', uuid.v4())", + "pm.environment.set('senderfundsInPrepareAmountCurrency2', 5000000);" + ] + } + } + }, + { + "id": 6, + "description": "Get Status Request after deposit for currency2", + "meta": { + "info": "Get Status Request after deposit" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PERF_FSP6_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PERF_FSP6_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Settlement Account Balance After FundsIn should be equal to the balance before plus the transfer amount", + "exec": [ + "expect(+environment.senderCurrency2SettlementAccountBalanceAfterFundsIn).to.equal(+environment.senderCurrency2SettlementAccountBalanceBeforeFundsIn - +environment.senderfundsInPrepareAmountCurrency2)" + ] + } + ] + }, + "delay": "500", + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency2')) {", + " pm.environment.set(\"senderCurrency2SettlementAccountBalanceAfterFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + } + ] + }, + { + "id": 3, + "name": "Add parties to Oracle", + "meta": { + "info": "Add parties to Oracle." + }, + "fileInfo": { + "labels": [] + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "This request allows us to add a new participant to Account Lookup Service." + }, + "description": "Add Participant to ALS", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "operationPath": "/participants/{Type}/{ID}", + "path": "/participants/{$inputs.toIdType}/{$inputs.PERF_FSP6_MSISDN}", + "method": "post", + "params": { + "Type": "{$inputs.toIdType}", + "ID": "{$inputs.PERF_FSP6_MSISDN}" + }, + "headers": { + "FSPIOP-Source": "{$inputs.PERF_FSP6_ID}", + "Authorization": "{$inputs.PAYEE_BEARER_TOKEN}", + "Accept": "{$inputs.acceptParticipants}", + "Content-Type": "{$inputs.contentTypeParticipants}", + "Date": "{$function.generic.curDate}" + }, + "body": { + "fspId": "{$inputs.PERF_FSP6_ID}", + "currency": "{$inputs.currency}" + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "ignoreCallbacks": true + } + ] + } + ] +} diff --git a/docker/ml-testing-toolkit/test-cases/collections/provisioning/participant_perffsp7.json b/docker/ml-testing-toolkit/test-cases/collections/provisioning/participant_perffsp7.json new file mode 100644 index 00000000..7e2f6ab7 --- /dev/null +++ b/docker/ml-testing-toolkit/test-cases/collections/provisioning/participant_perffsp7.json @@ -0,0 +1,1535 @@ +{ + "name": "multi", + "test_cases": [ + { + "id": 1, + "name": "perffsp7 provisioning", + "meta": { + "info": "perffsp7 provisioning" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Add participant" + }, + "description": "Add participant", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "{$inputs.PERF_FSP7_ID}", + "currency": "{$inputs.currency}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Add initial position and limits" + }, + "description": "Add initial position and limits", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/{$inputs.PERF_FSP7_ID}/initialPositionAndLimits", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "body": { + "currency": "{$inputs.currency}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 3, + "meta": { + "info": "Add callback - PARTICIPANT PUT" + }, + "description": "Add callback - PARTICIPANT PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP7_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT", + "value": "{$inputs.PERF_FSP7_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 4, + "meta": { + "info": "Add callback - PARTICIPANT PUT Error" + }, + "description": "Add callback - PARTICIPANT PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP7_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT_ERROR", + "value": "{$inputs.PERF_FSP7_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 5, + "meta": { + "info": "Add callback - PARTIES GET" + }, + "description": "Add callback - PARTIES GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP7_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_GET", + "value": "{$inputs.PERF_FSP7_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 6, + "meta": { + "info": "Add callback - PARTIES PUT" + }, + "description": "Add callback - PARTIES PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP7_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT", + "value": "{$inputs.PERF_FSP7_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 7, + "meta": { + "info": "Add callback - QUOTES PUT" + }, + "description": "Add callback - QUOTES PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP7_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_QUOTES", + "value": "{$inputs.PERF_FSP7_CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 8, + "meta": { + "info": "Add callback - TRANSFERS POST" + }, + "description": "Add callback - TRANSFERS POST", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP7_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_POST", + "value": "{$inputs.PERF_FSP7_CALLBACK_ENDPOINT_BASE_URL}/transfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 9, + "meta": { + "info": "Add callback - TRANSFERS PUT" + }, + "description": "Add callback - TRANSFERS PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP7_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_PUT", + "value": "{$inputs.PERF_FSP7_CALLBACK_ENDPOINT_BASE_URL}/transfers/{{transferId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 10, + "meta": { + "info": "Add callback - TRANSFERS ERROR" + }, + "description": "Add callback - TRANSFERS ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP7_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_ERROR", + "value": "{$inputs.PERF_FSP7_CALLBACK_ENDPOINT_BASE_URL}/transfers/{{transferId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 11, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID PUT" + }, + "description": "Add callback - PARTICIPANT SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP7_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT", + "value": "{$inputs.PERF_FSP7_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 12, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID PUT Error" + }, + "description": "Add callback - PARTICIPANT SUB-ID PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP7_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT_ERROR", + "value": "{$inputs.PERF_FSP7_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 13, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID DELETE" + }, + "description": "Add callback - PARTICIPANT SUB-ID DELETE", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP7_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_DELETE", + "value": "{$inputs.PERF_FSP7_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 14, + "meta": { + "info": "Add callback - PARTIES SUB-ID GET" + }, + "description": "Add callback - PARTIES SUB-ID GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP7_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_GET", + "value": "{$inputs.PERF_FSP7_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 15, + "meta": { + "info": "Add callback - PARTIES SUB-ID PUT" + }, + "description": "Add callback - PARTIES SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP7_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT", + "value": "{$inputs.PERF_FSP7_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 16, + "meta": { + "info": "Add callback - PARTIES SUB-ID ERROR PUT" + }, + "description": "Add callback - PARTIES SUB-ID ERROR PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP7_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT_ERROR", + "value": "{$inputs.PERF_FSP7_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 17, + "meta": { + "info": "Add callback - FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE" + }, + "description": "Add callback - FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP7_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE", + "value": "{$inputs.PERF_FSP7_CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 18, + "meta": { + "info": "Set Endpoint-NET_DEBIT_CAP_ADJUSTMENT_EMAIL" + }, + "description": "Set Endpoint-NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP7_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 19, + "meta": { + "info": "Set Endpoint-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL" + }, + "description": "Set Endpoint-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP7_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 20, + "meta": { + "info": "DFSP Endpoint-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL" + }, + "description": "DFSP Endpoint-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP7_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 21, + "meta": { + "info": "Setup Bulk POST endpoint" + }, + "description": "Setup Bulk POST endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP7_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_POST", + "value": "{$inputs.PERF_FSP7_CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 22, + "meta": { + "info": "Setup Bulk PUT endpoint" + }, + "description": "Setup Bulk PUT endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP7_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_PUT", + "value": "{$inputs.PERF_FSP7_CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers/{{id}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 23, + "meta": { + "info": "Setup Bulk PUT /error endpoint" + }, + "description": "Setup Bulk PUT /error endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP7_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_ERROR", + "value": "{$inputs.PERF_FSP7_CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers/{{id}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 24, + "meta": { + "info": "Add sender callback - PARTICIPANT PUT Batch" + }, + "description": "Add sender callback - PARTICIPANT PUT Batch", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP7_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT", + "value": "{$inputs.PERF_FSP7_CALLBACK_ENDPOINT_BASE_URL}/participants/{{requestId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 25, + "meta": { + "info": "Add sender callback - PARTICIPANT PUT Batch Error" + }, + "description": "Add sender callback - PARTICIPANT PUT Batch Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP7_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT_ERROR", + "value": "{$inputs.PERF_FSP7_CALLBACK_ENDPOINT_BASE_URL}/participants/{{requestId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 26, + "meta": { + "info": "Add callback - PARTIES PUT ERROR" + }, + "description": "Add callback - PARTIES PUT ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP7_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT_ERROR", + "value": "{$inputs.PERF_FSP7_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 27, + "meta": { + "info": "Add participant with second currency" + }, + "description": "Add participant with second currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "{$inputs.PERF_FSP7_ID}", + "currency": "{$inputs.currency2}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 28, + "meta": { + "info": "Add initial position and limits with second currency" + }, + "description": "Add initial position and limits with second currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/{$inputs.PERF_FSP7_ID}/initialPositionAndLimits", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "body": { + "currency": "{$inputs.currency2}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 29, + "description": "Add participant with second currency CGS", + "meta": { + "info": "Add participant with second currency" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "{$inputs.PERF_FSP7_ID}", + "currency": "{$inputs.cgscurrency}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 30, + "description": "Add initial position and limits with second currency CGS", + "meta": { + "info": "Add initial position and limits with second currency" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/{$inputs.PERF_FSP7_ID}/initialPositionAndLimits", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "body": { + "currency": "{$inputs.cgscurrency}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + } + ] + }, + { + "id": 2, + "name": "sender fundsin", + "meta": { + "info": "sender fundsin" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "sender Get Status Request before deposit" + }, + "description": "sender Get Status Request before deposit", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PERF_FSP7_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency')) {", + " pm.environment.set(\"senderSettlementAccountId\", jsonData[i].id)", + " pm.environment.set(\"senderSettlementAccountBalanceBeforeFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 2, + "meta": { + "info": "Deposit Funds in Settlement Account - sender" + }, + "description": "Deposit Funds in Settlement Account - sender", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts/{id}", + "path": "/participants/{$inputs.PERF_FSP7_ID}/accounts/{$environment.senderSettlementAccountId}", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}", + "id": "{$environment.senderSettlementAccountId}" + }, + "body": { + "transferId": "{$environment.senderfundsInPrepareTransferId}", + "externalReference": "string", + "action": "recordFundsIn", + "reason": "string", + "amount": { + "amount": "{$environment.senderfundsInPrepareAmount}", + "currency": "{$inputs.currency}" + }, + "extensionList": { + "extension": [ + { + "key": "string", + "value": "string" + } + ] + } + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "var uuid = require('uuid');", + "pm.environment.set('senderfundsInPrepareTransferId', uuid.v4())", + "pm.environment.set('senderfundsInPrepareAmount', 5000000);" + ] + } + } + }, + { + "id": 3, + "meta": { + "info": "sender Get Status Request after deposit" + }, + "description": "sender Get Status Request after deposit", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PERF_FSP7_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "sender Settlement Account Balance After FundsIn should be equal to the balance before plus the transfer amount", + "exec": [ + "expect(+environment.senderSettlementAccountBalanceAfterFundsIn).to.equal(+environment.senderSettlementAccountBalanceBeforeFundsIn - +environment.senderfundsInPrepareAmount)" + ] + } + ] + }, + "delay": "500", + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency')) {", + " pm.environment.set(\"senderSettlementAccountBalanceAfterFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 4, + "description": "Get Status Request before deposit for currency2", + "meta": { + "info": "Get Status Request before deposit" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PERF_FSP7_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency2')) {", + " pm.environment.set(\"senderCurrency2SettlementAccountId\", jsonData[i].id)", + " pm.environment.set(\"senderCurrency2SettlementAccountBalanceBeforeFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 5, + "description": "Deposit Funds in Settlement Account currency2", + "meta": { + "info": "Deposit Funds in Settlement Account" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts/{id}", + "path": "/participants/{$inputs.PERF_FSP7_ID}/accounts/{$environment.senderCurrency2SettlementAccountId}", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP7_ID}", + "id": "{$environment.senderCurrency2SettlementAccountId}" + }, + "body": { + "transferId": "{$environment.senderfundsInPrepareTransferId}", + "externalReference": "string", + "action": "recordFundsIn", + "reason": "string", + "amount": { + "amount": "{$environment.senderfundsInPrepareAmountCurrency2}", + "currency": "{$inputs.currency2}" + }, + "extensionList": { + "extension": [ + { + "key": "string", + "value": "string" + } + ] + } + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "var uuid = require('uuid');", + "pm.environment.set('senderfundsInPrepareTransferId', uuid.v4())", + "pm.environment.set('senderfundsInPrepareAmountCurrency2', 5000000);" + ] + } + } + }, + { + "id": 6, + "description": "Get Status Request after deposit for currency2", + "meta": { + "info": "Get Status Request after deposit" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PERF_FSP7_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PERF_FSP7_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Settlement Account Balance After FundsIn should be equal to the balance before plus the transfer amount", + "exec": [ + "expect(+environment.senderCurrency2SettlementAccountBalanceAfterFundsIn).to.equal(+environment.senderCurrency2SettlementAccountBalanceBeforeFundsIn - +environment.senderfundsInPrepareAmountCurrency2)" + ] + } + ] + }, + "delay": "500", + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency2')) {", + " pm.environment.set(\"senderCurrency2SettlementAccountBalanceAfterFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + } + ] + }, + { + "id": 3, + "name": "Add parties to Oracle", + "meta": { + "info": "Add parties to Oracle." + }, + "fileInfo": { + "labels": [] + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "This request allows us to add a new participant to Account Lookup Service." + }, + "description": "Add Participant to ALS", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "operationPath": "/participants/{Type}/{ID}", + "path": "/participants/{$inputs.toIdType}/{$inputs.PERF_FSP7_MSISDN}", + "method": "post", + "params": { + "Type": "{$inputs.toIdType}", + "ID": "{$inputs.PERF_FSP7_MSISDN}" + }, + "headers": { + "FSPIOP-Source": "{$inputs.PERF_FSP7_ID}", + "Authorization": "{$inputs.PAYEE_BEARER_TOKEN}", + "Accept": "{$inputs.acceptParticipants}", + "Content-Type": "{$inputs.contentTypeParticipants}", + "Date": "{$function.generic.curDate}" + }, + "body": { + "fspId": "{$inputs.PERF_FSP7_ID}", + "currency": "{$inputs.currency}" + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "ignoreCallbacks": true + } + ] + } + ] +} diff --git a/docker/ml-testing-toolkit/test-cases/collections/provisioning/participant_perffsp8.json b/docker/ml-testing-toolkit/test-cases/collections/provisioning/participant_perffsp8.json new file mode 100644 index 00000000..6c266914 --- /dev/null +++ b/docker/ml-testing-toolkit/test-cases/collections/provisioning/participant_perffsp8.json @@ -0,0 +1,1535 @@ +{ + "name": "multi", + "test_cases": [ + { + "id": 1, + "name": "perffsp8 provisioning", + "meta": { + "info": "perffsp8 provisioning" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "Add participant" + }, + "description": "Add participant", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "{$inputs.PERF_FSP8_ID}", + "currency": "{$inputs.currency}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 2, + "meta": { + "info": "Add initial position and limits" + }, + "description": "Add initial position and limits", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/{$inputs.PERF_FSP8_ID}/initialPositionAndLimits", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "body": { + "currency": "{$inputs.currency}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 3, + "meta": { + "info": "Add callback - PARTICIPANT PUT" + }, + "description": "Add callback - PARTICIPANT PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP8_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT", + "value": "{$inputs.PERF_FSP8_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 4, + "meta": { + "info": "Add callback - PARTICIPANT PUT Error" + }, + "description": "Add callback - PARTICIPANT PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP8_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_PUT_ERROR", + "value": "{$inputs.PERF_FSP8_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 5, + "meta": { + "info": "Add callback - PARTIES GET" + }, + "description": "Add callback - PARTIES GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP8_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_GET", + "value": "{$inputs.PERF_FSP8_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 6, + "meta": { + "info": "Add callback - PARTIES PUT" + }, + "description": "Add callback - PARTIES PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP8_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT", + "value": "{$inputs.PERF_FSP8_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 7, + "meta": { + "info": "Add callback - QUOTES PUT" + }, + "description": "Add callback - QUOTES PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP8_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_QUOTES", + "value": "{$inputs.PERF_FSP8_CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 8, + "meta": { + "info": "Add callback - TRANSFERS POST" + }, + "description": "Add callback - TRANSFERS POST", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP8_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_POST", + "value": "{$inputs.PERF_FSP8_CALLBACK_ENDPOINT_BASE_URL}/transfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 9, + "meta": { + "info": "Add callback - TRANSFERS PUT" + }, + "description": "Add callback - TRANSFERS PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP8_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_PUT", + "value": "{$inputs.PERF_FSP8_CALLBACK_ENDPOINT_BASE_URL}/transfers/{{transferId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 10, + "meta": { + "info": "Add callback - TRANSFERS ERROR" + }, + "description": "Add callback - TRANSFERS ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP8_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRANSFER_ERROR", + "value": "{$inputs.PERF_FSP8_CALLBACK_ENDPOINT_BASE_URL}/transfers/{{transferId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 11, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID PUT" + }, + "description": "Add callback - PARTICIPANT SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP8_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT", + "value": "{$inputs.PERF_FSP8_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 12, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID PUT Error" + }, + "description": "Add callback - PARTICIPANT SUB-ID PUT Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP8_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_PUT_ERROR", + "value": "{$inputs.PERF_FSP8_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 13, + "meta": { + "info": "Add callback - PARTICIPANT SUB-ID DELETE" + }, + "description": "Add callback - PARTICIPANT SUB-ID DELETE", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP8_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_SUB_ID_DELETE", + "value": "{$inputs.PERF_FSP8_CALLBACK_ENDPOINT_BASE_URL}/participants/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 14, + "meta": { + "info": "Add callback - PARTIES SUB-ID GET" + }, + "description": "Add callback - PARTIES SUB-ID GET", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP8_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_GET", + "value": "{$inputs.PERF_FSP8_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 15, + "meta": { + "info": "Add callback - PARTIES SUB-ID PUT" + }, + "description": "Add callback - PARTIES SUB-ID PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP8_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT", + "value": "{$inputs.PERF_FSP8_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 16, + "meta": { + "info": "Add callback - PARTIES SUB-ID ERROR PUT" + }, + "description": "Add callback - PARTIES SUB-ID ERROR PUT", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP8_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_SUB_ID_PUT_ERROR", + "value": "{$inputs.PERF_FSP8_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/{{partySubIdOrType}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 17, + "meta": { + "info": "Add callback - FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE" + }, + "description": "Add callback - FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP8_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_TRX_REQ_SERVICE", + "value": "{$inputs.PERF_FSP8_CALLBACK_ENDPOINT_BASE_URL}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 18, + "meta": { + "info": "Set Endpoint-NET_DEBIT_CAP_ADJUSTMENT_EMAIL" + }, + "description": "Set Endpoint-NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP8_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "NET_DEBIT_CAP_ADJUSTMENT_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 19, + "meta": { + "info": "Set Endpoint-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL" + }, + "description": "Set Endpoint-SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP8_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "SETTLEMENT_TRANSFER_POSITION_CHANGE_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 20, + "meta": { + "info": "DFSP Endpoint-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL" + }, + "description": "DFSP Endpoint-NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP8_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "NET_DEBIT_CAP_THRESHOLD_BREACH_EMAIL", + "value": "{$inputs.email}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 21, + "meta": { + "info": "Setup Bulk POST endpoint" + }, + "description": "Setup Bulk POST endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP8_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_POST", + "value": "{$inputs.PERF_FSP8_CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 22, + "meta": { + "info": "Setup Bulk PUT endpoint" + }, + "description": "Setup Bulk PUT endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP8_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_PUT", + "value": "{$inputs.PERF_FSP8_CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers/{{id}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 23, + "meta": { + "info": "Setup Bulk PUT /error endpoint" + }, + "description": "Setup Bulk PUT /error endpoint", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP8_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_BULK_TRANSFER_ERROR", + "value": "{$inputs.PERF_FSP8_CALLBACK_ENDPOINT_BASE_URL}/bulkTransfers/{{id}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 24, + "meta": { + "info": "Add sender callback - PARTICIPANT PUT Batch" + }, + "description": "Add sender callback - PARTICIPANT PUT Batch", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP8_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT", + "value": "{$inputs.PERF_FSP8_CALLBACK_ENDPOINT_BASE_URL}/participants/{{requestId}}" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 25, + "meta": { + "info": "Add sender callback - PARTICIPANT PUT Batch Error" + }, + "description": "Add sender callback - PARTICIPANT PUT Batch Error", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP8_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTICIPANT_BATCH_PUT_ERROR", + "value": "{$inputs.PERF_FSP8_CALLBACK_ENDPOINT_BASE_URL}/participants/{{requestId}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 26, + "meta": { + "info": "Add callback - PARTIES PUT ERROR" + }, + "description": "Add callback - PARTIES PUT ERROR", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/endpoints", + "path": "/participants/{$inputs.PERF_FSP8_ID}/endpoints", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "headers": { + "Content-Type": "application/json" + }, + "body": { + "type": "FSPIOP_CALLBACK_URL_PARTIES_PUT_ERROR", + "value": "{$inputs.PERF_FSP8_CALLBACK_ENDPOINT_BASE_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/error" + }, + "tests": { + "assertions": [ + { + "id": 1, + "description": "Status code is 201", + "exec": [ + "expect(response.status).to.equal(201)" + ] + } + ] + } + }, + { + "id": 27, + "meta": { + "info": "Add participant with second currency" + }, + "description": "Add participant with second currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "{$inputs.PERF_FSP8_ID}", + "currency": "{$inputs.currency2}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 28, + "meta": { + "info": "Add initial position and limits with second currency" + }, + "description": "Add initial position and limits with second currency", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/{$inputs.PERF_FSP8_ID}/initialPositionAndLimits", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "body": { + "currency": "{$inputs.currency2}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 29, + "description": "Add participant with second currency CGS", + "meta": { + "info": "Add participant with second currency" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants", + "path": "/participants", + "method": "post", + "body": { + "name": "{$inputs.PERF_FSP8_ID}", + "currency": "{$inputs.cgscurrency}" + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 400 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(400)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + }, + { + "id": 30, + "description": "Add initial position and limits with second currency CGS", + "meta": { + "info": "Add initial position and limits with second currency" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/initialPositionAndLimits", + "path": "/participants/{$inputs.PERF_FSP8_ID}/initialPositionAndLimits", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "body": { + "currency": "{$inputs.cgscurrency}", + "limit": { + "type": "NET_DEBIT_CAP", + "value": 1000000 + }, + "initialPosition": 0 + }, + "headers": { + "Content-Type": "application/json" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 201 if not exists or 500 if exists", + "exec": [ + "if (response.body.errorInformation) {", + " expect(response.status).to.equal(500)", + "} else {", + " expect(response.status).to.equal(201)", + "}" + ] + } + ] + } + } + ] + }, + { + "id": 2, + "name": "sender fundsin", + "meta": { + "info": "sender fundsin" + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "sender Get Status Request before deposit" + }, + "description": "sender Get Status Request before deposit", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PERF_FSP8_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency')) {", + " pm.environment.set(\"senderSettlementAccountId\", jsonData[i].id)", + " pm.environment.set(\"senderSettlementAccountBalanceBeforeFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 2, + "meta": { + "info": "Deposit Funds in Settlement Account - sender" + }, + "description": "Deposit Funds in Settlement Account - sender", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts/{id}", + "path": "/participants/{$inputs.PERF_FSP8_ID}/accounts/{$environment.senderSettlementAccountId}", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}", + "id": "{$environment.senderSettlementAccountId}" + }, + "body": { + "transferId": "{$environment.senderfundsInPrepareTransferId}", + "externalReference": "string", + "action": "recordFundsIn", + "reason": "string", + "amount": { + "amount": "{$environment.senderfundsInPrepareAmount}", + "currency": "{$inputs.currency}" + }, + "extensionList": { + "extension": [ + { + "key": "string", + "value": "string" + } + ] + } + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "var uuid = require('uuid');", + "pm.environment.set('senderfundsInPrepareTransferId', uuid.v4())", + "pm.environment.set('senderfundsInPrepareAmount', 5000000);" + ] + } + } + }, + { + "id": 3, + "meta": { + "info": "sender Get Status Request after deposit" + }, + "description": "sender Get Status Request after deposit", + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PERF_FSP8_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "sender Settlement Account Balance After FundsIn should be equal to the balance before plus the transfer amount", + "exec": [ + "expect(+environment.senderSettlementAccountBalanceAfterFundsIn).to.equal(+environment.senderSettlementAccountBalanceBeforeFundsIn - +environment.senderfundsInPrepareAmount)" + ] + } + ] + }, + "delay": "500", + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency')) {", + " pm.environment.set(\"senderSettlementAccountBalanceAfterFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 4, + "description": "Get Status Request before deposit for currency2", + "meta": { + "info": "Get Status Request before deposit" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PERF_FSP8_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + } + ] + }, + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency2')) {", + " pm.environment.set(\"senderCurrency2SettlementAccountId\", jsonData[i].id)", + " pm.environment.set(\"senderCurrency2SettlementAccountBalanceBeforeFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + }, + { + "id": 5, + "description": "Deposit Funds in Settlement Account currency2", + "meta": { + "info": "Deposit Funds in Settlement Account" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts/{id}", + "path": "/participants/{$inputs.PERF_FSP8_ID}/accounts/{$environment.senderCurrency2SettlementAccountId}", + "method": "post", + "params": { + "name": "{$inputs.PERF_FSP8_ID}", + "id": "{$environment.senderCurrency2SettlementAccountId}" + }, + "body": { + "transferId": "{$environment.senderfundsInPrepareTransferId}", + "externalReference": "string", + "action": "recordFundsIn", + "reason": "string", + "amount": { + "amount": "{$environment.senderfundsInPrepareAmountCurrency2}", + "currency": "{$inputs.currency2}" + }, + "extensionList": { + "extension": [ + { + "key": "string", + "value": "string" + } + ] + } + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 202", + "exec": [ + "expect(response.status).to.equal(202)" + ] + } + ] + }, + "scripts": { + "preRequest": { + "exec": [ + "var uuid = require('uuid');", + "pm.environment.set('senderfundsInPrepareTransferId', uuid.v4())", + "pm.environment.set('senderfundsInPrepareAmountCurrency2', 5000000);" + ] + } + } + }, + { + "id": 6, + "description": "Get Status Request after deposit for currency2", + "meta": { + "info": "Get Status Request after deposit" + }, + "apiVersion": { + "minorVersion": 0, + "majorVersion": 1, + "type": "central_admin" + }, + "operationPath": "/participants/{name}/accounts", + "path": "/participants/{$inputs.PERF_FSP8_ID}/accounts", + "method": "get", + "params": { + "name": "{$inputs.PERF_FSP8_ID}" + }, + "headers": { + "Content-Type": "application/json", + "FSPIOP-Source": "{$inputs.hub_operator}" + }, + "url": "{$inputs.HOST_CENTRAL_LEDGER}", + "tests": { + "assertions": [ + { + "id": 1, + "description": "status to be 200", + "exec": [ + "expect(response.status).to.equal(200)" + ] + }, + { + "id": 2, + "description": "Settlement Account Balance After FundsIn should be equal to the balance before plus the transfer amount", + "exec": [ + "expect(+environment.senderCurrency2SettlementAccountBalanceAfterFundsIn).to.equal(+environment.senderCurrency2SettlementAccountBalanceBeforeFundsIn - +environment.senderfundsInPrepareAmountCurrency2)" + ] + } + ] + }, + "delay": "500", + "scripts": { + "postRequest": { + "exec": [ + "const jsonData = pm.response.body", + "console.log(jsonData)", + "for(var i in jsonData) {", + " if(jsonData[i].ledgerAccountType === 'SETTLEMENT' && jsonData[i].currency === pm.environment.get('currency2')) {", + " pm.environment.set(\"senderCurrency2SettlementAccountBalanceAfterFundsIn\", jsonData[i].value)", + " }", + "}" + ] + } + } + } + ] + }, + { + "id": 3, + "name": "Add parties to Oracle", + "meta": { + "info": "Add parties to Oracle." + }, + "fileInfo": { + "labels": [] + }, + "requests": [ + { + "id": 1, + "meta": { + "info": "This request allows us to add a new participant to Account Lookup Service." + }, + "description": "Add Participant to ALS", + "apiVersion": { + "minorVersion": 1, + "majorVersion": 1, + "type": "fspiop", + "asynchronous": true + }, + "operationPath": "/participants/{Type}/{ID}", + "path": "/participants/{$inputs.toIdType}/{$inputs.PERF_FSP8_MSISDN}", + "method": "post", + "params": { + "Type": "{$inputs.toIdType}", + "ID": "{$inputs.PERF_FSP8_MSISDN}" + }, + "headers": { + "FSPIOP-Source": "{$inputs.PERF_FSP8_ID}", + "Authorization": "{$inputs.PAYEE_BEARER_TOKEN}", + "Accept": "{$inputs.acceptParticipants}", + "Content-Type": "{$inputs.contentTypeParticipants}", + "Date": "{$function.generic.curDate}" + }, + "body": { + "fspId": "{$inputs.PERF_FSP8_ID}", + "currency": "{$inputs.currency}" + }, + "url": "{$inputs.HOST_ACCOUNT_LOOKUP_SERVICE}", + "ignoreCallbacks": true + } + ] + } + ] +} diff --git a/docker/ml-testing-toolkit/test-cases/environments/default-env.json b/docker/ml-testing-toolkit/test-cases/environments/default-env.json index 51406440..afa8ef92 100644 --- a/docker/ml-testing-toolkit/test-cases/environments/default-env.json +++ b/docker/ml-testing-toolkit/test-cases/environments/default-env.json @@ -48,10 +48,28 @@ "NET_DEBIT_CAP": "50000000", "PERF_FSP1_ID": "perffsp1", "PERF_FSP2_ID": "perffsp2", + "PERF_FSP3_ID": "perffsp3", + "PERF_FSP4_ID": "perffsp4", + "PERF_FSP5_ID": "perffsp5", + "PERF_FSP6_ID": "perffsp6", + "PERF_FSP7_ID": "perffsp7", + "PERF_FSP8_ID": "perffsp8", "PERF_FSP1_MSISDN": "19012345001", "PERF_FSP2_MSISDN": "19012345002", - "PERF_FSP1_CALLBACK_ENDPOINT_BASE_URL": "http://callback-handler-svc-payer-sim:3001/fspiop", - "PERF_FSP2_CALLBACK_ENDPOINT_BASE_URL": "http://callback-handler-svc-payee-sim:3001/fspiop", + "PERF_FSP3_MSISDN": "19012345003", + "PERF_FSP4_MSISDN": "19012345004", + "PERF_FSP5_MSISDN": "19012345005", + "PERF_FSP6_MSISDN": "19012345006", + "PERF_FSP7_MSISDN": "19012345007", + "PERF_FSP8_MSISDN": "19012345008", + "PERF_FSP1_CALLBACK_ENDPOINT_BASE_URL": "http://sim-perffsp1:3001/fspiop", + "PERF_FSP2_CALLBACK_ENDPOINT_BASE_URL": "http://sim-perffsp2:3001/fspiop", + "PERF_FSP3_CALLBACK_ENDPOINT_BASE_URL": "http://sim-perffsp3:3001/fspiop", + "PERF_FSP4_CALLBACK_ENDPOINT_BASE_URL": "http://sim-perffsp4:3001/fspiop", + "PERF_FSP5_CALLBACK_ENDPOINT_BASE_URL": "http://sim-perffsp5:3001/fspiop", + "PERF_FSP6_CALLBACK_ENDPOINT_BASE_URL": "http://sim-perffsp6:3001/fspiop", + "PERF_FSP7_CALLBACK_ENDPOINT_BASE_URL": "http://sim-perffsp7:3001/fspiop", + "PERF_FSP8_CALLBACK_ENDPOINT_BASE_URL": "http://sim-perffsp8:3001/fspiop", "PERF_ORACLE_ENDPOINT_BASE_URL": "http://callback-handler-svc-oracle-sim:3001/oracle" } } diff --git a/docker/prometheus/prometheus.yml b/docker/prometheus/prometheus.yml index 1fb67611..1559448a 100644 --- a/docker/prometheus/prometheus.yml +++ b/docker/prometheus/prometheus.yml @@ -60,12 +60,47 @@ scrape_configs: static_configs: - targets: [ ## Discovery Services - 'account-lookup-service:4001', + 'ml-core-account-lookup-service-1:4001', + 'ml-core-account-lookup-service-2:4001', + 'ml-core-account-lookup-service-3:4001', + 'ml-core-account-lookup-service-4:4001', ## Agreement Services # 'quoting-service:3002' // Currently no metrics end-point exposed ## Transfer Services - 'ml-api-adapter:3000', + 'ml-core-ml-api-adapter-1:3000', + 'ml-core-ml-api-adapter-2:3000', + 'ml-core-ml-api-adapter-3:3000', + 'ml-core-ml-api-adapter-4:3000', + 'ml-core-ml-handler-notification-1:3000', + 'ml-core-ml-handler-notification-2:3000', + 'ml-core-ml-handler-notification-3:3000', + 'ml-core-ml-handler-notification-4:3000', 'central-ledger:3001', + 'ml-core-central-handler-prepare-1:3001', + 'ml-core-central-handler-prepare-2:3001', + 'ml-core-central-handler-prepare-3:3001', + 'ml-core-central-handler-prepare-4:3001', + 'ml-core-central-handler-position-1:3001', + 'ml-core-central-handler-position-2:3001', + 'ml-core-central-handler-position-3:3001', + 'ml-core-central-handler-position-4:3001', + 'ml-core-central-handler-position-5:3001', + 'ml-core-central-handler-position-6:3001', + 'ml-core-central-handler-position-7:3001', + 'ml-core-central-handler-position-8:3001', + 'ml-core-central-handler-fulfil-1:3001', + 'ml-core-central-handler-fulfil-2:3001', + 'ml-core-central-handler-fulfil-3:3001', + 'ml-core-central-handler-fulfil-4:3001', + 'ml-core-central-handler-admin-1:3001', + 'ml-core-central-handler-admin-2:3001', + 'ml-core-central-handler-admin-3:3001', + 'ml-core-central-handler-admin-4:3001', + 'ml-core-central-handler-timeout-1:3001', + 'ml-core-central-handler-timeout-2:3001', + 'ml-core-central-handler-timeout-3:3001', + 'ml-core-central-handler-timeout-4:3001', + # 'central-handler-get:3001', 'kafka-exporter:9308', ] @@ -77,9 +112,16 @@ scrape_configs: static_configs: - targets: [ # 'callback-handler-svc:3001', - 'callback-handler-svc-payer-sim:3001', - 'callback-handler-svc-payee-sim:3001', + 'sim-perffsp1:3001', + 'sim-perffsp2:3001', + 'sim-perffsp3:3001', + 'sim-perffsp4:3001', + 'sim-perffsp5:3001', + 'sim-perffsp6:3001', + 'sim-perffsp7:3001', + 'sim-perffsp8:3001', 'callback-handler-svc-oracle-sim:3001', 'callback-handler-svc-cl-sim:3001', 'mysqlexporter-als:9104', + 'mysqlexporter-cl:9104' ] diff --git a/docker/sql-cl-init/01_permissions.sql b/docker/sql-cl-init/01_permissions.sql new file mode 100644 index 00000000..5e451acd --- /dev/null +++ b/docker/sql-cl-init/01_permissions.sql @@ -0,0 +1,6 @@ +ALTER USER 'central_ledger'@'%' identified WITH mysql_native_password by 'password'; +CREATE USER 'exporter'@'%' IDENTIFIED BY 'password'; +GRANT PROCESS, REPLICATION CLIENT ON *.* TO 'exporter'@'%'; +GRANT SELECT ON performance_schema.* TO 'exporter'@'%'; +GRANT ALL PRIVILEGES ON mysql.* TO 'central_ledger'; +FLUSH PRIVILEGES; diff --git a/docker/wait4/wait4.config.perf-cl.js b/docker/wait4/wait4.config.perf-cl.js new file mode 100644 index 00000000..8af868f4 --- /dev/null +++ b/docker/wait4/wait4.config.perf-cl.js @@ -0,0 +1,162 @@ +module.exports = { + // format version sem-ver + // `v{major}.${minor}.${patch}` + wait4: 'v0.1.0', + + // How many times should we retry waiting for a service? + retries: 60, + + // How many ms to wait before retrying a service connection? + // waitMs: 2500, + waitMs: 10000, + + // services definitions + services: [ + { + name: 'central-ledger', + + // list of services to wait for + wait4: [ + { + description: 'Kafka broker', + uri: 'kafka:29092', + method: 'ncat' + }, + { + description: 'MySQL ledger', + uri: 'mysql-cl:3306', + method: 'mysql', + // customized RC setup + rc: { + namespace: 'CLEDG', + configPath: '../config/default.json' + }, + retries: 60 + }, + // { + // description: 'MongoDB object store', + // uri: 'mongodb://objstore:27017/mlos', + // method: 'mongo' + // } + ] + }, + { + name: 'central-settlement', + wait4: [ + { + uri: 'kafka:29092', + method: 'ncat' + }, + { + uri: 'mysql:3306', + method: 'mysql' + } + ] + }, + { + name: 'account-lookup-service', + wait4: [ + { + description: 'callback-handler central ledger admin simulator', + uri: 'callback-handler-svc-cl-sim:3001', + method: 'ncat', + + // we have to wait much longer for central-ledger + // to spin up so we overload `retires` default parameter value + retries: 60 + }, + { + description: 'MySQL ALS', + uri: 'mysql-als:3306', + method: 'mysql', + // customized RC setup + rc: { + namespace: 'ALS', + configPath: '../config/default.json' + }, + retries: 60 + } + ] + }, + { + name: 'ml-api-adapter', + wait4: [ + { + uri: 'kafka:29092', + method: 'ncat', + // Seems to take longer on circleci to start up + retries: 60 + } + ] + }, + { + name: 'thirdparty-api-svc', + wait4: [ + { + uri: 'kafka:29092', + method: 'ncat' + } + ] + }, + { + name: 'pisp-thirdparty-sdk', + wait4: [ + { + description: 'PISP Redis Cache', + uri: 'pisp-redis:6379', + method: 'ncat' + } + ] + }, + { + name: 'dfspa-thirdparty-sdk', + wait4: [ + { + description: 'DFSP A Redis Cache', + uri: 'dfspa-redis:6379', + method: 'ncat' + } + ] + }, + { + name: 'dfspb-thirdparty-sdk', + wait4: [ + { + description: 'DFSP B Redis Cache', + uri: 'dfspb-redis:6379', + method: 'ncat' + } + ] + }, + { + name: 'als-consent-oracle', + wait4: [ + { + description: 'MySQL Database', + uri: 'als-consent-oracle-mysql:3306', + method: 'mysql', + rc: { + namespace: 'CO', + configPath: '../config/default.json' + }, + retries: 60 + } + ] + }, + { + name: 'auth-service', + wait4: [ + { + description: 'MySQL Database', + uri: 'auth-service-mysql:3306', + method: 'mysqlAlt', + rc: { + namespace: '', + configPath: '../dist/config/integration.json' + }, + retries: 30 + } + ] + } + ] +} diff --git a/envs/cl-sim.env b/envs/cl-sim.env new file mode 100644 index 00000000..2180ada7 --- /dev/null +++ b/envs/cl-sim.env @@ -0,0 +1,3 @@ +### Admin Handlers +## TODO: Better to hardcode into test rather than env variable? +CBH_ADMIN_FSP_ENDPOINT_MAP='{"perffsp1":"http://sim-perffsp1:3001/fspiop","perffsp2":"http://sim-perffsp2:3001/fspiop","perffsp3":"http://sim-perffsp3:3001/fspiop","perffsp4":"http://sim-perffsp4:3001/fspiop","perffsp5":"http://sim-perffsp5:3001/fspiop","perffsp6":"http://sim-perffsp6:3001/fspiop","perffsp7":"http://sim-perffsp7:3001/fspiop","perffsp8":"http://sim-perffsp8:3001/fspiop"}' diff --git a/envs/perffsp1.env b/envs/perffsp1.env new file mode 100644 index 00000000..1518cee4 --- /dev/null +++ b/envs/perffsp1.env @@ -0,0 +1,11 @@ +CBH_FSPIOP_FSP_ID=perffsp1 +CBH_FSPIOP_CALLBACK_HTTP_KEEPALIVE=true + +### FSPIOP Handlers +#### Use this if we want to hit the ALS +CBH_FSPIOP_ALS_ENDPOINT_URL=http://account-lookup-service:4002 +#### Use this if we want to bypass ALS +# CBH_FSPIOP_ALS_ENDPOINT_URL=http://sim-perffsp1:3001/fspiop + +CBH_FSPIOP_TRANSFERS_ENDPOINT_URL=http://ml-api-adapter:3000 +# CBH_FSPIOP_TRANSFERS_ENDPOINT_URL=http://sim-perffsp2:3001/fspiop \ No newline at end of file diff --git a/envs/perffsp2.env b/envs/perffsp2.env new file mode 100644 index 00000000..9b20f1a6 --- /dev/null +++ b/envs/perffsp2.env @@ -0,0 +1,11 @@ +CBH_FSPIOP_FSP_ID=perffsp2 +CBH_FSPIOP_CALLBACK_HTTP_KEEPALIVE=true + +### FSPIOP Handlers +#### Use this if we want to hit the ALS +CBH_FSPIOP_ALS_ENDPOINT_URL=http://account-lookup-service:4002 +#### Use this if we want to bypass ALS +# CBH_FSPIOP_ALS_ENDPOINT_URL=http://sim-perffsp4:3001/fspiop + +CBH_FSPIOP_TRANSFERS_ENDPOINT_URL=http://ml-api-adapter:3000 +# CBH_FSPIOP_TRANSFERS_ENDPOINT_URL=http://sim-perffsp1:3001/fspiop diff --git a/envs/perffsp3.env b/envs/perffsp3.env new file mode 100644 index 00000000..41ee037f --- /dev/null +++ b/envs/perffsp3.env @@ -0,0 +1,10 @@ +CBH_FSPIOP_FSP_ID=perffsp3 +CBH_FSPIOP_CALLBACK_HTTP_KEEPALIVE=true + +### FSPIOP Handlers +#### Use this if we want to hit the ALS +CBH_FSPIOP_ALS_ENDPOINT_URL=http://account-lookup-service:4002 +#### Use this if we want to bypass ALS +# CBH_FSPIOP_ALS_ENDPOINT_URL=http://sim-perffsp3:3001/fspiop + +CBH_FSPIOP_TRANSFERS_ENDPOINT_URL=http://ml-api-adapter:3000 diff --git a/envs/perffsp4.env b/envs/perffsp4.env new file mode 100644 index 00000000..d5e70138 --- /dev/null +++ b/envs/perffsp4.env @@ -0,0 +1,10 @@ +CBH_FSPIOP_FSP_ID=perffsp4 +CBH_FSPIOP_CALLBACK_HTTP_KEEPALIVE=true + +### FSPIOP Handlers +#### Use this if we want to hit the ALS +CBH_FSPIOP_ALS_ENDPOINT_URL=http://account-lookup-service:4002 +#### Use this if we want to bypass ALS +# CBH_FSPIOP_ALS_ENDPOINT_URL=http://sim-perffsp4:3001/fspiop + +CBH_FSPIOP_TRANSFERS_ENDPOINT_URL=http://ml-api-adapter:3000 diff --git a/envs/perffsp5.env b/envs/perffsp5.env new file mode 100644 index 00000000..e158ef6d --- /dev/null +++ b/envs/perffsp5.env @@ -0,0 +1,10 @@ +CBH_FSPIOP_FSP_ID=perffsp5 +CBH_FSPIOP_CALLBACK_HTTP_KEEPALIVE=true + +### FSPIOP Handlers +#### Use this if we want to hit the ALS +CBH_FSPIOP_ALS_ENDPOINT_URL=http://account-lookup-service:4002 +#### Use this if we want to bypass ALS +# CBH_FSPIOP_ALS_ENDPOINT_URL=http://sim-perffsp5:3001/fspiop + +CBH_FSPIOP_TRANSFERS_ENDPOINT_URL=http://ml-api-adapter:3000 diff --git a/envs/perffsp6.env b/envs/perffsp6.env new file mode 100644 index 00000000..0292a532 --- /dev/null +++ b/envs/perffsp6.env @@ -0,0 +1,10 @@ +CBH_FSPIOP_FSP_ID=perffsp6 +CBH_FSPIOP_CALLBACK_HTTP_KEEPALIVE=true + +### FSPIOP Handlers +#### Use this if we want to hit the ALS +CBH_FSPIOP_ALS_ENDPOINT_URL=http://account-lookup-service:4002 +#### Use this if we want to bypass ALS +# CBH_FSPIOP_ALS_ENDPOINT_URL=http://sim-perffsp6:3001/fspiop + +CBH_FSPIOP_TRANSFERS_ENDPOINT_URL=http://ml-api-adapter:3000 diff --git a/envs/perffsp7.env b/envs/perffsp7.env new file mode 100644 index 00000000..e6059fe2 --- /dev/null +++ b/envs/perffsp7.env @@ -0,0 +1,10 @@ +CBH_FSPIOP_FSP_ID=perffsp7 +CBH_FSPIOP_CALLBACK_HTTP_KEEPALIVE=true + +### FSPIOP Handlers +#### Use this if we want to hit the ALS +CBH_FSPIOP_ALS_ENDPOINT_URL=http://account-lookup-service:4002 +#### Use this if we want to bypass ALS +# CBH_FSPIOP_ALS_ENDPOINT_URL=http://sim-perffsp7:3001/fspiop + +CBH_FSPIOP_TRANSFERS_ENDPOINT_URL=http://ml-api-adapter:3000 diff --git a/envs/perffsp8.env b/envs/perffsp8.env new file mode 100644 index 00000000..58bfa1c9 --- /dev/null +++ b/envs/perffsp8.env @@ -0,0 +1,10 @@ +CBH_FSPIOP_FSP_ID=perffsp8 +CBH_FSPIOP_CALLBACK_HTTP_KEEPALIVE=true + +### FSPIOP Handlers +#### Use this if we want to hit the ALS +CBH_FSPIOP_ALS_ENDPOINT_URL=http://account-lookup-service:4002 +#### Use this if we want to bypass ALS +# CBH_FSPIOP_ALS_ENDPOINT_URL=http://sim-perffsp8:3001/fspiop + +CBH_FSPIOP_TRANSFERS_ENDPOINT_URL=http://ml-api-adapter:3000 diff --git a/packages/callback-handler-svc/handlers/admin.js b/packages/callback-handler-svc/handlers/admin.js index 7d8f4685..ebffc2a1 100644 --- a/packages/callback-handler-svc/handlers/admin.js +++ b/packages/callback-handler-svc/handlers/admin.js @@ -3,10 +3,7 @@ const env = require('env-var') const init = (config, logger, options = undefined) => { const router = express.Router() - const PAYER_FSP_ID = env.get('CBH_FSPIOP_PAYER_FSP_ID').default('perffsp2').asString() - const PAYEE_FSP_ID = env.get('CBH_FSPIOP_PAYEE_FSP_ID').default('perffsp2').asString() - const ADMIN_FSPIOP_PAYER_CALLBACK_URL = env.get('CBH_ADMIN_FSPIOP_PAYER_CALLBACK_URL').default('http://callback-handler-svc:3001/fspiop').asString() - const ADMIN_FSPIOP_PAYEE_CALLBACK_URL = env.get('CBH_ADMIN_FSPIOP_PAYEE_CALLBACK_URL').default('http://callback-handler-svc:3001/fspiop').asString() + const FSP_ENDPOINT_MAP = env.get('CBH_ADMIN_FSP_ENDPOINT_MAP').default('{}').asString() const FSPIOP_ALS_ENDPOINT_URL = env.get('CBH_FSPIOP_ALS_ENDPOINT_URL').default('http://central-ledger').asString() // Handle admin Get Participants request @@ -49,13 +46,11 @@ const init = (config, logger, options = undefined) => { ['success', 'operation'] ).startTimer() - const id = req.params.id - let ADMIN_FSPIOP_CALLBACK_URL = ADMIN_FSPIOP_PAYEE_CALLBACK_URL - if(id === PAYER_FSP_ID) { - ADMIN_FSPIOP_CALLBACK_URL = ADMIN_FSPIOP_PAYER_CALLBACK_URL - } + const id = req.params.id + const fspMap = JSON.parse(FSP_ENDPOINT_MAP) + const ADMIN_FSPIOP_CALLBACK_URL = fspMap[id] - res.status(200).json( + res.status(200).json( [ { "type":"FSPIOP_CALLBACK_URL_PARTICIPANT_PUT", @@ -116,18 +111,34 @@ const init = (config, logger, options = undefined) => { { "type":"FSPIOP_CALLBACK_URL_PARTIES_PUT_ERROR", "value":`${ADMIN_FSPIOP_CALLBACK_URL}/parties/{{partyIdType}}/{{partyIdentifier}}/error` - } + }, + { + "type":"FSPIOP_CALLBACK_URL_QUOTES", + "value":`${ADMIN_FSPIOP_CALLBACK_URL}` + }, + { + "type":"FSPIOP_CALLBACK_URL_TRANSFER_POST", + "value":`${ADMIN_FSPIOP_CALLBACK_URL}/transfers` + }, + { + "type":"FSPIOP_CALLBACK_URL_TRANSFER_PUT", + "value":`${ADMIN_FSPIOP_CALLBACK_URL}/transfers/{{transferId}}` + }, + { + "type":"FSPIOP_CALLBACK_URL_TRANSFER_ERROR", + "value":`${ADMIN_FSPIOP_CALLBACK_URL}/transfers/{{transferId}}/error` + }, ] ) histTimerEnd({ success: true, operation: 'admin_get_participants_endpoints'}) }) - return { - name: 'admin', - basepath: '/admin', - router - } + return { + name: 'admin', + basepath: '/admin', + router + } } // require-glob has no ES support diff --git a/packages/callback-handler-svc/handlers/fspiop.js b/packages/callback-handler-svc/handlers/fspiop.js index 1d4fb1b7..830cacc6 100644 --- a/packages/callback-handler-svc/handlers/fspiop.js +++ b/packages/callback-handler-svc/handlers/fspiop.js @@ -7,8 +7,13 @@ const env = require('env-var') const TRACESTATE_KEY_END2END_START_TS = 'tx_end2end_start_ts' const TRACESTATE_KEY_CALLBACK_START_TS = 'tx_callback_start_ts' +// ILP Packet: AYIDGQAAAAAAACcQIWcuZ3JlZW5iYW5rZnNwLm1zaXNkbi4yNzcxMzgwMzkxMoIC62V5SjBjbUZ1YzJGamRHbHZia2xrSWpvaU1ERXhaR1EyTldZdE5UQXpNeTAwTVdNMkxUazFaR1l0T1RFeFl6WTRPVFExWWpobUlpd2ljWFZ2ZEdWSlpDSTZJbVF3TXpJMU1EVTJMVE0xTldFdE5EUmxNUzFpT1RnMExXWXdZVFExTmpFMFkyRXpPQ0lzSW5CaGVXVmxJanA3SW5CaGNuUjVTV1JKYm1adklqcDdJbkJoY25SNVNXUlVlWEJsSWpvaVRWTkpVMFJPSWl3aWNHRnlkSGxKWkdWdWRHbG1hV1Z5SWpvaU1qYzNNVE00TURNNU1USWlMQ0ptYzNCSlpDSTZJbWR5WldWdVltRnVhMlp6Y0NKOWZTd2ljR0Y1WlhJaU9uc2ljR0Z5ZEhsSlpFbHVabThpT25zaWNHRnlkSGxKWkZSNWNHVWlPaUpOVTBsVFJFNGlMQ0p3WVhKMGVVbGtaVzUwYVdacFpYSWlPaUkwTkRFeU16UTFOamM0T1NJc0ltWnpjRWxrSWpvaWNHbHVhMkpoYm10bWMzQWlmU3dpY0dWeWMyOXVZV3hKYm1adklqcDdJbU52YlhCc1pYaE9ZVzFsSWpwN0ltWnBjbk4wVG1GdFpTSTZJa1pwY25OMGJtRnRaUzFVWlhOMElpd2liR0Z6ZEU1aGJXVWlPaUpNWVhOMGJtRnRaUzFVWlhOMEluMHNJbVJoZEdWUFprSnBjblJvSWpvaU1UazROQzB3TVMwd01TSjlmU3dpWVcxdmRXNTBJanA3SW1OMWNuSmxibU41SWpvaVZWTkVJaXdpWVcxdmRXNTBJam9pTVRBd0luMHNJblJ5WVc1ellXTjBhVzl1Vkhsd1pTSTZleUp6WTJWdVlYSnBieUk2SWxSU1FVNVRSa1ZTSWl3aWFXNXBkR2xoZEc5eUlqb2lVRUZaUlZJaUxDSnBibWwwYVdGMGIzSlVlWEJsSWpvaVEwOU9VMVZOUlZJaWZYMAA +// Condition: 5m0gq_5dLQlTSSRKQmLpj0MZ1MtWLWgSu1oLGVTJyYs +const FULFILMENT = 'lnYe4rYwLthWbzhVyX5cAuDfL1Ulw4WdaTgyGDREysw' + const init = (config, logger, options = undefined) => { const FSPIOP_ALS_ENDPOINT_URL = env.get('CBH_FSPIOP_ALS_ENDPOINT_URL').default('http://account-lookup-service:4002').asString() + const FSPIOP_TRANSFERS_ENDPOINT_URL = env.get('CBH_FSPIOP_TRANSFERS_ENDPOINT_URL').default('http://ml-api-adapter:3000').asString() const FSP_ID = env.get('CBH_FSPIOP_FSP_ID').default('perffsp2').asString() const HTTP_KEEPALIVE = env.get('CBH_FSPIOP_CALLBACK_HTTP_KEEPALIVE').default('true').asBool() const router = express.Router() @@ -45,7 +50,7 @@ const init = (config, logger, options = undefined) => { "party": { "partyIdInfo": { "partyIdType": "MSISDN", - "partyIdentifier": "19012345002", + "partyIdentifier": id, "fspId": FSP_ID, "partySubIdOrType": "HEALTH_CARD" }, @@ -123,6 +128,59 @@ const init = (config, logger, options = undefined) => { histTimerEnd({ success: true, operation: 'fspiop_get_participants'}) }) + // Handle Payee POST /transfers + router.post('/transfers', (req, res) => { + const histTimerEnd = options.metrics.getHistogram( + 'ing_callbackHandler', + 'Ingress - Operation handler', + ['success', 'operation'] + ).startTimer() + + // Async callback + const fspiopSourceHeader = req.headers['fspiop-source'] + const traceparentHeader = req.headers['traceparent'] + const tracestateHeader = req.headers['tracestate']; + const transferId = req.body.transferId; + + (async () => { + const egressHistTimerEnd = options.metrics.getHistogram( + 'egress_callbackHandler', + 'Egress - Operation handler', + ['success', 'operation'] + ).startTimer() + try { + await axios.put(`${FSPIOP_TRANSFERS_ENDPOINT_URL}/transfers/${transferId}`, { + "transferState": "COMMITTED", + "fulfilment": FULFILMENT, + "completedTimestamp": (new Date()).toISOString() + }, + { + headers: { + 'Content-Type': 'application/vnd.interoperability.transfers+json;version=1.1', + 'Accept': 'application/vnd.interoperability.transfers+json;version=1.1', + Date: (new Date()).toUTCString(), + 'FSPIOP-Source': FSP_ID, + 'FSPIOP-Destination': fspiopSourceHeader, + 'traceparent': traceparentHeader, + 'tracestate': tracestateHeader + `,${TRACESTATE_KEY_CALLBACK_START_TS}=${Date.now()}` + }, + httpAgent, + }) + egressHistTimerEnd({ success: true, operation: 'fspiop_put_transfers'}) + } catch(err) { + logger.error({ + traceparent: req.headers.traceparent, + operation: 'fspiop_put_transfers', + err, + }) + egressHistTimerEnd({ success: false, operation: 'fspiop_put_transfers'}) + } + })(); + // Sync 202 + res.status(202).end() + histTimerEnd({ success: true, operation: 'fspiop_put_transfers'}) + }) + const handleCallback = (resource, req, res) => { const histTimerEnd = options.metrics.getHistogram( 'ing_callbackHandler', @@ -150,22 +208,19 @@ const init = (config, logger, options = undefined) => { const performanceHistogram = options.metrics.getHistogram( 'tx_cb_perf', 'Metrics for callbacks', - ['success', 'path', 'operation'] + ['success', 'operation'] ) performanceHistogram.observe({ success: (!isErrorOperation).toString(), - path, operation: operationE2e }, e2eDelta / 1000) performanceHistogram.observe({ success: (!isErrorOperation).toString(), - path, operation: operationRequest }, requestDelta / 1000) performanceHistogram.observe({ success: (!isErrorOperation).toString(), - path, operation: operationResponse }, responseDelta / 1000) @@ -199,6 +254,11 @@ const init = (config, logger, options = undefined) => { return handleCallback('participants', req, res) }) + // Handle Payer PUT Transfers callback + router.put('/transfers/*', (req, res) => { + return handleCallback('transfers', req, res) + }) + return { name: 'fspiop', basepath: '/fspiop', diff --git a/packages/callback-handler-svc/handlers/oracle.js b/packages/callback-handler-svc/handlers/oracle.js index 13ce55da..3aa23df1 100644 --- a/packages/callback-handler-svc/handlers/oracle.js +++ b/packages/callback-handler-svc/handlers/oracle.js @@ -11,11 +11,23 @@ const init = (config, logger, options = undefined) => { 'Ingress - Operation handler', ['success', 'operation'] ).startTimer() + + const partyToFspIdMap = { + "19012345001": 'perffsp1', + "19012345002": 'perffsp2', + "19012345003": 'perffsp3', + "19012345004": 'perffsp4', + "19012345005": 'perffsp5', + "19012345006": 'perffsp6', + "19012345007": 'perffsp7', + "19012345008": 'perffsp8' + } + const id = req.params.id res.status(200).json({ "partyList":[ { - "fspId":id, + "fspId": partyToFspIdMap[id], "currency":"USD" } ] diff --git a/packages/callback-handler-svc/src/server/index.ts b/packages/callback-handler-svc/src/server/index.ts index b46a8898..cb7e7c7a 100644 --- a/packages/callback-handler-svc/src/server/index.ts +++ b/packages/callback-handler-svc/src/server/index.ts @@ -50,6 +50,13 @@ export type options = { wsServer: WSServer, metrics: (typeof Metrics) } +app.use(express.json({ + type: [ + 'application/json', + 'application/*+json', + ] +})) + async function run (wsServer: WSServer): Promise { const handlersList = await requireGlob(path.join(process.cwd(), './handlers/**.js')) Logger.isInfoEnabled && Logger.info(`Handler imports found ${JSON.stringify(handlersList)}`) @@ -68,7 +75,6 @@ async function run (wsServer: WSServer): Promise { Metrics.setup(Config.INSTRUMENTATION.METRICS.config) } - app.use(express.json()) app.get('/health', (_req, res) => { res.json({ status: 'OK' diff --git a/packages/k6-tests/common/utils.js b/packages/k6-tests/common/utils.js index 2baf5aab..ea6f2c2c 100644 --- a/packages/k6-tests/common/utils.js +++ b/packages/k6-tests/common/utils.js @@ -1,4 +1,5 @@ import { check, fail } from "k6"; +import { randomItem } from 'https://jslib.k6.io/k6-utils/1.2.0/index.js'; export function checkStatus({ response, expectedStatus, expectedContent, failOnError, printOnError, dynamicIds }) { if (isEmpty(expectedStatus) && isEmpty(expectedContent)) { @@ -54,3 +55,18 @@ function isEmpty(str) { return (!str || str.length === 0); } +export function getTwoItemsFromArray(inputArray) { + + // Option 1 + // const outputArray = inputArray.concat().sort(() => randomItem([-1,1])).slice(0, 2); + + // Option 2 + const tempArray = [ ...inputArray ] + const outputArray = [] + const selectedItem1 = randomItem(tempArray) + outputArray.push(selectedItem1) + tempArray.splice(tempArray.indexOf(selectedItem1), 1); + outputArray.push(randomItem(tempArray)) + + return outputArray +} \ No newline at end of file diff --git a/packages/k6-tests/config/fspiopDiscovery.json b/packages/k6-tests/config/fspiopDiscovery.json new file mode 100644 index 00000000..e89699b2 --- /dev/null +++ b/packages/k6-tests/config/fspiopDiscovery.json @@ -0,0 +1,20 @@ +{ + "scenarios": { + "fspiopDiscovery": { + "executor": "ramping-vus", + "exec": "fspiopDiscoveryScenarios", + "env": { + "UNIDIRECTIONAL": "true" + }, + "startVUs": 1, + "stages": [ + { "duration": "10s", "target": 6 } + ] + } + }, + "thresholds": { + "iteration_duration": [ "p(95)<1000" ], + "http_req_failed": [ "rate<0.01" ], + "http_req_duration": [ "p(95)<1000" ] + } +} diff --git a/packages/k6-tests/config/fspiopTransfers.json b/packages/k6-tests/config/fspiopTransfers.json new file mode 100644 index 00000000..7c3392ca --- /dev/null +++ b/packages/k6-tests/config/fspiopTransfers.json @@ -0,0 +1,21 @@ +{ + "scenarios": { + "fspiopTransfers": { + "executor": "ramping-vus", + "exec": "fspiopTransfersScenarios", + "env": { + "UNIDIRECTIONAL": "false" + }, + "startVUs": 1, + "stages": [ + { "duration": "30s", "target": 30 }, + { "duration": "5m", "target": 30 } + ] + } + }, + "thresholds": { + "iteration_duration": [ "p(95)<1000" ], + "http_req_failed": [ "rate<0.01" ], + "http_req_duration": [ "p(95)<1000" ] + } +} diff --git a/packages/k6-tests/config/fspiopTransfersUnidirectional.json b/packages/k6-tests/config/fspiopTransfersUnidirectional.json new file mode 100644 index 00000000..effb8b85 --- /dev/null +++ b/packages/k6-tests/config/fspiopTransfersUnidirectional.json @@ -0,0 +1,21 @@ +{ + "scenarios": { + "fspiopTransfers": { + "executor": "ramping-vus", + "exec": "fspiopTransfersScenarios", + "env": { + "UNIDIRECTIONAL": "true" + }, + "startVUs": 1, + "stages": [ + { "duration": "30s", "target": 10 }, + { "duration": "5m", "target": 10 } + ] + } + }, + "thresholds": { + "iteration_duration": [ "p(95)<1000" ], + "http_req_failed": [ "rate<0.01" ], + "http_req_duration": [ "p(95)<1000" ] + } +} diff --git a/packages/k6-tests/config/test.js b/packages/k6-tests/config/test.js deleted file mode 100644 index 0bc78bed..00000000 --- a/packages/k6-tests/config/test.js +++ /dev/null @@ -1,39 +0,0 @@ -// Main configuration for Scripts - -const config = { - // # define scenarios - "scenarios": { - "accountLookup": { // # original scenario for accountLookup - "executor": "ramping-vus", - "exec": "accountLookupScenarios", - "startVUs": 1, - "stages": [ - { "duration": "2m", "target": 6 }, - { "duration": "5m", "target": 6 }, - { "duration": "2m", "target": 0 } - ] - }, - // # Example using "ramping-arrival-rate" executor - // "accountLookup": { - // "executor": "ramping-arrival-rate", - // "exec": "accountLookupScenarios", - // "preAllocatedVUs": 10, - // "timeUnit": "1s", - // "startRate": 1, - // "stages": [ - // { "target": 400, "duration": "2m" }, - // { "target": 400, "duration": "15m" }, - // { "target": 0, "duration": "2m"}, - // ] - // } - }, - "thresholds": { - "iteration_duration": [ "p(95)<1000" ], - "http_req_failed": [ "rate<0.01" ], - "http_req_duration": [ "p(95)<1000" ] - } -}; - -export default () => { - return config; -}; diff --git a/packages/k6-tests/config/test.json b/packages/k6-tests/config/test.json new file mode 100644 index 00000000..43be4c64 --- /dev/null +++ b/packages/k6-tests/config/test.json @@ -0,0 +1,17 @@ +{ + "scenarios": { + "test": { + "executor": "ramping-vus", + "exec": "testScenarios", + "startVUs": 1, + "stages": [ + { "duration": "10s", "target": 6 } + ] + } + }, + "thresholds": { + "iteration_duration": [ "p(95)<1000" ], + "http_req_failed": [ "rate<0.01" ], + "http_req_duration": [ "p(95)<1000" ] + } +} diff --git a/packages/k6-tests/index.js b/packages/k6-tests/index.js index 99dd47cb..8ebe4f0a 100644 --- a/packages/k6-tests/index.js +++ b/packages/k6-tests/index.js @@ -1,11 +1,8 @@ -export { accountLookupScenarios } from './scenarios/accountLookup.js'; +export { fspiopDiscoveryScenarios } from './scenarios/fspiopDiscovery.js'; +export { fspiopTransfersScenarios } from './scenarios/fspiopTransfers.js'; -// export testConfig from __ENV.K6_SCRIPT_CONFIG_FILE || './config/test.js'; - -import testConfig from './config/test.js'; - -// const configFile = __ENV.CONFIG_FILE || './config/test.json'; -// const testConfig = JSON.parse(open(configFile)); +const configFile = __ENV.K6_SCRIPT_CONFIG_FILE_NAME ? './config/' + __ENV.K6_SCRIPT_CONFIG_FILE_NAME : './config/test.json'; +const testConfig = JSON.parse(open(configFile)); export const options = Object.assign( { // default configs @@ -13,7 +10,7 @@ export const options = Object.assign( testid: `${Date.now()}`, }, }, - testConfig() // imported config + testConfig ); // used to store global variables @@ -23,6 +20,6 @@ globalThis.VARS = []; globalThis.PAUSE_MIN = __ENV.K6_SCRIPT_PAUSE_MIN || 5; globalThis.PAUSE_MAX = __ENV.K6_SCRIPT_PAUSE_MAX || 15; -export default function() { +export default async () => { console.log("No scenarios found in config/test.json. Executing default function..."); } diff --git a/packages/k6-tests/scenarios/accountLookup.js b/packages/k6-tests/scenarios/fspiopDiscovery.js similarity index 75% rename from packages/k6-tests/scenarios/accountLookup.js rename to packages/k6-tests/scenarios/fspiopDiscovery.js index 988eca84..99130795 100644 --- a/packages/k6-tests/scenarios/accountLookup.js +++ b/packages/k6-tests/scenarios/fspiopDiscovery.js @@ -2,6 +2,6 @@ import { getParties } from "../scripts/getParties.js"; import http from 'k6/http'; import exec from 'k6/execution'; -export function accountLookupScenarios() { +export function fspiopDiscoveryScenarios() { getParties(); } diff --git a/packages/k6-tests/scenarios/fspiopTransfers.js b/packages/k6-tests/scenarios/fspiopTransfers.js new file mode 100644 index 00000000..d59675c2 --- /dev/null +++ b/packages/k6-tests/scenarios/fspiopTransfers.js @@ -0,0 +1,6 @@ +import { postTransfers } from "../scripts/postTransfers.js"; + + +export function fspiopTransfersScenarios() { + postTransfers(); +} diff --git a/packages/k6-tests/scripts/getParties.js b/packages/k6-tests/scripts/getParties.js index 98ab000d..e5e0eef4 100644 --- a/packages/k6-tests/scripts/getParties.js +++ b/packages/k6-tests/scripts/getParties.js @@ -3,32 +3,47 @@ import { check, fail, sleep, group } from 'k6'; import crypto from "k6/crypto"; import { WebSocket } from 'k6/experimental/websockets'; import { setTimeout, clearTimeout, setInterval, clearInterval } from 'k6/experimental/timers'; -import { randomIntBetween } from "https://jslib.k6.io/k6-utils/1.1.0/index.js"; +import { randomItem } from "https://jslib.k6.io/k6-utils/1.1.0/index.js"; import { Trace } from "../common/trace.js"; + +// K6_SCRIPT_FSPIOP_ALS_PAYEE_PARTYID=${__ENV.K6_SCRIPT_FSPIOP_ALS_PAYEE_PARTYID}, +// K6_SCRIPT_FSPIOP_PAYER_FSP_ID=${__ENV.K6_SCRIPT_FSPIOP_PAYER_FSP_ID}, +// K6_SCRIPT_FSPIOP_PAYEE_FSP_ID=${__ENV.K6_SCRIPT_FSPIOP_PAYEE_FSP_ID}, +// K6_SCRIPT_CALLBACK_HANDLER_SERVICE_WS_URL=${__ENV.K6_SCRIPT_CALLBACK_HANDLER_SERVICE_WS_URL}, + console.log(`Env Vars --> K6_SCRIPT_WS_TIMEOUT_MS=${__ENV.K6_SCRIPT_WS_TIMEOUT_MS}, K6_SCRIPT_FSPIOP_ALS_ENDPOINT_URL=${__ENV.K6_SCRIPT_FSPIOP_ALS_ENDPOINT_URL}, - K6_SCRIPT_FSPIOP_ALS_PAYEE_PARTYID=${__ENV.K6_SCRIPT_FSPIOP_ALS_PAYEE_PARTYID}, - K6_SCRIPT_FSPIOP_PAYER_FSP_ID=${__ENV.K6_SCRIPT_FSPIOP_PAYER_FSP_ID}, - K6_SCRIPT_FSPIOP_PAYEE_FSP_ID=${__ENV.K6_SCRIPT_FSPIOP_PAYEE_FSP_ID}, - K6_SCRIPT_CALLBACK_HANDLER_SERVICE_WS_URL=${__ENV.K6_SCRIPT_CALLBACK_HANDLER_SERVICE_WS_URL}, K6_SCRIPT_ADMIN_ENDPOINT_URL=${__ENV.K6_SCRIPT_ADMIN_ENDPOINT_URL}, - K6_SCRIPT_ORACLE_ENDPOINT_URL=${__ENV.K6_SCRIPT_ORACLE_ENDPOINT_URL} + K6_SCRIPT_ORACLE_ENDPOINT_URL=${__ENV.K6_SCRIPT_ORACLE_ENDPOINT_URL}, + K6_SCRIPT_FSPIOP_FSP_POOL=${__ENV.K6_SCRIPT_FSPIOP_FSP_PAYER_POOL} `); +const fspList = JSON.parse(__ENV.K6_SCRIPT_FSPIOP_FSP_POOL) + export function getParties() { group("Get Parties", function () { + let payerFsp + let payeeFsp + if (__ENV.UNIDIRECTIONAL === "true" || __ENV.UNIDIRECTIONAL === "TRUE") { + payerFsp = fspList[0] + payeeFsp = fspList[1] + } else { + const randomSortedFsp = fspList.concat().sort(() => randomItem([-1,1])).slice(0, 2); + payerFsp = randomSortedFsp[0] + payeeFsp = randomSortedFsp[1] + } const startTs = Date.now(); - - const payeeId = `${__ENV.K6_SCRIPT_FSPIOP_ALS_PAYEE_PARTYID}`; - const payerFspId = `${__ENV.K6_SCRIPT_FSPIOP_PAYER_FSP_ID}`; - const payeeFspId = `${__ENV.K6_SCRIPT_FSPIOP_PAYEE_FSP_ID}`; + const payeeId = payeeFsp['partyId']; + const payerFspId = payerFsp['fspId']; + const payeeFspId = payeeFsp['fspId']; + const wsUrl = payerFsp['wsUrl']; const traceParent = Trace(); const traceId = traceParent.traceId; const wsChannel = `${traceParent.traceId}/PUT/parties/MSISDN/${payeeId}`; - const wsURL = `${__ENV.K6_SCRIPT_CALLBACK_HANDLER_SERVICE_WS_URL}/${wsChannel}` + const wsURL = `${wsUrl}/${wsChannel}` const ws = new WebSocket(wsURL); const wsTimeoutMs = Number(__ENV.K6_SCRIPT_WS_TIMEOUT_MS) || 2000; // user session between 5s and 1m @@ -60,10 +75,14 @@ export function getParties() { ws.onopen = () => { console.info(traceId, `WS open on URL: ${wsURL}`); const params = { + tags: { + payerFspId, + payeeFspId + }, headers: { 'Accept': 'application/vnd.interoperability.parties+json;version=1.1', 'Content-Type': 'application/vnd.interoperability.parties+json;version=1.1', - 'FSPIOP-Source': 'perffsp1', + 'FSPIOP-Source': payerFspId, 'Date': (new Date()).toUTCString(), 'traceparent': traceParent.toString(), 'tracestate': `tx_end2end_start_ts=${startTs}` diff --git a/packages/k6-tests/scripts/postTransfers.js b/packages/k6-tests/scripts/postTransfers.js new file mode 100644 index 00000000..f4cb8e64 --- /dev/null +++ b/packages/k6-tests/scripts/postTransfers.js @@ -0,0 +1,116 @@ +import http from 'k6/http'; +import { crypto } from "k6/experimental/webcrypto"; +import { check, fail, sleep, group } from 'k6'; +import { WebSocket } from 'k6/experimental/websockets'; +import { setTimeout, clearTimeout, setInterval, clearInterval } from 'k6/experimental/timers'; +import { Trace } from "../common/trace.js"; +import { getTwoItemsFromArray } from "../common/utils.js"; + +console.log(`Env Vars --> + K6_SCRIPT_WS_TIMEOUT_MS=${__ENV.K6_SCRIPT_WS_TIMEOUT_MS}, + K6_SCRIPT_FSPIOP_TRANSFERS_ENDPOINT_URL=${__ENV.K6_SCRIPT_FSPIOP_TRANSFERS_ENDPOINT_URL}, + K6_SCRIPT_FSPIOP_FSP_POOL=${__ENV.K6_SCRIPT_FSPIOP_FSP_POOL} +`); + +const fspList = JSON.parse(__ENV.K6_SCRIPT_FSPIOP_FSP_POOL) + +const ilpPacket = __ENV.K6_SCRIPT_FSPIOP_TRANSFERS_ILPPACKET +const condition = __ENV.K6_SCRIPT_FSPIOP_TRANSFERS_CONDITION +const amount = __ENV.K6_SCRIPT_FSPIOP_TRANSFERS_AMOUNT.toString() +const currency = __ENV.K6_SCRIPT_FSPIOP_TRANSFERS_CURRENCY + +export function postTransfers() { + group("Post Transfers", function () { + let payerFsp + let payeeFsp + + if (__ENV.UNIDIRECTIONAL === "true" || __ENV.UNIDIRECTIONAL === "TRUE") { + payerFsp = fspList[0] + payeeFsp = fspList[1] + } else { + const selectedFsps = getTwoItemsFromArray(fspList) + payerFsp = selectedFsps[0] + payeeFsp = selectedFsps[1] + } + + const startTs = Date.now(); + const transferId = crypto.randomUUID(); + const payerFspId = payerFsp['fspId']; + const payeeFspId = payeeFsp['fspId']; + const wsUrl = payerFsp['wsUrl']; + const traceParent = Trace(); + const traceId = traceParent.traceId; + const wsChannel = `${traceParent.traceId}/PUT/transfers/${transferId}`; + const wsURL = `${wsUrl}/${wsChannel}` + const ws = new WebSocket(wsURL); + const wsTimeoutMs = Number(__ENV.K6_SCRIPT_WS_TIMEOUT_MS) || 2000; // user session between 5s and 1m + + var wsTimeoutId = null; + + const clearTimers = () => { + if (wsTimeoutId) { clearTimeout(wsTimeoutId); wsTimeoutId=null } + } + + ws.onclose(() => { + clearTimers(); + }); + + ws.onerror((err) => { + console.error(traceId, err); + check(err, { 'TRANSFERS_E2E_FSPIOP_POST_TRANSFERS_SUCCESS': (cbMessage) => false }); + clearTimers(); + ws.close(); + }); + + ws.onmessage = (event) => { + console.info(traceId, `WS message received [${wsChannel}]: ${event.data}`); + check(event.data, { 'TRANSFERS_E2E_FSPIOP_POST_TRANSFERS_SUCCESS': (cbMessage) => cbMessage == 'SUCCESS_CALLBACK_RECEIVED' }); + clearTimers(); + ws.close(); + // sleep(1); + }; + + ws.onopen = () => { + console.info(traceId, `WS open on URL: ${wsURL}`); + const params = { + tags: { + payerFspId, + payeeFspId + }, + headers: { + 'Accept': 'application/vnd.interoperability.transfers+json;version=1.1', + 'Content-Type': 'application/vnd.interoperability.transfers+json;version=1.1', + 'FSPIOP-Source': payerFspId, + 'FSPIOP-Destination': payeeFspId, + 'Date': (new Date()).toUTCString(), + 'traceparent': traceParent.toString(), + 'tracestate': `tx_end2end_start_ts=${startTs}` + }, + }; + + const body = { + "transferId": transferId, + "payerFsp": payerFspId, + "payeeFsp": payeeFspId, + "amount": { + amount, + currency + }, + "expiration": "2030-01-01T00:00:00.000Z", + ilpPacket, + condition + } + + // Lets send the FSPIOP POST /transfers request + const res = http.post(`${__ENV.K6_SCRIPT_FSPIOP_TRANSFERS_ENDPOINT_URL}/transfers`, JSON.stringify(body), params); + check(res, { 'TRANSFERS_FSPIOP_POST_TRANSFERS_RESPONSE_IS_202' : (r) => r.status == 202 }); + + wsTimeoutId = setTimeout(() => { + const errorMsg = `WS timed-out on URL: ${wsURL}` + console.error(traceId, errorMsg); + check(res, { 'TRANSFERS_E2E_FSPIOP_POST_TRANSFERS_SUCCESS': (cbMessage) => false }); + ws.close(); + }, wsTimeoutMs); + }; + }); +} diff --git a/packages/kafaka-partitioner-calculator/.gitignore b/packages/kafaka-partitioner-calculator/.gitignore new file mode 100644 index 00000000..b512c09d --- /dev/null +++ b/packages/kafaka-partitioner-calculator/.gitignore @@ -0,0 +1 @@ +node_modules \ No newline at end of file diff --git a/packages/kafaka-partitioner-calculator/fsp_partition.js b/packages/kafaka-partitioner-calculator/fsp_partition.js new file mode 100644 index 00000000..80ee89d5 --- /dev/null +++ b/packages/kafaka-partitioner-calculator/fsp_partition.js @@ -0,0 +1,48 @@ +const FSPS = ['perffsp1','perffsp2','perffsp3','perffsp4','perffsp5','perffsp6','perffsp7','perffsp8'] +const PARTITION_NUM = 17 + +function MurmurHashV2(str, seed) { + var + l = str.length, + h = seed ^ l, + i = 0, + k; + + while (l >= 4) { + k = + ((str.charCodeAt(i) & 0xff)) | + ((str.charCodeAt(++i) & 0xff) << 8) | + ((str.charCodeAt(++i) & 0xff) << 16) | + ((str.charCodeAt(++i) & 0xff) << 24); + + k = (((k & 0xffff) * 0x5bd1e995) + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16)); + k ^= k >>> 24; + k = (((k & 0xffff) * 0x5bd1e995) + ((((k >>> 16) * 0x5bd1e995) & 0xffff) << 16)); + + h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16)) ^ k; + + l -= 4; + ++i; + } + + switch (l) { + case 3: h ^= (str.charCodeAt(i + 2) & 0xff) << 16; + case 2: h ^= (str.charCodeAt(i + 1) & 0xff) << 8; + case 1: h ^= (str.charCodeAt(i) & 0xff); + h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16)); + } + + h ^= h >>> 13; + h = (((h & 0xffff) * 0x5bd1e995) + ((((h >>> 16) * 0x5bd1e995) & 0xffff) << 16)); + h ^= h >>> 15; + + return h >>> 0; +}; + +let fspPartitionMap = {} + +for (var fsp of FSPS) { + fspPartitionMap[fsp] = (MurmurHashV2(fsp, 0x9747b28c) & 0x7ffffff) % PARTITION_NUM; +} + +console.log(fspPartitionMap) diff --git a/packages/kafaka-partitioner-calculator/index.js b/packages/kafaka-partitioner-calculator/index.js new file mode 100644 index 00000000..a9d18591 --- /dev/null +++ b/packages/kafaka-partitioner-calculator/index.js @@ -0,0 +1,44 @@ +const utf8 = require('utf8'); +murmurhash = require('murmurhash'); + +const FSP_PREFIX = 'perffsp' +const FSP_NUM = 8 + +const MAX_INTEGER_SIGNED = 0x7fffffff // ref: https://github.com/apache/pinot/blob/master/pinot-segment-spi/src/main/java/org/apache/pinot/segment/spi/partition/MurmurPartitionFunction.java#L45 +const KAFKA_SEED = 0x9747b28c // ref: https://github.com/a0x8o/kafka/blob/master/clients/src/main/java/org/apache/kafka/common/utils/Utils.java#L481 + +const ATTEMPTS = parseInt(process.env.ATTEMPTS) || 100 + +function getPartitionAllocationMap(totalPartitions, breakOnCollision = false) { + let partitionFspMap = {} + + for (let i=1; i<=FSP_NUM; i++) { + const fsp = FSP_PREFIX + i + const hash = murmurhash.v2(utf8.encode(fsp), KAFKA_SEED) + const selectedPartition = (hash & MAX_INTEGER_SIGNED) % totalPartitions; + if (partitionFspMap[selectedPartition]) { + if(breakOnCollision) { + return null + } + partitionFspMap[selectedPartition].push(fsp) + } else { + partitionFspMap[selectedPartition] = [ fsp ] + } + } + return partitionFspMap +} + +// const PARTITION_NUM = 17 +// const result = getPartitionAllocationMap(PARTITION_NUM) +// console.log(`Partition allocation for ${PARTITION_NUM} partitions`,result) +let isResult = false +for (let partNumCount=1; partNumCount<=ATTEMPTS; partNumCount++) { + const result = getPartitionAllocationMap(partNumCount, true) + if (result) { + isResult = true + console.log(`Partition allocation for ${partNumCount} partitions`,result) + break + } +} + +if (!isResult) console.error(`Unable to find a no-colission solution after ${ATTEMPTS} attempts!`) diff --git a/packages/kafaka-partitioner-calculator/package-lock.json b/packages/kafaka-partitioner-calculator/package-lock.json new file mode 100644 index 00000000..89874878 --- /dev/null +++ b/packages/kafaka-partitioner-calculator/package-lock.json @@ -0,0 +1,36 @@ +{ + "name": "kafaka-partitioner-calculator", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "kafaka-partitioner-calculator", + "version": "1.0.0", + "license": "ISC", + "dependencies": { + "install": "^0.13.0", + "murmurhash": "^2.0.1", + "utf8": "^3.0.0" + } + }, + "node_modules/install": { + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/install/-/install-0.13.0.tgz", + "integrity": "sha512-zDml/jzr2PKU9I8J/xyZBQn8rPCAY//UOYNmR01XwNwyfhEWObo2SWfSl1+0tm1u6PhxLwDnfsT/6jB7OUxqFA==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/murmurhash": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/murmurhash/-/murmurhash-2.0.1.tgz", + "integrity": "sha512-5vQEh3y+DG/lMPM0mCGPDnyV8chYg/g7rl6v3Gd8WMF9S429ox3Xk8qrk174kWhG767KQMqqxLD1WnGd77hiew==" + }, + "node_modules/utf8": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/utf8/-/utf8-3.0.0.tgz", + "integrity": "sha512-E8VjFIQ/TyQgp+TZfS6l8yp/xWppSAHzidGiRrqe4bK4XP9pTRyKFgGJpO3SN7zdX4DeomTrwaseCHovfpFcqQ==" + } + } +} diff --git a/packages/kafaka-partitioner-calculator/package.json b/packages/kafaka-partitioner-calculator/package.json new file mode 100644 index 00000000..7ec32bb4 --- /dev/null +++ b/packages/kafaka-partitioner-calculator/package.json @@ -0,0 +1,17 @@ +{ + "name": "kafaka-partitioner-calculator", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "start": "node ./index.js", + "test": "echo \"Error: no test specified\" && exit 1" + }, + "author": "", + "license": "ISC", + "dependencies": { + "install": "^0.13.0", + "murmurhash": "^2.0.1", + "utf8": "^3.0.0" + } +} diff --git a/perf.env b/perf.env index fa1b7734..d80a11d3 100644 --- a/perf.env +++ b/perf.env @@ -1,17 +1,3 @@ -## -== Callback Handler SVC Env Vars ==- - -### FSPIOP Handlers -#### Use this if we want to hit the ALS -CBH_FSPIOP_ALS_ENDPOINT_URL=http://account-lookup-service:4002 -#### Use this if we want to bypass ALS -# CBH_FSPIOP_ALS_ENDPOINT_URL=http://callback-handler-svc-payer-sim:3001/fspiop -CBH_FSPIOP_PAYER_FSP_ID=perffsp1 -CBH_FSPIOP_PAYEE_FSP_ID=perffsp2 - -### Admin Handlers -CBH_ADMIN_FSPIOP_PAYER_CALLBACK_URL=http://callback-handler-svc-payer-sim:3001/fspiop -CBH_ADMIN_FSPIOP_PAYEE_CALLBACK_URL=http://callback-handler-svc-payee-sim:3001/fspiop - ## -== K6 Configs ==- ### K6 Engine @@ -29,10 +15,79 @@ K6_SCRIPT_WS_TIMEOUT_MS=2000 #### Use this if we want to hit the ALS K6_SCRIPT_FSPIOP_ALS_ENDPOINT_URL=http://account-lookup-service:4002 #### Use this if we want to bypass ALS -# K6_SCRIPT_FSPIOP_ALS_ENDPOINT_URL=http://callback-handler-svc-payee-sim:3001/fspiop -K6_SCRIPT_FSPIOP_ALS_PAYEE_PARTYID=19012345002 -K6_SCRIPT_FSPIOP_PAYER_FSP_ID=perffsp1 -K6_SCRIPT_FSPIOP_PAYEE_FSP_ID=perffsp2 -K6_SCRIPT_CALLBACK_HANDLER_SERVICE_WS_URL=ws://callback-handler-svc-payer-sim:3002 +# K6_SCRIPT_FSPIOP_ALS_ENDPOINT_URL=http://perffsp2:3001/fspiop + + +# [ +# {"partyId":19012345001,"fspId":"perffsp1","wsUrl":"ws://sim-perffsp1:3002"}, +# {"partyId":19012345002,"fspId":"perffsp2","wsUrl":"ws://sim-perffsp2:3002"}, +# {"partyId":19012345003,"fspId":"perffsp3","wsUrl":"ws://sim-perffsp3:3002"}, +# {"partyId":19012345004,"fspId":"perffsp4","wsUrl":"ws://sim-perffsp4:3002"}, +# {"partyId":19012345005,"fspId":"perffsp5","wsUrl":"ws://sim-perffsp5:3002"}, +# {"partyId":19012345006,"fspId":"perffsp6","wsUrl":"ws://sim-perffsp6:3002"}, +# {"partyId":19012345007,"fspId":"perffsp7","wsUrl":"ws://sim-perffsp7:3002"}, +# {"partyId":19012345008,"fspId":"perffsp8","wsUrl":"ws://sim-perffsp8:3002"}, +# ] +## IMPORTANT: Update pool depending 2dfsp, 4dfsp or 8dfsp docker profile +## NOTE: Unidirectional will take the first two DFSP's in the pool +# 8 DFSPs +K6_SCRIPT_FSPIOP_FSP_POOL='[{"partyId":19012345001,"fspId":"perffsp1","wsUrl":"ws://sim-perffsp1:3002"},{"partyId":19012345002,"fspId":"perffsp2","wsUrl":"ws://sim-perffsp2:3002"},{"partyId":19012345003,"fspId":"perffsp3","wsUrl":"ws://sim-perffsp3:3002"},{"partyId":19012345004,"fspId":"perffsp4","wsUrl":"ws://sim-perffsp4:3002"},{"partyId":19012345005,"fspId":"perffsp5","wsUrl":"ws://sim-perffsp5:3002"},{"partyId":19012345006,"fspId":"perffsp6","wsUrl":"ws://sim-perffsp6:3002"},{"partyId":19012345007,"fspId":"perffsp7","wsUrl":"ws://sim-perffsp7:3002"},{"partyId":19012345008,"fspId":"perffsp8","wsUrl":"ws://sim-perffsp8:3002"}]' +# 2 DFSPs +# K6_SCRIPT_FSPIOP_FSP_POOL='[{"partyId":19012345001,"fspId":"perffsp1","wsUrl":"ws://sim-perffsp1:3002"},{"partyId":19012345002,"fspId":"perffsp2","wsUrl":"ws://sim-perffsp2:3002"}]' +# 4 DFSPs +# K6_SCRIPT_FSPIOP_FSP_POOL='[{"partyId":19012345001,"fspId":"perffsp1","wsUrl":"ws://sim-perffsp1:3002"},{"partyId":19012345002,"fspId":"perffsp2","wsUrl":"ws://sim-perffsp2:3002"},{"partyId":19012345003,"fspId":"perffsp3","wsUrl":"ws://sim-perffsp3:3002"},{"partyId":19012345004,"fspId":"perffsp4","wsUrl":"ws://sim-perffsp4:3002"}]' + + K6_SCRIPT_ADMIN_ENDPOINT_URL=http://callback-handler-svc-cl-sim:3001/admin K6_SCRIPT_ORACLE_ENDPOINT_URL=http://callback-handler-svc-oracle-sim:3001/oracle + +K6_SCRIPT_FSPIOP_TRANSFERS_ENDPOINT_URL=http://ml-api-adapter:3000 +# K6_SCRIPT_FSPIOP_TRANSFERS_ENDPOINT_URL=http://sim-perffsp2:3001/fspiop + +K6_SCRIPT_FSPIOP_TRANSFERS_ILPPACKET='AYIDGQAAAAAAACcQIWcuZ3JlZW5iYW5rZnNwLm1zaXNkbi4yNzcxMzgwMzkxMoIC62V5SjBjbUZ1YzJGamRHbHZia2xrSWpvaU1ERXhaR1EyTldZdE5UQXpNeTAwTVdNMkxUazFaR1l0T1RFeFl6WTRPVFExWWpobUlpd2ljWFZ2ZEdWSlpDSTZJbVF3TXpJMU1EVTJMVE0xTldFdE5EUmxNUzFpT1RnMExXWXdZVFExTmpFMFkyRXpPQ0lzSW5CaGVXVmxJanA3SW5CaGNuUjVTV1JKYm1adklqcDdJbkJoY25SNVNXUlVlWEJsSWpvaVRWTkpVMFJPSWl3aWNHRnlkSGxKWkdWdWRHbG1hV1Z5SWpvaU1qYzNNVE00TURNNU1USWlMQ0ptYzNCSlpDSTZJbWR5WldWdVltRnVhMlp6Y0NKOWZTd2ljR0Y1WlhJaU9uc2ljR0Z5ZEhsSlpFbHVabThpT25zaWNHRnlkSGxKWkZSNWNHVWlPaUpOVTBsVFJFNGlMQ0p3WVhKMGVVbGtaVzUwYVdacFpYSWlPaUkwTkRFeU16UTFOamM0T1NJc0ltWnpjRWxrSWpvaWNHbHVhMkpoYm10bWMzQWlmU3dpY0dWeWMyOXVZV3hKYm1adklqcDdJbU52YlhCc1pYaE9ZVzFsSWpwN0ltWnBjbk4wVG1GdFpTSTZJa1pwY25OMGJtRnRaUzFVWlhOMElpd2liR0Z6ZEU1aGJXVWlPaUpNWVhOMGJtRnRaUzFVWlhOMEluMHNJbVJoZEdWUFprSnBjblJvSWpvaU1UazROQzB3TVMwd01TSjlmU3dpWVcxdmRXNTBJanA3SW1OMWNuSmxibU41SWpvaVZWTkVJaXdpWVcxdmRXNTBJam9pTVRBd0luMHNJblJ5WVc1ellXTjBhVzl1Vkhsd1pTSTZleUp6WTJWdVlYSnBieUk2SWxSU1FVNVRSa1ZTSWl3aWFXNXBkR2xoZEc5eUlqb2lVRUZaUlZJaUxDSnBibWwwYVdGMGIzSlVlWEJsSWpvaVEwOU9VMVZOUlZJaWZYMAA' +K6_SCRIPT_FSPIOP_TRANSFERS_CONDITION='5m0gq_5dLQlTSSRKQmLpj0MZ1MtWLWgSu1oLGVTJyYs' +K6_SCRIPT_FSPIOP_TRANSFERS_AMOUNT=2 +K6_SCRIPT_FSPIOP_TRANSFERS_CURRENCY=USD + +K6_SCRIPT_CONFIG_FILE_NAME=test.json + +KAFKA_PARTITIONS_NUM=19 + +## General Config +UV_THREADPOOL_SIZE=24 +LOG_LEVEL=info +# EVENT_SDK_TRACEID_PER_VENDOR=false +# EVENT_SDK_LOG_FILTER="" + +ALS_DATABASE__HOST=mysql-als +ALS_DATABASE__USER=account_lookup +ALS_DATABASE__PASSWORD=password +ALS_DATABASE__SCHEMA=account_lookup + +## CLEDG - Central Ledger Env Config +CLEDG_CACHE__CACHE_ENABLED=true +## Cache duration: 2min - NOT WORKING +# CLEDG_CACHE__EXPIRES_IN_MS=120000 +# partition.assignment.strategy - range(default), roundrobin, cooperative-sticky +CLEDG_KAFKA__CONSUMER__TRANSFER__POSITION__config__rdkafkaConf__partition.assignment.strategy=cooperative-sticky + +CLEDG_DATABASE__PORT=3306 + +CLEDG_DATABASE__HOST=mysql-cl +CLEDG_DATABASE__USER=central_ledger +CLEDG_DATABASE__PASSWORD=password +CLEDG_DATABASE__SCHEMA=central_ledger + + +# CLEDG_DATABASE__HOST=oss-core-perf-db-1.cd3wbwtfazqy.eu-west-2.rds.amazonaws.com +# CLEDG_DATABASE__USER=admin +# CLEDG_DATABASE__PASSWORD=eWPPK3VmK1IlI4KSt2RI1sAEX9eUt1DZqyGF3suW +# CLEDG_DATABASE__SCHEMA=central_ledger + +# CLEDG_DATABASE__HOST=centralledger.cd3wbwtfazqy.eu-west-2.rds.amazonaws.com +# CLEDG_DATABASE__USER=userdb +# CLEDG_DATABASE__PASSWORD=X8eAz61f7L94ANdhs10G4MYWklSACeJjIq0a0YIu +# CLEDG_DATABASE__SCHEMA=centralledger + +## MLAPI - ML API Adapter API/Handler Config +MLAPI_TRANSFERS__SEND_TRANSFER_CONFIRMATION_TO_PAYEE=false diff --git a/reports/.gitignore b/reports/.gitignore deleted file mode 100644 index 9ebf3970..00000000 --- a/reports/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -# Ignore everything: -* - -# Except for the themes directories: -!.gitignore \ No newline at end of file