"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.applyProjectMigrations = applyProjectMigrations;
const migrateInvalidTimelineStages_1 = require("./migrateInvalidTimelineStages");
const defaults_1 = require("../defaults");
const migrateProjectSlugAndOrgUrlKey_1 = require("./migrateProjectSlugAndOrgUrlKey");
/**
 * Apply project migrations.
 * Exported for testing purposes. This is not exported from the main module.
 * @param project
 * @returns
 */
function applyProjectMigrations(project) {
    // Ensure the orgUrlKey is lowercase and the slug is updated accordingly
    if (project.schemaVersion === defaults_1.HUB_PROJECT_CURRENT_SCHEMA_VERSION) {
        return project;
    }
    // Apply the migrations
    let migrated = (0, migrateProjectSlugAndOrgUrlKey_1.migrateProjectSlugAndOrgUrlKey)(project);
    migrated = (0, migrateInvalidTimelineStages_1.migrateInvalidTimelineStages)(migrated);
    // add more migration here as needed
    // e.g. migrated = anotherMigration(migrated);
    return migrated;
}
//# sourceMappingURL=applyProjectMigrations.js.map