npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

rabo

v0.1.5

Published

Rabobank Customer Statement Processor

Downloads

7

Readme

Rabobank Customer Statement Processor

"Rabobank receives monthly deliveries of customer statement records. This information is delivered in two formats, CSV and XML. These records need to be validated."


How to use

# install dependencies
npm i

# run tests
npm run test

# build
npm run build

# install the CLI globally
npm install -g .

# run the CLI
rabo -h

Simply run the CLI in a folder containing the input files (XML or CSV). The CLI will scan the folder and generate a JSON report of the failed transactions in the same folder. For more options, see the help menu (rabo -h).

You can also run the CLI with npx:

npx rabo

The challenge

The challenge is to implement an I/O API that can process the customer statement records and generate a report on any invalid records.

The customer statement records can be delivered in two file formats: CSV or XML. Records within these files need to be parsed and validated.

Validations:

  1. all records should have a unique transaction reference.
  2. all records should show a balance that matches the sum of all the mutations to the initial balance.

Any record that does not meet these requirements should be written to a report.

Approach

My approach consists of three steps:

  1. Read the input file and parse the records.
  2. Validate the records.
  3. Generate a report.

Requirements and missing requirements

As this is a challenge, there are some requirements missing. Additional to the requirements I received initially, I was also told:

"A requirement we would put to you is that the report should be easy to use for further processing. Think about what is necessary for a user/another application to best navigate this report, what information should be in it and how can it best be presented and used."

Statements and assumptions

  1. My goal with this is to create a simple API that could easily be implemented in other applications.
  2. I will not implement a UI as the challenge is to create a processor that generates a report that can be used elsewhere. 1
  3. I will use a command line interface to demonstrate the functionality and write the reports.
  4. Based on the additional requirement, I will use a JSON format for the report as a default.

1: I imagine, and am working under the assumption, that a statement processor would more likely exist in an automated environment, e.g. as part of a pipeline, rather than be implemented in a UI. Of course, it would still be easy to support a manual file upload too.

Focus points

  1. Code quality
  2. Testing and coverage
  3. Type safety (TS) and documentation (JSDoc)