Skip to content

Commit

Permalink
v7.0.0
Browse files Browse the repository at this point in the history
Co-Authored-By: Patryk Smolarz <[email protected]>
  • Loading branch information
p-zielinski and patryksmolarz committed Sep 26, 2024
1 parent 060de80 commit 87f4484
Show file tree
Hide file tree
Showing 36 changed files with 224 additions and 69 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ WORKDIR /app
COPY . .

RUN gem build VoucherifySdk.gemspec
RUN gem install voucherify-6.0.0.gem
RUN gem install voucherify-7.0.0.gem
RUN gem install dotenv
RUN gem install rspec

Expand Down
6 changes: 3 additions & 3 deletions EXAMPLES.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,15 +67,15 @@ gem build VoucherifySdk.gemspec
Then either install the gem locally:

```shell
gem install ./VoucherifySdk-6.0.0.gem
gem install ./VoucherifySdk-7.0.0.gem
```

(for development, run `gem install --dev ./VoucherifySdk-6.0.0.gem` to install the development dependencies)
(for development, run `gem install --dev ./VoucherifySdk-7.0.0.gem` to install the development dependencies)

Add this to the Gemfile:

```shell
gem 'VoucherifySdk', '~> 6.0.0'
gem 'VoucherifySdk', '~> 7.0.0'
```

Then install dependencies with bundler
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ Remember that this SDK is auto generated (except of the tests) so changes made h

## 📅 Changelog

- **2024-10-02** - `7.0.0`
- Fix object parsing in query. For example `filters` while listing redemptions.
- !!! BREAKING CHANGES !!!
- Pagination changed on listing card transactions - NO `page` param is supported - use `starting_after_id` instead.
- Pagination changed on listing voucher transactions - NO `page` param is supported - use `starting_after_id` instead.
- ApplicableToEffect - changed - `EVERY` -> `TO_EVERY`, `CHEAPEST` -> `TO_CHEAPEST`, `MOST_EXPENSIVE` -> `TO_MOST_EXPENSIVE`, 2 new values introduced.
- **2024-09-05** - `6.0.0` - The new version of the SKD includes coverage for all the most commonly used Voucherify endpoints and supports typed models.

*Previous versions of the SDK are no longer supported, and we highly recommend upgrading to version 6.0.0, which is now designated as Long-Term Support (LTS).*
Expand Down Expand Up @@ -825,6 +831,7 @@ Class | Method | HTTP request | Description
- [VoucherifySdk::ParameterOrderListPublications](docs/ParameterOrderListPublications.md)
- [VoucherifySdk::ParameterOrderListRedeemables](docs/ParameterOrderListRedeemables.md)
- [VoucherifySdk::ParameterOrderListRedemptions](docs/ParameterOrderListRedemptions.md)
- [VoucherifySdk::ParameterOrderListTransactions](docs/ParameterOrderListTransactions.md)
- [VoucherifySdk::ParameterOrderListValidationRuleAssignments](docs/ParameterOrderListValidationRuleAssignments.md)
- [VoucherifySdk::ParameterOrderListValidationRules](docs/ParameterOrderListValidationRules.md)
- [VoucherifySdk::ParameterOrderVouchers](docs/ParameterOrderVouchers.md)
Expand Down
8 changes: 6 additions & 2 deletions VoucherifySdk.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,11 @@ Gem::Specification.new do |s|

s.add_development_dependency 'rspec', '~> 3.6', '>= 3.6.0'

s.files = `find *`.split("\n").uniq.sort.select { |f| !f.empty? }
s.test_files = `find __tests__/spec/*`.split("\n")
# Include all necessary files but exclude .gem
s.files = Dir.glob("{lib,__tests__}/**/*").select { |f| File.file?(f) } - Dir.glob("*.gem")

# Only include spec files
s.test_files = Dir.glob("__tests__/spec/*")

s.require_paths = ["lib"]
end
18 changes: 18 additions & 0 deletions __tests__/lib/stackables.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,3 +63,21 @@ def redeem_stacked_discounts(redemptions_api_instance, voucher_ids)
return nil;
end
end

def list_redemptions(redemptions_api_instance)
begin
redemptions = @redemptions_api_instance.list_redemptions({
filters: VoucherifySdk::ParameterFiltersListRedemptions.new({
voucher_code: VoucherifySdk::ParameterFiltersListRedemptionsVoucherCode.new({
conditions: VoucherifySdk::FilterConditionsString.new({
not_in: ["123"]
})
})
})
})

expect(redemptions).not_to be_nil
rescue VoucherifySdk::ApiError => e
return nil
end
end
5 changes: 5 additions & 0 deletions __tests__/spec/09_redemptions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,10 @@
# expect(validate_deep_match(filtered_snapshot, result)).to be true
end

