Skip to content

Commit 3f38e5d

Browse files
committed
changed updated_data query to name columns after the Salesforce Contact objects field names
1 parent f2da0b9 commit 3f38e5d

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/server/api/API_ingest/updated_data.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)