"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.VPWorker = void 0;
const Di_1 = require("../../ioc/Di");
const VPContainerToken_1 = require("../../ioc/VPContainerToken");
const workers_1 = require("@golemio/core/dist/integration-engine/workers");
const constants_1 = require("./constants");
const DataRetentionTask_1 = require("./tasks/DataRetentionTask");
const ProcessRegionalBusPositionsTask_1 = require("./tasks/ProcessRegionalBusPositionsTask");
const PropagateDelayTask_1 = require("./tasks/PropagateDelayTask");
const PropagateTrainDelayTask_1 = require("./tasks/PropagateTrainDelayTask");
const SaveDataToDBTask_1 = require("./tasks/SaveDataToDBTask");
const UpdateDelayTask_1 = require("./tasks/UpdateDelayTask");
const UpdateGtfsTripIdTask_1 = require("./tasks/UpdateGtfsTripIdTask");
const UpdateRunsGtfsTripIdTask_1 = require("./tasks/UpdateRunsGtfsTripIdTask");
class VPWorker extends workers_1.AbstractWorker {
    constructor() {
        super();
        this.name = constants_1.WORKER_NAME;
        this.registerTask = (task) => {
            super.registerTask(task);
            task.queuePrefix = this.getQueuePrefix();
        };
        // Register tasks
        this.registerTask(Di_1.VPContainer.resolve(VPContainerToken_1.VPContainerToken.RefreshPublicTripCacheTask));
        this.registerTask(Di_1.VPContainer.resolve(VPContainerToken_1.VPContainerToken.RefreshPublicStopTimeCacheTask));
        this.registerTask(Di_1.VPContainer.resolve(VPContainerToken_1.VPContainerToken.RefreshGtfsTripDataTask));
        this.registerTask(new SaveDataToDBTask_1.SaveDataToDBTask(this.getQueuePrefix()));
        this.registerTask(new UpdateGtfsTripIdTask_1.UpdateGtfsTripIdTask(this.getQueuePrefix()));
        this.registerTask(new UpdateRunsGtfsTripIdTask_1.UpdateRunsGtfsTripIdTask(this.getQueuePrefix()));
        this.registerTask(new UpdateDelayTask_1.UpdateDelayTask(this.getQueuePrefix()));
        this.registerTask(new ProcessRegionalBusPositionsTask_1.ProcessRegionalBusPositionsTask(this.getQueuePrefix()));
        this.registerTask(new PropagateDelayTask_1.PropagateDelayTask(this.getQueuePrefix()));
        this.registerTask(new PropagateTrainDelayTask_1.PropagateTrainDelayTask(this.getQueuePrefix()));
        this.registerTask(new DataRetentionTask_1.DataRetentionTask(this.getQueuePrefix()));
    }
}
exports.VPWorker = VPWorker;
//# sourceMappingURL=VPWorker.js.map