Giter VIP home page Giter VIP logo

wextest's Introduction

Wex test

This is a technical interview exercise

Transaction Management Application

This application is designed to handle financial transactions, including storing transaction details and retrieving them with the option of currency conversion based on the Treasury Reporting Rates of Exchange API.

Project Structure

The project is organized into several packages, each with a specific responsibility:

cmd/main.go

The entry point of the application. It sets up and starts the HTTP server, routes, and integrates all application components.

pkg/transactions

Contains the core business logic for handling transactions.

  • transaction.go: Defines the Transaction struct and any methods related to it.
  • service.go: Contains the Service struct with methods for storing and retrieving.
  • transactions.go It interacts with the repository and the currency converter.
  • repository.go: Defines the Repository interface and includes an in-memory implementation for storing transactions.

pkg/currency

Handles currency conversion logic.

  • converter.go: Contains the Converter struct with methods to perform currency conversions using exchange rates from an external API.

pkg/api

Responsible for external API interactions.

  • client.go: Defines the Client struct with methods to interact with external APIs, such as fetching currency exchange rates.

pkg/utils

Includes utility functions and custom error definitions.

  • errors.go: Contains custom error types and utility functions related to error handling.

Installation and Running

go build ./cmd/main.go
./main

API Endpoints

Describe the available HTTP endpoints, their methods, request parameters, and expected responses. For example:

  • POST /store: Stores a new transaction.
  • GET /retrieve/{id}: Retrieves a transaction by ID with no conversion.
  • GET /retrieve/{id}/{targetCountry}: Retrieves a transaction by ID and converts it to the specified currency.

wextest's People

Contributors

pvmendes 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.