# Costco

## Description

Process in bulk.

## Jobs

See the [docs/jobs](./docs/guides/) for job-specific documentation.

1. [Create Abacus Profiles](./docs/guides/create_abacus_profiles.md)
1. [SAP Sync Contracts](./docs/guides/sap_sync_contracts.md)
1. [Terminate Contracts](./docs/guides/terminate_contracts.md)

## Setup

1. Install dependencies

   ```bash
   $ npm install
   ```

1. Build

   ```bash
   $ npm run build
   ```

1. Copy `.env.shadow` to `.env`

## Configuration

Your `.env` file must be configured before running.

### Required

**Note**: [Jobs](./docs/jobs) may have additional requirements.

- ORCHARD_IDENTITY_ID

### Defaults ([source](./src/schemas.ts))

- APPLICATION_NAME: `costco`
- CHUNK_SIZE: `16`,
- ENVIRONMENT: `dev`
- INPUT_PATH: `./input.json`
- MAX_WORKERS: `16`
- OUTPUT_PATH: `./output.json`
- THROTTLE_DURATION: `1000`
- THROTTLE_LIMIT: `16`

## Instructions

**Note**: [Jobs](./docs/jobs) may have additional and/or different instructions.

In general:

1. Create an input JSON file with your input.

   ```json
   {
       "job": "job_name",
       "config": {/*...*/}
       "data": {/*...*/}
   }
   ```

1. Run

   ```bash
   $ npm start
   ```

1. Review your output JSON file
   ```json
   {
     "errors": [[1, "Error message for input at index 1"]],
     "success": 2,
     "total": 3
     //...
   }
   ```
