| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- import { User } from 'src/models/User'
- import { Invoice } from 'src/models/Invoice.js'
- import { Model, Collection } from 'js-abstract-model'
- import { Transaction } from 'src/models/Transaction.js'
- class Payment extends Model {
- constructor (data) {
- super(data, [
- { key: 'id' },
- { key: 'creator' },
- {
- key: 'creator_info',
- relatedModel: User
- },
- { key: 'invoice' },
- {
- key: 'invoice_info',
- relatedModel: Invoice
- },
- { key: 'wallet' },
- { key: 'transaction' },
- {
- key: 'transaction_info',
- relatedModel: Transaction
- },
- { key: 'amount' },
- { key: 'description' },
- { key: 'type' }, // WITHDRAW - ...
- {
- key: 'additional_data',
- default: []
- },
- { key: 'creation_time' },
- { key: 'last_modification_time' },
- { key: 'receipt' },
- { key: 'IBAN' },
- { key: 'is_active' },
- { key: 'is_deleted' }
- ], {
- type: {
- infoKey: 'type_info',
- enumListKey: 'typeEnums',
- enums: [
- {
- label: 'برداشت',
- value: 'WITHDRAW'
- },
- {
- label: 'درخواست برداشت',
- value: 'WITHDRAW_REQUEST'
- },
- {
- label: 'برداشت تایید شده',
- value: 'WITHDRAW_ADMITTED'
- },
- {
- label: 'برداشت رد شده',
- value: 'WITHDRAW_REJECT'
- },
- {
- label: 'واریز',
- value: 'DEPOSIT'
- }
- ]
- }
- })
- }
- }
- class PaymentList extends Collection {
- model () {
- return Payment
- }
- }
- export { Payment, PaymentList }
|