sellsy-client 0.1.0 → 0.2.0

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
  SHA256:
3
- metadata.gz: 78b03e7b612e383e392d3787bec683bffa6dca68a58c3f97db72376db5c839cf
4
- data.tar.gz: d64a36eecac409851efd06e4f20ee93ebb164afe78b0cf93c07e4309b4ff7b16
3
+ metadata.gz: 165af8ae3b65cccc9b2034b90bb589fb7f0161341bb4ef37f66def892cbb01c4
4
+ data.tar.gz: 6e64eebc0fc8c72c15a762ac87f5b3f810c419a59900195b80e295f148b7c373
5
5
  SHA512:
6
- metadata.gz: aeaeddef7c89273e8902ba8fb9440c22270375acb1dfbfa7ba6e68e6e4ea9c8d2f173f3206fd7da2b9bbff179e6cc59c212c67eb0d15ce64260f76eeeb7a77dd
7
- data.tar.gz: c3e014c216c40e60395f840e8497256adaeb33eb3889555bc2971306d68426610a5e8979ebd7187bf2fecd53890cee92c1f7a2111acf449d9d0c248fdc3451a8
6
+ metadata.gz: 77a2821b78be6529a6fdd1ebc03d359874f9f3fb6a0209f99395bb6ccaf7c3f4ec81f8b3e8f2c40b2491755db86e2dd2de07f2c89214b484d202bb61ae243234
7
+ data.tar.gz: 7c9a532fd7e3d50d61c90132c0ac35b19fb631aca78bba4aa9c7998848d35591850ff8210965aa7fdbbc1c1dfb4d7089944a537c4ebf61a46c8cd974fd6f9e58
@@ -32,6 +32,8 @@ module Sellsy
32
32
  'prospect'
33
33
  when Opportunity
34
34
  'opportunity'
35
+ when Contact
36
+ 'people'
35
37
  when Document
36
38
  'document'
37
39
  else
@@ -4,7 +4,7 @@ module Sellsy
4
4
  class Customer
5
5
  attr_accessor :id, :title, :name, :first_name, :last_name, :structure_name, :category, :college_type, :siret,
6
6
  :ape, :legal_type, :role, :birth_date, :address, :postal_code, :town, :country, :telephone, :email,
7
- :website, :payment_method, :person_type, :apidae_member_id
7
+ :website, :payment_method, :person_type, :apidae_member_id, :main_contact_id
8
8
 
9
9
  def create
10
10
  command = {
@@ -29,6 +29,7 @@ module Sellsy
29
29
 
30
30
  def api_params
31
31
  {
32
+ 'id' => @id,
32
33
  'third' => {
33
34
  'name' => person_type == 'pp' ? @name : @structure_name,
34
35
  'type' => person_type == 'pp' ? 'person' : 'corporation',
@@ -49,7 +50,7 @@ module Sellsy
49
50
  'position' => @role,
50
51
  },
51
52
  'address' => {
52
- 'name' => 'adresse souscription',
53
+ 'name' => 'Adresse principale',
53
54
  'part1' => @address.split(/(\r\n?)/)[0],
54
55
  'part2' => @address.split(/(\r\n?)/)[0],
55
56
  'zip' => @postal_code,
@@ -77,6 +78,7 @@ module Sellsy
77
78
  client.name = value['name']
78
79
  client.joindate = value['joindate']
79
80
  client.type = value['type']
81
+ client.main_contact_id = value['maincontactid']
80
82
  end
81
83
 
82
84
  client
@@ -86,7 +86,7 @@ module Sellsy
86
86
  command = {
87
87
  'method' => 'Opportunities.getOne',
88
88
  'params' => {
89
- 'clientid' => id
89
+ 'id' => id
90
90
  }
91
91
  }
92
92
 
@@ -2,10 +2,9 @@ require 'multi_json'
2
2
 
3
3
  module Sellsy
4
4
  class Prospect
5
-
6
5
  attr_accessor :id, :title, :name, :first_name, :last_name, :structure_name, :category, :college_type, :siret,
7
6
  :ape, :legal_type, :role, :birth_date, :address, :postal_code, :town, :country, :telephone, :email,
8
- :website, :payment_method, :person_type, :apidae_member_id
7
+ :website, :payment_method, :person_type, :apidae_member_id, :main_contact_id
9
8
 
10
9
  def create
11
10
  command = {
@@ -30,6 +29,7 @@ module Sellsy
30
29
 
31
30
  def api_params
32
31
  {
32
+ 'id' => @id,
33
33
  'third' => {
34
34
  'name' => person_type == 'pp' ? @name : @structure_name,
35
35
  'type' => person_type == 'pp' ? 'person' : 'corporation',
@@ -47,11 +47,12 @@ module Sellsy
47
47
  'tel' => @telephone,
48
48
  'mobile' => @telephone,
49
49
  'position' => @role,
50
+ 'birthdate' => @birth_date.blank? ? '' : Date.parse(@birth_date).to_datetime.to_i
50
51
  },
51
52
  'address' => {
52
- 'name' => 'adresse souscription',
53
+ 'name' => 'Adresse principale',
53
54
  'part1' => @address.split(/(\r\n?)/)[0],
54
- 'part2' => @address.split(/(\r\n?)/)[0],
55
+ 'part2' => @address.split(/(\r\n?)/)[1],
55
56
  'zip' => @postal_code,
56
57
  'town' => @town,
57
58
  'countrycode' => @country.upcase
@@ -75,6 +76,7 @@ module Sellsy
75
76
  value = response['response']['client']
76
77
  prospect.id = value['id']
77
78
  prospect.name = value['name']
79
+ prospect.main_contact_id = value['maincontactid']
78
80
  end
79
81
 
80
82
  return prospect
@@ -1,3 +1,3 @@
1
1
  module Sellsy
2
- VERSION = "0.1.0"
2
+ VERSION = "0.2.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sellsy-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jens Stammers
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2020-02-28 00:00:00.000000000 Z
14
+ date: 2020-03-20 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: multi_json