Skip to content
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

Ps #66

Closed
wants to merge 8 commits into from
Closed

Ps #66

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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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-5.0.1.gem
RUN gem install voucherify-6.0.0.gem
RUN gem install dotenv
RUN gem install rspec

Expand Down
1,117 changes: 295 additions & 822 deletions ENDPOINTS-COVERAGE.md

Large diffs are not rendered by default.

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-5.0.1.gem
gem install ./VoucherifySdk-6.0.0.gem
```

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

Add this to the Gemfile:

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

Then install dependencies with bundler
Expand Down
428 changes: 191 additions & 237 deletions README.md

Large diffs are not rendered by default.

11 changes: 6 additions & 5 deletions __tests__/lib/campaigns.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,20 +50,21 @@ def create_validation_rule_more_than(validation_rules_api_instance, product_id)
def create_discount_campaign(campaigns_api_instance, validation_rule_id)
begin
campaign = campaigns_api_instance.create_campaign({
campaigns_create_request_body: VoucherifySdk::CampaignsCreateDiscountCouponsCampaign.new({
campaigns_create_request_body: VoucherifySdk::CampaignsCreateRequestBody.new({
campaign_type: "DISCOUNT_COUPONS",
name: generate_random_string(),
type: "AUTO_UPDATE",
voucher: VoucherifySdk::DiscountCouponsCampaignVoucher.new({
discount: VoucherifySdk::DiscountAmount.new({
type: "AMOUNT",
voucher: VoucherifySdk::CampaignsCreateRequestBodyVoucher.new({
type: 'DISCOUNT_VOUCHER',
discount: VoucherifySdk::Discount.new({
type: 'AMOUNT',
amount_off: 1000
})
}),
validation_rules: [validation_rule_id]
})
})

return campaign
rescue VoucherifySdk::ApiError => e
return nil
Expand Down
2 changes: 1 addition & 1 deletion __tests__/lib/stackables.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
def create_request_body_redeemable(voucher_id)
begin
validations_validate_request_body_redeemables = [
VoucherifySdk::RedeemVoucher.new({
VoucherifySdk::RedemptionEntryVoucher.new({
object: "voucher", id: voucher_id
})
]
Expand Down
2 changes: 1 addition & 1 deletion __tests__/spec/4_publications_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
it 'create a publication', :order => :first do
publication = @publications_api_instance.create_publication({
join_once: true,
publications_create_request_body: VoucherifySdk::CreatePublicationWithCampaign.new({
publications_create_request_body: VoucherifySdk::PublicationsCreateRequestBody.new({
customer: VoucherifySdk::Customer.new({
id: @voucherify_data.get_customer().id
}),
Expand Down
2 changes: 1 addition & 1 deletion __tests__/spec/6_validations_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
expect(redeemable.order).to be_a(VoucherifySdk::OrderCalculated)
expect(redeemable.applicable_to).to be_a(VoucherifySdk::ApplicableToResultList)
expect(redeemable.inapplicable_to).to be_a(VoucherifySdk::InapplicableToResultList)
expect(redeemable.result).to be_a(VoucherifySdk::RedeemableResultPromotionTier)
expect(redeemable.result).to be_a(VoucherifySdk::ValidationsValidateResponseBodyRedeemablesItemResult)
end

it 'validates the order object structure (successful)', :order => :fourth do
Expand Down
11 changes: 11 additions & 0 deletions docs/AccessSettingsCampaignAssignmentsList.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# VoucherifySdk::AccessSettingsCampaignAssignmentsList

## Properties

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **object** | **String** | The type of the object represented by JSON. Default is `list`. This object stores information about campaign assignments to areas and stores | [optional][default to 'list'] |
| **data_ref** | **String** | Identifies the name of the attribute that contains the array of campaign assignments. | [optional][default to 'data'] |
| **data** | [**Array<AreaStoreCampaignAssignment>**](AreaStoreCampaignAssignment.md) | Contains an array of campaign assignments. | [optional] |
| **total** | **Integer** | Total number of areas and stores to which the campaign is assigned. | [optional] |

53 changes: 0 additions & 53 deletions docs/Any.md

This file was deleted.

6 changes: 3 additions & 3 deletions docs/ApplicableTo.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **object** | **String** | This object stores information about the product collection. | |
| **id** | **String** | Unique product collection ID assigned by Voucherify. | |
| **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] |
| **product_id** | **String** | Parent product's unique ID assigned by Voucherify. | [optional] |
| **product_source_id** | **String** | Parent product's source ID from your inventory system. | [optional] |
| **strict** | **Boolean** | | |
| **strict** | **Boolean** | | [optional] |
| **price** | **Float** | New fixed price of an item. Value is multiplied by 100 to precisely represent 2 decimal places. For example, a $10 price is written as 1000. In case of the fixed price being calculated by the formula, i.e. the price_formula parameter is present in the fixed price definition, this value becomes the fallback value. Such that in a case where the formula cannot be calculated due to missing metadata, for example, this value will be used as the fixed price. | [optional] |
| **price_formula** | **Float** | Formula used to calculate the discounted price of an item. | [optional] |
| **effect** | [**ApplicableToEffect**](ApplicableToEffect.md) | | |
Expand Down
8 changes: 4 additions & 4 deletions docs/ApplicableToResultList.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **data** | [**Array<ApplicableTo>**](ApplicableTo.md) | Contains array of items to which the discount can apply. | |
| **total** | **Integer** | Total number of objects defining included products, SKUs, or product collections. | |
| **object** | **String** | The type of object represented by JSON. | [default to 'list'] |
| **data_ref** | **String** | The type of object represented by JSON. | [default to 'data'] |
| **data** | [**Array<ApplicableTo>**](ApplicableTo.md) | Contains array of items to which the discount can apply. | [optional] |
| **total** | **Integer** | Total number of objects defining included products, SKUs, or product collections. | [optional] |
| **object** | **String** | The type of the object represented by JSON. | [optional][default to 'list'] |
| **data_ref** | **String** | The type of the object represented by JSON. | [optional][default to 'data'] |

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

## Properties

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **id** | **String** | Unique identifier of the campaign assignment. | [optional] |
| **area_id** | **String** | Unique identifier of the area to which the campaign is assigned. | [optional] |
| **area_store_id** | **String** | Unique identifier of the store to which the campaign is assigned. | [optional] |
| **created_at** | **Time** | Date and time when the assignment was made. The value is shown in the ISO 8601 format. | [optional] |
| **object** | **String** | The type of the object represented by JSON. This object stores information about the campaign assignment to areas or stores. | [optional][default to 'area_store_campaign_assignment'] |

51 changes: 0 additions & 51 deletions docs/ArrayInner.md

This file was deleted.

2 changes: 1 addition & 1 deletion docs/AsyncActions.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **async_action_id** | **String** | The ID of the scheduled asynchronous action. | |
| **async_action_id** | **String** | The ID of the scheduled asynchronous action. | [optional] |

12 changes: 6 additions & 6 deletions docs/BusValRuleAssignment.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **id** | **String** | The unique identifier for a assignment | |
| **rule_id** | **String** | The unique identifier for a rule | |
| **related_object_id** | **String** | The unique identifier for a related object | |
| **related_object_type** | **String** | The type of related object | |
| **created_at** | **Time** | Timestamp representing the date and time when the object was created in ISO 8601 format. | [optional] |
| **id** | **String** | The unique identifier for a assignment | [optional] |
| **rule_id** | **String** | The unique identifier for a rule | [optional] |
| **related_object_id** | **String** | The unique identifier for a related object | [optional] |
| **related_object_type** | **String** | The type of related object | [optional] |
| **created_at** | **Time** | Timestamp representing the date and time when the object was created. The value is shown in the ISO 8601 format. | [optional] |
| **updated_at** | **Time** | Timestamp representing the date and time when the object was last updated in ISO 8601 format. | [optional] |
| **object** | **String** | The type of object represented by JSON. | [default to 'validation_rules_assignment'] |
| **object** | **String** | The type of the object represented by JSON. | [optional][default to 'validation_rules_assignment'] |
| **validation_status** | **String** | The validation status of the assignment | [optional] |
| **validation_omitted_rules** | **Array<String>** | The list of omitted rules | [optional] |

36 changes: 19 additions & 17 deletions docs/Campaign.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,36 @@

| Name | Type | Description | Notes |
| ---- | ---- | ----------- | ----- |
| **id** | **String** | Unique campaign ID, assigned by Voucherify. | |
| **name** | **String** | Campaign name. | |
| **id** | **String** | Unique campaign ID, assigned by Voucherify. | [optional] |
| **name** | **String** | Campaign name. | [optional] |
| **description** | **String** | An optional field to keep any extra textual information about the campaign such as a campaign description and details. | [optional] |
| **campaign_type** | **String** | Type of campaign. | |
| **type** | **String** | Defines whether the campaign can be updated with new vouchers after campaign creation. - `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria - `STATIC`: vouchers need to be manually published | |
| **campaign_type** | **String** | Type of campaign. | [optional] |
| **type** | **String** | Defines whether the campaign can be updated with new vouchers after campaign creation. - `AUTO_UPDATE`: the campaign is dynamic, i.e. vouchers will generate based on set criteria - `STATIC`: vouchers need to be manually published | [optional] |
| **voucher** | [**CampaignVoucher**](CampaignVoucher.md) | | [optional] |
| **auto_join** | **Boolean** | Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled. | |
| **join_once** | **Boolean** | If this value is set to `true`, customers will be able to join the campaign only once. | |
| **use_voucher_metadata_schema** | **Boolean** | Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema. | |
| **validity_timeframe** | [**CampaignBaseValidityTimeframe**](CampaignBaseValidityTimeframe.md) | | [optional] |
| **validity_day_of_week** | **Array<Integer>** | Integer array corresponding to the particular days of the week in which the campaign is valid. - `0` Sunday - `1` Monday - `2` Tuesday - `3` Wednesday - `4` Thursday - `5` Friday - `6` Saturday | [optional] |
| **auto_join** | **Boolean** | Indicates whether customers will be able to auto-join a loyalty campaign if any earning rule is fulfilled. | [optional] |
| **join_once** | **Boolean** | If this value is set to `true`, customers will be able to join the campaign only once. | [optional] |
| **use_voucher_metadata_schema** | **Boolean** | Flag indicating whether the campaign is to use the voucher's metadata schema instead of the campaign metadata schema. | [optional] |
| **validity_timeframe** | [**ValidityTimeframe**](ValidityTimeframe.md) | | [optional] |
| **validity_day_of_week** | **Array<Integer>** | Integer array corresponding to the particular days of the week in which the voucher is valid. - `0` Sunday - `1` Monday - `2` Tuesday - `3` Wednesday - `4` Thursday - `5` Friday - `6` Saturday | [optional] |
| **validity_hours** | [**ValidityHours**](ValidityHours.md) | | [optional] |
| **activity_duration_after_publishing** | **String** | Defines the amount of time the campaign will be active in ISO 8601 format after publishing. For example, a campaign with a `duration` of `P24D` will be valid for a duration of 24 days. | [optional] |
| **vouchers_count** | **Integer** | Total number of unique vouchers in campaign. | [optional] |
| **start_date** | **Time** | Activation timestamp defines when the campaign starts to be active in ISO 8601 format. Campaign is *inactive before* this date. | [optional] |
| **expiration_date** | **Time** | Expiration timestamp defines when the campaign expires in ISO 8601 format. Campaign is *inactive after* this date. | [optional] |
| **active** | **Boolean** | A flag to toggle the campaign on or off. You can disable a campaign even though it's within the active period defined by the `start_date` and `expiration_date`. - `true` indicates an *active* campaign - `false` indicates an *inactive* campaign | [optional] |
| **metadata** | **Object** | The metadata object stores all custom attributes assigned to the campaign. A set of key/value pairs that you can attach to a campaign object. It can be useful for storing additional information about the campaign in a structured format. | [optional] |
| **created_at** | **Time** | Timestamp representing the date and time when the campaign was created in ISO 8601 format. | |
| **updated_at** | **Time** | Timestamp representing the date and time when the voucher was updated in ISO 8601 format. | [optional] |
| **created_at** | **Time** | Timestamp representing the date and time when the campaign was created. The value is shown in the ISO 8601 format. | [optional] |
| **updated_at** | **Time** | Timestamp representing the date and time when the campaign was last updated in ISO 8601 format. | [optional] |
| **category** | **String** | Unique category name. | [optional] |
| **creation_status** | **String** | Indicates the status of the campaign creation. | |
| **vouchers_generation_status** | **String** | Indicates the status of the campaign's vouchers. | |
| **protected** | **Boolean** | Indicates whether the resource can be deleted. | |
| **category_id** | **String** | Unique category ID that this campaign belongs to. | |
| **categories** | [**Array<Category>**](Category.md) | Contains details about the category. | |
| **object** | **String** | The type of object represented by JSON. This object stores information about the campaign. | [default to 'campaign'] |
| **creation_status** | **String** | Indicates the status of the campaign creation. | [optional] |
| **vouchers_generation_status** | **String** | Indicates the status of the campaign's voucher generation. | [optional] |
| **protected** | **Boolean** | Indicates whether the resource can be deleted. | [optional] |
| **category_id** | **String** | Unique category ID that this campaign belongs to. | [optional] |
| **categories** | [**Array<Category>**](Category.md) | Contains details about the category. | [optional] |
| **object** | **String** | The type of the object represented by JSON. This object stores information about the campaign. | [optional][default to 'campaign'] |
| **referral_program** | [**ReferralProgram**](ReferralProgram.md) | | [optional] |
| **loyalty_tiers_expiration** | [**LoyaltyTiersExpirationAll**](LoyaltyTiersExpirationAll.md) | | [optional] |
| **promotion** | [**PromotionTiersList**](PromotionTiersList.md) | | [optional] |
| **validation_rules_assignments** | [**ValidationRulesAssignmentsList**](ValidationRulesAssignmentsList.md) | | [optional] |
| **access_settings_assignments** | [**AccessSettingsCampaignAssignmentsList**](AccessSettingsCampaignAssignmentsList.md) | | [optional] |

Loading
Loading