# Data verifications

## Prereqs

install Docker (boot2docker if on Mac/Windows machine)
install docker-compose

## One-time setup

`$ cp .env.example .env` then manually fill in the necessary credentials

## Usage

`$ make` to run all tests

## Developing

If you modify the Dockerfile, `$ make rebuild` to rebuild the new container

If you modify the Gemfile,

```
$ bundle install
$ make rebuild
```

to ensure the `Gemfile.lock` is regenerated & committed

## Caveats

0. These validations should only be run at the very end of the Accounting Run to validate whether it's OK to turn the new period "on". We should probably split up the validations into:
  - `pre run`
  - `post AR prep`
  - `post ETL`
  - `post currencies`
  - `post period on` (if and when this is set by a DB field - currently it's `active period` in some config files)
0. `mysql.query` returns numbers casted as Ruby BigDecimals, while `redshift.exec` leaves them as Strings. We should probably change this so both return BigDecimals.
