signature.model.js 563 B

1234567891011121314151617181920212223242526272829
  1. const mongoose = require('mongoose')
  2. const { Schema,Types } = mongoose
  3. const dokumen = require('./dokumen.model')
  4. const laporan = require('./laporan.model')
  5. module.exports = mongoose.model(
  6. 'Signature',
  7. new Schema({
  8. laporan_id: {
  9. type: Types.ObjectId,
  10. ref: laporan,
  11. },
  12. daftar_kehadiran_peserta: [
  13. new Schema(
  14. {
  15. nama: String,
  16. ttd: {
  17. type: Types.ObjectId,
  18. ref: dokumen,
  19. },
  20. },
  21. {
  22. timestamps: true
  23. }
  24. )
  25. ],
  26. }),
  27. 'signature'
  28. )