AravindSchnell / XSERP_Automation

This repository contains a script designed to automate tasks within an XS ERP (Enterprise Resource Planning) system using regression analysis.
0 stars 0 forks source link

Collect data from user and send it to API for coupon creation #2

Open sync-by-unito[bot] opened 3 months ago

sync-by-unito[bot] commented 3 months ago

Goals

  1. Collect data from the user to create a coupon code and send it to the backend API.
  2. Implement a function to handle API requests for coupon creation and display the response on the frontend.
  3. Validate discount and date inputs, showing error messages for invalid entries.
  4. Validate the discount percentage against price deductions and remaining amount to pay.

Steps

Collect User Data:

Create API Request Function:

Handle API Response:

Implement Validations:

Discount Validation:

Expiry Date Validation:

Integrate Price Validation API:

Validation

Discount Input:

Expiry Date:

Acceptance Criteria

Functionality:

Validation:

Error Handling:

┆Issue is synchronized with this Jira Task by Unito ┆Attachments: Screenshot from 2024-07-23 17-30-07.png | Screenshot from 2024-07-23 17-30-33.png | Screenshot from 2024-07-23 17-31-07.png

sync-by-unito[bot] commented 3 months ago

➤ Neeraja commented:

Work Summary - 10/07/2024 Worked on resolving the API integration issue and collaborating with the backend team to find a solution. Resolved “CORS” issue

sync-by-unito[bot] commented 3 months ago

➤ Neeraja commented:

Work Summary - 11/07/2024

Continued working on resolving the API integration issue and collaborated with the backend team to find a solution. Fixed all issues except one caused by parsing errors in the data format sent from the frontend and the response received from the backend. Addressed this issue with the help of seniors and have come up with a solution. Will need to verify if it works; if not, a different approach will be required.

sync-by-unito[bot] commented 3 months ago

➤ Neeraja commented:

Work Summary - 12/07/2024 Worked on resolving the API integration issue with the help of Nithin and discovered that the error may have occurred due to the CSRF token not being passed correctly in the headers. I tried various approaches to solve this issue, including using interceptors to identify the potential error causing the problem with the API integration.

To do: Examine the CSRF token issue further

sync-by-unito[bot] commented 3 months ago

➤ Neeraja commented:

Work Summary - 15/07/2024 I have been working on resolving the API integration issue and identified that the CSRF token is not being fetched because it is undefined. It seems that the token is not being correctly set as it cannot be retrieved from cookies, likely due to the cookies not being set properly. This may be the reason why we are unable to get the CSRF token. I need to work on solving this issue.

sync-by-unito[bot] commented 3 months ago

➤ Neeraja commented:

Work Summary - 16/07/2024 I temporarily put the coupon generation API on hold to focus on the subscription price discount calculation, but encountered the same error. I tried various solutions, but the issue persists. APIs defined within the same application endpoints work, but those with different endpoints do not, likely due to cross-platform activities. I sought help from Devi, but we couldn't find a solution. Now, I need to try sending data similarly to how it is sent in the mobile API.

Issues : Unexpectedly, while making changes for API integration, the Angular CLI and Node versions got upgraded, causing the application to fail to open. I tried different approaches to downgrade the versions, but the changes didn't take effect. I need to resolve this issue before addressing the actual problem.

sync-by-unito[bot] commented 3 months ago

➤ Neeraja commented:

Work Summary - 17/07/2024

Worked on the issue mentioned in the previous comment. During the API integration process, the Angular CLI and Node versions were unexpectedly upgraded, causing the application to fail to open. Initially, I tried various approaches to downgrade the versions, but the errors persisted. This may have been due to caching issues from repeatedly upgrading and downgrading different versions of Node and Angular. To solve the issue, I reverted the codebase to the state before any changes were made by fetching it directly from the repository. I then re-implemented the logic I had previously developed, ensuring the application now functions correctly.

sync-by-unito[bot] commented 3 months ago

