app.repository.user_actions_repository module

class app.repository.user_actions_repository.UserActionsRepository(session_factory, model=<class 'app.model.user_actions.UserActions'>)[source]

Bases: BaseRepository

Repository class for user points.

Parameters:

session_factory (Callable[[...], AbstractAsyncContextManager[AsyncSession]])

session_factory

Factory for creating SQLAlchemy sessions.

Type:

Callable[…, AbstractAsyncContextManager[AsyncSession]]

model

SQLAlchemy model class for user points.

__init__(session_factory, model=<class 'app.model.user_actions.UserActions'>)[source]
Initializes the UserPointsRepository with the provided session factory

and model.

Parameters:
  • session_factory (Callable[..., AbstractAsyncContextManager[AsyncSession]]) – The session factory.

  • model – The SQLAlchemy model class for user points.

Return type:

None

async add_action_in_task(user_id, task_id, action)[source]

Add action in task for user.

Parameters:
  • user_id (str)

  • task_id (str)

  • action (AddActionDidByUserInTask)