reserve.js 704 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
12
13
    type: ObjectId,
    required: true,
    ref: 'User',
  },
  date: {
    type: String,
  },
14
15
16
17
18
19
20
  starttime: {
    type: Number,
  },
  usetime: {
    type: Number,
  },
  start: {
21
22
    type: String,
  },
23
  end: {
24
25
26
    type: String,

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

  },
  reason: {
    type: String,

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

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

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