Skip to content
This repository has been archived by the owner on Oct 4, 2024. It is now read-only.

Commit

Permalink
enh: Add new task for demo (#254)
Browse files Browse the repository at this point in the history
* fix: streak not incremented

Signed-off-by: Henry Brink <[email protected]>

* enh: Add new task

Signed-off-by: Henry Brink <[email protected]>

* fix: invalid id

Signed-off-by: Henry Brink <[email protected]>

---------

Signed-off-by: Henry Brink <[email protected]>
  • Loading branch information
henrybrink authored Jun 19, 2024
1 parent c177bf6 commit 7fdd4d5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions backend/src/app/tasks/task.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import { Task2 } from './tasks/static/task2';
import { Task3 } from './tasks/static/task3';
import { StreakService } from '../streaks/streak.service';
import { NotificationService } from '../../notification/notification.service';
import { Task4 } from './tasks/static/task4';

export class ConcurrentTaskError extends Error {}
export class TaskNotAvailableError extends Error {}
Expand All @@ -29,6 +30,7 @@ export class TaskService {
'1': Task1,
'2': Task2,
'3': Task3,
'4': Task4,
};

private getLogForTask(logs: TaskLog[], task: string): TaskLog | undefined {
Expand Down
18 changes: 18 additions & 0 deletions backend/src/app/tasks/tasks/static/task4.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { StepTask } from '../task.step';
import { TaskInfo } from '../task.types';

export class Task4 extends StepTask {
getRequiredSteps(): number {
return 4000;
}
getInfo(): TaskInfo {
return {
id: '4',
title: 'Schritte-Meister: Junior',
description: 'Erreiche mindestens 4.000 Schritte',
points: 20,
conditions: [],
status: this.userStatus,
};
}
}

0 comments on commit 7fdd4d5

Please sign in to comment.