"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.TimetableWorker = void 0;
const Di_1 = require("../../ioc/Di");
const RopidGtfsContainerToken_1 = require("../../ioc/RopidGtfsContainerToken");
const workers_1 = require("@golemio/core/dist/integration-engine/workers");
const constants_1 = require("./constants");
const CheckForNewDataTask_1 = require("./tasks/CheckForNewDataTask");
const CheckSavedRowsAndReplaceTablesTask_1 = require("./tasks/CheckSavedRowsAndReplaceTablesTask");
const DownloadDatasetsTask_1 = require("./tasks/DownloadDatasetsTask");
const RefreshPrecomputedTablesTask_1 = require("./tasks/RefreshPrecomputedTablesTask");
const TransformAndSaveDataTask_1 = require("./tasks/TransformAndSaveDataTask");
class TimetableWorker extends workers_1.AbstractWorker {
    constructor() {
        super();
        this.name = constants_1.TIMETABLE_WORKER_NAME;
        this.registerTask = (task) => {
            super.registerTask(task);
            task.queuePrefix = this.getQueuePrefix();
        };
        // Register tasks
        this.registerTask(Di_1.RopidGtfsContainer.resolve(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RefreshGtfsStopsCacheTask));
        this.registerTask(Di_1.RopidGtfsContainer.resolve(RopidGtfsContainerToken_1.RopidGtfsContainerToken.RefreshPublicGtfsDepartureCacheTask));
        this.registerTask(new CheckForNewDataTask_1.CheckForNewDataTask(this.getQueuePrefix()));
        this.registerTask(new CheckSavedRowsAndReplaceTablesTask_1.CheckSavedRowsAndReplaceTablesTask(this.getQueuePrefix()));
        this.registerTask(new DownloadDatasetsTask_1.DownloadDatasetsTask(this.getQueuePrefix()));
        this.registerTask(new RefreshPrecomputedTablesTask_1.RefreshPrecomputedTablesTask(this.getQueuePrefix()));
        this.registerTask(new TransformAndSaveDataTask_1.TransformAndSaveDataTask(this.getQueuePrefix()));
        this.registerTask(Di_1.RopidGtfsContainer.resolve(RopidGtfsContainerToken_1.RopidGtfsContainerToken.SaveStaticDataTask));
    }
}
exports.TimetableWorker = TimetableWorker;
//# sourceMappingURL=TimetableWorker.js.map