Giter Site home page Giter Site logo

manish-genai / fetch Goto Github PK

View Code? Open in Web Editor NEW

This project forked from itsmeblackops/fetch

2.0 0.0 0.0 211 KB

The Receipt Processor is a web service built with Go that processes receipts and calculates points based on predefined rules. It provides a simple and efficient way to process receipts and determine the points earned for each receipt.

Go 93.96% Dockerfile 6.04%

fetch's Introduction

Receipt Processor

This is a web service built with Go that processes receipts and calculates points based on predefined rules.

API Endpoints

Process Receipts

Endpoint: /receipts/process
Method: POST
Payload: Receipt JSON
Response: JSON containing an ID for the receipt

This endpoint takes in a JSON receipt and returns a JSON object with an ID generated by the service. The ID can be used to retrieve the number of points awarded to the receipt.

Get Points

Endpoint: /receipts/{id}/points
Method: GET
Response: JSON object containing the number of points awarded

This endpoint retrieves the number of points awarded to a receipt identified by the ID parameter.

Getting Started

To run the Receipt Processor, follow these steps:

  1. Clone the repository: git clone https://github.com/your-username/receipt-processor.git

  2. Navigate to the project directory: cd receipt-processor

  3. Build the Docker image: docker build -t receipt-processor .

  4. Run the Docker container: docker run -p 8080:8080 receipt-processor

By default, the application will run on port 8080. You can access the API endpoints using the following URLs:

  • Process Receipts: http://localhost:8080/receipts/process
  • Get Points: http://localhost:8080/receipts/{id}/points

Testing

To run the unit tests for the Receipt Processor, execute the following command: go test

The tests cover different scenarios, including valid inputs, invalid inputs, and edge cases.

fetch's People

Stargazers

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