Session.js 919 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. import { Model, Collection } from 'js-abstract-model'
  2. import { User } from 'src/models/User'
  3. class Session extends Model {
  4. constructor (data) {
  5. super(data, [
  6. { key: 'id' },
  7. { key: 'creator' },
  8. {
  9. key: 'creator_info',
  10. relatedModel: User
  11. },
  12. { key: 'classroom' },
  13. { key: 'title' },
  14. { key: 'syllabus' },
  15. { key: 'description' },
  16. { key: 'beginning_time' },
  17. { key: 'ending_time' },
  18. { key: 'questions' },
  19. { key: 'questions_info' },
  20. { key: 'creation_time' },
  21. { key: 'last_modification_time' },
  22. { key: 'is_defined_syllabus' },
  23. { key: 'current_user_attendance_sheet' },
  24. { key: 'assignment_description' },
  25. {
  26. key: 'session_attendance_sheets',
  27. defalut: []
  28. }
  29. ])
  30. }
  31. }
  32. class SessionList extends Collection {
  33. model () {
  34. return Session
  35. }
  36. }
  37. export { Session, SessionList }