Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

receipt-processor

Solution to the Receipt Processor challenge.

Endpoints

/receipts/process

Body: A JSON-formatted Receipt.

Response:

  • 200: A JSON-formatted body in the form of:

    { "id": "062e96a5-3dcf-4a42-b565-06ea3bc3d2e9" }

    where id can be later used in GET /receipts/{id}/points.

  • 400: If the receipt did not pass validation, or is otherwise malformed.

/receipts/{id}/points

Body: None

Response:

  • 200: A JSON-formatted body in the form of:

    { "points": 23 }

    where points is the points awarded to the processed receipt, according to a set of predefined rules.

  • 404: If the id did not come from a prior /receipts/process request.

Running

go mod tidy
go run main.go

Or using Docker:

docker build -t receipt-processor:latest .
docker run -p 8080:8080 -it receipt-processor:latest

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages