From e7bf718fa67b36ffedb23c7d8c857ff4f70039ce Mon Sep 17 00:00:00 2001 From: apetitco Date: Mon, 22 Dec 2025 18:29:45 +0100 Subject: [PATCH] (database): Initial commit --- src/@shared/src/database/index.ts | 4 +++- src/tic-tac-toe/src/app.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/@shared/src/database/index.ts b/src/@shared/src/database/index.ts index 1cc1628..d4ddfc7 100644 --- a/src/@shared/src/database/index.ts +++ b/src/@shared/src/database/index.ts @@ -4,11 +4,13 @@ import { FastifyInstance, FastifyPluginAsync } from 'fastify'; import { Database as DbImpl } from './mixin/_base'; import { IUserDb, UserImpl } from './mixin/user'; import { IBlockedDb, BlockedImpl } from './mixin/blocked'; +import { ITicTacToeDb, TicTacToeImpl } from './mixin/tictactoe'; Object.assign(DbImpl.prototype, UserImpl); Object.assign(DbImpl.prototype, BlockedImpl); +Object.assign(DbImpl.prototype, TicTacToeImpl); -export interface Database extends DbImpl, IUserDb, IBlockedDb { } +export interface Database extends DbImpl, IUserDb, IBlockedDb, ITicTacToeDb { } // When using .decorate you have to specify added properties for Typescript declare module 'fastify' { diff --git a/src/tic-tac-toe/src/app.ts b/src/tic-tac-toe/src/app.ts index 977bb8f..7b1a3b2 100644 --- a/src/tic-tac-toe/src/app.ts +++ b/src/tic-tac-toe/src/app.ts @@ -83,7 +83,7 @@ async function onReady(fastify: FastifyInstance, game: TTC) { turn: game.currentPlayer, lastResult: result, }); - // setGameOutcome(); + // fastify.db.setGameOutcome(this, "011001"); } });