2018-03-12 09:26:44 +01:00
|
|
|
'use strict';
|
2018-03-03 12:26:24 +01:00
|
|
|
|
|
|
|
const mongoose = require('mongoose');
|
|
|
|
const Schema = mongoose.Schema;
|
|
|
|
|
|
|
|
const LogVehicleKillSchema = new Schema({
|
|
|
|
war: {
|
|
|
|
type: mongoose.Schema.Types.ObjectId,
|
|
|
|
ref: 'War',
|
2018-03-12 09:26:44 +01:00
|
|
|
required: true,
|
2018-03-03 12:26:24 +01:00
|
|
|
},
|
|
|
|
time: {
|
|
|
|
type: Date,
|
2018-03-12 09:26:44 +01:00
|
|
|
required: true,
|
2018-03-03 12:26:24 +01:00
|
|
|
},
|
|
|
|
shooter: {
|
2018-03-12 09:26:44 +01:00
|
|
|
type: String,
|
2018-03-03 12:26:24 +01:00
|
|
|
},
|
|
|
|
target: {
|
|
|
|
type: String,
|
2018-03-12 09:26:44 +01:00
|
|
|
required: true,
|
2018-03-03 12:26:24 +01:00
|
|
|
},
|
|
|
|
fraction: {
|
|
|
|
type: String,
|
|
|
|
enum: ['BLUFOR', 'OPFOR', 'NONE'],
|
2018-03-12 09:26:44 +01:00
|
|
|
required: true,
|
|
|
|
},
|
2018-04-14 13:44:50 +02:00
|
|
|
vehicleClass: {
|
|
|
|
type: String,
|
|
|
|
enum: ['LIGHT', 'HEAVY', 'AIR', "UNKNOWN"],
|
|
|
|
required: true,
|
|
|
|
},
|
2018-03-03 12:26:24 +01:00
|
|
|
}, {
|
2018-03-12 09:26:44 +01:00
|
|
|
collection: 'logVehicle',
|
2018-03-03 12:26:24 +01:00
|
|
|
});
|
|
|
|
// optional more indices
|
|
|
|
LogVehicleKillSchema.index({war: 1, shooter: 1, target: 1});
|
|
|
|
|
|
|
|
module.exports = mongoose.model('LogVehicle', LogVehicleKillSchema);
|