catatan.model.js 634 B

12345678910111213141516171819202122232425262728293031323334
  1. const mongoose = require('mongoose')
  2. const { Schema, Types } = mongoose
  3. const dokumen = require('./dokumen.model')
  4. const sanksi = require('./sanksi.model')
  5. module.exports = mongoose.model(
  6. 'Catatan',
  7. new Schema({
  8. sanksi_id: {
  9. type: Types.ObjectId,
  10. ref: sanksi
  11. },
  12. judul: String,
  13. isi: Object,
  14. menu: String,
  15. daftar_kehadiran_peserta: [
  16. new Schema(
  17. {
  18. nama: String,
  19. ttd: {
  20. type: Types.ObjectId,
  21. ref: dokumen
  22. }
  23. },
  24. {
  25. timestamps: true
  26. }
  27. )
  28. ]
  29. }, {
  30. timestamps: true
  31. }),
  32. 'catatan'
  33. )