No description
This repository has been archived on 2026-04-20. You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
  • Python 97%
  • HTML 1.7%
  • Dockerfile 1.1%
  • Shell 0.2%
Find a file
Chris Pressland 3393f1ec17
Some checks failed
ci / tests (push) Failing after 1m14s
ci / release_dev (push) Has been skipped
ci / release_staging (push) Has been skipped
ci / release_production (push) Has been skipped
RET-2774 - Remove Linkerd from Dockerfile (#24)
Co-authored-by: backwardspy <cl@bink.com>
2024-03-05 11:55:19 +00:00
.github/workflows Remove unused tests 2024-02-06 13:30:43 +00:00
eos Add to CSRF Origins 2024-02-06 15:11:09 +00:00
mids Migrate to Python 3.11 and Poetry 2023-03-03 09:44:40 +00:00
templates Migrate to Python 3.11 and Poetry 2023-03-03 09:44:40 +00:00
tests Migrate to Python 3.11 and Poetry 2023-03-03 09:44:40 +00:00
.gitignore Migrate to Python 3.11 and Poetry 2023-03-03 09:44:40 +00:00
Dockerfile RET-2774 - Remove Linkerd from Dockerfile (#24) 2024-03-05 11:55:19 +00:00
entrypoint.sh RET-2774 - Remove Linkerd from Dockerfile (#24) 2024-03-05 11:55:19 +00:00
manage.py Migrate to Python 3.11 and Poetry 2023-03-03 09:44:40 +00:00
mypy.ini Migrate to Python 3.11 and Poetry 2023-03-03 09:44:40 +00:00
poetry.lock Bump cryptography from 42.0.0 to 42.0.4 2024-02-27 17:59:45 +00:00
pyproject.toml Bump requests from 2.28.2 to 2.31.0 2024-02-06 14:02:42 +00:00
README.md Use standard app dir 2021-02-16 20:35:14 +00:00

Eos

Sibling of Selene. Manager of Amex MID on/off-boarding.

Accepts "batch" CSV files in the following format allowing actions to be performed on the Amex MID on/off-boarding API:

mid,start_date,end_date,merchant_slug,provider_slug,action
4548436161,2021-01-01,2999-12-31,bink_test_merchant,amex,a
5934398301,2021-01-01,2999-12-31,bink_test_merchant,amex,a
3945029385,2021-01-01,2999-12-31,bink_test_merchant,amex,d

Processing of individual items corresponding to individual calls to the onboarding API are handled by an RQ worker.

Prerequisites

Project design overview

This is a vanilla Django project leaning heavily on the django.contrib.admin app. It makes use of an RQ (Redis) queue to process API call tasks to the Amex API.

Project Setup

Pipenv is used for managing project dependencies and execution.

Virtual Environment

To create a virtualenv and install required software packages:

pipenv install --dev

Project configuration is done through environment variables. A convenient way to set these is in a .env file in the project root. This file will be sourced by Pipenv when pipenv run and pipenv shell are used.

To make a .env file from the example below:

DEBUG=True
DATABASE_HOST=localhost
DATABASE_USER=<username>
DATABASE_PASSWORD=<password> (if required)
KEY_VAULT=https://bink-uksouth-dev-com.vault.azure.net/
AMEX_API_HOST=https://api.dev2s.americanexpress.com
AMEX_CLIENT_ID=<client_id - optional if in the vault>
AMEX_CLIENT_SECRET=<client_secret - optional if in the vault>
REDIS_URL=redis://localhost:6379/0

Other Django settings may be overridable in the .env file. See the app.settings module.

Database

The default database is called eos. Be sure to create a new postgres database and run the migrations prior to running the development server.

postgres=# CREATE DATABASE eos;
cd eos
pipenv run python manage.py migrate

Development Server

The Django development server is used for running the project locally. This should be replaced with a WSGI-compatible server for deployment to a live environment.

To run the django development server:

pipenv run python manage.py runserver

Unit Tests

To execute a full test run:

cd eos
pipenv run python manage.py test

Deployment

There is a Dockerfile provided in the project root. Build an image from this to get a deployment-ready version of the project.