reserve.js 703 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
    type: String,
Kim, Subin's avatar
Kim, Subin committed
25

26
  },
27
  room: {
28
    type: String,
Kim, Subin's avatar
Kim, Subin committed
29

30
31
32
  },
  reason: {
    type: String,
Kim, Subin's avatar
Kim, Subin committed
33

34
  },
CHAERIN KIM's avatar
CHAERIN KIM committed
35
36
  students: {
    type: Array,
Kim, Subin's avatar
Kim, Subin committed
37

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

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