@@ -14,10 +14,10 @@ def get_updated_contact_data():
14
14
with ev_dates as
15
15
(select
16
16
person_id,
17
- max(case when event_type=1 then time else null end) adopt,
18
- max(case when event_type=2 then time else null end) foster_out,
17
+ max(case when event_type=1 then time else null end) * 1000 adopt,
18
+ max(case when event_type=2 then time else null end) * 1000 foster_out,
19
19
-- max(case when event_type=3 then time else null end) rto,
20
- max(case when event_type=5 then time else null end) foster_return
20
+ max(case when event_type=5 then time else null end) * 1000 foster_return
21
21
22
22
from
23
23
sl_animal_events sla
@@ -32,7 +32,7 @@ def get_updated_contact_data():
32
32
select json_agg (upd) as "cd" from (
33
33
select
34
34
slsf.source_id as "Contact_Record_Id__c" , -- long salesforce string
35
- slp.id as "Person_Id__c" , -- short PAWS-local shelterluv id
35
+ slp.internal_id as "Person_Id__c" , -- short PAWS-local shelterluv id
36
36
37
37
--case
38
38
-- when
@@ -45,8 +45,8 @@ def get_updated_contact_data():
45
45
foster_out as "Updated_Foster_Start_Date__c",
46
46
foster_return as "Updated_Foster_End_Date__c",
47
47
48
- extract(epoch from min(vs.from_date)) as "Updated_First_Volunteer_Date__c",
49
- extract(epoch from max(vs.from_date)) as "Updated_Last_Volunteer_Date__c",
48
+ extract(epoch from min(vs.from_date)) * 1000 as "Updated_First_Volunteer_Date__c",
49
+ extract(epoch from max(vs.from_date)) * 1000 as "Updated_Last_Volunteer_Date__c",
50
50
sum(vs.hours) as "Updated_Total_Volunteer_Hours__c",
51
51
vc.source_id::integer as "Volgistics_Id__c"
52
52
@@ -63,7 +63,7 @@ def get_updated_contact_data():
63
63
64
64
group by
65
65
slsf.source_id,
66
- slp.id ,
66
+ slp.internal_id ,
67
67
vc.source_id,
68
68
foster_out ,
69
69
foster_return
0 commit comments