Add the BizDev module
This commit is contained in:
parent
6be05e8fc5
commit
6992bea141
1 changed files with 48 additions and 0 deletions
48
app/lib/biz_dev.rb
Normal file
48
app/lib/biz_dev.rb
Normal file
|
@ -0,0 +1,48 @@
|
|||
module BizDev
|
||||
BIZ_DEV_MAPPING = {
|
||||
8 =>
|
||||
{
|
||||
full_name: "Camille Garrigue",
|
||||
pipedrive_id: 3189424
|
||||
},
|
||||
9 =>
|
||||
{
|
||||
full_name: "Philippe Vrignaud",
|
||||
pipedrive_id: 2753338
|
||||
},
|
||||
10 =>
|
||||
{
|
||||
full_name: "Benjamin Doberset",
|
||||
pipedrive_id: 4223834
|
||||
},
|
||||
11 =>
|
||||
{
|
||||
full_name: "Rédouane Bouchane",
|
||||
pipedrive_id: 4438645
|
||||
}
|
||||
}
|
||||
|
||||
BIZ_DEV_IDS = BIZ_DEV_MAPPING.keys
|
||||
|
||||
def full_name(administration_id)
|
||||
id = ensure_proper_administration_id(administration_id)
|
||||
|
||||
BIZ_DEV_MAPPING[id][:full_name]
|
||||
end
|
||||
|
||||
def pipedrive_id(administration_id)
|
||||
id = ensure_proper_administration_id(administration_id)
|
||||
|
||||
BIZ_DEV_MAPPING[id][:pipedrive_id]
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def ensure_proper_administration_id(administration_id)
|
||||
if administration_id.in?(BIZ_DEV_IDS)
|
||||
administration_id
|
||||
else
|
||||
BIZ_DEV_IDS[administration_id % BIZ_DEV_IDS.length]
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue