(database): Initial commit

This commit is contained in:
apetitco 2025-12-22 18:29:45 +01:00 committed by Maix0
parent 0b15fd897b
commit e7bf718fa6
2 changed files with 4 additions and 2 deletions

View file

@ -4,11 +4,13 @@ import { FastifyInstance, FastifyPluginAsync } from 'fastify';
import { Database as DbImpl } from './mixin/_base'; import { Database as DbImpl } from './mixin/_base';
import { IUserDb, UserImpl } from './mixin/user'; import { IUserDb, UserImpl } from './mixin/user';
import { IBlockedDb, BlockedImpl } from './mixin/blocked'; import { IBlockedDb, BlockedImpl } from './mixin/blocked';
import { ITicTacToeDb, TicTacToeImpl } from './mixin/tictactoe';
Object.assign(DbImpl.prototype, UserImpl); Object.assign(DbImpl.prototype, UserImpl);
Object.assign(DbImpl.prototype, BlockedImpl); 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 // When using .decorate you have to specify added properties for Typescript
declare module 'fastify' { declare module 'fastify' {

View file

@ -83,7 +83,7 @@ async function onReady(fastify: FastifyInstance, game: TTC) {
turn: game.currentPlayer, turn: game.currentPlayer,
lastResult: result, lastResult: result,
}); });
// setGameOutcome(); // fastify.db.setGameOutcome(this, "011001");
} }
}); });