Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
5b0417c
feat: add root admins (#18)
emptybutton Aug 21, 2025
ba0742c
feat: add draft `matchmaking_queue` (#4)
emptybutton Aug 27, 2025
05e61d9
feat: add in-postgres `matchmaking_queue` (#6)
emptybutton Aug 28, 2025
b060076
ref(`aiogram_dialog`): remove dublicates
emptybutton Aug 30, 2025
1ca0c1d
ref(`adapters`): use `DialogManagerForUser` instead of `BgManagerFact…
emptybutton Aug 30, 2025
0722d01
ref(`adapters`): fix class names
emptybutton Aug 30, 2025
a0e23c8
feat: add ranks (#44)
emptybutton Aug 30, 2025
aec5660
feat: present ranks in another way (#44)
emptybutton Aug 31, 2025
2d256aa
fix: view admin panel
emptybutton Aug 31, 2025
5eb3285
feat: add other user views for admins (#42)
emptybutton Aug 31, 2025
30ac0de
style: fix `ruff` and `mypy` errors (#42)
emptybutton Aug 31, 2025
c08e4b9
ref(`aiogram_dialog`): split `Hint`
emptybutton Aug 31, 2025
2745664
feat(`entities`): add not-root admin operations (#41)
emptybutton Sep 3, 2025
69084f5
feat: make it better, faster, stronger (#42)
emptybutton Sep 5, 2025
fab4a3d
feat: make it better, faster, stronger (#41)
emptybutton Sep 8, 2025
dc10fa7
fix(`presentation`): consider corner cases in `admin_main_dialog` (#41)
emptybutton Sep 9, 2025
aadf331
style: fix `ruff` errors (#41)
emptybutton Sep 9, 2025
8add2b5
style: fix `mypy` errors (#41)
emptybutton Sep 9, 2025
bf88d4f
fix(`tests`): use `AdminRight` not `Role` (#41)
emptybutton Sep 9, 2025
7db8d13
feat: add user account change for admins (#46)
emptybutton Sep 9, 2025
fe0368c
feat: add base of `InvitationToGame` (#43)
emptybutton Sep 10, 2025
de54fa8
fix(`invitation_to_game`): fix small errors (#43)
emptybutton Sep 11, 2025
4e15bed
style: fix `ruff` errors (#43)
emptybutton Sep 11, 2025
416bc60
feat: complete some `invitation_to_game` details (#43)
emptybutton Sep 12, 2025
d60f9a4
style: fix `ruff` errors (#43)
emptybutton Sep 12, 2025
ce497ff
style: fix `mypy` errors (#43)
emptybutton Sep 12, 2025
95b4e8e
chore(`pyproject`): use `0.4.0`v
emptybutton Sep 12, 2025
5b8fea9
chore(`deploy`): remove unused `env` variables
emptybutton Sep 12, 2025
111acb7
Merge pull request #47 from emptybutton/dev
emptybutton Sep 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions deploy/dev/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ services:
TTT_NATS_URL: nats://nats:4222

TTT_GEMINI_URL: https://my-openai-gemini-sigma-sandy.vercel.app

TTT_GAME_WAITING_QUEUE_PULLING_TIMEOUT_MIN_MS: 100
TTT_GAME_WAITING_QUEUE_PULLING_TIMEOUT_SALT_MS: 100
secrets:
- secrets
command: ttt-dev
Expand Down
3 changes: 0 additions & 3 deletions deploy/prod/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ services:
TTT_NATS_URL: nats://${NATS_TOKEN}@nats:4222

TTT_GEMINI_URL: ${GEMINI_URL}

TTT_GAME_WAITING_QUEUE_PULLING_TIMEOUT_MIN_MS: 100
TTT_GAME_WAITING_QUEUE_PULLING_TIMEOUT_SALT_MS: 200
secrets:
- secrets
networks:
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "ttt"
version = "0.3.0"
version = "0.4.0"
description = "Tic-Tac-Toe Telegram Bot"
authors = [
{name = "Alexander Smolin", email = "[email protected]"}
Expand Down Expand Up @@ -75,6 +75,9 @@ indent-width = 4
[tool.ruff.lint.isort]
lines-after-imports = 2

[tool.ruff.lint.pylint]
allow-dunder-method-names = ["__entity__"]

[tool.ruff.lint]
select = ["ALL"]
ignore = [
Expand Down
6 changes: 5 additions & 1 deletion src/ttt/application/common/ports/map.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
class NotUniqueUserIdError(Exception): ...


class NotUniqueActiveInvitationToGameUserIdsError(Exception): ...


type MappableTracking = Tracking[Atomic]


Expand All @@ -19,4 +22,5 @@ async def __call__(
) -> None:
"""
:raises ttt.application.common.ports.map.NotUniqueUserIdError:
"""
:raises ttt.application.common.ports.map.NotUniqueActiveInvitationToGameUserIdsError:
""" # noqa: E501
33 changes: 3 additions & 30 deletions src/ttt/application/game/game/ports/game_log.py
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
from abc import ABC, abstractmethod
from collections.abc import Sequence

from ttt.entities.core.game.game import Game
from ttt.entities.core.game.move import AiMove, UserMove
from ttt.entities.core.user.user import User


class GameLog(ABC):
@abstractmethod
async def waiting_for_game_start(
self,
user_id: int,
/,
) -> None: ...

@abstractmethod
async def double_waiting_for_game_start(
self,
user_id: int,
/,
) -> None: ...

@abstractmethod
async def game_against_user_started(
self,
Expand Down Expand Up @@ -70,7 +55,9 @@ async def game_completed(
) -> None: ...

@abstractmethod
async def user_already_in_game_to_start_game(self, user: User, /) -> None:
async def user_already_in_game_to_start_game_against_ai(
self, user: User, /,
) -> None:
...

@abstractmethod
Expand Down Expand Up @@ -116,17 +103,3 @@ async def already_completed_game_to_cancel(
user_id: int,
/,
) -> None: ...

@abstractmethod
async def users_already_in_game_to_start_game_via_game_starting_queue(
self,
user_ids: Sequence[int],
/,
) -> None: ...

@abstractmethod
async def bad_attempt_to_start_game_via_game_starting_queue(
self,
user_ids: Sequence[int],
/,
) -> None: ...
29 changes: 0 additions & 29 deletions src/ttt/application/game/game/ports/game_starting_queue.py

This file was deleted.

9 changes: 1 addition & 8 deletions src/ttt/application/game/game/ports/game_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@


class GameViews(ABC):
@abstractmethod
async def waiting_for_game_view(self, user_id: int, /) -> None: ...

@abstractmethod
async def current_game_view_with_user_id(self, user_id: int, /) -> None: ...

Expand Down Expand Up @@ -68,8 +65,4 @@ async def already_filled_cell_error(
) -> None: ...

@abstractmethod
async def users_already_in_game_views(
self,
user_ids: Sequence[int],
/,
) -> None: ...
async def user_already_in_game_view(self, user_id: int, /) -> None: ...
120 changes: 0 additions & 120 deletions src/ttt/application/game/game/start_game.py

This file was deleted.

10 changes: 4 additions & 6 deletions src/ttt/application/game/game/start_game_with_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
from ttt.application.common.ports.uuids import UUIDs
from ttt.application.game.game.ports.game_ai_gateway import GameAiGateway
from ttt.application.game.game.ports.game_log import GameLog
from ttt.application.game.game.ports.game_starting_queue import (
GameStartingQueue,
)
from ttt.application.game.game.ports.game_views import GameViews
from ttt.application.game.game.ports.games import Games
from ttt.application.user.common.ports.user_views import CommonUserViews
Expand All @@ -32,7 +29,6 @@ class StartGameWithAi:
user_views: CommonUserViews
games: Games
game_views: GameViews
game_starting_queue: GameStartingQueue
transaction: Transaction
ai_gateway: GameAiGateway
log: GameLog
Expand Down Expand Up @@ -66,8 +62,10 @@ async def __call__(self, user_id: int, ai_type: AiType) -> None:
tracking,
)
except UserAlreadyInGameError:
await self.log.user_already_in_game_to_start_game(user)
await self.game_views.users_already_in_game_views([user_id])
await self.log.user_already_in_game_to_start_game_against_ai(
user,
)
await self.game_views.user_already_in_game_view(user_id)
else:
await self.log.game_against_ai_started(started_game.game)

Expand Down
35 changes: 0 additions & 35 deletions src/ttt/application/game/game/wait_game.py

This file was deleted.

Empty file.
Loading