| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152 |
- import { User } from 'src/models/User.js'
- import { UnitList } from 'src/models/Unit.js'
- import { Model, Collection } from 'js-abstract-model'
- class UnitCategory extends Model {
- constructor (data) {
- super(data, [
- { key: 'id' },
- { key: 'title' },
- { key: 'creator' },
- {
- key: 'creator_info',
- relatedModel: User
- },
- {
- key: 'units_info',
- relatedModel: UnitList
- },
- { key: 'type' },
- { key: 'creation_time' },
- { key: 'last_modification_time' },
- { key: 'is_active' },
- { key: 'is_deleted' }
- ], {
- type: {
- infoKey: 'type_info',
- enumListKey: 'typeEnums',
- enums: [
- {
- label: 'دوره آموزشی',
- value: 'TRAINING'
- },
- {
- label: 'حلقه مباحثاتی',
- value: 'DiscussionCircles'
- },
- {
- label: 'رویداد',
- value: 'EVENT'
- }
- ]
- }
- })
- }
- }
- class UnitCategoryList extends Collection {
- model () {
- return UnitCategory
- }
- }
- export { UnitCategory, UnitCategoryList }
|