connectwise_sdk 0.0.10 → 0.0.11

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: 70ce73cadcc0bc9f53aef9d11f95088b34e5dc33
4
- data.tar.gz: 03fae785f7477983b3e17d279a2c94c3bafabb08
3
+ metadata.gz: 59719857b1137c92f2069632546dafb209909cbc
4
+ data.tar.gz: ebb3dd44f5feaa449268e97013e802bca925e8b0
5
5
  SHA512:
6
- metadata.gz: 36e9eebd4e99ab3a62dbc3e9a5df86edfd34838b7d6fb7acd52b4bebf00962c78a22646a8182590b1bc98a54ff80b186d10a58a9fe30cd6014780025e23f6c5e
7
- data.tar.gz: 4b03d8dd15d1b8b785ddb225cf78f8043fe944497abde3b639f25e272b424ab8c6f372442d9238502e18f5fdf4ad1f87531ecf118745db53ebc1970c816893d4
6
+ metadata.gz: 7610d28b69c7f71ff751c43fbd5b48cf94e45a26be07757dd581caf41cb4a67d81a75e6480d8a7cc9eb757e594c510fd9e6caac1908731fd04a5296d0205809e
7
+ data.tar.gz: 73e74dffb140980811b5750b2780ef39ca6893c2559799a00252b2db8d792e7393e3f73c173266b369a669e2d59ab9e629091a7adc6c046baee148adf6bd703d
@@ -4,7 +4,7 @@ module Connectwise
4
4
  class Ticket
5
5
  include Model
6
6
  model_name 'service_ticket'
7
- attr_accessor :id, :summary, :problem_description, :status_name, :board, :site_name, :status, :resolution, :remote_internal_company_name, :priority, :source, :severity, :impact, :company, :company_id, :closed_flag, :member_id, :member_rec_id
7
+ attr_accessor :id, :summary, :problem_description, :status_name, :board, :site_name, :status, :resolution, :remote_internal_company_name, :priority, :source, :severity, :impact, :company, :company_id, :closed_flag, :member_id, :member_rec_id, :notes
8
8
 
9
9
  #TODO - The use of SrServiceRecid and TicketNumber instead of id - may want to configure these
10
10
  # but this is so inconsistent for tickets that it may not be worth it unless other calls do the same thing
@@ -48,6 +48,10 @@ module Connectwise
48
48
  private
49
49
  def self.find_transform(attrs)
50
50
  attrs[:id] = attrs.delete(:ticket_number) || attrs.delete(:sr_service_rec_id)
51
+ notes = normalize_find_response(attrs[:detail_notes]) + normalize_find_response(attrs[:internal_notes]) + normalize_find_response(attrs[:resolution_notes])
52
+ attrs[:notes] = notes.compact.map do |note|
53
+ TicketNote.new(@connection, **note)
54
+ end
51
55
  attrs
52
56
  end
53
57
 
@@ -1,3 +1,3 @@
1
1
  module Connectwise
2
- VERSION = "0.0.10"
2
+ VERSION = "0.0.11"
3
3
  end
@@ -85,4 +85,19 @@ describe Connectwise::Ticket do
85
85
  expect(ticket.company_id).to eq entity['CompanyId']
86
86
  expect(ticket.member_id).to eq entity['memberId']
87
87
  end
88
+
89
+ it 'allows access to the notes contained within it' do
90
+ subject.company = company.save
91
+ new_ticket = subject.save
92
+ new_ticket.add_note('this api sucks')
93
+ resp = Connectwise::Ticket.find(conn, new_ticket.id)
94
+ expect(resp.notes).to be_kind_of(Array)
95
+ end
96
+
97
+ it 'allows access to the note contained within it' do
98
+ subject.company = company.save
99
+ new_ticket = subject.save
100
+ resp = Connectwise::Ticket.find(conn, new_ticket.id)
101
+ expect(resp.notes).to be_kind_of(Array)
102
+ end
88
103
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: connectwise_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.10
4
+ version: 0.0.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Emery A. Miller
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-13 00:00:00.000000000 Z
11
+ date: 2014-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler