EventRegistration.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. import { User } from 'src/models/User.js'
  2. import { Classroom } from 'src/models/Classroom.js'
  3. import { Model, Collection } from 'js-abstract-model'
  4. class EventRegistration extends Model {
  5. constructor (data) {
  6. super(data, [
  7. { key: 'id' },
  8. { key: 'owner' },
  9. {
  10. key: 'owner_info',
  11. relatedModel: User
  12. },
  13. { key: 'event' },
  14. {
  15. key: 'event_info',
  16. relatedModel: Classroom
  17. },
  18. { key: 'status' }
  19. ], {
  20. status: {
  21. infoKey: 'status_info',
  22. enumListKey: 'statusEnums',
  23. enums: [
  24. {
  25. label: 'پیش ثبت نام',
  26. value: 'ENROLLED'
  27. },
  28. {
  29. label: 'ثبت نام',
  30. value: 'REGISTERED'
  31. },
  32. {
  33. label: 'حذف توسط کاربر',
  34. value: 'DROPPED_BY_ITSELF'
  35. },
  36. {
  37. label: 'حذف توسط ادمین',
  38. value: 'DROPPED_BY_ADMIN'
  39. },
  40. {
  41. label: 'حذف سیستمی (شرایط غیر مجاز)',
  42. value: 'DROPPED_FOR_CONDITION'
  43. }
  44. ]
  45. }
  46. })
  47. }
  48. }
  49. class EventRegistrationList extends Collection {
  50. model () {
  51. return EventRegistration
  52. }
  53. }
  54. export { EventRegistration, EventRegistrationList }