Skip to content

Commit 9ad7232

Browse files
authored
adding :resource_id and :service_id to Booking item response [finishes #147164743] (#28)
1 parent e01e215 commit 9ad7232

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Change Log
22
All notable changes to this project will be documented in this file.
33

4+
## [0.1.2] - 2017-06-14 ##
5+
### Added
6+
- [#28](https://github.com/gonebusy/gonebusy-nodejs-client/pull/28) - Booking item response now includes :resource_id and :service_id corresponding to Resource providing the Booking and the Service being performed.
7+
48
## [0.1.1] - 2017-05-25 ##
59
### Changed
610
- [#27](https://github.com/gonebusy/gonebusy-nodejs-client/pull/27) - POST /bookings/new :user_id is now a required parameter.

lib/Models/EntitiesBookingResponse.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class EntitiesBookingResponse extends BaseModel {
2424
this.workflowState = this.constructor.getValue(obj.workflowState || obj.workflow_state);
2525
this.userMessage = this.constructor.getValue(obj.userMessage || obj.user_message);
2626
this.timeWindow = this.constructor.getValue(obj.timeWindow || obj.time_window);
27+
this.resourceId = this.constructor.getValue(obj.resourceId || obj.resource_id);
28+
this.serviceId = this.constructor.getValue(obj.serviceId || obj.service_id);
2729
}
2830

2931
/**
@@ -37,6 +39,8 @@ class EntitiesBookingResponse extends BaseModel {
3739
{ name: 'workflowState', realName: 'workflow_state' },
3840
{ name: 'userMessage', realName: 'user_message' },
3941
{ name: 'timeWindow', realName: 'time_window', type: 'EntitiesTimeWindowResponse' },
42+
{ name: 'resourceId', realName: 'resource_id' },
43+
{ name: 'serviceId', realName: 'service_id' },
4044
]);
4145
}
4246
}

test/fixtures/bookings/show.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
"string"
2020
],
2121
"unavailable": true
22-
}
22+
},
23+
"resource_id": 0,
24+
"service_id": 0
2325
}
2426
}

0 commit comments

Comments
 (0)