| 123456789101112131415161718192021222324252627282930313233343536 |
- import { Model, Collection } from 'js-abstract-model'
- class Discount extends Model {
- constructor (data) {
- super(data, [
- { key: 'id' },
- { key: 'code' },
- { key: 'price' },
- { key: 'order_price' },
- { key: 'target' },
- {
- key: 'percent',
- default: 0
- },
- { key: 'expire_time' }
- ], {
- target: {
- infoKey: 'target_info',
- enumListKey: 'targetEnums',
- enums: [
- { label: 'فروشگاه', value: 'STORE' },
- { label: 'دوره آموزشی', value: 'TRAINING' },
- { label: 'رویداد', value: 'EVENT' }
- ]
- }
- })
- }
- }
- class DiscountList extends Collection {
- model() {
- return Discount
- }
- }
- export { Discount, DiscountList }
|