openhim-core
Version:
The OpenHIM core application that provides logging and routing of http requests
71 lines (63 loc) • 1.48 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.TaskModel = exports.TaskModelAPI = void 0;
var _mongoose = require("mongoose");
var _config = require("../config");
const TaskSchema = new _mongoose.Schema({
status: {
type: String,
required: true,
enum: ['Queued', 'Processing', 'Paused', 'Cancelled', 'Completed'],
default: 'Queued',
index: true
},
transactions: [{
tid: {
type: String,
required: true
},
tstatus: {
type: String,
required: true,
enum: ['Queued', 'Processing', 'Completed', 'Failed'],
default: 'Queued'
},
error: String,
rerunID: String,
rerunStatus: String
}],
created: {
type: Date,
required: true,
default: Date.now,
index: true
},
completedDate: Date,
user: {
type: String,
required: true
},
remainingTransactions: {
type: Number,
required: true
},
totalTransactions: {
type: Number,
required: true
},
batchSize: {
type: Number,
default: 1
}
});
/*
* The task object that describes a specific task within the OpenHIM.
* It provides some metadata describing a task and contains a number of transaction IDs.
*/
const TaskModelAPI = _config.connectionAPI.model('Task', TaskSchema);
exports.TaskModelAPI = TaskModelAPI;
const TaskModel = _config.connectionDefault.model('Task', TaskSchema);
exports.TaskModel = TaskModel;
//# sourceMappingURL=tasks.js.map