reserve.js 649 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
42
43
44
45
46

  },
  approve: {
    type: Boolean,
    default: false,

  },
  num: {
    type: Number,
  },
Kim, Subin's avatar
ㅁㅁ    
Kim, Subin committed
47
});
Kim, Subin's avatar
Kim, Subin committed
48

49
module.exports = mongoose.model('Reserve', reserveSchema);