2018-03-12 09:26:44 +01:00
|
|
|
'use strict';
|
2017-10-21 18:23:04 +02:00
|
|
|
|
|
|
|
const mongoose = require('mongoose');
|
|
|
|
const Schema = mongoose.Schema;
|
|
|
|
|
|
|
|
const LogReviveSchema = new Schema({
|
|
|
|
war: {
|
|
|
|
type: mongoose.Schema.Types.ObjectId,
|
|
|
|
ref: 'War',
|
2018-03-12 09:26:44 +01:00
|
|
|
required: true,
|
2017-10-21 18:23:04 +02:00
|
|
|
},
|
|
|
|
time: {
|
2017-10-29 17:36:55 +01:00
|
|
|
type: Date,
|
2018-03-12 09:26:44 +01:00
|
|
|
required: true,
|
2017-10-21 18:23:04 +02:00
|
|
|
},
|
|
|
|
medic: {
|
|
|
|
type: String,
|
2018-03-12 09:26:44 +01:00
|
|
|
required: true,
|
2017-10-21 18:23:04 +02:00
|
|
|
},
|
|
|
|
patient: {
|
|
|
|
type: String,
|
2018-03-12 09:26:44 +01:00
|
|
|
required: true,
|
2017-10-21 18:23:04 +02:00
|
|
|
},
|
|
|
|
stabilized: {
|
|
|
|
type: Boolean,
|
2018-03-12 09:26:44 +01:00
|
|
|
required: true,
|
2017-10-21 19:49:24 +02:00
|
|
|
},
|
|
|
|
fraction: {
|
|
|
|
type: String,
|
|
|
|
enum: ['BLUFOR', 'OPFOR'],
|
2018-03-12 09:26:44 +01:00
|
|
|
required: true,
|
|
|
|
},
|
2017-10-21 18:23:04 +02:00
|
|
|
}, {
|
2018-03-12 09:26:44 +01:00
|
|
|
collection: 'logRevive',
|
2019-02-09 20:42:24 +01:00
|
|
|
versionKey: false,
|
2017-10-21 18:23:04 +02:00
|
|
|
});
|
|
|
|
// optional more indices
|
|
|
|
LogReviveSchema.index({war: 1, medic: 1});
|
|
|
|
|
|
|
|
module.exports = mongoose.model('LogRevive', LogReviveSchema);
|