SUPPORT-9127 : add deferment hpl's

This commit is contained in:
AlexSave 2025-04-20 14:43:47 +03:00
parent 81e81a8790
commit 84546e8a64
3 changed files with 526 additions and 1 deletions

View file

@ -0,0 +1,108 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>deferment_reason_once</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/04/20 13:49:26.080</created_date>
<modified_user>-</modified_user>
<modified_date>2025/04/20 13:49:26.080</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>Table input 2</from>
<to>Table output</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Table input 2</name>
<type>TableInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu_person_registry</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>select
code,
value,
true as actual
from ervu_reason_for_deferment
where hidden is false;</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>304</xloc>
<yloc>304</yloc>
</GUI>
</transform>
<transform>
<name>Table output</name>
<type>TableOutput</type>
<description/>
<distribute>N</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>1000</commit>
<connection>ervu-dashboard</connection>
<fields>
<field>
<column_name>code</column_name>
<stream_name>code</stream_name>
</field>
<field>
<column_name>value</column_name>
<stream_name>value</stream_name>
</field>
<field>
<column_name>actual</column_name>
<stream_name>actual</stream_name>
</field>
</fields>
<ignore_errors>N</ignore_errors>
<only_when_have_rows>N</only_when_have_rows>
<partitioning_daily>N</partitioning_daily>
<partitioning_enabled>N</partitioning_enabled>
<partitioning_field/>
<partitioning_monthly>Y</partitioning_monthly>
<return_field/>
<return_keys>N</return_keys>
<schema>ervu_dashboard</schema>
<specify_fields>Y</specify_fields>
<table>deferment_reason</table>
<tablename_field/>
<tablename_in_field>N</tablename_in_field>
<tablename_in_table>Y</tablename_in_table>
<truncate>N</truncate>
<use_batch>Y</use_batch>
<attributes/>
<GUI>
<xloc>528</xloc>
<yloc>304</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -0,0 +1,307 @@
<?xml version="1.0" encoding="UTF-8"?>
<pipeline>
<info>
<name>deferments_once</name>
<name_sync_with_filename>Y</name_sync_with_filename>
<description/>
<extended_description/>
<pipeline_version/>
<pipeline_type>Normal</pipeline_type>
<parameters>
</parameters>
<capture_transform_performance>N</capture_transform_performance>
<transform_performance_capturing_delay>1000</transform_performance_capturing_delay>
<transform_performance_capturing_size_limit>100</transform_performance_capturing_size_limit>
<created_user>-</created_user>
<created_date>2025/04/20 11:21:19.116</created_date>
<modified_user>-</modified_user>
<modified_date>2025/04/20 11:21:19.116</modified_date>
</info>
<notepads>
</notepads>
<order>
<hop>
<from>deferment_right_input</from>
<to>deferment_right_output</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>deferment_input</from>
<to>deferment_output</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>deferment_right_output</from>
<to>Update</to>
<enabled>Y</enabled>
</hop>
<hop>
<from>deferment_output</from>
<to>Update 2</to>
<enabled>Y</enabled>
</hop>
</order>
<transform>
<name>Update</name>
<type>Update</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>1000</commit>
<connection>ervu-dashboard</connection>
<error_ignored>Y</error_ignored>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>citizen</table>
<value>
<name>has_deferment_right</name>
<rename>has_deferment_right</rename>
</value>
</lookup>
<skip_lookup>N</skip_lookup>
<use_batch>Y</use_batch>
<attributes/>
<GUI>
<xloc>720</xloc>
<yloc>208</yloc>
</GUI>
</transform>
<transform>
<name>Update 2</name>
<type>Update</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>1000</commit>
<connection>ervu-dashboard</connection>
<error_ignored>Y</error_ignored>
<lookup>
<key>
<condition>=</condition>
<field>recruit_id</field>
<name>recruit_id</name>
</key>
<schema>ervu_dashboard</schema>
<table>citizen</table>
<value>
<name>has_deferment</name>
<rename>has_active_deferment</rename>
</value>
<value>
<name>has_exemption</name>
<rename>has_exemption</rename>
</value>
</lookup>
<skip_lookup>N</skip_lookup>
<use_batch>Y</use_batch>
<attributes/>
<GUI>
<xloc>720</xloc>
<yloc>336</yloc>
</GUI>
</transform>
<transform>
<name>deferment_input</name>
<type>TableInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu_person_registry</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>select
ddd.recruit_id,
ddd.decision_number,
ddd.type->>'value' as deferment_type,
ddd.decision_date as start_date,
ddd.postponement_date as end_date,
ddd.base_deferment as reason_code,
ddd.type->>'code' = '1' as has_active_deferment,
ddd.type->>'code' = '2' as has_exemption,
not ddd.hidden as active
from decision_deferment_dto ddd
join public.recruits r
ON r.id = ddd.recruit_id
AND (r.target_recruitment_id= '${RCRT_C}' or r.current_recruitment_id = '${RCRT_C}')
where hidden is false;</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>272</xloc>
<yloc>336</yloc>
</GUI>
</transform>
<transform>
<name>deferment_output</name>
<type>TableOutput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>1000</commit>
<connection>ervu-dashboard</connection>
<fields>
<field>
<column_name>recruit_id</column_name>
<stream_name>recruit_id</stream_name>
</field>
<field>
<column_name>decision_number</column_name>
<stream_name>decision_number</stream_name>
</field>
<field>
<column_name>type</column_name>
<stream_name>deferment_type</stream_name>
</field>
<field>
<column_name>start_date</column_name>
<stream_name>start_date</stream_name>
</field>
<field>
<column_name>end_date</column_name>
<stream_name>end_date</stream_name>
</field>
<field>
<column_name>reason_code</column_name>
<stream_name>reason_code</stream_name>
</field>
<field>
<column_name>active</column_name>
<stream_name>active</stream_name>
</field>
</fields>
<ignore_errors>N</ignore_errors>
<only_when_have_rows>N</only_when_have_rows>
<partitioning_daily>N</partitioning_daily>
<partitioning_enabled>N</partitioning_enabled>
<partitioning_monthly>Y</partitioning_monthly>
<return_keys>N</return_keys>
<schema>ervu_dashboard</schema>
<specify_fields>Y</specify_fields>
<table>citizen_deferment</table>
<tablename_in_field>N</tablename_in_field>
<tablename_in_table>Y</tablename_in_table>
<truncate>N</truncate>
<use_batch>Y</use_batch>
<attributes/>
<GUI>
<xloc>544</xloc>
<yloc>336</yloc>
</GUI>
</transform>
<transform>
<name>deferment_right_input</name>
<type>TableInput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<connection>ervu_person_registry</connection>
<execute_each_row>N</execute_each_row>
<limit>0</limit>
<sql>select
rd.recruit_id,
rd.date_of_information as start_date,
rd.postponement_date as end_date,
erfd.code,
true as has_deferment_right
from recruits_deferment rd
join ervu_reason_for_deferment erfd
on erfd.id = rd.ervu_reason_for_deferment_id
join public.recruits r
ON r.id = rd.recruit_id
AND (r.target_recruitment_id= '${RCRT_C}' or r.current_recruitment_id = '${RCRT_C}')
where rd.hidden is false;</sql>
<variables_active>N</variables_active>
<attributes/>
<GUI>
<xloc>272</xloc>
<yloc>208</yloc>
</GUI>
</transform>
<transform>
<name>deferment_right_output</name>
<type>TableOutput</type>
<description/>
<distribute>Y</distribute>
<custom_distribution/>
<copies>1</copies>
<partitioning>
<method>none</method>
<schema_name/>
</partitioning>
<commit>1000</commit>
<connection>ervu-dashboard</connection>
<fields>
<field>
<column_name>recruit_id</column_name>
<stream_name>recruit_id</stream_name>
</field>
<field>
<column_name>start_date</column_name>
<stream_name>start_date</stream_name>
</field>
<field>
<column_name>end_date</column_name>
<stream_name>end_date</stream_name>
</field>
<field>
<column_name>code</column_name>
<stream_name>code</stream_name>
</field>
<field>
<column_name>actual</column_name>
<stream_name>has_deferment_right</stream_name>
</field>
</fields>
<ignore_errors>N</ignore_errors>
<only_when_have_rows>N</only_when_have_rows>
<partitioning_daily>N</partitioning_daily>
<partitioning_enabled>N</partitioning_enabled>
<partitioning_monthly>Y</partitioning_monthly>
<return_keys>N</return_keys>
<schema>ervu_dashboard</schema>
<specify_fields>Y</specify_fields>
<table>citizen_deferment_right</table>
<tablename_in_field>N</tablename_in_field>
<tablename_in_table>Y</tablename_in_table>
<truncate>N</truncate>
<use_batch>Y</use_batch>
<attributes/>
<GUI>
<xloc>544</xloc>
<yloc>208</yloc>
</GUI>
</transform>
<transform_error_handling>
</transform_error_handling>
<attributes/>
</pipeline>

