MoonMiners/test-endpoints.restclient
Joseph Ferano 9b753cf103 Porting database from SQLite to PostgreSQL
- New Postgres table schemas
- Using Stored Procedures with transactions that validate business logic
- User Ids now use UUID
- Updated and simplified all endpoints to call the stored procedures

Notes: There are still a few things missing that broke because of the migration,
in particular, because we moved a lot of the business logic into the database,
we now require that certain data that lived in the game-config.json to be
present in the database as well, to prevent cheating and truly have a single
source of truth.
2023-03-30 14:13:30 +07:00

53 lines
1.2 KiB
Plaintext

:headers = <<
Content-Type: application/json
#
:user_id = 595ab570-fa74-4c6c-980e-4c80d1064dd1
# Get Inventory Items
GET http://localhost:3000/api/seed
:headers
# Get Inventory Items
POST http://localhost:3000/api/user/login
:headers
{ "wallet" : "Wallet12345678" }
# Get bank account
GET http://localhost:3000/api/user/:user_id/bank-account
:headers
# Get Staking Sources
GET http://localhost:3000/api/user/:user_id/staking-sources
:headers
# Create a new staking source
POST http://localhost:3000/api/user/:user_id/staking-sources
:headers
# Get Inventory Items
GET http://localhost:3000/api/user/:user_id/inventory-items
:headers
# Buy a new Item
POST http://localhost:3000/api/user/:user_id/inventory-items/
:headers
{ "storeItemId" : "item1" }
# Upgrade an owned item
PUT http://localhost:3000/api/user/:user_id/inventory-items/
:headers
{ "storeItemId" : "item3", "inventoryItemId": 3 }
# Get stakes
GET http://localhost:3000/api/user/:user_id/stakes/
:headers
# Start a stake
POST http://localhost:3000/api/user/:user_id/stakes/start
:headers
{ "inventoryItemId": 3, "storeItemId": "item3", "wellId": 1 }
# Claim a stake
POST http://localhost:3000/api/user/:user_id/stakes/claim
:headers
{ "stakingEventId" : 3 }