centaman 4.0.5 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f2257fe17a58d628c7cefcdfdb8f0a64508277c2ab590a6f0930a436eead0875
4
- data.tar.gz: e30f7fc3c8f30a448123282a16b0ee4e834f44e9616788b2f8804bc52c693b4e
3
+ metadata.gz: 294533b04ffeddf23c945591d3fa6417c026c61cc79a66256127a5a1aa948580
4
+ data.tar.gz: f619c092dfa90b48cc6ae6f6da988303af70e40315eb79f7d6933e7c9135a038
5
5
  SHA512:
6
- metadata.gz: 7d9ecadde582c7fdad2ab99f1ba85be8a26bbeb5ac37870ef4541aed56f9cb13c65afd716876da5def53c4fc6c11310008c4a7ee79deeb50e9b8e645ad7f8723
7
- data.tar.gz: 18018a3bb5bec62a7636985cec8afa2d96c401986414debeec5d19d88877b2838d19a6beb609db3163c560ad1a7b18d95c6efeb10bafa168c762c347372162a6
6
+ metadata.gz: aae88015f47144cd77f984bb13dfd249ece5afca137132e7d82a810b366400aa7e692bc1d9c4cd4f60fc85546fb0e8ad891bb52e7d105f97f0c459ad1595eddb
7
+ data.tar.gz: 1dd84f04bf8e2f2716e026c1520f332655418f7f6db45d0b1e2933aab31ed8e4bfea99f865bd1571dcfdce2f36a739a9e098a298d342bbddf7fdb9e2bcc7fee7
@@ -30,6 +30,26 @@ module Centaman
30
30
  centaman_key: 'UsesRemaining',
31
31
  app_key: :uses_remaining,
32
32
  type: :integer
33
+ ),
34
+ Centaman::Attribute.new(
35
+ centaman_key: 'ConditionForUse',
36
+ app_key: :condition_for_use,
37
+ type: :string
38
+ ),
39
+ Centaman::Attribute.new(
40
+ centaman_key: 'CouponStockID',
41
+ app_key: :coupon_stock_id,
42
+ type: :integer
43
+ ),
44
+ Centaman::Attribute.new(
45
+ centaman_key: 'IsValidForNewMembership',
46
+ app_key: :is_valid_for_new_membership,
47
+ type: :boolean
48
+ ),
49
+ Centaman::Attribute.new(
50
+ centaman_key: 'IsvalidForRenewMembership',
51
+ app_key: :is_valid_for_renew_membership,
52
+ type: :boolean
33
53
  )
34
54
  ]
35
55
  end
@@ -1,6 +1,18 @@
1
1
  module Centaman
2
2
  class Object::Effect < Centaman::Object
3
3
  # rubocop:disable Metrics/MethodLength
4
+ def dollar_discount
5
+ effect_type == 'DiscountAmount'
6
+ end
7
+
8
+ def percent_discount
9
+ effect_type == 'DiscountPercent'
10
+ end
11
+
12
+ def override_discount
13
+ effect_type == 'PriceOverride'
14
+ end
15
+
4
16
  def attributes
5
17
  [
6
18
  Centaman::Attribute.new(
@@ -48,9 +48,9 @@ module Centaman
48
48
  return {} unless coupon_service.coupon_applies(add_on)
49
49
  {
50
50
  'Coupon': {
51
- "CouponCode": coupon.code,
51
+ "CouponCode": coupon.coupon_code,
52
52
  "DiscountAmount": coupon_service.amount_saved(add_on),
53
- "StockID": coupon.stock_code
53
+ "StockID": coupon.coupon_stock_id
54
54
  }
55
55
  }
56
56
  end
@@ -1,3 +1,3 @@
1
1
  module Centaman
2
- VERSION = "4.0.5"
2
+ VERSION = "5.0.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: centaman
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.5
4
+ version: 5.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - francirp
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2018-03-15 00:00:00.000000000 Z
12
+ date: 2018-04-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler