go_import 3.0.22 → 3.0.23

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MzkxYmMwYWUwM2M0MjE1YTZmNzA0YjdiN2Q5NWZmMTk0YWVkZDhiOQ==
4
+ NzczNzgyNTkzYzM5MjhkZjk1YjExNDFhMDc4M2U3NzRlMGU2YTI2Nw==
5
5
  data.tar.gz: !binary |-
6
- NzBkM2ZkMDkzNWQ1MGM0MDc5MmU5MzBmNDMzYmMwNGRjNGQ5YmVkMg==
6
+ ZmQwZjAyMGJkMzNmZWZjOTE3MDM2ZWRmMDgyNTQ4MGExMTFlYzcxYQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- N2Y4ZTM1ZWQxNDAyYmQ5MWVhZmE5OGM1NzYzOTJhYTliOWVjNDZjN2I1YmMy
10
- MTVkOGU1N2I1ZjVmNmYyYTcwZWQ1YTE0ODQzM2I4OTZlZTFmYTRhM2Q4NDFi
11
- ODFjMzI5NDYyNmFjMjAwMDVhODE0ODliNTQ0NGRhNWUwNGQ4MzM=
9
+ Y2I4Zjk5MmExODRlY2ExMWQ3YmM0ZDNkM2RhYzg5YTFhMjEyNzZjYjg2M2Mx
10
+ ODExMjdhNjU3OWFmMTQwYjA2OGJkOWRhNjY4YTlkMDRhZmI3N2I5ZGFiYWMy
11
+ OGQ5N2Y3M2ZiODc3OTFjZjNmMGMyZjkyZGYzYzJmY2ZiNGUyZjI=
12
12
  data.tar.gz: !binary |-
13
- ZWRkYWI2MGRiZDI1YTcxZmVlNTUyNWNhOWUxZTc0ZmQyZWY4Nzg3YzdlMzI0
14
- ZTY3YTZkYjA5MjZlZWRkNWNlOWQ2YzJlZjEzNTZlNTNjYjJlNjA0OWEzMGVk
15
- ZmRjMDJlNjU0YjEwZjdmYTAxNTM5MzFjYzlhMmI5OWUzNWQ4Y2I=
13
+ ZmZlODEzYWQxZmU1NjAxYWQ5OTdjYmRmMTQ1MTAzOGQxYWI3OGIyNWVlMDEx
14
+ ZmRhZjYwODMzZDYzMmM1NzM5Zjc3Nzk3ZjQyYWI3OTUyYTRiOTk4NWE5YjMz
15
+ ZDcxNWMzZDcwZTNlYmM2NmY2ZmMzODdmYzUxZGIzMDE4NjhmYzk=
@@ -125,7 +125,7 @@ module GoImport
125
125
  # statuses during import (you will probably add the
126
126
  # DealStatusSettings to the settings model). If the statuses
127
127
  # already exists in the application use the status label
128
- # (String) or id (Integer) here.
128
+ # (String) or integration id (Integer) here.
129
129
  def status=(status)
130
130
  @status = DealStatus.new if @status.nil?
131
131
 
@@ -5,6 +5,10 @@ module GoImport
5
5
  class DealClassSettings < ClassSettings
6
6
  attr_reader :statuses
7
7
 
8
+ attr_reader :default_status
9
+
10
+
11
+
8
12
  def initialize(opt = nil)
9
13
  @statuses = []
10
14
  if opt != nil
@@ -16,7 +20,9 @@ module GoImport
16
20
  end
17
21
 
18
22
  def serialize_variables
19
- super() + [{:id => :statuses, :type => :statuses }]
23
+ super() + [{:id => :statuses, :type => :statuses },
24
+ {:id => :default_status, :type => :deal_status_reference}
25
+ ]
20
26
  end
21
27
 
22
28
  def add_status(obj)
@@ -48,6 +54,22 @@ module GoImport
48
54
  return status
49
55
  end
50
56
 
57
+ # Sets the default status for new deals. When a deal is
58
+ # created in LIME Go it will get this status. Valid values are
59
+ # an integration_id or label. The status must exist or be
60
+ # created with this import.
61
+ def default_status=(status)
62
+ if status.nil?
63
+ return
64
+ end
65
+
66
+ if status.is_a?(DealStatusReference)
67
+ @default_status = status
68
+ else
69
+ @default_status = DealStatusReference.from_deal_status(status)
70
+ end
71
+ end
72
+
51
73
  def find_status_by_label(label)
52
74
  return nil if @statuses.nil? || label.nil?
53
75
 
@@ -99,6 +99,18 @@ describe "DealClassSettings" do
99
99
  # then
100
100
  status.should eq nil
101
101
  end
102
+
103
+ it "default status must be a deal status reference" do
104
+ # given
105
+ deal_class_settings.add_status({:label => '1. Kvalificering', :integration_id => 'qualify'})
106
+ deal_class_settings.add_status({:label => "2. Skickat offert", :integration_id => "tender sent"})
107
+
108
+ # when
109
+ deal_class_settings.default_status = '1. Kvalificering'
110
+
111
+ # then
112
+ deal_class_settings.default_status.is_a?(GoImport::DealStatusReference)
113
+ end
102
114
  end
103
115
 
104
116
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: go_import
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.22
4
+ version: 3.0.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oskar Gewalli