it 'should list redemptions', :order => :third do
redemptions = list_redemptions(@redemptions_api_instance)

expect(redemptions).not_to be_nil
end

end
14 changes: 7 additions & 7 deletions docs/ApplicableTo.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **object** | **String** | This object stores information about the product collection. | [optional] |
| **id** | **String** | Unique product collection ID assigned by Voucherify. | [optional] |
| **source_id** | **String** | The source ID from your inventory system. | [optional] |
| **object** | **String** | This object stores information about the resource to which the discount is applicable. | [optional] |
| **id** | **String** | Unique product collection, product, or SKU identifier assigned by Voucherify. | [optional] |
| **source_id** | **String** | The source identifier from your inventory system. | [optional] |
| **product_id** | **String** | Parent product&#39;s unique ID assigned by Voucherify. | [optional] |
| **product_source_id** | **String** | Parent product&#39;s source ID from your inventory system. | [optional] |
| **strict** | **Boolean** | | [optional] |
Expand All @@ -17,8 +17,8 @@
| **aggregated_quantity_limit** | **Integer** | The maximum number of units allowed to be discounted combined across all matched order line items. | [optional] |
| **amount_limit** | **Integer** | Upper limit allowed to be applied as a discount per order line item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600. | [optional] |
| **aggregated_amount_limit** | **Integer** | Maximum discount amount per order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount on the entire order is written as 600. This value is definable for the following discount effects: - &#x60;APPLY_TO_ITEMS&#x60; (each item subtotal is discounted equally) - &#x60;APPLY_TO_ITEMS_BY_QUANTITY&#x60; (each unit of matched products has the same discount value) | [optional] |
| **order_item_indices** | **Array&lt;Integer&gt;** | | [optional] |
| **repeat** | **Integer** | | [optional] |
| **skip_initially** | **Integer** | | [optional] |
| **target** | **String** | | [optional] |
| **order_item_indices** | **Array&lt;Integer&gt;** | Determines the order in which the discount is applied to the products or SKUs sent in the &#x60;order&#x60; object in the request. The counting begins from &#x60;0&#x60;. | [optional] |
| **repeat** | **Integer** | Determines the recurrence of the discount, e.g. &#x60;\&quot;repeat\&quot;: 3&#x60; means that the discount is applied to every third item. | [optional] |
| **skip_initially** | **Integer** | Determines how many items are skipped before the discount is applied. | [optional] |
| **target** | **String** | Determines to which kinds of objects the discount is applicable. &#x60;\&quot;ITEM\&quot;&#x60; includes products and SKUs. | [optional] |

