0% found this document useful (0 votes)
63 views6 pages

Kloudrac Assesment - Senior Salesforce Developer - Assesment - 2

The document outlines an assessment for integrating the GST API into Salesforce using Lightning Web Components (LWC). It details the objectives, including user input for GST numbers, fetching and displaying GST details in a table, and saving the data in a custom Salesforce object. Additionally, it covers backend requirements for API calls using Apex, key skills assessed, and submission guidelines for the project.

Uploaded by

helloharry.dagar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views6 pages

Kloudrac Assesment - Senior Salesforce Developer - Assesment - 2

The document outlines an assessment for integrating the GST API into Salesforce using Lightning Web Components (LWC). It details the objectives, including user input for GST numbers, fetching and displaying GST details in a table, and saving the data in a custom Salesforce object. Additionally, it covers backend requirements for API calls using Apex, key skills assessed, and submission guidelines for the project.

Uploaded by

helloharry.dagar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

Integrating GST API in Salesforce with LWC

This assessment will test your ability to work with Salesforce Lightning Web Components
(LWC) and integrate external APIs, such as the GST API, in a Salesforce environment. You will
be asked to create a fully functional LWC that can interact with the GST API, display the
response in a table, and store the data in a custom Salesforce object.

Objective:
Integrate the GST API portal into a Salesforce Lightning Web Component to:

1. Take input for the GST Number from the user.


2. Fetch GST details based on the entered GST Number via an API call.
3. Display the fetched data in a tabular format.
4. Save the retrieved details into a custom Salesforce object called GST_Details__c.

Part 1: LWC Frontend Design


1. User Input:
○ Create an input field where users can enter a GST Number.
○ Add proper validation to ensure the GST Number is in the correct format (e.g., for
Indian GST, a format like XXAAAAA0000A1Z5).

2. API Integration:
a. Create a GET GST DETAILS button that will trigger an API call to the GST API
when clicked.

b. The API should return relevant GST details, such as:


■ GST Number
■ Legal Name of the Business
■ Address
■ Status of GST Registration
■ Type of Business (Default - Regular)
3. Tabular Display:

a. Display the API response in a table with columns for each detail mentioned
above.
b. The table should be dynamically populated with the data returned by the API.

4. Save Button:
a. After displaying the GST details in the table, add a Save button below the table.

b. Clicking this button should store the details in a custom object called
GST_Details__c.

i. Create a custom object GST_Details__c in Salesforce to store the


following fields:

1. GST_Number__c (Text)
2. Legal_Name__c (Text)
3. Address__c (Text)
4. GST_Status__c (Picklist: ‘Active’, ‘Inactive’, etc.)
5. Business_Type__c (Picklist: ‘Regular’)

Part 2: Backend (Apex Integration)


1. Create an Apex class to handle the API call to the GST portal. This Apex class should:
○ Accept the GST Number as input.
○ Make a GET request to the GST API and return the response.
○ Handle authentication and API rate limits if applicable.
○ Parse the API response and return the necessary fields (GST Number, Business
Name, GST Status, etc.) back to the LWC.
2. Save Data in Salesforce:
○ Create an Apex method to insert the GST details into the GST_Details__c
object.
○ Ensure proper error handling and logging.

Part 3: Key Skills Assessed


This assessment is designed to test your knowledge and skills in the following areas:

● Lightning Web Components (LWC) Development


○ Understanding of LWC structure (HTML, JavaScript, and CSS)
○ Event handling in LWC (button click, form submission, etc.)
○ Conditional rendering and dynamic data binding in LWC
● Apex Development
○ Making HTTP requests from Apex (e.g., using HttpRequest, HttpResponse)
○ Parsing JSON or XML responses
○ Inserting records into custom Salesforce objects (insert DML operations)

● Salesforce Data Modeling