➤ Neeraja commented:

Work Summary - 18/07/2024

Worked on API integration for material price. Took help from Sathana V to solve some of the errors. Found some techniques to be implemented to solve the error and will try them out.

sync-by-unito[bot] commented 3 months ago

➤ Neeraja commented:

Work Summary - 22/07/2024

Successfully completed the API integration for material prices by modifying the API call method. Applied a similar strategy for coupon code generation. Encountered an error due to recent backend code updates, but collaborated with the backend team and resolved the issue.Will have to check if this strategy works fine for coupon code generation

sync-by-unito[bot] commented 3 months ago

➤ Neeraja commented:

Work Summary - 23/07/2024

Completed API integration for material price and coupon code generation. Successfully retrieved responses from the backend, performed necessary actions, and displayed the results on the frontend. Pending task: Retrieve the token directly from the API instead of hard-coding it.

sync-by-unito[bot] commented 3 months ago

➤ Neeraja commented:

Completed validations - Dialog Box without any selections

!Screenshot from 2024-07-23 17-30-07.png|width=1920,height=1080,alt="Screenshot from 2024-07-23 17-30-07.png"!

sync-by-unito[bot] commented 3 months ago

➤ Neeraja commented:

Completed validations - Material price

!Screenshot from 2024-07-23 17-30-33.png|width=1920,height=1080,alt="Screenshot from 2024-07-23 17-30-33.png"!

sync-by-unito[bot] commented 3 months ago

➤ Neeraja commented:

Completed validations - Coupon code generation

!Screenshot from 2024-07-23 17-31-07.png|width=1920,height=1080,alt="Screenshot from 2024-07-23 17-31-07.png"!

sync-by-unito[bot] commented 3 months ago

➤ Neeraja commented:

Work Summary - 24/07/2024

Successfully retrieved the token directly from the API instead of hard-coding it and verified all functionalities within the local server setup. Everything worked fine. However, when the server's IP was changed, an unexpected error occurred: the client's connection to the server was closed whenever an API was hit. This issue needs to be addressed.

sync-by-unito[bot] commented 3 months ago

➤ Neeraja commented:

Work Summary - 25/07/2024

The issue persists despite trying different methods. Will have to explore alternative approaches to resolve it.

sync-by-unito[bot] commented 3 months ago

➤ Neeraja commented:

Work Summary - 26/07/2024

I worked on the issue today and explored various techniques, but unfortunately, the error remains unresolved. I'll need to consider alternative approaches to address the problem.

sync-by-unito[bot] commented 3 months ago

➤ Neeraja commented:

Work Summary - 29/07/2024

I worked on the issue today and discovered that code that was previously functioning on the local server is now also failing. I received assistance from Nandha L , reverted the code to its original format, and then accessed the GitHub repository to clone the project. Despite reverting the code and making necessary changes to call the API, the same error persists. I am currently focused on resolving the new error that has arisen with the local server.

sync-by-unito[bot] commented 3 months ago

➤ Neeraja commented:

Work Summary - 30/07/2024

Today, I set up a new project with just one API to isolate and address the error. Despite focusing on resolving the issue with this single API function, the error still persists.

sync-by-unito[bot] commented 3 months ago

➤ Neeraja commented:

Work Summary - 31/07/2024

With Nandha L 's assistance, we determined that the error might be due to the “Content-Length” not being passed to the server. I will now try explicitly setting the Content-Length in the request header to resolve the issue.

sync-by-unito[bot] commented 3 months ago

➤ Neeraja commented:

Work Summary - 01/08/2024

I explicitly set the “Content-Length” in the request header, but the issue persisted. With Nandha L's assistance, I then attempted to replicate the operation using plain HTML and JavaScript instead of Angular. I also set up a sample server locally to troubleshoot the error with a basic HTML and JavaScript setup, but the same error continues to occur. I will need to experiment with different “Content-Type” and “Content-Length” values to resolve the issue.