reserve.js 644 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
    type: String,
  },
26
  room: {
27
28
29
30
31
    type: String,
  },
  reason: {
    type: String,
  },
CHAERIN KIM's avatar
CHAERIN KIM committed
32
33
  students: {
    type: Array,
34
35
36
37
38
39
40
41
  },
  approve: {
    type: Boolean,
    default: false,
  },
  num: {
    type: Number,
  },
Kim, Subin's avatar
ㅁㅁ    
Kim, Subin committed
42
});
Kim, Subin's avatar
Kim, Subin committed
43

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