@@ -16,18 +16,18 @@ def get_updated_contact_data():
1616 select
1717 sf.source_id as "Id" , -- long salesforce string
1818 sle.person_id as "Person_Id__c", -- short PAWS-local shelterluv id
19- -- case
20- -- when
21- -- (extract(epoch from now())::bigint - foster_out < 365*86400) -- foster out in last year
22- -- or (extract(epoch from now())::bigint - foster_return < 365*86400) -- foster return
23- -- then 'Active'
24- -- else 'Inactive'
25- -- end as "Updated_Recent_Foster_Activity__c ",
26- foster_out as "Updated_Foster_Start_Date__c ",
27- foster_return as "Updated_Foster_End_Date__c ",
28- vol.first_date "Updated_First_Volunteer_Date__c ",
29- vol.last_date "Updated_Last_Volunteer_Date__c ",
30- vol.hours as "Updated_Total_Volunteer_Hours__c ",
19+ case
20+ when
21+ (extract(epoch from now())::bigint - foster_out < 365*86400) -- foster out in last year
22+ or (extract(epoch from now())::bigint - foster_return < 365*86400) -- foster return
23+ then 'Active'
24+ else 'Inactive'
25+ end as "Foster_Activity__c ",
26+ foster_out as "Foster_Start_Date__c ",
27+ foster_return as "Foster_End_Date__c ",
28+ vol.first_date "First_volunteer_date__c ",
29+ vol.last_date "Last_volunteer_date__c ",
30+ vol.hours as "Total_volunteer_hours__c ",
3131 vc.source_id::integer as "Volgistics_Id__c"
3232 from (
3333 select source_id, matching_id from pdp_contacts sf
0 commit comments