<commit_before># salesforce service

## Install:
```
npm install
```

## Configuration

Ensure configuration file for the running environment exists and has the correct options. Default environment is development, options read from `config/config.js` - environment overrides in `config/<environment>.env`.

### Environment variables

```
SALESFORCE_URL - url
SALESFORCE_USERNAME - username
SALESFORCE_PASSWORD - password
```

## Run

Start Server:

`./start.sh development ./service.js`

## Salesforce

SalesForce Leads are documented [here](https://www.salesforce.com/developer/docs/api/Content/sforce_api_objects_lead.htm). The full REST documentation may also be of use: http://www.salesforce.com/us/developer/docs/api_rest/api_rest.pdf.

## Custom Fields

It is necessary to create two custom fields on Leads in SalesForce:

* In SalesForce, go to Setup -> Build -> Customize -> Leads -> Fields
* Create a 'Platform Id' field of type string, set the field name to 'PlatformId'
* Create a 'Platform Url' field of type URL, set the field name to 'PlatformUrl'<commit_msg>Update readme to point to documentation and cp-local-dev repos<commit_after># cp-salesforce-service

## About
This is the Salesforce service, a repository which deals with the Salesforce integration of the [CoderDojo Zen Community Platform](https://github.com/CoderDojo/community-platform) project.

## Install:
For installation instructions, please see the [cp-local-development repository](https://github.com/CoderDojo/cp-local-development). 

General documentation is in the [community-platform repository](https://github.com/CoderDojo/community-platform).

## Configuration

Ensure configuration file for the running environment exists and has the correct options. Default environment is development, options read from `config/config.js` - environment overrides in `config/<environment>.env`.

### Environment variables

```
SALESFORCE_URL - url
SALESFORCE_USERNAME - username
SALESFORCE_PASSWORD - password
```

## Run

Start Server:

`./start.sh development ./service.js`

## Salesforce

SalesForce Leads are documented [here](https://www.salesforce.com/developer/docs/api/Content/sforce_api_objects_lead.htm). The full REST documentation may also be of use: http://www.salesforce.com/us/developer/docs/api_rest/api_rest.pdf.

## Testing
You'll need to be set up with an account on the CoderDojo Salesforce sandbox. Please get in touch with our Technical Lead for guidance!
{'fraction_non_alphanumeric': 0.09706362153344208, 'fraction_numerical': 0.0, 'mean_word_length': 4.968369829683699, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 5, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2155475', 'n_tokens_mistral': 711, 'n_tokens_neox': 677, 'n_words': 240}