klnodekb/models/works.js

87 lines
1.7 KiB
JavaScript

let mongoose = require('mongoose');
//using mongoose.model('Artice');
// Article Schema
var a = require('./article');
let workSchema = mongoose.Schema({
// CM DATA
megrendelo:{
type: String,
require: true
},
cmId:{
type: Number,
require: true
},
cmRendAzonosito:{
type: String,
require: true
},
// Megnevezés
title:{
type: String,
require: true
},
// Létrehozó
author:{
type: String,
require: true
},
// Megjegyzés
body:{
type: String,
require: true
},
// Munkaszám
workNumber:{
type: String,
require: true
},
// PO szám
poNumber:{
type: String,
require: true
},
// Gyártási szám
workDate:{
type: String,
require: true
},
// rejtett munkaszám
workCounter:{
type: Number,
require: true
},
// Státusz, nyitva/zárva
state: {
type: String,
require: true
},
// Ütemterv
ganttData: {
id: {type: mongoose.Schema.Types.ObjectId},
text: {type: String},
start_date: {type: String},
end_date: {type: String},
parent: {type: String},
duration: {type: Number},
progress: {type: Number}
},
enaploTemplate: {type: String},
// Napi jelentés
// dailyReportId:{type: mongoose.Schema.Types.ObjectId, default:null},
// Berendezések
// Napi jelentés
dailyReport:[{
date: {type: String},
foremanId: {type: String},
workTitle: {type: String},
employeeList:[{type: mongoose.Schema.Types.ObjectId}]
}],
//devicesArray: ['Article']
devicesArray: [{type: mongoose.Schema.Types.ObjectId}],
filesCM:[{type: String}],
pathCM: {type: String}
});
let Work = module.exports = mongoose.model('Work', workSchema);