"use strict";
Object.defineProperty(exports, "__esModule", {
    value: true
});
function _export(target, all) {
    for(var name in all)Object.defineProperty(target, name, {
        enumerable: true,
        get: Object.getOwnPropertyDescriptor(all, name).get
    });
}
_export(exports, {
    get down () {
        return down;
    },
    get up () {
        return up;
    }
});
const _config = /*#__PURE__*/ _interop_require_default(require("config"));
const _selectFacilityIds = require("@tamanu/utils/selectFacilityIds");
function _interop_require_default(obj) {
    return obj && obj.__esModule ? obj : {
        default: obj
    };
}
async function up(query) {
    const isFacility = Boolean((0, _selectFacilityIds.selectFacilityIds)(_config.default));
    if (!isFacility) {
        return;
    }
    const fhirEnabled = !!_config.default?.integrations?.fhir?.enabled;
    if (fhirEnabled) {
        return;
    }
    await query.sequelize.query('TRUNCATE fhir.jobs');
}
async function down(_query) {
// DESTRUCTIVE: cannot restore deleted FHIR jobs
}

//# sourceMappingURL=1782024666353-cleanupFhirJobsOnFacilityServers.js.map