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
|
|
|
},
|
2018-06-09 19:31:22 +02:00
|
|
|
additionalShooter: {
|
|
|
|
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,
|
2020-04-19 12:47:22 +02:00
|
|
|
enum: ['LIGHT', 'HEAVY', 'AIR', 'BOAT', 'UNKNOWN'],
|
2018-04-14 13:44:50 +02:00
|
|
|
required: true,
|
|
|
|
},
|
2018-06-17 11:52:43 +02:00
|
|
|
magazine: {
|
|
|
|
type: String,
|
|
|
|
},
|
|
|
|
shooterVehicle: {
|
|
|
|
type: String,
|
|
|
|
},
|
2018-03-03 12:26:24 +01:00
|
|
|
}, {
|
2018-03-12 09:26:44 +01:00
|
|
|
collection: 'logVehicle',
|
2019-02-09 20:42:24 +01:00
|
|
|
versionKey: false,
|
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);
|