Skip to content

Remove hotel estimates #104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,34 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.4.0] - 2025-05-16

### Removed

- Removes `createHotelEstimate` method

## [2.3.1] - 2025-04-28

### Removed

- Removes `createEcommerceEstimateRequest`

## [2.3.0] - 2025-01-10

### Breaking

- Remove retired estimates API endpoints:

- `createEthereumEstimateRequest`
- `createShippingEstimateRequest`
- `createVehicleEstimateRequest`

## [1.19.0] - 2022-04-11

### Added

- Adds `patch.estimates.createHotelEstimate()` method

## [2.2.0] - 2024-05-06

### Breaking
Expand Down
16 changes: 0 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -147,22 +147,6 @@ patch.estimates.createVehicleEstimate({
year: 1995
});

// Create a hotel estimate
const country_code = 'US'; // ISO3166 alpha-2 country code
const city = 'New York'; // [Optional]
const region = 'New York'; // [Optional]
const star_rating = 4; // [Optional] Star rating of the hotel from 2 to 5
const number_of_nights = 2; // [Optional] Default value is 1
const number_of_rooms = 2; // [Optional] Default value is 1
patch.estimates.createHotelEstimate({
country_code,
city,
region,
star_rating,
number_of_nights,
number_of_rooms
});

// Retrieve an estimate
const estimateId = 'est_test_1234';
patch.estimates.retrieveEstimate(estimate_id);
Expand Down
68 changes: 45 additions & 23 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@patch-technology/patch",
"version": "2.3.1",
"version": "2.4.0",
"description": "Node.js wrapper for the Patch API",
"license": "MIT",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion src/ApiClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ApiClient {
};

this.defaultHeaders = {
'User-Agent': 'patch-node/2.3.1',
'User-Agent': 'patch-node/2.4.0',
'Patch-Version': 2
};

Expand Down
55 changes: 0 additions & 55 deletions src/api/EstimatesApi.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import ApiClient from '../ApiClient';
import CreateAirShippingEstimateRequest from '../model/CreateAirShippingEstimateRequest';
import CreateBitcoinEstimateRequest from '../model/CreateBitcoinEstimateRequest';
import CreateFlightEstimateRequest from '../model/CreateFlightEstimateRequest';
import CreateHotelEstimateRequest from '../model/CreateHotelEstimateRequest';
import CreateMassEstimateRequest from '../model/CreateMassEstimateRequest';
import CreateRailShippingEstimateRequest from '../model/CreateRailShippingEstimateRequest';
import CreateRoadShippingEstimateRequest from '../model/CreateRoadShippingEstimateRequest';
Expand Down Expand Up @@ -188,60 +187,6 @@ export default class EstimatesApi {
);
}

createHotelEstimateWithHttpInfo(createHotelEstimateRequest, opts) {
opts = opts || {};

const _createHotelEstimateRequest =
CreateHotelEstimateRequest.constructFromObject(
createHotelEstimateRequest,
new CreateHotelEstimateRequest()
);

// verify the required parameter 'createHotelEstimateRequest' is set
if (
_createHotelEstimateRequest === undefined ||
_createHotelEstimateRequest === null
) {
throw new Error(
"Missing the required parameter 'createHotelEstimateRequest' when calling createHotelEstimate"
);
}

let postBody = _createHotelEstimateRequest;
let pathParams = {};
let queryParams = {};
let headerParams = {
'Patch-Version': opts['patchVersion']
};
let formParams = {};

let authNames = ['bearer_auth'];
let contentTypes = ['application/json'];
let accepts = ['application/json'];
let returnType = EstimateResponse;

return this.apiClient.callApi(
'/v1/estimates/hotel',
'POST',
pathParams,
queryParams,
headerParams,
formParams,
postBody,
authNames,
contentTypes,
accepts,
returnType
);
}

createHotelEstimate(createHotelEstimateRequest, opts) {
return this.createHotelEstimateWithHttpInfo(
createHotelEstimateRequest,
opts
);
}

createMassEstimateWithHttpInfo(createMassEstimateRequest, opts) {
opts = opts || {};

Expand Down
93 changes: 0 additions & 93 deletions src/model/CreateHotelEstimateRequest.js

This file was deleted.

16 changes: 0 additions & 16 deletions test/integration/estimates.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,22 +75,6 @@ describe('Estimates Integration', function () {
expect(estimate1.mass_g).to.be.below(estimate2.mass_g);
});

it('supports creating hotel estimates', async function () {
const createEstimateResponse = await patch.estimates.createHotelEstimate({
country_code: 'US',
city: 'New York',
region: 'New York',
star_rating: 5,
number_of_nights: 2,
number_of_rooms: 2
});
const estimate = createEstimateResponse.data;

expect(estimate.type).to.be.eq('hotel');
expect(estimate.mass_g).to.be.above(150_000);
expect(estimate.production).to.be.eq(false);
});

it('supports creating air shipping estimates from airports', async function () {
const createEstimateResponse =
await patch.estimates.createAirShippingEstimate({
Expand Down
Loading