○ Creating and working with custom objects in Salesforce
○ Ensuring proper data validation and error handling
● API Integration
○ Authenticating and calling external APIs
○ Handling API responses (success and error scenarios)

Assessment Instructions:

API DETAILS : -
curl --location
'https://api.e-waybill.in/api/gstin/validate?gstin=09AAFCK6485M1ZR'

Use the following GST Numbers for testing :-


1- 09AAFCK6485M1ZR
2- 27AAACR5055K1Z7
3- 29AACCG0527D1Z0

1. Create a Custom Object:


○ Create a custom object called GST_Details__c in Salesforce with the following
fields:
■ GST_Number__c (Text)
■ Legal_Name__c (Text)
■ Address__c (LongText)
■ GST_Status__c (Picklist: ‘Active’, ‘Inactive’, etc.)
■ Business_Type__c (Picklist: ‘Regular’, ‘Composition’, etc.)
2. Develop the LWC Component:
○ HTML File: Create an input field for the GST Number and a button to fetch
details from the GST API.
○ JavaScript File: Handle the button click event to trigger an API call and process
the API response. Display the data in a table and handle errors.
○ CSS File (optional): Style the component to ensure it is visually appealing.
3. Create the Apex Class:
○ Develop an Apex class with methods for making API calls, processing the
response, and saving the details to the custom object.
○ Ensure proper error handling (e.g., invalid GST Number, API errors).
4. Test the Integration:
○ Test the LWC by entering a valid GST Number and checking the displayed
details.
○ Ensure the Save button works and inserts the data into the GST_Details__c
object correctly.
○ Handle potential errors such as invalid input, network issues, or missing fields.

Bonus Tasks (Optional):


● Data Validation: Add additional data validation on the input field (e.g., to check if the
GST Number is in the correct format before making the API call).
● Error Handling UI: Display user-friendly error messages on the LWC when the API call
fails or when invalid data is entered.
● Batch API Calls: If the API allows bulk fetching, implement a feature to retrieve details
for multiple GST Numbers at once.

Submission Guidelines
1. GitHub Repository: Create a GitHub repository with the following:
○ A README file that explains your approach and any assumptions.
○ Apex classes that implement the business logic.
○ Custom objects and fields for storing business and account details.
○ API endpoints exposed via Apex REST.
○ Unit test classes covering different scenarios.

2. Pull Request: Create a pull request to the main branch with a description of your
changes and submit it.

Create a GitHub Repository (if not already created):


○ Go to GitHub and create a new repository, or use an existing one.
○ If it's a new repository, you can either initialize it with a README or leave it
empty.

Clone the Repository to Your Local Machine: Open your terminal/command line
and use the following command to clone the repository (replace your-username
and your-repository with the appropriate values):

git clone
https://github.com/your-username/your-repository.git
cd your-repository

3. Create a New Branch for Your Changes: It's best practice to make changes in a
separate branch instead of directly on main or master:

git checkout -b your-branch-name

4. Make Your Code Changes: Make the necessary changes to the code on your local
machine.

Stage and Commit the Changes: After you've made your changes, you need to stage
and commit them:

git add .
git commit -m "Description of changes made"

5. Push the Changes to GitHub: Push your changes to the newly created branch on
GitHub:

git push origin your-branch-name

6. Create a Pull Request:


○ Go to your repository on GitHub.
○ You'll see an option to create a pull request from your branch to the main
branch.
○ Click on "Compare & pull request."
○ Add a description of the changes you've made, and submit the pull request.

7. Share the Pull Request Link: Once the pull request is created, you can share the link
to it.

Assessment Evaluation Criteria:

Criteria Weight Description


(%)

LWC Component 40% Input field, button, and table display work as
Functionality expected.

Apex Integration 30% Correct implementation of the API call, response


handling, and saving data.

Data Handling and 20% Proper validation, error handling, and API response
Validation processing.

Code Quality 10% Clear, maintainable code with appropriate use of


comments and formatting.

You might also like