Skip to content

Instantly share code, notes, and snippets.

@ppshobi
Created April 15, 2019 12:48
Show Gist options
  • Save ppshobi/166846e722d70bb2ba8878d4bef887bd to your computer and use it in GitHub Desktop.
Save ppshobi/166846e722d70bb2ba8878d4bef887bd to your computer and use it in GitHub Desktop.

Case A

path: /banana

method: post

payload:

{
    'user_id':899
    'lot' : {
        'name' : 'Red Dacca',
        'locality': 'Costa Rica',
        'harvested_at': 'July 27, 2018',
        'weight': 1500,
    }
}

response

code: 201 CREATED

message: banana lot created 1881

Case B

path: /banana

method: post

payload:

{
    'user_id':899
    'lot' : {
        'name' : 'Red Dacca',
        'locality': 'Costa Rica',
        'harvested_at': 'July 27, 2018',
        'weight': 500,
    }
}

response

code: 400

message: Minimum weight allowed is 1000kg

Case C

path: /banana/1881

method: PATCH

payload:

{
    'user_id':899
    'harvested_at': 'June 14, 2018',
}

response

code: 200 OK

message: Banana lot 1881 updated its harvested_at date

Case D

path: /auction

method: POST

payload:

{
    'user_id':899
    'lot_id': 1881,
    'start_at': 'September 04, 2018 00:00:00',
    'end_at': 'September 04, 2018 23:59:00',
    'rate': 1.20
    'currency': 'USD'
}

response

code : 201 CREATED

message: auction item created with id 2222

Case E

path: /auction/2222/bid

method: POST

payload:

{
    'user_id': 72,
    'rate': 1.21,
    'currency: USD,
}

response

code : 201 CREATED

message: bid created for autcion item 2222 with bid_id 5555

Case F

path: /auction/2222/bid

method: GET payload:

{}

response

code : 200 OK message:

5555 : {
    'rate': 1.21,
    'currency': 'USD',
    'bidder_id': 72,
  }
}

Case G

path: /banana/1881

method: DELETE

payload:

{
    'user_id': 899
}

response

code: 202 MARKED FOR DELETION

message: banana lot 1881 deleted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment