from flask import Flask, request

from dataclasses import dataclass
# from dataclasses_json import dataclass_json

from game_app.app_backend import TicTacToeApp
app = Flask(__name__)

app_backend = TicTacToeApp()

@app.route('/start-game', methods=["POST"])
def start_game():
    first_player = request.json["first_player_id"]
    second_player = request.json["second_player_id"]
    
    started_game = app_backend.start_game(first_player_id=first_player, second_player_id=second_player)
    return started_game.game_id



@app.route('/turn')
def make_turn():
    pass



@app.route('/get-game-by-id/<game_id>')
def get_game_by_id(game_id):
    app_backend.get_game_by_id(game_id)

