auto.model.js 461 B

1234567891011121314151617
  1. const mongoose = require('mongoose')
  2. const { Schema, Types } = mongoose
  3. const laporan = require('./laporan.model')
  4. const sanksi = require('./sanksi.model')
  5. module.exports = mongoose.model(
  6. 'Auto',
  7. new Schema({
  8. laporan_id: { type: Types.ObjectId, ref: laporan },
  9. sanksi_id: { type: Types.ObjectId, ref: sanksi },
  10. sanksi: { type: Object },
  11. laporan: { type: Object }
  12. }, {
  13. timestamps: true,
  14. }),
  15. 'auto'
  16. )