# frontend-accounting

## Setup ##

```bash
nvm use # Select the current development version of node
brew install yarn # installs yarn package manager
cp .env.shadow .env # edit .env - see below
yarn --frozen-lockfile # installs all dependencies
yarn start # starts dev server
```

#### Edit .env
- set `API_URL` to WS URL used for proxying to ows-accounting microservice, e.g, `http://workstation.qaorch.com`.  You may need
to use *HTTPS* for a `devorch` server as our Dev server Apache setup enforces SSL access
- set `GRASS_TOKEN` to a valid Grass token obtained from QA WS for the label
  you're interested in testing with

#### Custom Host/Port
```bash
yarn start  -- --host 0.0.0.0
```

#### Tasks

* `yarn start` runs local development server at localhost:8888
* `yarn build` bundles all application js into build/bundle.js
* `yarn test` to run the linter and unit tests
* `yarn test:unit` to run unit tests
* `yarn test:unit:watch` to run unit tests every time a change is saved
* `yarn lint` to run only the linter
* `yarn lint:fix` attempt to have linter fix problems

Note: to see all available tasks, run `yarn run`.

#### Adding a new dependency

* `yarn add package-name` where package-name is the name of the npm package.
* Commit any changes to the `yarn.lock` file.

For more info: https://yarnpkg.com/en/docs/cli/add#toc-adding-dependencies

## Testing in QA ##

When testing on QA WS, be aware that only a select number of labels have their
accounting data copied over from Prod to QA.  Please use the following list of
labels:

```
MONTHLY_LABEL_IDS = [
10303, 14251, 17144, 17292, 17559, 17975, 18072, 18074, 18089, 18094,
18215, 18389, 18805, 19405, 19973, 20177, 20329, 20892, 21109, 21786,
21805, 22057
]
QUARTERLY_LABEL_IDS = [
2604, 4565, 4938, 5333, 7123, 7724, 8869, 10109, 16055, 16175, 17901,
21127, 22234, 22264
]
```

Enjoy!
