github.com/companieshouse/lfp-pay-api@v0.0.0-20230203133422-0ca455cd79f9/README.md (about) 1 # LFP PAY API 2 3 LFP PAY API which provides an interface for Creating, Getting, and Patching LFPs. 4 5 ## Requirements 6 In order to run this API locally you will need to install the following: 7 8 - [Go](https://golang.org/doc/install) 9 - [Git](https://git-scm.com/downloads) 10 11 ## Getting Started 12 1. Clone this repository: `go get github.com/companieshouse/lfp-pay-api` 13 1. Build the executable: `make build` 14 15 ## Configuration 16 | Variable | Default | Description | 17 |:---------------------------------|:-------:|:----------------------------------------------------------------------| 18 | `E5_API_URL` | `-` | E5 API Address | 19 | `E5_USERNAME` | `-` | E5 API Username | 20 | `BIND_ADDR` | `-` | The host:port to bind to | 21 | `MONGODB_URL` | `-` | The mongo db connection string | 22 | `LFP_MONGODB_DATABASE` | `-` | The database name to connect to e.g. `late_filing_penalties` | 23 | `LFP_MONGODB_COLLECTION` | `-` | The collection name e.g. `payable_resources` | 24 | `KAFKA_BROKER_ADDR` | `_` | Kafka Broker Address | 25 | `SCHEMA_REGISTRY_URL` | `_` | Schema Registry URL | 26 | `CHS_URL` | `_` | CHS URL | 27 | `WEEKLY_MAINTENANCE_START_TIME` | `_` | Start time of weekly maintenance e.g. `0700` | 28 | `WEEKLY_MAINTENANCE_END_TIME` | `_` | End time of weekly maintenance e.g. `0730` | 29 | `WEEKLY_MAINTENANCE_DAY` | `_` | Day of weekly maintenance e.g. `0` (zero for Sunday) | 30 | `PLANNED_MAINTENANCE_START_TIME` | `_` | Start time and date of planned maintenance e.g. `01 Jan 19 15:04 BST` | 31 | `PLANNED_MAINTENANCE_END_TIME` | `_` | End time and date of planned maintenance e.g. `31 Jan 19 16:59 BST` | 32 33 ## Endpoints 34 | Method | Path | Description | 35 |:----------|:-----------------------------------------------------------------------|:----------------------------------------------------------------------| 36 | **GET** | `/healthcheck` | Standard healthcheck endpoint | 37 | **GET** | `/healthcheck/finance-system` | Healthcheck endpoint to check whether the finance system is available | 38 | **GET** | `/company/{company_number}/penalties/late-filing` | List the Late Filing Penalties for a company | 39 | **POST** | `/company/{company_number}/penalties/late-filing/payable` | Create a payable penalty resource | 40 | **GET** | `/company/{company_number}/penalties/late-filing/payable/{id}` | Get a payable resource | 41 | **GET** | `/company/{company_number}/penalties/late-filing/payable/{id}/payment` | List the cost items related to the penalty resource | 42 | **PATCH** | `/company/{company_number}/penalties/late-filing/payable/{id}/payment` | Mark the resource as paid | 43 44 ## External Finance Systems 45 The only external finance system currently supported is E5. 46 47 ## Docker support 48 49 Pull image from private CH registry by running `docker pull 169942020521.dkr.ecr.eu-west-1.amazonaws.com/local/lfp-pay-api:latest` command or run the following steps to build image locally: 50 51 1. `export SSH_PRIVATE_KEY_PASSPHRASE='[your SSH key passhprase goes here]'` (optional, set only if SSH key is passphrase protected) 52 2. `DOCKER_BUILDKIT=0 docker build --build-arg SSH_PRIVATE_KEY="$(cat ~/.ssh/id_rsa)" --build-arg SSH_PRIVATE_KEY_PASSPHRASE -t 169942020521.dkr.ecr.eu-west-1.amazonaws.com/local/lfp-pay-api:latest .`