| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- const mongoose = require('mongoose')
- const { Schema, Types } = mongoose
- const user = require('./user.model')
- const dokumen = require('./dokumen.model')
- const pelanggaran = require('./pelanggaran.model')
- module.exports = mongoose.model(
- 'PT',
- new Schema(
- {
- no_laporan: { type: String, unique: true },
- user: { type: Types.ObjectId, ref: user },
- pt: Object,
- keterangan: String,
- pelanggaran: [{ type: Types.ObjectId, ref: pelanggaran }],
- role_data: {
- type: String,
- enum: ['dikti', 'lldikti'],
- default: 'dikti',
- },
- status: String,
- aktif: { type: Boolean, default: true },
- dokumen: [
- {
- type: Types.ObjectId,
- ref: dokumen,
- },
- ],
- jadwal: {
- judul: String,
- dari_tanggal: Date,
- sampai_tanggal: Date,
- warna: String,
- },
- evaluasi: [
- new Schema(
- {
- tanggal: Date,
- judul: String,
- dokumen: [
- {
- type: Types.ObjectId,
- ref: dokumen,
- },
- ],
- },
- {
- timestamps: true,
- }
- ),
- ],
- },
- {
- timestamps: true,
- }
- ),
- 'pt'
- )
|