# Introduction

## Flow
- Pick the game from the [list](api-3510882)
- Display  [game](api-3510883)
- Get [ticket](api-3510884) required to play game
- [Play](api-3510885) the game with obtained ticket key
- If prize has been won, [issue prize](api-3510886)

## Additional info

- One ticket - one play
- Ticket is generated per game and valid till played
- If prize has not been won, player can play again with new ticket
- If prize limit has been reached, every next game will be lost
- Tickets limit resets every day
- After prize issue, coupon will be granted (currently only coupon can be won)
- When `redeem_before_new_ticket` flag is set, no new ticket will be generated till the previous ticket's prize redeemed

## Configuration

Config | Description                                  | Type
--------- | -------------------------------------------- | ------
`attempts` |    how many tickets player can receive / per day  | int
`chance_to_win`|    chance to win in percentage  | int
`day_start_time` |    hour when day starts and resets ticket counts  | hour (H:i:s)
`prize_limit` |    prize limit per game  | int
`redeem_before_new_ticket` |    prize must be used before new game  | bool
`revoke_unredeemed_prize` |   revoke unredeemed prize  | bool
`days_to_prize_revoked` |    days the prize will be revoked after  | int
`show_prizes` | show prizes in game rules | bool
`start_date`| start game campaign | date
`end_date`| end game campaign | date
`active`|  is game active (manual flag) | bool
`setup_finished` | is game configured (auto flag) | bool

## Scratchcard - Implementation

> Game [details](api-3510883) endpoint returns:

```json

{
    "type": "game type",
    "background_image": "background image for game",
    "foreground_image": "foreground image for game",
    "design_image": "t3",
    "inactive_image": "image to show when is active flag is set to false",
    "is_active": true
}

```
> When in game, ask for [ticket](api-3510884).

> When click [play](api-3510885), endpoint returns:

```json

{
  "symbols": [
    "symbol_image1",
    "symbol_image5",
    "symbol_image2",
    "symbol_image3",
    "symbol_image2",
    "symbol_image4",
    "symbol_image3",
    "symbol_image4",
    "symbol_image1"
  ],
  "prize": {
    "name": "100 NOK !"
  }
}
```

> Symbols should be placed on game's foreground image.
If prize has been won, the symbol list contains 3 same symbols and 
the prize name can be displayed with link to [prize issue](api-3510886)

## Wheel of fortune - Implementation

> Game [details](api-3510883) endpoint returns:

```json
{
    "type": "wof",
    "background_image": "background image for game",
    "wheel_image": "wheel image",
    "arrow_image": "arrow image",
    "inactive_image": "image to show when is active flag is set to false",
    "is_active": true
}
```
> When in game, ask for [ticket](api-3510884).

> When click [play](api-3510885), endpoint returns:

```json
{
    "degree": 65,
    "prize": null
}
```

> Endpoint returns degree, where the wheel must stop on.
If prize has been won, the arrow should point to prize on wheel.
the prize name can be displayed with link to [prize issue](api-3510886)