reserve.js 724 Bytes
Newer Older
Kim, Subin's avatar
Kim, Subin committed
1
2
3
const mongoose = require('mongoose');

const { Schema } = mongoose;
4
const { Types: { ObjectId } } = Schema;
Kim, Subin's avatar
ㅁㅁ    
Kim, Subin committed
5
const reserveSchema = new Schema({
6
  user: {
7
8
9
10
11
    type: ObjectId,
    required: true,
    ref: 'User',
  },
  date: {
12
13
    type: Date,
    default: Date.now
14
  },
15
16
17
18
19
20
21
  starttime: {
    type: Number,
  },
  usetime: {
    type: Number,
  },
  start: {
22
23
    type: String,
  },
24
  end: {
25
26
27
    type: String,

  },
28
  room: {
29
30
31
32
33
34
35
    type: String,

  },
  reason: {
    type: String,

  },
CHAERIN KIM's avatar
CHAERIN KIM committed
36
37
  students: {
    type: Array,
38
39
40
41
42

  },
  approve: {
    type: Boolean,
    default: false,
Ha YeaJin's avatar
Ha YeaJin committed
43
44
45
46
  },
  check: {
    type: Boolean,
    default: false,
47
48
49
50
  },
  num: {
    type: Number,
  },
Kim, Subin's avatar
ㅁㅁ    
Kim, Subin committed
51
});
Kim, Subin's avatar
Kim, Subin committed
52

Ha YeaJin's avatar
Ha YeaJin committed
53
module.exports = mongoose.model('Reserve', reserveSchema);