2 changes: 1 addition & 1 deletion docs/ClientPromotionsTiersListResponseBody.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
| **data_ref** | **String** | Identifies the name of the attribute that contains the array of promotion tier objects. | [optional][default to &#39;tiers&#39;] |
| **tiers** | [**Array&lt;PromotionTier&gt;**](PromotionTier.md) | Contains array of promotion tier objects. | [optional] |
| **total** | **Integer** | Total number of promotion tiers. | [optional] |
| **has_more** | **Boolean** | As query results are always limited (by the limit parameter), the &#x60;has_more&#x60; flag indicates if there are more records for given filter parameters. This lets you know if you can run another request (with a different page or a different start date filter) to get more records returned in the results. | [optional] |
| **has_more** | **Boolean** | As query results are always limited (by the limit parameter), the &#x60;has_more&#x60; flag indicates if there are more records for given filter parameters. This lets you know if you can run another request to get more records returned in the results. | [optional] |

2 changes: 1 addition & 1 deletion docs/CustomersActivityListResponseBody.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
| **data_ref** | **String** | Identifies the name of the attribute that contains the array of customer activity objects. | [optional][default to &#39;data&#39;] |
| **data** | [**Array&lt;CustomerActivity&gt;**](CustomerActivity.md) | Array of customer activity objects. | [optional] |
| **has_more** | **Boolean** | As query results are always limited (by the limit parameter), the &#x60;has_more&#x60; flag indicates if there are more records for given filter parameters. This lets you know if you can run another request with a &#x60;starting_after_id&#x60; query or a different limit to get more records returned in the results. | [optional] |
| **more_starting_after** | **String** | Returns an ID that can be used to return another page of results. Use the event id in the &#x60;starting_after_id&#x60; query parameter to display another page of the results starting after the event with that ID. | [optional] |
| **more_starting_after** | **String** | Returns an ID that can be used to return another page of results. Use the event ID in the &#x60;starting_after_id&#x60; query parameter to display another page of the results starting after the event with that ID. | [optional] |

2 changes: 1 addition & 1 deletion docs/Error.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
| ---- | ---- | ----------- | ----- |
| **code** | **Integer** | Error&#39;s HTTP status code. | [optional] |
| **key** | **String** | Short string describing the kind of error which occurred. | [optional] |
| **message** | **String** | A human-readable message providing a short description about the error. | [optional] |
| **message** | **String** | A human-readable message providing a short description of the error. | [optional] |
| **details** | **String** | A human-readable message providing more details about the error. | [optional] |
| **request_id** | **String** | This ID is useful when troubleshooting and/or finding the root cause of an error response by our support team. | [optional] |
| **resource_id** | **String** | Unique resource ID that can be used in another endpoint to get more details. | [optional] |
Expand Down
14 changes: 7 additions & 7 deletions docs/InapplicableTo.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **object** | **String** | This object stores information about the product collection. | [optional] |
| **id** | **String** | Unique product collection ID assigned by Voucherify. | [optional] |
| **source_id** | **String** | The source ID from your inventory system. | [optional] |
| **object** | **String** | This object stores information about the resource to which the discount is applicable. | [optional] |
| **id** | **String** | Unique product collection, product, or SKU identifier assigned by Voucherify. | [optional] |
| **source_id** | **String** | The source identifier from your inventory system. | [optional] |
| **product_id** | **String** | Parent product&#39;s unique ID assigned by Voucherify. | [optional] |
| **product_source_id** | **String** | Parent product&#39;s source ID from your inventory system. | [optional] |
| **strict** | **Boolean** | | [optional] |
Expand All @@ -17,8 +17,8 @@
| **aggregated_quantity_limit** | **Integer** | The maximum number of units allowed to be discounted combined across all matched order line items. | [optional] |
| **amount_limit** | **Integer** | Upper limit allowed to be applied as a discount per order line item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount is written as 600. | [optional] |
| **aggregated_amount_limit** | **Integer** | Maximum discount amount per order. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $6 maximum discount on the entire order is written as 600. This value is definable for the following discount effects: - &#x60;APPLY_TO_ITEMS&#x60; (each item subtotal is discounted equally) - &#x60;APPLY_TO_ITEMS_BY_QUANTITY&#x60; (each unit of matched products has the same discount value) | [optional] |
| **order_item_indices** | **Array&lt;Integer&gt;** | | [optional] |
| **repeat** | **Integer** | | [optional] |
| **skip_initially** | **Integer** | | [optional] |
| **target** | **String** | | [optional] |
| **order_item_indices** | **Array&lt;Integer&gt;** | Determines the order in which the discount is applied to the products or SKUs sent in the &#x60;order&#x60; object in the request. The counting begins from &#x60;0&#x60;. | [optional] |
| **repeat** | **Integer** | Determines the recurrence of the discount, e.g. &#x60;\&quot;repeat\&quot;: 3&#x60; means that the discount is applied to every third item. | [optional] |
| **skip_initially** | **Integer** | Determines how many items are skipped before the discount is applied. | [optional] |
| **target** | **String** | Determines to which kinds of objects the discount is applicable. &#x60;\&quot;ITEM\&quot;&#x60; includes products and SKUs. | [optional] |

12 changes: 9 additions & 3 deletions docs/LoyaltiesApi.md
Original file line number Diff line number Diff line change
Expand Up @@ -1417,7 +1417,9 @@ end
api_instance = VoucherifySdk::LoyaltiesApi.new
member_id = 'member_id_example' # String | A unique code identifying the loyalty card that you are looking to retrieve transaction data for.
opts = {
limit: 56 # Integer | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.
limit: 56, # Integer | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.
order: VoucherifySdk::ParameterOrderListTransactions::ID, # ParameterOrderListTransactions | Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.
starting_after_id: 'starting_after_id_example' # String | A cursor for pagination. It retrieves the transactions starting after a transaction with the given ID.
}

begin
Expand All @@ -1435,6 +1437,8 @@ end
| ---- | ---- | ----------- | ----- |
| **member_id** | **String** | A unique code identifying the loyalty card that you are looking to retrieve transaction data for. | |
| **limit** | **Integer** | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. | [optional] |
| **order** | [**ParameterOrderListTransactions**](.md) | Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. | [optional] |
| **starting_after_id** | **String** | A cursor for pagination. It retrieves the transactions starting after a transaction with the given ID. | [optional] |

### Return type

Expand Down Expand Up @@ -1481,7 +1485,8 @@ campaign_id = 'campaign_id_example' # String | A unique identifier of the loyalt
member_id = 'member_id_example' # String | A unique code identifying the loyalty card that you are looking to retrieve transaction data for.
opts = {
limit: 56, # Integer | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.
page: 56 # Integer | Which page of results to return. The lowest value is 1.
order: VoucherifySdk::ParameterOrderListTransactions::ID, # ParameterOrderListTransactions | Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.
starting_after_id: 'starting_after_id_example' # String | A cursor for pagination. It retrieves the transactions starting after a transaction with the given ID.
}

begin
Expand All @@ -1500,7 +1505,8 @@ end
| **campaign_id** | **String** | A unique identifier of the loyalty campaign containing the voucher whose transactions you would like to return. | |
| **member_id** | **String** | A unique code identifying the loyalty card that you are looking to retrieve transaction data for. | |
| **limit** | **Integer** | Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items. | [optional] |
| **page** | **Integer** | Which page of results to return. The lowest value is 1. | [optional] |
| **order** | [**ParameterOrderListTransactions**](.md) | Sorts the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order. | [optional] |
| **starting_after_id** | **String** | A cursor for pagination. It retrieves the transactions starting after a transaction with the given ID. | [optional] |

### Return type

Expand Down
2 changes: 1 addition & 1 deletion docs/LoyaltiesMemberActivityListResponseBody.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
| **data_ref** | **String** | Identifies the name of the attribute that contains the array of member activity objects. | [optional][default to &#39;data&#39;] |
| **data** | [**Array&lt;MemberActivity&gt;**](MemberActivity.md) | Array of member activity objects. | [optional] |
| **has_more** | **Boolean** | As query results are always limited (by the limit parameter), the &#x60;has_more&#x60; flag indicates if there are more records for given filter parameters. This lets you know if you can run another request with a &#x60;starting_after_id&#x60; query or a different limit to get more records returned in the results. | [optional] |
| **more_starting_after** | **String** | Returns an ID that can be used to return another page of results. Use the event id in the &#x60;starting_after_id&#x60; query parameter to display another page of the results starting after the event with that ID. | [optional] |
| **more_starting_after** | **String** | Returns an ID that can be used to return another page of results. Use the event ID in the &#x60;starting_after_id&#x60; query parameter to display another page of the results starting after the event with that ID. | [optional] |

3 changes: 2 additions & 1 deletion docs/LoyaltiesMembersTransactionsListResponseBody.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@
| **object** | **String** | The type of the object represented by JSON. | [optional][default to &#39;list&#39;] |
| **data_ref** | **String** | Identifies the name of the attribute that contains the array of transaction objects. | [optional][default to &#39;data&#39;] |
| **data** | [**Array&lt;LoyaltyCardTransaction&gt;**](LoyaltyCardTransaction.md) | A dictionary that contains an array of transactions. Each entry in the array is a separate transaction object. | [optional] |
| **has_more** | **Boolean** | As query results are always limited (by the limit parameter), the has_more flag indicates if there are more records for given filter parameters. This lets you know if you can run another request (with a different page or a different start date filter) to get more records returned in the results. | [optional] |
| **has_more** | **Boolean** | As query results are always limited (by the limit parameter), the &#x60;has_more&#x60; flag indicates if there are more records for given filter parameters. This lets you know if you can run another request to get more records returned in the results. | [optional] |
| **more_starting_after** | **String** | Returns an ID that can be used to return another page of results. Use the transaction ID in the &#x60;starting_after_id&#x60; query parameter to display another page of the results starting after the transaction with that ID. | [optional] |

7 changes: 7 additions & 0 deletions docs/ParameterOrderListTransactions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# VoucherifySdk::ParameterOrderListTransactions

## Properties

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |

2 changes: 1 addition & 1 deletion docs/PromotionTiersList.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
| **data_ref** | **String** | Identifies the name of the attribute that contains the array of promotion tier objects. | [optional][default to &#39;tiers&#39;] |
| **tiers** | [**Array&lt;PromotionTier&gt;**](PromotionTier.md) | Contains array of promotion tier objects. | [optional] |
| **total** | **Integer** | Total number of promotion tiers. | [optional] |
| **has_more** | **Boolean** | As query results are always limited (by the limit parameter), the &#x60;has_more&#x60; flag indicates if there are more records for given filter parameters. This lets you know if you can run another request (with a different page or a different start date filter) to get more records returned in the results. | [optional] |
| **has_more** | **Boolean** | As query results are always limited (by the limit parameter), the &#x60;has_more&#x60; flag indicates if there are more records for given filter parameters. This lets you know if you can run another request to get more records returned in the results. | [optional] |

Loading

0 comments on commit 87f4484

Please sign in to comment.