moved a bunch of churned customers templates to a hidden folder. Added to Sandata's script and the new groups. Notes.
This commit is contained in:
@ -1,41 +1,45 @@
|
||||
import tmp
|
||||
|
||||
webhook_payload:
|
||||
[
|
||||
|
||||
{
|
||||
id: dc9aafe3-eee7-4d50-a480-3bd9831b893a,
|
||||
email: it,
|
||||
type: person_properties,
|
||||
attributes:
|
||||
{
|
||||
properties:
|
||||
{
|
||||
agency_name: 32,
|
||||
agency_id: 323,
|
||||
medicaid_id: 22222,
|
||||
provider_id: 2123231234,
|
||||
learner_role: Agency Billing,
|
||||
learner_state: Ohio,
|
||||
evv-selection: aw;jakkd'l,
|
||||
oh_group_name: EVV,
|
||||
ca_group_name: None,
|
||||
cal_evv_id: None,
|
||||
successfully_completed_secondary_registration: true
|
||||
}
|
||||
}
|
||||
WEBHOOK_PAYLOAD = {
|
||||
id: " dc9aafe3-eee7-4d50-a480-3bd9831b893a",
|
||||
email: " it",
|
||||
type: " person_properties",
|
||||
attributes: {
|
||||
properties: {
|
||||
agency_name: " 32",
|
||||
agency_id: " 323",
|
||||
medicaid_id: " 22222",
|
||||
provider_id: " 2123231234",
|
||||
learner_role: " Agency Billing",
|
||||
learner_state: " Ohio",
|
||||
evv - selection: " aw;jakkd'l",
|
||||
oh_group_name: " EVV",
|
||||
ca_group_name: " None",
|
||||
cal_evv_id: " None",
|
||||
successfully_completed_secondary_registration: true,
|
||||
}
|
||||
]
|
||||
},
|
||||
}
|
||||
|
||||
for item in webhook_payload['payload']['array']:
|
||||
evv = item['attributes']['properties']['oh_group_name']
|
||||
state = item['attributes']['properties']['learner_state']
|
||||
group_result = [ref_state for ref_state in tmp.REF if state in ref_state]
|
||||
if len(group_result) > 1:
|
||||
for group in group_result:
|
||||
if evv in group:
|
||||
group_uuid = group[2]
|
||||
print(group_uuid)
|
||||
else:
|
||||
group_uuid = group_result[0][2]
|
||||
print(group_uuid)
|
||||
|
||||
def main(input):
|
||||
payload = input["webhook_payload"]
|
||||
for item in input["webhook_payload"]:
|
||||
evv = item["attributes"]["properties"]["oh_group_name"]
|
||||
state = item["attributes"]["properties"]["learner_state"]
|
||||
group_result = [ref_state for ref_state in REF if state in ref_state]
|
||||
try:
|
||||
if len(group_result) > 1:
|
||||
for group in group_result:
|
||||
if evv in group:
|
||||
group_uuid = group[2]
|
||||
else:
|
||||
group_uuid = group_result[0][2]
|
||||
except ValueError:
|
||||
pass
|
||||
finally:
|
||||
return {"group_uuid": group_uuid}
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user