Skip to content

Commit 93e880f

Browse files
authored
[v.1.3.0] Add support for Flight/Vehicle/Shipping estimates (#21)
1 parent 012ba10 commit 93e880f

16 files changed

+630
-76
lines changed

Diff for: .github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
### SDK Release Checklist
1010

1111
- [ ] Have you added an integration test for the changes?
12-
- [ ] Have you built the gem locally and made queries against it successfully?
12+
- [ ] Have you built the package locally and made queries against it successfully?
1313
- [ ] Did you update the changelog?
1414
- [ ] Did you bump the package version?
1515
- [ ] For breaking changes, did you plan for the release of the new SDK versions and deploy the API to production?

Diff for: CHANGELOG.md

+5-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,11 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [Unreleased]
8+
## [1.3.0] - 2020-02-08
9+
10+
### Added
11+
12+
- Adds support for creating carbon emission estimates for flights, shipping, and vehicles. See the [docs](https://docs.usepatch.com/#/?id=estimates) for more information.
913

1014
## [1.2.5] - 2020-01-07
1115

Diff for: README.md

+24-1
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,33 @@ Estimates allow API users to get a quote for the cost of compensating a certain
101101
#### Examples
102102

103103
```javascript
104-
// Create an estimate
104+
// Create a mass estimate
105105
const mass = 1000000; // Pass in the mass in grams (i.e. 1 metric tonne)
106106
patch.estimates.createMassEstimate({ mass_g: mass });
107107

108+
// Create a flight estimate
109+
const distance_m = 9000000; // Pass in the distance traveled in meters
110+
patch.estimates.createFlightEstimate({ distance_m: distance_m });
111+
112+
// Create a shipping estimate
113+
const distance_m = 9000000;
114+
// Pass in the shipping distance in meters, the transportation method, and the package mass
115+
patch.estimates.createFlightEstimate({
116+
distance_m: distance_m,
117+
transportation_method: 'air',
118+
package_mass_g: 1000
119+
});
120+
121+
// Create a vehicle estimate
122+
const distance_m = 9000000;
123+
// Pass in the shipping distance in meters and the model/make/year of the vehicle
124+
patch.estimates.createFlightEstimate({
125+
distance_m: distance_m,
126+
make: 'Toyota',
127+
model: 'Corolla',
128+
year: 1995
129+
});
130+
108131
// Retrieve an estimate
109132
const estimateId = 'est_test_1234';
110133
patch.estimates.retrieveEstimate(estimate_id);

0 commit comments

Comments
 (0)