transaction-service v1.58.2
Transaction Service
This service handles the parsing of uploaded transaction files. It then performs the following steps:
- Put the raw file in a bucket
- Parse the input (MT940, CAMT.053, intermediate)
- Convert (or pass through) to intermediate format, put in the next bucket
- Insert file -> statements -> transactions into database
- Create timelines of consecutive statements
- Filter out duplicate transactions
The service provides timelines and (limited) transaction information to other services through endpoints and events.
Swagger
Swagger is automatically generated, and is available from the artifacts here.
Commands
- Install dependencies
yarn install
- Run tests
yarn test
- Run locally:
- Have
docker
anddocker-compose
installed - Run
yarn start
- It sets up some infra (S3, SNS) locally
- Have
Folder Structure
We have chosen to use src/<subpackage>
as a folder structure, with a corresponding @<subpackage>
alias for includes. This way, we can develop submodules inside the project that can either be split off if needed, or they can remain there if it is highly coupled with the project. To simplify migrations to separate modules, we've defined
moduleNameMapper
insidepackage.json
paths
insidetsconfig.json
alias
insidewebpack.config.js
The three need to be in sync in order to work properly in every configuration (deploy, test, local run).
Considerations
Moment
We've had a discussion about using momentjs
or the more lightweight date-fns
, but for the scope of this project, date-fns
is lacking timezone support. date-fns
does support parsing timezone offsets (+01:00
suffix for example), but it cannot infer the timezone for a certain date in the past if the offset is missing. momentjs
does support setting a timezone and inferring the offset at a given date. As we have a mix of timezone-aware and timezone-unaware input, we decided to stick with moment
.
Dependencies
- Local deployment test:
- Docker
- docker-compose