View file

@ -1409,6 +1409,88 @@
<yloc>2032</yloc> <yloc>2032</yloc>
<attributes_hac/> <attributes_hac/>
</action> </action>
<action>
<name>SQL.citizen_deferments</name>
<description/>
<type>SQL</type>
<attributes/>
<connection/>
<sendOneStatement>N</sendOneStatement>
<sql/>
<sqlfilename/>
<sqlfromfile>N</sqlfromfile>
<useVariableSubstitution>N</useVariableSubstitution>
<parallel>N</parallel>
<xloc>640</xloc>
<yloc>2112</yloc>
<attributes_hac/>
</action>
<action>
<name>deferments_once.hpl</name>
<description/>
<type>PIPELINE</type>
<attributes/>
<add_date>N</add_date>
<add_time>N</add_time>
<clear_files>N</clear_files>
<clear_rows>N</clear_rows>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<filename>${PROJECT_HOME}/jobs_once_a_day/deferments_once.hpl</filename>
<logext/>
<logfile/>
<loglevel>Basic</loglevel>
<parameters>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<params_from_previous>N</params_from_previous>
<run_configuration>local</run_configuration>
<set_append_logfile>N</set_append_logfile>
<set_logfile>N</set_logfile>
<wait_until_finished>Y</wait_until_finished>
<parallel>N</parallel>
<xloc>1184</xloc>
<yloc>2112</yloc>
<attributes_hac/>
</action>
<action>
<name>Success</name>
<description/>
<type>SUCCESS</type>
<attributes/>
<parallel>N</parallel>
<xloc>1408</xloc>
<yloc>2112</yloc>
<attributes_hac/>
</action>
<action>
<name>deferment_reason_once.hpl</name>
<description/>
<type>PIPELINE</type>
<attributes/>
<add_date>N</add_date>
<add_time>N</add_time>
<clear_files>N</clear_files>
<clear_rows>N</clear_rows>
<create_parent_folder>N</create_parent_folder>
<exec_per_row>N</exec_per_row>
<filename>${PROJECT_HOME}/jobs_once_a_day/deferment_reason_once.hpl</filename>
<logext/>
<logfile/>
<loglevel>Basic</loglevel>
<parameters>
<pass_all_parameters>Y</pass_all_parameters>
</parameters>
<params_from_previous>N</params_from_previous>
<run_configuration>local</run_configuration>
<set_append_logfile>N</set_append_logfile>
<set_logfile>N</set_logfile>
<wait_until_finished>Y</wait_until_finished>
<parallel>N</parallel>
<xloc>896</xloc>
<yloc>2112</yloc>
<attributes_hac/>
</action>
</actions> </actions>
<hops> <hops>
<hop> <hop>
@ -1960,7 +2042,7 @@
<hop> <hop>
<from>Start</from> <from>Start</from>
<to>SQL.citizen_individual_decisions</to> <to>SQL.citizen_individual_decisions</to>
<enabled>N</enabled> <enabled>Y</enabled>
<evaluation>Y</evaluation> <evaluation>Y</evaluation>
<unconditional>Y</unconditional> <unconditional>Y</unconditional>
</hop> </hop>
@ -1978,6 +2060,34 @@
<evaluation>Y</evaluation> <evaluation>Y</evaluation>
<unconditional>Y</unconditional> <unconditional>Y</unconditional>
</hop> </hop>
<hop>
<from>Start</from>
<to>SQL.citizen_deferments</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>deferments_once.hpl</from>
<to>Success</to>
<enabled>Y</enabled>
<evaluation>N</evaluation>
<unconditional>Y</unconditional>
</hop>
<hop>
<from>SQL.citizen_deferments</from>
<to>deferment_reason_once.hpl</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
<hop>
<from>deferment_reason_once.hpl</from>
<to>deferments_once.hpl</to>
<enabled>Y</enabled>
<evaluation>Y</evaluation>
<unconditional>N</unconditional>
</hop>
</hops> </hops>
<notepads> <notepads>
</notepads> </notepads>