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 +4 -4
- data/lib/sellsy/custom_field.rb +2 -0
- data/lib/sellsy/customer.rb +4 -2
- data/lib/sellsy/opportunity.rb +1 -1
- data/lib/sellsy/prospect.rb +6 -4
- data/lib/sellsy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 165af8ae3b65cccc9b2034b90bb589fb7f0161341bb4ef37f66def892cbb01c4
|
4
|
+
data.tar.gz: 6e64eebc0fc8c72c15a762ac87f5b3f810c419a59900195b80e295f148b7c373
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77a2821b78be6529a6fdd1ebc03d359874f9f3fb6a0209f99395bb6ccaf7c3f4ec81f8b3e8f2c40b2491755db86e2dd2de07f2c89214b484d202bb61ae243234
|
7
|
+
data.tar.gz: 7c9a532fd7e3d50d61c90132c0ac35b19fb631aca78bba4aa9c7998848d35591850ff8210965aa7fdbbc1c1dfb4d7089944a537c4ebf61a46c8cd974fd6f9e58
|
data/lib/sellsy/custom_field.rb
CHANGED
data/lib/sellsy/customer.rb
CHANGED
@@ -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' => '
|
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
|
data/lib/sellsy/opportunity.rb
CHANGED
data/lib/sellsy/prospect.rb
CHANGED
@@ -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' => '
|
53
|
+
'name' => 'Adresse principale',
|
53
54
|
'part1' => @address.split(/(\r\n?)/)[0],
|
54
|
-
'part2' => @address.split(/(\r\n?)/)[
|
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
|
data/lib/sellsy/version.rb
CHANGED
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.
|
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-
|
14
|
+
date: 2020-03-20 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: multi_json
|