Celebrations automation

This commit is contained in:
2020-05-06 21:07:18 +03:00
parent 9087a79c5b
commit fca60a93a6
8 changed files with 130 additions and 4 deletions

View File

@ -0,0 +1,20 @@
import { TaskController, registerTask, ActionDefinition } from './TaskController';
import { GoToPageAction } from '../Action/GoToPageAction';
import { Task } from '../Queue/TaskProvider';
import { path } from '../Helpers/Path';
import { CelebrationAction } from '../Action/CelebrationAction';
@registerTask
export class CelebrationTask extends TaskController {
defineActions(task: Task): Array<ActionDefinition> {
const args = task.args;
const pathArgs = {
newdid: args.villageId,
gid: args.buildTypeId || undefined,
id: args.buildId || undefined,
};
return [[GoToPageAction.name, { ...args, path: path('/build.php', pathArgs) }], [CelebrationAction.name]];
}
}