app.services.task_service module

Public entry point for task operations.

TaskService composes three focused mixins (see app.services.task) so its read, write and points-by-task concerns live in separate modules without changing the single DI-injected class that endpoints depend on:

  • TaskQueryMixin - read-only task lookups and listings.

  • TaskMutationMixin - the create/patch/delete/duplicate write path.

  • TaskPointsMixin - points-by-task read queries.

class app.services.task_service.TaskService(strategy_service, task_repository, game_repository, user_repository, user_points_repository, game_params_repository, task_params_repository, strategy_definition_service=None)[source]

Bases: BaseService, TaskQueryMixin, TaskMutationMixin, TaskPointsMixin

Service class for managing tasks.

Parameters:
strategy_service

Service instance for strategies.

Type:

StrategyService

task_repository

Repository instance for tasks.

Type:

TaskRepository

game_repository

Repository instance for games.

Type:

GameRepository

user_repository

Repository instance for users.

Type:

UserRepository

user_points_repository

Repository instance for user points.

Type:

UserPointsRepository

game_params_repository

Repository instance for game parameters.

Type:

GameParamsRepository

task_params_repository

Repository instance for task parameters.

Type:

TaskParamsRepository

__init__(strategy_service, task_repository, game_repository, user_repository, user_points_repository, game_params_repository, task_params_repository, strategy_definition_service=None)[source]
Initializes the TaskService with the provided repositories and

services.

strategy_definition_service is optional so existing call sites and tests that don’t exercise custom: strategyIds keep working. Required for patch_task_by_id() to validate custom: ids against the persistent registry.

Parameters:
Return type:

None