Coder Social home page Coder Social logo

brunagirao / trade-lwc Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 1.09 MB

It's a trade project using LWC and Fixer APi to get the latest rate of a currency and convert.

Apex 59.08% HTML 15.60% JavaScript 23.03% Shell 1.98% CSS 0.31%
apex css fixerapi html integration javascript lightning-web-components lwc salesforce salesforce-developers trade wrapper-class shell-script

trade-lwc's Introduction

Ebury Trading App

My Image

Ebury Requirements Test

  • We want to build a new web application that will allow us to create and store foreign exchange trades.
  • The main view is the Ebury Trading application, which contains a Trade list view, displaying the list of already booked trades and the relevant fields

What I used in this project

  • Apex Class
  • Apex Test Class
  • Apex Mock Class
  • Fixer API
  • Lightning Web Component (LWC)
  • Custom Labels
  • Named Credentials
  • Custom Settings

IMPORTANT! | Ebury Custom Settings

  • After push the components of this project in Salesforce a Custom Setting named Ebury Custom Setting will be created. So, you need fill the fields below with the correct data for the code execute as expected:
  • ApiKey: get your key in Fixer API site. My apiKey is C2NlwIvwyXnRC2smGYyGRc9kDlctJ82O
  • Ebury Queue: TradeReviewers
  • Template Email Notification: NewTrade

REQ1. New Trade View [Done]

  • Sell Currency and Buy Currency: initial value should be empty.
  • App: retrieve latest rate for the selected currency pair and display it.
  • Buy Amount: not be editable and be automatically calculated.
  • Rate: not be editable.
  • Buy Amount formula: Sell Amount x Rate.

What I Made?

  • I created the New Trade View using LWC as imagem below provided in the test.
  • I used the newTrade.js of the NewTrade LWC provided in the test.
  • I added the fields to view and follow the requirements above:

Wireframe

My Image

Screen I created | Initial field values

My Image

Screen after selected currency pairs

My Image

Screen after fill Sell Amount

My Image

REQ2. Send a notification after Trade Creation [Done]

  • Notify all users in a queue named Trade Reviewers.
  • Content of notification:
    โ€œA new trade has been created with the following data:
    Sell Currency: {sell ccy}
    Sell Amount: {sell amount}
    Buy Currency: {buy ccy}
    Buy Amount: {buy amount}
    Rate: {rate}
    Booked Date: {date}
    Link to the trade: {trade link}"

What I Made?

  • I created a Classic Email Template named New Trade and add the Template Content provided in the test.
  • I created a Queue named Trade Reviewers
  • I created a Custom Settings named Ebury Trading Settings to store the main app settings.

Classic Email Template

My Image My Image

Queue

My Image

Custom Settings

My Image My Image

REQ3. Create a connection with a External Service(API) | Fixer.io | Get Latest Rate [Done]

  • Create a connection with a External Service(API) to get Latest Rate
  • Use fixer.io(API) to get Latest Rate.
  • Use the class NewTradeController provided in the test to make the connection to API Fixer.io

What I Made?

  • I created add the link fixer.io to CSP Trusted Sites in Salesforce
  • I created a Named Credentials named GetLatestExchangeRate to add the fixer.io endpoint that I use to make the callouts to get the latest rates.
  • I added the ApiKey provided by fixer.io in the Ebury Trade Settings (Custom Setting)
  • I created a standard class of response named ActionResponse
  • I used the endpoint /latest of the API (returns real-time exchange rate data for all available or a specific set of currencies).

CSP Trusted Sites

My Image

Named Credentials

My Image

Ebury Trade Settings

My Image My Image

REQ4. Test Class Coverage [Done]

  • Create a connection with a External Service(API) to get Latest Rate
  • Use fixer.io(API) to get Latest Rate.
  • Use the class NewTradeController provided in the test to make the connection to API Fixer.io

What I Made?

  • I created a mock class named NewTradeControllerMock to simulate the callouts to fixer.io
  • I created a test class named NewTradeControllerTest.
  • I covered 100% of the classes used in this test.

Test Class Coverage

My Image My Image

REQ5. Salesforce CLI and Salesforce DX [Done]

  • This application will be deployed using Salesforce CLI and Salesforce DX
  • Update the build.sh script to create the scratch org if needed and leave it ready for testing.

What I Made?

  • I worked with the SFDX and CLI developement to push, retrieve, run test and so on.
  • I updated the buil.sh with the command needed to:
    • create scratch org
    • set the scratch org as default
    • push the changes
    • execute tests

How Do You Plan to Deploy Your Changes?

Do you want to deploy a set of changes, or create a self-contained application? Choose a development model.

Configure Your Salesforce DX Project

The sfdx-project.json file contains useful configuration information for your project. See Salesforce DX Project Configuration in the Salesforce DX Developer Guide for details about this file.

Read All About It

trade-lwc's People

Contributors

brunagirao avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.