tirage.model.js 612 B

1234567891011121314151617181920212223242526272829
  1. const mongoose = require('mongoose');
  2. const { UserSchema } = require('./user.model');
  3. const TirageSchema = new mongoose.Schema(
  4. {
  5. nb_users: {
  6. type: Number,
  7. },
  8. random_user: {
  9. type: Number,
  10. },
  11. executed_date: {
  12. type: Date,
  13. },
  14. tirage_date: {
  15. type: Date,
  16. },
  17. isExecuted: {
  18. type: Boolean,
  19. default: false
  20. },
  21. winner: UserSchema
  22. }
  23. );
  24. exports.TirageSchema = TirageSchema;
  25. Tirage = mongoose.model('Tirage', TirageSchema );
  26. exports.Tirage = Tirage;