-
Notifications
You must be signed in to change notification settings - Fork 6
Update fees and rentals_fees endpoints with new actions and attributes #206
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "fees": [ | ||
| { | ||
| "name_en": "Fee", | ||
| "kind": "other", | ||
| "rate": "12.0", | ||
| "rate_kind": "fixed", | ||
| "downpayment_percentage": "0.0" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| { | ||
| "fees": [ | ||
| { | ||
| "name_en": "Fee", | ||
| "kind": "other", | ||
| "rate": "12.0", | ||
| "rate_kind": "fixed", | ||
| "downpayment_percentage": "0.0" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| { | ||
| "rentals_fees": [ | ||
| { | ||
| "fee_id": 9, | ||
| "always_applied": true, | ||
| "maximum_bookable": 12, | ||
| "status": "public" | ||
| } | ||
| ] | ||
| } |
14 changes: 11 additions & 3 deletions
14
...e/rentals_fees/public-scope-response.json → .../public-rentals_write-scope-response.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| { | ||
| "rentals_fees": [ | ||
| { | ||
| "always_applied": "true", | ||
| "maximum_bookable": 12, | ||
| "status": "public" | ||
| } | ||
| ] | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,6 +7,7 @@ | |
| <ul class="nav nav-pills" role="tablist"> | ||
| <li class="disabled"><a>OAuth Scopes:</a></li> | ||
| <li class="active"><a href="#public" role="tab" data-toggle="pill">public</a></li> | ||
| <li><a href="#rentals_write" role="tab" data-toggle="pill">rentals_write</a></li> | ||
| </ul> | ||
| <div class="tab-content" markdown="1"> | ||
| <div class="tab-pane active" id="public" markdown="1"> | ||
|
|
@@ -16,13 +17,40 @@ id | Integer | Read | Rentals Fee's id. | |
| -----------------|---------|------------|------------ | ||
| always_applied | Boolean | Read | Available to all seasons and periods if set to true. | ||
| maximum_bookable | Integer | Read | Rentals Fee's maximum booked count. | ||
| name | [Object](/reference/enums#formats) | Read | Rentals Fee's name, list of locales described in [enums section](/reference/enums#locales). | ||
| public | Boolean | Read | Publicly bookable by client if set to true. | ||
| rate | [Decimal](/reference/enums#formats) | Read | Rentals Fee's rate. | ||
| rate_kind | String | Read | Rentals Fee's rate kind, list of fee's rate kinds described in [enums section](/reference/enums#fee-rate-kinds). | ||
| required | Boolean | Read | Always included for new bookings, also public if set to true. | ||
| -----------------|---------|------------|------------ | ||
| archived_at | [Time](/reference/enums#formats) | Read | Rentals Fee's archive time. | ||
| created_at | [Time](/reference/enums#formats) | Read | Rentals Fee's create time. | ||
| updated_at | [Time](/reference/enums#formats) | Read | Rentals Fee's update time. | ||
| start_date | [Date](/reference/enums#formats) | Read | Rentals Fee's start date. | ||
| end_date | [Date](/reference/enums#formats) | Read | Rentals Fee's end date. | ||
| {: class="table table-bordered"} | ||
| </div> | ||
| <div class="tab-pane" id="rentals_write" markdown="1"> | ||
| Name | Type | Read/Write | Description | ||
| -----------------|---------|------------|------------ | ||
| id | Integer | Read | Rentals Fee's id. | ||
| fee_id | Integer | Write | Fee id related to the Rentals Fee. | ||
| season_ids | Array | Write | Season ids related to the Rentals Fee. | ||
| -----------------|---------|------------|------------ | ||
| always_applied | Boolean | Read/Write | Available to all seasons and periods if set to true. | ||
| maximum_bookable | Integer | Read/Write | Rentals Fee's maximum booked count. | ||
| name | [Object](/reference/enums#formats) | Read | Rentals Fee's name, list of locales described in [enums section](/reference/enums#locales). | ||
| public | Boolean | Read | Publicly bookable by client if set to true. | ||
| rate | [Decimal](/reference/enums#formats) | Read | Rentals Fee's rate. | ||
| rate_kind | String | Read | Rentals Fee's rate kind, list of fee's rate kinds described in [enums section](/reference/enums#fee-rate-kinds). | ||
| required | Boolean | Read | Always included for new bookings, also public if set to true. | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this should be writtable There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. its not on core |
||
| status | Boolean | Write | Possible values are `public`, `required` or `private`. | ||
| -----------------|---------|------------|------------ | ||
| archived_at | [Time](/reference/enums#formats) | Read | Rentals Fee's archive time. | ||
| created_at | [Time](/reference/enums#formats) | Read | Rentals Fee's create time. | ||
| updated_at | [Time](/reference/enums#formats) | Read | Rentals Fee's update time. | ||
| start_date | [Date](/reference/enums#formats) | Read/Write | Rentals Fee's start date. | ||
| end_date | [Date](/reference/enums#formats) | Read/Write | Rentals Fee's end date. | ||
| {: class="table table-bordered"} | ||
| </div> | ||
| </div> | ||
|
|
@@ -35,7 +63,7 @@ List all rentals fees for given account(s). | |
| GET /rentals_fees | ||
| ~~~ | ||
|
|
||
| <%= render 'json_response', endpoint: "rentals_fees", scopes: %w(public) %> | ||
| <%= render 'json_response', endpoint: "rentals_fees", scopes: [{ public: "public-rentals_write" }] %> | ||
|
|
||
| ## Get a single rentals fee | ||
|
|
||
|
|
@@ -45,4 +73,36 @@ Returns a single rentals fee identified by ID. | |
| GET /rentals_fees/:rentals_fee_id | ||
| ~~~ | ||
|
|
||
| <%= render 'json_response', endpoint: "rentals_fees", scopes: %w(public) %> | ||
| <%= render 'json_response', endpoint: "rentals_fees", scopes: [{ public: "public-rentals_write" }] %> | ||
|
|
||
| ## Create a new rentals fee | ||
|
|
||
| Creates a rentals fee for given rental. | ||
|
|
||
| ~~~ | ||
| POST /rentals/:rental_id/rentals_fees | ||
| ~~~ | ||
|
|
||
| <%= render 'json_response', endpoint: "rentals_fees", request: "create", | ||
| scopes: [{ rentals_write: "public-rentals_write" }] %> | ||
|
|
||
| ## Update a rentals fee | ||
|
|
||
| Returns an updated rentals fee identified by ID. | ||
|
|
||
| ~~~ | ||
| PUT /rentals_fees/:rentals_fee_id | ||
| ~~~ | ||
|
|
||
| <%= render 'json_response', endpoint: "rentals_fees", request: "update", | ||
| scopes: [{ rentals_write: "public-rentals_write" }] %> | ||
|
|
||
| ## Archive a rentals fee | ||
|
|
||
| Required OAuth scope: `:rentals_write` | ||
|
|
||
| Returns empty response with '204 No Content' status code on success. | ||
|
|
||
| ~~~~~~ | ||
| DELETE /rentals_fees/:rentals_fee_id | ||
| ~~~~~~ | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should be writtable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its not on core
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, on admin v2 it's using
status, should be here as well then. Needed to set this.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
status added