From a9be1eeb7cd3143d6694760a2c1b245c1f6ee5e9 Mon Sep 17 00:00:00 2001 From: "CHIEFSOFT\\ameye" Date: Sun, 8 Mar 2026 08:19:57 -0400 Subject: [PATCH] added penal dags --- automation/dags/digifi_penal.py | 47 +++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 automation/dags/digifi_penal.py diff --git a/automation/dags/digifi_penal.py b/automation/dags/digifi_penal.py new file mode 100644 index 0000000..d297e13 --- /dev/null +++ b/automation/dags/digifi_penal.py @@ -0,0 +1,47 @@ + +from airflow import DAG +from airflow.operators.dummy import DummyOperator +# from airflow.operators.python import PythonOperator +from airflow.operators.python_operator import PythonOperator +from datetime import datetime, timedelta +from airflow.models import Variable + +import requests + +default_args = { + 'owner': 'DigiFi', + 'depends_on_past': False, + 'start_date': datetime(2022, 1, 1), + 'email_on_failure': False, + 'email_on_retry': False, + 'retries': 1 +} + + +def DigiFiTrxPenal(**kwargs): + url = kwargs["api_host"] + "/autocall/process-penal-charges" + querystring= {"testuser":"ameye"} + response = requests.request("GET", url, params=querystring) + print(response.text) + +with DAG( + dag_id="DIGIFI_CRON_PENALS", + default_args=default_args, + start_date=datetime(2024, 9, 1, 10, 00), + schedule_interval=timedelta(minutes=1), + catchup=False) as dag: + t1 = PythonOperator( + task_id = "digifi_cron_penal_-charges", + python_callable= DigiFiTrxPenal, + op_kwargs={ + "api_host" : Variable.get("DIGIFI_EVENT_HOST") + } + ) + + t2 = DummyOperator( + task_id="end" + ) + + t1 >> t2 + +