Skip to content

DEFRA/ffc-pay-alerting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Payment Hub Alerting

Microservice to publish alerts from Payment Hub events via GOV.UK Notify.

This service is part of the Payment Hub.

Prerequisites

Optional:

Configuration

Azure Service Bus

This service publishes responses as messages to Azure Service Bus topics.

Name Description
MESSAGE_QUEUE_HOST Azure Service Bus hostname, e.g. myservicebus.servicebus.windows.net
MESSAGE_QUEUE_USER Azure Service Bus SAS policy name, e.g. RootManageSharedAccessKey
MESSAGE_QUEUE_PASSWORD Azure Service Bus SAS policy key
MESSAGE_QUEUE_SUFFIX Developer initials, optional, will be automatically added to topic names, e.g. -jw
ALERT_TOPIC_ADDRESS Azure Service Bus topic name for events, e.g. ffc-pay-alert
ALERT_SUBSCRIPTION_ADDRESS Azure Service Bus subscription name for events, e.g. ffc-pay-alerting
Message schemas

All message schemas are fully documented in an AsyncAPI specification.

Setup

Configuration

These configuration values should be set in the docker-compose.yaml file or Helm values file if running Kubernetes.

Name Description
APPINSIGHTS_CLOUDROLE Azure App Insights cloud role
APPINSIGHTS_CONNECTIONSTRING Azure App Insights connection string
DEV_TEAM_EMAILS ; separated list of developer email addresses, receives all system issue alerts
DEBT_ENRICHMENT_EMAILS ; separated list of debt enrichment email addresses, receives all debt enrichment alerts
INVALID_BANK_DETAILS_EMAILS ; separated list of invalid bank details email addresses, receives all invalid bank details alerts
CORE_SOLUTIONS_TEAM_EMAILS ; separated list of core solutions team email addresses, receives all Siti Agri alerts
SFI_EMAILS ; separated list of SFI email addresses, receives SFI alerts
ES_EMAILS ; separated list of ES email addresses, receives all ES alerts
FC_EMAILS ; separated list of FC email addresses, receives all FC alerts
TRADER_EMAILS ; separated list of trader email addresses, receives all trader alerts
VET_VISITS_EMAILS ; separated list of vet visits email addresses, receives all vet visits alerts
OPS_ANALYSIS_EMAILS ; separated list of operations analysis email addresses, receives all operations analysis related alerts
SFI_EXPANDED_EMAILS ; separated list of Expanded SFI Offer email addresses, receives all Expanded SFI Offer alerts
FFC_ENVIRONMENT Environment code; local, dev, test, pre or prod. Defaults to local
NOTIFY_API_KEY GOV.UK Notify API key
SEND_ALERTS true to send alerts, false to log alerts only. Defaults to true

Docker

Docker Compose can be used to build the container image.

docker compose build

The service will file watch application and test files so no need to rebuild the container unless a change to an npm package is made.

How to start the service

The service can be run using the start script.

./scripts/start

This script accepts any Docker Compose Up argument.

Debugging

A debugger can be attached to the running application using port 9329.

How to get an output

The output of this service is an email following receipt of a valid event received from the Azure Service Bus subscription.

Use the AsyncAPI specification to obtain a test input and submit to the Azure Service Bus topic, ffc-pay-alert.

You can use the Azure Storage Explorer to view the contents of the Azure Table Storage tables.

How to stop the service

The service can be stopped using the stop script.

./scripts/stop

The script accepts any Docker Compose Down argument.

For example, to stop the service and clear all data volumes.

./scripts/stop -v

How to test the service

The service can be tested using the test script.

./scripts/test

The script accepts the following arguments:

  • --watch/-w - run tests with file watching to support Test Driven Development scenarios (TDD)
  • --debug/-d - run tests in debug mode. Same as watch mode but will wait for a debugger to be attached before running tests.

CI pipeline

This service uses the FFC CI pipeline.

Licence

THIS INFORMATION IS LICENSED UNDER THE CONDITIONS OF THE OPEN GOVERNMENT LICENCE found at:

http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3

The following attribution statement MUST be cited in your products and applications when using this information.

Contains public sector information licensed under the Open Government license v3

About the licence

The Open Government Licence (OGL) was developed by the Controller of Her Majesty's Stationery Office (HMSO) to enable information providers in the public sector to license the use and re-use of their information under a common open licence.

It is designed to encourage use and re-use of information freely and flexibly, with only a few conditions.