Ayesha shirur

All generations.

testsTue, 31 Jan 2023

public void processPayment(ConsumerPaymentRequest consumerPaymentRequest) throws PaymentServiceException, IOException { String userId = consumerPaymentRequest.getIdentity().getUserId(); log.info("Consumer Payment validation: {}", consumerPaymentRequest); PaymentRequest paymentRequest = populatePaymentRequest(consumerPaymentRequest); log.info("Payment Request JSON ::" + gson.toJson(paymentRequest)); //validate(consumerPaymentRequest); String payment_id = createPayment(paymentRequest); paymentRequest.setPaymentId(payment_id); log.info("Created payment wit payment id: {}", payment_id); for (MetaData contactDetail : consumerPaymentRequest.getContactDetailList()) { PaymentAuthCreateRequest paymentAuthCreateRequest = populatePaymentAuthCreateRequest(contactDetail, consumerPaymentRequest.getClaimData(), paymentRequest, consumerPaymentRequest.getRepairOrder()); String paId = paymentAuthorizationManagementService.createPaymentAuthorization(paymentAuthCreateRequest); consumerPaymentContactsRepository.save(createConsumerPaymentContactsRecord( contactDetail, userId, paId)); log.info("Created the Payment Auth Entity with paId: {}", paId); ConsumerPaymentMobileRequest consumerPaymentMobileRequest = new ConsumerPaymentMobileRequest(consumerPaymentRequest.getClaimData(), contactDetail, consumerPaymentRequest.getRepairOrder(), payment_id); mobileAppNotifyHelper.invokePushNotification(consumerPaymentMobileRequest, paId, SEND); }

# Sprint 2 ## Story 1 As a Software Engineer I want to be able to write test cases for my code so that I can be confident that my code works as expected ### Task 1 Using the newly created Jira ticket. Create a new branch ### Task 2 Using the newly created branch, add a test case that shows that the new feature that you added works as expected. ### Task 3 Commit your test case with the new branch ### Task 4 Push your new branch to the remote repository ### Task 5 Create a Pull Request with the new branch and assign it to the Dev Lead ### Task 6 Merge the Pull Request and delete the branch once it is merged. --- # Sprint 3 ## Story 1 As a Software Engineer I want to be able to write test cases for my code so that I can be confident that my code works as expected ### Task 1 Using the newly created Jira ticket. Create a new branch ### Task 2 Using the newly created branch, add a test case that shows that the new feature that you added works as expected. ###

typingsWed, 18 Jan 2023

#fetches task_id of the object and loads the object to Snowflake table def sql_call_proc(**kwargs): global obj_key sf_curr = get_sf_conn(config_file) print('******kwargs******') print(kwargs) object_key = kwargs['dag_run'].conf.get('obj_key') bucket = kwargs['dag_run'].conf.get('bucket') dataset_mapping = {'epsilon/pub_click_detail_load':'SF_Ingest_pub_click_detail_load' 'epsilon/pub_click_detail_load_missing_extra':'SF_Ingest_pub_click_detail_load_missing_extra' 'epsilon/pub_common_link_framework_load':'SF_Ingest_pub_common_link_framework_load' 'adobe_campaign/pub_marketing_mrw_stg_click_detail_harmony_load':'SF_Ingest_pub_marketing_mrw_stg_click_detail_harmony_load'} print('****Object key to be loaded****' object_key) if object_key is not None: object_name = object_key.replace('run_id%3D' 'run_id=') print('***Object key***' object_name) obj_path = bucket+'/'+object_name object_path = 's3://'+obj_path.replace('_SUCCESS' '') print('======object_path======' object_path) batch_id = object_path.split('/')[5].split('=')[1] print('======batch_id=======' batch_id) #dataset = object_name.rsplit('/' 2)[0] dataset = "/".join(object_name.split("/")[0:2]) prefix = "/".join(object_name.split("/")[0:3]) print('****Dataset****' dataset) print('**Prefix****' prefix) ctrl_query = "select TASK_ID from UTIL.IT.DATA_INGESTION_CTRL where STAGE_FULLPATH_TXT='"+dataset+"/' and GROUP_ID='mdp-dppe-mkteml-snowflake-ingestion';" print('****Control table query to be executed******') print(ctrl_query) res = execute_query(sf_curr ctrl_query) if len(res)>0: task_id = res[0][0] print('***Task Id for the dataset***' task_id) sp_query = "CALL UTIL.IT.SP_MDP_MKT_EMAIL_DATA_INGESTION('"+dataset_mapping[dataset]+"' '"+batch_id+"' '"+task_id+"' '"+object_path+"')" print('****Stored procedure query****') print(sp_query) sp_res = execute_query(sf_curr sp_query) print('****Result****') for row in sp_res: for ele in row: print(ele) if ele.find('SP-FAILED')==-1: print('Data Ingestion Success..!!') else: raise AirflowException("Data Ingestion Failure!! Please check logs of the Stored Procedure for details.") return sp_res else: raise AirflowException("Data Ingestion Failure!! Invalid object placed for dataset ingestion.") else: raise AirflowException("Data Ingestion Failure!! Object not found for Data Ingestion.") #Stored procedure to load data t1 = PythonOperator( task_id='mdp-dppe-mkteml-data-load' python_callable = sql_call_proc provide_context=True xcom_push=True dag=dag ) t1

## 6.7. Implementation of a template to load data to snowflake: - Create a template in airflow web server as shown - <p align="center"> <img src="images/airflow_template_7.png" alt="airflow_template_7" width="500" height="300"> </p> - Click on the template, it will be shown as below - <p align="center"> <img src="images/airflow_template_8.png" alt="airflow_template_8" width="500" height="300"> </p> - We can see that the template parameters are passed in the form of a string - <p align="center"> <img src="images/airflow_template_9.png" alt="airflow_template_9" width="500" height="300"> </p> - The above parameters are used in the code to implement the logic -

language from codeFri, 20 Jan 2023

Payee Info--Both the 1st and second Payee will receive the Payment invite for authorization, any Payee can accept or decline the invite. The payee(s) info should be displayed within the Payment section in portal. 1 Field-->Consumer Payment Type, Required--> yes, Details--> Allow user to select single or Multi-Party Payee. Single will be defaulted based on Vehicle Owner/Insured entered within the assignment entry. if user selects mutiple party then system will allow user to add/display second Payee. · Only 2 Payee are allowed. · Multi Payment on a repairable claim is allowed. IE on an E01 the option to do multip pay for 1,000 could be (2) 500 payments with the same Payee. All supplemental payments will go to assigned shop. 2 Field-->Repair Order, Required--> Yes, Details--> Allow user to select if the claim is for Repairable or Total Loss. 3 Field--> Claim Party, Required--> Yes, Details-->Display Claim Party Contact Drop list (Owner/Insured, Insured, Owner) 4 Field--> First Name, Required--> Yes, Details-->Alpha min=2, max =100, and it is required. Prefilled based on contact person selection from contact drop list. If the assignment does not have this info, then it will be blank. The field will be editable. 5 Field--> Last Name, Required--> Yes, Details-->Alpha min=2, max =100, and it is required. Prefilled based on contact person selection and from assignment entry. If the assignment does not have this info, then it will be blank. The field will be editable. 6 Field--> Cell Phone, Required--> **Yes, Details--> Numeric only, 10 characters with following format (312)-222-2222 The field is editable. **Note: User should select Cell phone or email. 7 Field--> Email, Required--> **Yes, Details--> Alphanumeric, Email address format only. The field will be editable. **Note: User should select Cell phone or email. Write junit tescases in springboot

@RunWith(SpringRunner.class) @SpringBootTest public class SpringbootHelloWorldApplicationTests { @Test public void contextLoads() { } }

fix invalid codeTue, 31 Jan 2023

package com.philips.ampm.ods.deviceobservations.domain.dataaccess; import static org.junit.jupiter.api.Assertions.assertEquals; import com.philips.ampm.ods.deviceobservations.domain.dataaccess.dao.obs.DeviceMetric; import com.philips.ampm.ods.deviceobservations.domain.dataaccess.dao.obs.DeviceMetricId; import com.philips.ampm.ods.deviceobservations.domain.dataaccess.dao.obs.SleepObservationCalculationEntity; import com.philips.ampm.ods.deviceobservations.domain.dataaccess.dao.obs.SleepObservationMeasurementEntity; import com.philips.ampm.ods.deviceobservations.domain.dataaccess.repo.DeviceMetricSQLSerializer; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.Collections; import java.util.List; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; class DeviceMetricSQLSerializerTest { private static String EXPECTED_EMPTY_RESPONSE = "{}"; @Test void serializerDeviceMetricsToSQLText_emptyList() { Assertions.assertEquals(EXPECTED_EMPTY_RESPONSE, DeviceMetricSQLSerializer.serializerDeviceMetricsToSQLText(Collections.emptyList())); } @Test void serializerDeviceMetricsToSQLText_NullList() { assertEquals(EXPECTED_EMPTY_RESPONSE, DeviceMetricSQLSerializer.serializerDeviceMetricsToSQLText(null)); } @Test void singleDeviceMetric() { String expected = "{\"(5," + "ABC," + "2021-03-23T01:03:05Z," + "2021-03-24T23:40:30Z," + "5.600000," + "849102," + "1," + "B2x.3," + "null," + "2," + "obs_id," + "MEASUREMENT)\"}"; DeviceMetric metric = getSleepMeasurement(); assertEquals(expected, DeviceMetricSQLSerializer.serializerDeviceMetricsToSQLText( Collections.singletonList(metric))); } @Test void multipleDeviceMetrics() { String expected = "{\"(5," + "ABC," + "2021-03-23T01:03:05Z," + "2021-03-24T23:40:30Z," + "5.600000," + "849102," + "1," + "B2x.3," + "null," + "2," + "obs_id," + "MEASUREMENT)\"," + "\"(345," + "XYZ," + "2021-04-01T11:58:01Z," + "2021-05-09T23:59:59Z," + "1837.234679," + "773348489," + "56733," + "BC82\\\",\\\"837," + "c\\\"`\\\"alc\\\"''\\\"Mode," + "3485758," + "obs_id," + "CALCULATION)\"}"; DeviceMetric measurement = getSleepMeasurement(); DeviceMetric calculation = getSleepCalculation(); List<DeviceMetric> metrics = Arrays.asList(measurement, calculation); assertEquals(expected, DeviceMetricSQLSerializer.serializerDeviceMetricsToSQLText(metrics)); } private SleepObservationMeasurementEntity getSleepMeasurement() { SleepObservationMeasurementEntity metric = new SleepObservationMeasurementEntity(); metric.setId(new DeviceMetricId("obs_id", OffsetDateTime.parse("2021-03-23T01:03:05Z"))); metric.setDeviceId(5L); metric.setMetricName("ABC"); metric.setDeviceSoftwareVersion("B2x.3"); metric.setDownloadId(2L); metric.setMode(null); metric.setValue(5.6D); metric.setDurationInSeconds(849102); metric.setNumberOfSamples(1); metric.setEndTime(OffsetDateTime.parse("2021-03-24T23:40:30Z")); return metric; } private SleepObservationCalculationEntity getSleepCalculation() { SleepObservationCalculationEntity metric = new SleepObservationCalculationEntity(); metric.setId(new DeviceMetricId("obs_id", OffsetDateTime.parse("2021-04-01T11:58:01Z"))); metric.setDeviceId(345L); metric.setMetricName("XYZ"); metric.setDeviceSoftwareVersion("BC82,837"); metric.setDownloadId(3485758L); metric.setMode("c`alc'Mode"); metric.setValue(1837.2346789D); metric.setEndTime(OffsetDateTime.parse("2021-05-09T23:59:59Z")); metric.setNumberOfSamples(56733L); metric.setDurationInSeconds(773348489); return metric; } }

package com.philips.ampm.ods.deviceobservations.domain.dataaccess; import static org.junit.jupiter.api.Assertions.assertEquals; import com.philips.ampm.ods.deviceobservations.domain.dataaccess.dao.obs.DeviceMetric; import com.philips.ampm.ods.deviceobservations.domain.dataaccess.dao.obs.DeviceMetricId; import com.philips.ampm.ods.deviceobservations.domain.dataaccess.dao.obs.SleepObservationCalculationEntity; import com.philips.ampm.ods.deviceobservations.domain.dataaccess.dao.obs.SleepObservationMeasurementEntity; import com.philips.ampm.ods.deviceobservations.domain.dataaccess.repo.DeviceMetricSQLSerializer; import java.time.OffsetDateTime; import java.util.Arrays; import java.util.Collections; import java.util.List;

language from codeFri, 20 Jan 2023

Payee Info--Both the 1st and second Payee will receive the Payment invite for authorization, any Payee can accept or decline the invite. The payee(s) info should be displayed within the Payment section in portal. 1 Field-->Consumer Payment Type, Required--> yes, Details--> Allow user to select single or Multi-Party Payee. Single will be defaulted based on Vehicle Owner/Insured entered within the assignment entry. if user selects mutiple party then system will allow user to add/display second Payee. · Only 2 Payee are allowed. · Multi Payment on a repairable claim is allowed. IE on an E01 the option to do multip pay for 1,000 could be (2) 500 payments with the same Payee. All supplemental payments will go to assigned shop. 2 Field-->Repair Order, Required--> Yes, Details--> Allow user to select if the claim is for Repairable or Total Loss. 3 Field--> Claim Party, Required--> Yes, Details-->Display Claim Party Contact Drop list (Owner/Insured, Insured, Owner) 4 Field--> First Name, Required--> Yes, Details-->Alpha min=2, max =100, and it is required. Prefilled based on contact person selection from contact drop list. If the assignment does not have this info, then it will be blank. The field will be editable. 5 Field--> Last Name, Required--> Yes, Details-->Alpha min=2, max =100, and it is required. Prefilled based on contact person selection and from assignment entry. If the assignment does not have this info, then it will be blank. The field will be editable. 6 Field--> Cell Phone, Required--> **Yes, Details--> Numeric only, 10 characters with following format (312)-222-2222 The field is editable. **Note: User should select Cell phone or email. 7 Field--> Email, Required--> **Yes, Details--> Alphanumeric, Email address format only. The field will be editable. **Note: User should select Cell phone or email. Write junit tescases in springboot

Given When Then

testsTue, 31 Jan 2023

public void processPayment(ConsumerPaymentRequest consumerPaymentRequest) throws PaymentServiceException, IOException { String userId = consumerPaymentRequest.getIdentity().getUserId(); log.info("Consumer Payment validation: {}", consumerPaymentRequest); PaymentRequest paymentRequest = populatePaymentRequest(consumerPaymentRequest); log.info("Payment Request JSON ::" + gson.toJson(paymentRequest)); //validate(consumerPaymentRequest); String payment_id = createPayment(paymentRequest); paymentRequest.setPaymentId(payment_id); log.info("Created payment wit payment id: {}", payment_id); for (MetaData contactDetail : consumerPaymentRequest.getContactDetailList()) { PaymentAuthCreateRequest paymentAuthCreateRequest = populatePaymentAuthCreateRequest(contactDetail, consumerPaymentRequest.getClaimData(), paymentRequest, consumerPaymentRequest.getRepairOrder()); String paId = paymentAuthorizationManagementService.createPaymentAuthorization(paymentAuthCreateRequest); consumerPaymentContactsRepository.save(createConsumerPaymentContactsRecord( contactDetail, userId, paId)); log.info("Created the Payment Auth Entity with paId: {}", paId); ConsumerPaymentMobileRequest consumerPaymentMobileRequest = new ConsumerPaymentMobileRequest(consumerPaymentRequest.getClaimData(), contactDetail, consumerPaymentRequest.getRepairOrder(), payment_id); mobileAppNotifyHelper.invokePushNotification(consumerPaymentMobileRequest, paId, SEND); }

## Getting Started ### Prerequisites - Java 8 - Maven - [JavaCC](https://javacc.org/) - [INSTALL_DIR]/lib/javacc.jar - [INSTALL_DIR]/lib/javacc-maven-plugin.jar - STS or Eclipse (optional) ### Installing 1. Checkout repository 2. Add to your Java project, and reference in your pom.xml 3. Edit `[INSTALL_DIR]/config/config.properties` ## Running the tests To run the tests, you will need to modify the `config.properties` file, and include a `test.java.directory` property that points to a directory where you have Java source files that you want to test. ## Deployment To deploy, modify the `config.properties` file, and include a `deploy.java.directory` property that points to a directory where you have Java source files that you want to deploy. ## Built With * [javacc](https://jav

language from codeFri, 20 Jan 2023

Payee Info--Both the 1st and second Payee will receive the Payment invite for authorization, any Payee can accept or decline the invite. The payee(s) info should be displayed within the Payment section in portal. 1 Field-->Consumer Payment Type, Required--> yes, Details--> Allow user to select single or Multi-Party Payee. Single will be defaulted based on Vehicle Owner/Insured entered within the assignment entry. if user selects mutiple party then system will allow user to add/display second Payee. · Only 2 Payee are allowed. · Multi Payment on a repairable claim is allowed. IE on an E01 the option to do multip pay for 1,000 could be (2) 500 payments with the same Payee. All supplemental payments will go to assigned shop. 2 Field-->Repair Order, Required--> Yes, Details--> Allow user to select if the claim is for Repairable or Total Loss. 3 Field--> Claim Party, Required--> Yes, Details-->Display Claim Party Contact Drop list (Owner/Insured, Insured, Owner) 4 Field--> First Name, Required--> Yes, Details-->Alpha min=2, max =100, and it is required. Prefilled based on contact person selection from contact drop list. If the assignment does not have this info, then it will be blank. The field will be editable. 5 Field--> Last Name, Required--> Yes, Details-->Alpha min=2, max =100, and it is required. Prefilled based on contact person selection and from assignment entry. If the assignment does not have this info, then it will be blank. The field will be editable. 6 Field--> Cell Phone, Required--> **Yes, Details--> Numeric only, 10 characters with following format (312)-222-2222 The field is editable. **Note: User should select Cell phone or email. 7 Field--> Email, Required--> **Yes, Details--> Alphanumeric, Email address format only. The field will be editable. **Note: User should select Cell phone or email. Write junit tescases in springboot

public void test() { assertThat(1+1,is(2)) }

language from codeFri, 20 Jan 2023

Payee Info--Both the 1st and second Payee will receive the Payment invite for authorization, any Payee can accept or decline the invite. The payee(s) info should be displayed within the Payment section in portal. 1 Field-->Consumer Payment Type, Required--> yes, Details--> Allow user to select single or Multi-Party Payee. Single will be defaulted based on Vehicle Owner/Insured entered within the assignment entry. if user selects mutiple party then system will allow user to add/display second Payee. · Only 2 Payee are allowed. · Multi Payment on a repairable claim is allowed. IE on an E01 the option to do multip pay for 1,000 could be (2) 500 payments with the same Payee. All supplemental payments will go to assigned shop. 2 Field-->Repair Order, Required--> Yes, Details--> Allow user to select if the claim is for Repairable or Total Loss. 3 Field--> Claim Party, Required--> Yes, Details-->Display Claim Party Contact Drop list (Owner/Insured, Insured, Owner) 4 Field--> First Name, Required--> Yes, Details-->Alpha min=2, max =100, and it is required. Prefilled based on contact person selection from contact drop list. If the assignment does not have this info, then it will be blank. The field will be editable. 5 Field--> Last Name, Required--> Yes, Details-->Alpha min=2, max =100, and it is required. Prefilled based on contact person selection and from assignment entry. If the assignment does not have this info, then it will be blank. The field will be editable. 6 Field--> Cell Phone, Required--> **Yes, Details--> Numeric only, 10 characters with following format (312)-222-2222 The field is editable. **Note: User should select Cell phone or email. 7 Field--> Email, Required--> **Yes, Details--> Alphanumeric, Email address format only. The field will be editable. **Note: User should select Cell phone or email. Write junit tescases in springboot

@RunWith(SpringRunner.class) @SpringBootTest public class DemoApplicationTests { @Autowired private PaymentController paymentController; @Test public void testAddPayee() { Payment payment = new Payment(); payment.setPayee1(new Payee()); Payee payee = new Payee(); payee.setFirstName("kumar"); payee.setLastName("raghu"); payment.setPayee1(payee); PayeeResponse response = paymentController.addPayee(payment); Assert.assertNotNull(response); } }

testsTue, 31 Jan 2023

public void processPayment(ConsumerPaymentRequest consumerPaymentRequest) throws PaymentServiceException, IOException { String userId = consumerPaymentRequest.getIdentity().getUserId(); log.info("Consumer Payment validation: {}", consumerPaymentRequest); PaymentRequest paymentRequest = populatePaymentRequest(consumerPaymentRequest); log.info("Payment Request JSON ::" + gson.toJson(paymentRequest)); //validate(consumerPaymentRequest); String payment_id = createPayment(paymentRequest); paymentRequest.setPaymentId(payment_id); log.info("Created payment wit payment id: {}", payment_id); for (MetaData contactDetail : consumerPaymentRequest.getContactDetailList()) { PaymentAuthCreateRequest paymentAuthCreateRequest = populatePaymentAuthCreateRequest(contactDetail, consumerPaymentRequest.getClaimData(), paymentRequest, consumerPaymentRequest.getRepairOrder()); String paId = paymentAuthorizationManagementService.createPaymentAuthorization(paymentAuthCreateRequest); consumerPaymentContactsRepository.save(createConsumerPaymentContactsRecord( contactDetail, userId, paId)); log.info("Created the Payment Auth Entity with paId: {}", paId); ConsumerPaymentMobileRequest consumerPaymentMobileRequest = new ConsumerPaymentMobileRequest(consumerPaymentRequest.getClaimData(), contactDetail, consumerPaymentRequest.getRepairOrder(), payment_id); mobileAppNotifyHelper.invokePushNotification(consumerPaymentMobileRequest, paId, SEND); }

testsTue, 31 Jan 2023

public void processPayment(ConsumerPaymentRequest consumerPaymentRequest) throws PaymentServiceException, IOException { String userId = consumerPaymentRequest.getIdentity().getUserId(); log.info("Consumer Payment validation: {}", consumerPaymentRequest); PaymentRequest paymentRequest = populatePaymentRequest(consumerPaymentRequest); log.info("Payment Request JSON ::" + gson.toJson(paymentRequest)); //validate(consumerPaymentRequest); Write junit test case using junit5 and mockito

testsTue, 31 Jan 2023

public void processPayment(ConsumerPaymentRequest consumerPaymentRequest) throws PaymentServiceException, IOException { String userId = consumerPaymentRequest.getIdentity().getUserId(); log.info("Consumer Payment validation: {}", consumerPaymentRequest); PaymentRequest paymentRequest = populatePaymentRequest(consumerPaymentRequest); log.info("Payment Request JSON ::" + gson.toJson(paymentRequest)); //validate(consumerPaymentRequest); Write junit test case using junit5 and mockito

import org.junit.jupiter.api.Test; import org.mockito.Mockito; import java.io.IOException; import static org.junit.jupiter.api.Assertions.assertEquals; public class PaymentServiceTest { private static final Logger log = LoggerFactory.getLogger(PaymentServiceTest.class); private static final Gson gson = new Gson(); private static final PaymentService paymentService = new PaymentService(); @Test public void testProcessPayment() throws PaymentServiceException, IOException { ConsumerPaymentRequest consumerPaymentRequest = new ConsumerPaymentRequest(); consumerPaymentRequest.setUserId("123"); consumerPaymentRequest.setPaymentType("DEBIT_CARD"); consumerPaymentRequest.setPaymentAmount(BigDecimal.valueOf(10)); consumerPaymentRequest.setMerchantId("merchant-1"); consumerPaymentRequest.setMerchantSecret("merchant-secret-1"); Payment

language from codeFri, 20 Jan 2023

Payee Info--Both the 1st and second Payee will receive the Payment invite for authorization, any Payee can accept or decline the invite. The payee(s) info should be displayed within the Payment section in portal. 1 Field-->Consumer Payment Type, Required--> yes, Details--> Allow user to select single or Multi-Party Payee. Single will be defaulted based on Vehicle Owner/Insured entered within the assignment entry. if user selects mutiple party then system will allow user to add/display second Payee. · Only 2 Payee are allowed. · Multi Payment on a repairable claim is allowed. IE on an E01 the option to do multip pay for 1,000 could be (2) 500 payments with the same Payee. All supplemental payments will go to assigned shop. 2 Field-->Repair Order, Required--> Yes, Details--> Allow user to select if the claim is for Repairable or Total Loss. 3 Field--> Claim Party, Required--> Yes, Details-->Display Claim Party Contact Drop list (Owner/Insured, Insured, Owner) 4 Field--> First Name, Required--> Yes, Details-->Alpha min=2, max =100, and it is required. Prefilled based on contact person selection from contact drop list. If the assignment does not have this info, then it will be blank. The field will be editable. 5 Field--> Last Name, Required--> Yes, Details-->Alpha min=2, max =100, and it is required. Prefilled based on contact person selection and from assignment entry. If the assignment does not have this info, then it will be blank. The field will be editable. 6 Field--> Cell Phone, Required--> **Yes, Details--> Numeric only, 10 characters with following format (312)-222-2222 The field is editable. **Note: User should select Cell phone or email. 7 Field--> Email, Required--> **Yes, Details--> Alphanumeric, Email address format only. The field will be editable. **Note: User should select Cell phone or email. Write junit tescases in springboot

testsTue, 31 Jan 2023

public void processPayment(ConsumerPaymentRequest consumerPaymentRequest) throws PaymentServiceException, IOException { String userId = consumerPaymentRequest.getIdentity().getUserId(); log.info("Consumer Payment validation: {}", consumerPaymentRequest); PaymentRequest paymentRequest = populatePaymentRequest(consumerPaymentRequest); log.info("Payment Request JSON ::" + gson.toJson(paymentRequest)); //validate(consumerPaymentRequest); String payment_id = createPayment(paymentRequest); paymentRequest.setPaymentId(payment_id); log.info("Created payment wit payment id: {}", payment_id); for (MetaData contactDetail : consumerPaymentRequest.getContactDetailList()) { PaymentAuthCreateRequest paymentAuthCreateRequest = populatePaymentAuthCreateRequest(contactDetail, consumerPaymentRequest.getClaimData(), paymentRequest, consumerPaymentRequest.getRepairOrder()); String paId = paymentAuthorizationManagementService.createPaymentAuthorization(paymentAuthCreateRequest); consumerPaymentContactsRepository.save(createConsumerPaymentContactsRecord( contactDetail, userId, paId)); log.info("Created the Payment Auth Entity with paId: {}", paId); ConsumerPaymentMobileRequest consumerPaymentMobileRequest = new ConsumerPaymentMobileRequest(consumerPaymentRequest.getClaimData(), contactDetail, consumerPaymentRequest.getRepairOrder(), payment_id); mobileAppNotifyHelper.invokePushNotification(consumerPaymentMobileRequest, paId, SEND); }

## Configurations To configure the default executable path for RSpec, Cucumber, or JUnit, add default_executable_path to a .rspecrc or .cucumber file.

testsFri, 20 Jan 2023

Payee Info--Both the 1st and second Payee will receive the Payment invite for authorization, any Payee can accept or decline the invite. The payee(s) info should be displayed within the Payment section in portal. 1 Field-->Consumer Payment Type, Required--> yes, Details--> Allow user to select single or Multi-Party Payee. Single will be defaulted based on Vehicle Owner/Insured entered within the assignment entry. if user selects mutiple party then system will allow user to add/display second Payee. · Only 2 Payee are allowed. · Multi Payment on a repairable claim is allowed. IE on an E01 the option to do multip pay for 1,000 could be (2) 500 payments with the same Payee. All supplemental payments will go to assigned shop. 2 Field-->Repair Order, Required--> Yes, Details--> Allow user to select if the claim is for Repairable or Total Loss. 3 Field--> Claim Party, Required--> Yes, Details-->Display Claim Party Contact Drop list (Owner/Insured, Insured, Owner) 4 Field--> First Name, Required--> Yes, Details-->Alpha min=2, max =100, and it is required. Prefilled based on contact person selection from contact drop list. If the assignment does not have this info, then it will be blank. The field will be editable. 5 Field--> Last Name, Required--> Yes, Details-->Alpha min=2, max =100, and it is required. Prefilled based on contact person selection and from assignment entry. If the assignment does not have this info, then it will be blank. The field will be editable. 6 Field--> Cell Phone, Required--> **Yes, Details--> Numeric only, 10 characters with following format (312)-222-2222 The field is editable. **Note: User should select Cell phone or email. 7 Field--> Email, Required--> **Yes, Details--> Alphanumeric, Email address format only. The field will be editable. **Note: User should select Cell phone or email. Write Junit Testcases in springboot

import unittest class TestAdd(unittest.TestCase): def test_add(self): self.assertEqual(add(1, 2), 3)

language from codeFri, 20 Jan 2023

Payee Info--Both the 1st and second Payee will receive the Payment invite for authorization, any Payee can accept or decline the invite. The payee(s) info should be displayed within the Payment section in portal. 1 Field-->Consumer Payment Type, Required--> yes, Details--> Allow user to select single or Multi-Party Payee. Single will be defaulted based on Vehicle Owner/Insured entered within the assignment entry. if user selects mutiple party then system will allow user to add/display second Payee. · Only 2 Payee are allowed. · Multi Payment on a repairable claim is allowed. IE on an E01 the option to do multip pay for 1,000 could be (2) 500 payments with the same Payee. All supplemental payments will go to assigned shop. 2 Field-->Repair Order, Required--> Yes, Details--> Allow user to select if the claim is for Repairable or Total Loss. 3 Field--> Claim Party, Required--> Yes, Details-->Display Claim Party Contact Drop list (Owner/Insured, Insured, Owner) 4 Field--> First Name, Required--> Yes, Details-->Alpha min=2, max =100, and it is required. Prefilled based on contact person selection from contact drop list. If the assignment does not have this info, then it will be blank. The field will be editable. 5 Field--> Last Name, Required--> Yes, Details-->Alpha min=2, max =100, and it is required. Prefilled based on contact person selection and from assignment entry. If the assignment does not have this info, then it will be blank. The field will be editable. 6 Field--> Cell Phone, Required--> **Yes, Details--> Numeric only, 10 characters with following format (312)-222-2222 The field is editable. **Note: User should select Cell phone or email. 7 Field--> Email, Required--> **Yes, Details--> Alphanumeric, Email address format only. The field will be editable. **Note: User should select Cell phone or email. Write junit tescases in springboot

@Test public void testGetAllPayment() throws Exception { when(paymentService.getAllPayment()).thenReturn(null); RequestBuilder requestBuilder = MockMvcRequestBuilders .get("/api/v1/payment") .accept(MediaType.APPLICATION_JSON); MvcResult result = mockMvc.perform(requestBuilder).andReturn(); MockHttpServletResponse response = result.getResponse(); assertEquals(HttpStatus.OK.value(), response.getStatus()); assertEquals(null, response.getContentAsString()); }

typingsWed, 18 Jan 2023

#fetches task_id of the object and loads the object to Snowflake table def sql_call_proc(**kwargs): global obj_key sf_curr = get_sf_conn(config_file) print('******kwargs******') print(kwargs) object_key = kwargs['dag_run'].conf.get('obj_key') bucket = kwargs['dag_run'].conf.get('bucket') dataset_mapping = {'epsilon/pub_click_detail_load':'SF_Ingest_pub_click_detail_load' 'epsilon/pub_click_detail_load_missing_extra':'SF_Ingest_pub_click_detail_load_missing_extra' 'epsilon/pub_common_link_framework_load':'SF_Ingest_pub_common_link_framework_load' 'adobe_campaign/pub_marketing_mrw_stg_click_detail_harmony_load':'SF_Ingest_pub_marketing_mrw_stg_click_detail_harmony_load'} print('****Object key to be loaded****' object_key) if object_key is not None: object_name = object_key.replace('run_id%3D' 'run_id=') print('***Object key***' object_name) obj_path = bucket+'/'+object_name object_path = 's3://'+obj_path.replace('_SUCCESS' '') print('======object_path======' object_path) batch_id = object_path.split('/')[5].split('=')[1] print('======batch_id=======' batch_id) #dataset = object_name.rsplit('/' 2)[0] dataset = "/".join(object_name.split("/")[0:2]) prefix = "/".join(object_name.split("/")[0:3]) print('****Dataset****' dataset) print('**Prefix****' prefix) ctrl_query = "select TASK_ID from UTIL.IT.DATA_INGESTION_CTRL where STAGE_FULLPATH_TXT='"+dataset+"/' and GROUP_ID='mdp-dppe-mkteml-snowflake-ingestion';" print('****Control table query to be executed******') print(ctrl_query) res = execute_query(sf_curr ctrl_query) if len(res)>0: task_id = res[0][0] print('***Task Id for the dataset***' task_id) sp_query = "CALL UTIL.IT.SP_MDP_MKT_EMAIL_DATA_INGESTION('"+dataset_mapping[dataset]+"' '"+batch_id+"' '"+task_id+"' '"+object_path+"')" print('****Stored procedure query****') print(sp_query) sp_res = execute_query(sf_curr sp_query) print('****Result****') for row in sp_res: for ele in row: print(ele) if ele.find('SP-FAILED')==-1: print('Data Ingestion Success..!!') else: raise AirflowException("Data Ingestion Failure!! Please check logs of the Stored Procedure for details.") return sp_res else: raise AirflowException("Data Ingestion Failure!! Invalid object placed for dataset ingestion.") else: raise AirflowException("Data Ingestion Failure!! Object not found for Data Ingestion.") #Stored procedure to load data t1 = PythonOperator( task_id='mdp-dppe-mkteml-data-load' python_callable = sql_call_proc provide_context=True xcom_push=True dag=dag ) t1

See the [Airflow documentation](https://airflow.apache.org/docs/stable/tutorial.html) for more details. ## Usage ### Install #### Install from source <details>

testsTue, 31 Jan 2023

public void processPayment(ConsumerPaymentRequest consumerPaymentRequest) throws PaymentServiceException, IOException { String userId = consumerPaymentRequest.getIdentity().getUserId(); log.info("Consumer Payment validation: {}", consumerPaymentRequest); PaymentRequest paymentRequest = populatePaymentRequest(consumerPaymentRequest); log.info("Payment Request JSON ::" + gson.toJson(paymentRequest)); //validate(consumerPaymentRequest); String payment_id = createPayment(paymentRequest); paymentRequest.setPaymentId(payment_id); log.info("Created payment wit payment id: {}", payment_id); for (MetaData contactDetail : consumerPaymentRequest.getContactDetailList()) { PaymentAuthCreateRequest paymentAuthCreateRequest = populatePaymentAuthCreateRequest(contactDetail, consumerPaymentRequest.getClaimData(), paymentRequest, consumerPaymentRequest.getRepairOrder()); String paId = paymentAuthorizationManagementService.createPaymentAuthorization(paymentAuthCreateRequest); consumerPaymentContactsRepository.save(createConsumerPaymentContactsRecord( contactDetail, userId, paId)); log.info("Created the Payment Auth Entity with paId: {}", paId); ConsumerPaymentMobileRequest consumerPaymentMobileRequest = new ConsumerPaymentMobileRequest(consumerPaymentRequest.getClaimData(), contactDetail, consumerPaymentRequest.getRepairOrder(), payment_id); mobileAppNotifyHelper.invokePushNotification(consumerPaymentMobileRequest, paId, SEND); }

### Embedding code snippets It is possible to embed code snippets into the documentation. Given the following code snippet:

fix invalid codeWed, 18 Jan 2023

default_args = { 'owner': 'svc-dpsd-airflow' 'depends_on_past': False 'email_on_failure': False #on_failure_callback': failure_callback 'retries': 0 } dag = DAG( 'mdp-dppe-mkteml-snowflake-ingestion-test' default_args=default_args start_date=datetime(2020 10 20 tzinfo=pendulum.timezone('US/Eastern')) schedule_interval = None max_active_runs=1 access_control={'dpsd_airflow_role':{'can_dag_read' 'can_dag_edit'}} description='DAG for Marketing and email datasets ingestion' catchup=False )

## Copy CSV data to S3 temp folder

fix invalid codeWed, 18 Jan 2023

default_args = { 'owner': 'svc-dpsd-airflow' 'depends_on_past': False 'email_on_failure': False #on_failure_callback': failure_callback 'retries': 0 } dag = DAG( 'mdp-dppe-mkteml-snowflake-ingestion-test' default_args=default_args start_date=datetime(2020 10 20 tzinfo=pendulum.timezone('US/Eastern')) schedule_interval = None max_active_runs=1 access_control={'dpsd_airflow_role':{'can_dag_read' 'can_dag_edit'}} description='DAG for Marketing and email datasets ingestion' catchup=False )

default_args = { 'owner': 'svc-dpsd-airflow' 'depends_on_past': False 'email_on_failure': False #on_failure_callback': failure_callback 'retries': 0 } dag = DAG( 'mdp-dppe-mkteml-snowflake-ingestion-test' default_args=default_args start_date=datetime(2020, 10, 20, tzinfo=pendulum.timezone('US/Eastern')) schedule_interval = None max_active_runs=1 access_control={'dpsd_airflow_role':{'can_dag_read','can_dag_edit'}}

testsFri, 20 Jan 2023

Payee Info--Both the 1st and second Payee will receive the Payment invite for authorization, any Payee can accept or decline the invite. The payee(s) info should be displayed within the Payment section in portal. 1 Field-->Consumer Payment Type, Required--> yes, Details--> Allow user to select single or Multi-Party Payee. Single will be defaulted based on Vehicle Owner/Insured entered within the assignment entry. if user selects mutiple party then system will allow user to add/display second Payee. · Only 2 Payee are allowed. · Multi Payment on a repairable claim is allowed. IE on an E01 the option to do multip pay for 1,000 could be (2) 500 payments with the same Payee. All supplemental payments will go to assigned shop. 2 Field-->Repair Order, Required--> Yes, Details--> Allow user to select if the claim is for Repairable or Total Loss. 3 Field--> Claim Party, Required--> Yes, Details-->Display Claim Party Contact Drop list (Owner/Insured, Insured, Owner) 4 Field--> First Name, Required--> Yes, Details-->Alpha min=2, max =100, and it is required. Prefilled based on contact person selection from contact drop list. If the assignment does not have this info, then it will be blank. The field will be editable. 5 Field--> Last Name, Required--> Yes, Details-->Alpha min=2, max =100, and it is required. Prefilled based on contact person selection and from assignment entry. If the assignment does not have this info, then it will be blank. The field will be editable. 6 Field--> Cell Phone, Required--> **Yes, Details--> Numeric only, 10 characters with following format (312)-222-2222 The field is editable. **Note: User should select Cell phone or email. 7 Field--> Email, Required--> **Yes, Details--> Alphanumeric, Email address format only. The field will be editable. **Note: User should select Cell phone or email.

def test_add(self): self.assertEqual(add(1, 2), 3)

language from codeFri, 20 Jan 2023

Payee Info--Both the 1st and second Payee will receive the Payment invite for authorization, any Payee can accept or decline the invite. The payee(s) info should be displayed within the Payment section in portal. 1 Field-->Consumer Payment Type, Required--> yes, Details--> Allow user to select single or Multi-Party Payee. Single will be defaulted based on Vehicle Owner/Insured entered within the assignment entry. if user selects mutiple party then system will allow user to add/display second Payee. · Only 2 Payee are allowed. · Multi Payment on a repairable claim is allowed. IE on an E01 the option to do multip pay for 1,000 could be (2) 500 payments with the same Payee. All supplemental payments will go to assigned shop. 2 Field-->Repair Order, Required--> Yes, Details--> Allow user to select if the claim is for Repairable or Total Loss. 3 Field--> Claim Party, Required--> Yes, Details-->Display Claim Party Contact Drop list (Owner/Insured, Insured, Owner) 4 Field--> First Name, Required--> Yes, Details-->Alpha min=2, max =100, and it is required. Prefilled based on contact person selection from contact drop list. If the assignment does not have this info, then it will be blank. The field will be editable. 5 Field--> Last Name, Required--> Yes, Details-->Alpha min=2, max =100, and it is required. Prefilled based on contact person selection and from assignment entry. If the assignment does not have this info, then it will be blank. The field will be editable. 6 Field--> Cell Phone, Required--> **Yes, Details--> Numeric only, 10 characters with following format (312)-222-2222 The field is editable. **Note: User should select Cell phone or email. 7 Field--> Email, Required--> **Yes, Details--> Alphanumeric, Email address format only. The field will be editable. **Note: User should select Cell phone or email. Write junit tescases in springboot

## GitHub Repository The GitHub repository with an automated README.md template to explain that project is scheduled to completed by: Friday, November 20, 2020. * [GitHub / amit-dixit](https://github.com/amit-dixit/Copy-of-User-Service) * [GitHub Pages / amit-dixit](https://amit-dixit.github.io/Copy-of-User-Service) ## Built With * [Spring-Boot](https://spring.io/projects/spring-boot) - The web framework used * [Maven](https://maven.apache.org/) - Dependency Management ## Frameworks used * [Spring Data JPA](https://spring.io/projects/spring-data-jpa) - Spring Data JPA * [Hibernate](https://hibernate.org/) - ORM * [Spring Security](https://spring.io/projects/spring-security) - Authentication * [Swagger](https://swagger.io/) - Swagger

typingsWed, 18 Jan 2023

#fetches task_id of the object and loads the object to Snowflake table def sql_call_proc(**kwargs): global obj_key sf_curr = get_sf_conn(config_file) print('******kwargs******') print(kwargs) object_key = kwargs['dag_run'].conf.get('obj_key') bucket = kwargs['dag_run'].conf.get('bucket') dataset_mapping = {'epsilon/pub_click_detail_load':'SF_Ingest_pub_click_detail_load' 'epsilon/pub_click_detail_load_missing_extra':'SF_Ingest_pub_click_detail_load_missing_extra' 'epsilon/pub_common_link_framework_load':'SF_Ingest_pub_common_link_framework_load' 'adobe_campaign/pub_marketing_mrw_stg_click_detail_harmony_load':'SF_Ingest_pub_marketing_mrw_stg_click_detail_harmony_load'} print('****Object key to be loaded****' object_key) if object_key is not None: object_name = object_key.replace('run_id%3D' 'run_id=') print('***Object key***' object_name) obj_path = bucket+'/'+object_name object_path = 's3://'+obj_path.replace('_SUCCESS' '') print('======object_path======' object_path) batch_id = object_path.split('/')[5].split('=')[1] print('======batch_id=======' batch_id) #dataset = object_name.rsplit('/' 2)[0] dataset = "/".join(object_name.split("/")[0:2]) prefix = "/".join(object_name.split("/")[0:3]) print('****Dataset****' dataset) print('**Prefix****' prefix) ctrl_query = "select TASK_ID from UTIL.IT.DATA_INGESTION_CTRL where STAGE_FULLPATH_TXT='"+dataset+"/' and GROUP_ID='mdp-dppe-mkteml-snowflake-ingestion';" print('****Control table query to be executed******') print(ctrl_query) res = execute_query(sf_curr ctrl_query) if len(res)>0: task_id = res[0][0] print('***Task Id for the dataset***' task_id) sp_query = "CALL UTIL.IT.SP_MDP_MKT_EMAIL_DATA_INGESTION('"+dataset_mapping[dataset]+"' '"+batch_id+"' '"+task_id+"' '"+object_path+"')" print('****Stored procedure query****') print(sp_query) sp_res = execute_query(sf_curr sp_query) print('****Result****') for row in sp_res: for ele in row: print(ele) if ele.find('SP-FAILED')==-1: print('Data Ingestion Success..!!') else: raise AirflowException("Data Ingestion Failure!! Please check logs of the Stored Procedure for details.") return sp_res else: raise AirflowException("Data Ingestion Failure!! Invalid object placed for dataset ingestion.") else: raise AirflowException("Data Ingestion Failure!! Object not found for Data Ingestion.") #Stored procedure to load data t1 = PythonOperator( task_id='mdp-dppe-mkteml-data-load' python_callable = sql_call_proc provide_context=True xcom_push=True dag=dag ) t1

## PythonOperator

typingsWed, 18 Jan 2023

#fetches task_id of the object and loads the object to Snowflake table def sql_call_proc(**kwargs): global obj_key sf_curr = get_sf_conn(config_file) print('******kwargs******') print(kwargs) object_key = kwargs['dag_run'].conf.get('obj_key') bucket = kwargs['dag_run'].conf.get('bucket') dataset_mapping = {'epsilon/pub_click_detail_load':'SF_Ingest_pub_click_detail_load' 'epsilon/pub_click_detail_load_missing_extra':'SF_Ingest_pub_click_detail_load_missing_extra' 'epsilon/pub_common_link_framework_load':'SF_Ingest_pub_common_link_framework_load' 'adobe_campaign/pub_marketing_mrw_stg_click_detail_harmony_load':'SF_Ingest_pub_marketing_mrw_stg_click_detail_harmony_load'} print('****Object key to be loaded****' object_key) if object_key is not None: object_name = object_key.replace('run_id%3D' 'run_id=') print('***Object key***' object_name) obj_path = bucket+'/'+object_name object_path = 's3://'+obj_path.replace('_SUCCESS' '') print('======object_path======' object_path) batch_id = object_path.split('/')[5].split('=')[1] print('======batch_id=======' batch_id) #dataset = object_name.rsplit('/' 2)[0] dataset = "/".join(object_name.split("/")[0:2]) prefix = "/".join(object_name.split("/")[0:3]) print('****Dataset****' dataset) print('**Prefix****' prefix) ctrl_query = "select TASK_ID from UTIL.IT.DATA_INGESTION_CTRL where STAGE_FULLPATH_TXT='"+dataset+"/' and GROUP_ID='mdp-dppe-mkteml-snowflake-ingestion';" print('****Control table query to be executed******') print(ctrl_query) res = execute_query(sf_curr ctrl_query) if len(res)>0: task_id = res[0][0] print('***Task Id for the dataset***' task_id) sp_query = "CALL UTIL.IT.SP_MDP_MKT_EMAIL_DATA_INGESTION('"+dataset_mapping[dataset]+"' '"+batch_id+"' '"+task_id+"' '"+object_path+"')" print('****Stored procedure query****') print(sp_query) sp_res = execute_query(sf_curr sp_query) print('****Result****') for row in sp_res: for ele in row: print(ele) if ele.find('SP-FAILED')==-1: print('Data Ingestion Success..!!') else: raise AirflowException("Data Ingestion Failure!! Please check logs of the Stored Procedure for details.") return sp_res else: raise AirflowException("Data Ingestion Failure!! Invalid object placed for dataset ingestion.") else: raise AirflowException("Data Ingestion Failure!! Object not found for Data Ingestion.") #Stored procedure to load data t1 = PythonOperator( task_id='mdp-dppe-mkteml-data-load' python_callable = sql_call_proc provide_context=True xcom_push=True dag=dag ) t1

### Example Airflow DAG

Questions about programming?Chat with your personal AI assistant