Skip to content

HappyHappy1996/appcharge-NestJS-code-task

Repository files navigation

Installation

$ npm ci

Running the app

# development
$ docker-compose up --build

The code task requirements

create a REST Nest.js web server that exposes the following APIs:

  1. Login

    • Request
      • playerId
      • Password
    • Logic
      • Validate that this is a valid player user and generate a unique session id
    • Response
      • A login session id
  2. Offer sets CRUD endpoint with this schema example

{
  "gameId": "33",
  "avlabilty": 15,
  "offerSetName": "bundle medium",
  "offerSetId": "63e8ac11df807b5c13656c69",
  "sku": "222",
  "priceInCents": "3900",
  "currency": "usd",
  "products": [
    {
      "amount": 500,
      "sku": "002",
      "name": "dice medium"
    },
    {
      "amount": 1500,
      "sku": "005",
      "name": "coins medium"
    }
  ]
}
  1. Order

    • Request
      • Credit card details
      • OfferSetId
      • Session id
    • Logic
      • Validate that the user loged in
      • Validate basic credit card details
      • Validate OfferSet availability and reduce it
      • Record the order in a DB table
    • Response
      • Encrypted new order id
        • Use aes-256-cbc encryption algorithm (Edit: makes no sense to me, so I ignored that)
  2. The system should be ready to lunch with the user and offers set data injected into the chosen DB in the setup

Swagger

The Swagger doc is available locally at (if you use default .env values):

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published