Skip to content

IThinkThatsKirby/GOwebservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GOwebservice

This was for a takehome assesment

roast my line comments and readme PLS :D

  • If this is your first time with the GO language please visit https://go.dev/dl/
  • Follow the instructions for your system.
  • Clone this repo to a folder.
  • Open a terminal inside the folder.
  • Enter the command: go run test.go

what it DO:

  1. This web service provides proccessing for payer transactions with timestamps. example:
    POST { "payer": "DANNON", "points": 1000, "timestamp": "2020-11-02T14:00:00Z" }
  1. Spend points from oldest to newest by transaction date regardless of payer. example:
    POST { "points": 5000 }

   
  * response from server:

   [
     { "payer": "DANNON", "points": -100 },
     { "payer": "UNILEVER", "points": -200 },
     { "payer": "MILLER COORS", "points": -4,700 }
   ]
  1. return current balance of all payers. example:
    	{
       "DANNON": 1000,
       ”UNILEVER” : 0,
       "MILLER COORS": 5300
   }

HTTP routes for the server:

POST "/" : Receives transaction call
POST "/spend" : Receives spend request from user(you), responds with payer points spent.
GET"/points" : blank request will respond with current payers points.

About

roast my line comments and readme PLS :D

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages