# Snapshot Exchange Rates

## OWS Dependencies:
- [ows-royalties](https://github.com/theorchard/ows-royalties)

## Overview
This lambda prepares exchange rates data for an accounting period by
1. Using the `target_id` of the received `abacus_event` to determine which `accounting_period`'s exchange rates are to be snapshot.
2. Connecting to AWS S3 and determining which folder to read from based on the `abacus_event`.
3. Saving an accounting period exchange rates into the parquet file
4. Saving the new parquet to S3 so it is available for the next steps of an accounting run.

## Running
To run the function with a mock event, execute the command:
> make run

## Deployment
Deployment is managed by [zappa](https://github.com/Miserlou/Zappa).
The scripting is in `deploy.sh`, and the configuration is in `zappa_settings.json`.

## Integration testing
OWS services can be added to the `docker-compose.yml` file in order to test
integrations.
Snowflake data fixtures can be staged in the ROYALTY_ACCOUNTING.TEST schema.
