atol 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eaa6d279dc4327059f9506c8cf7e82d238207ca4
4
- data.tar.gz: aeb95695cf7abaaa20241d7ca1b8a7a2283a9a5e
3
+ metadata.gz: c0ff541b6a0a75a0f0389369f92a39fca0db4301
4
+ data.tar.gz: d3eb8d7e57ac97399f714faad701f110de417f5b
5
5
  SHA512:
6
- metadata.gz: cb130da1394655b7d508532058fbee0ebafb3ddc961f6108d84347e7764a62ab4e21f0e3c809acfbe7db3a19fc31dc8749dcfb77911708f2f07a2669e32446d2
7
- data.tar.gz: ad87645fc6f8344161ee39610d1075320fc56d6133093bf040c31ae123ab70ad77a6516862b51e16f8b0e744de52c97fae7c3bb5e2f12a49f3a0b9f4813dd49c
6
+ metadata.gz: aa5424db538ad60b2eb9bb347c5e2022841998f162205086171c69d7efec095df465f39e14dc01ee30fbe4d58789c8cb076fca86fb9ea7a77a4515e66332faf4
7
+ data.tar.gz: 68c78330cc87bf04226781ec66f528b5233dda1a1a0b59dd70e7ec95cbd7e8342cc242813f1c290158556552cb63f714ddf4565286deedba536158fa522ea995
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- atol (0.1.1)
4
+ atol (0.1.2)
5
5
  anyway_config (~> 1.0)
6
6
 
7
7
  GEM
data/lib/atol/errors.rb CHANGED
@@ -24,6 +24,7 @@ module Atol
24
24
  class StateExpiredTokenError < StandardError; end
25
25
  class StateMissingUuidError < StandardError; end
26
26
  class StateNotFoundError < StandardError; end
27
+ class ZeroItemQuantityError < StandardError; end
27
28
 
28
29
  ERRORS = Hash[
29
30
  1 => BadJSONError,
@@ -43,6 +44,7 @@ module Atol
43
44
  15 => StateMissingUuidError,
44
45
  16 => StateNotFoundError,
45
46
  22 => GroupCodeToTokenError,
46
- 23 => IsNullExternalIdError
47
+ 23 => IsNullExternalIdError,
48
+ -3804 => ZeroItemQuantityError
47
49
  ].freeze
48
50
  end
@@ -8,6 +8,8 @@ module Atol
8
8
  def initialize(name:, price:, quantity: 1, config: nil)
9
9
  @config = config || Atol.config
10
10
 
11
+ raise Atol::ZeroItemQuantityError if quantity.to_i.zero?
12
+
11
13
  @body = Hash[]
12
14
  @body[:name] = name
13
15
  @body[:price] = price.to_f
data/lib/atol/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Atol
2
2
  module Version
3
3
  API = 'v3'.freeze
4
- LIB = '0.1.1'.freeze
4
+ LIB = '0.1.2'.freeze
5
5
  end
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: atol
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - GeorgeGorbanev