Files
bigcapital/server/src/models/BillPaymentEntry.js
Ahmed Bouhuolia 1738a333c7 fix: validate payment made entries ids exists.
fix: retrieve payment made and receive details.
2020-11-04 00:23:58 +02:00

37 lines
670 B
JavaScript

import { mixin, Model } from 'objection';
import TenantModel from 'models/TenantModel';
export default class BillPaymentEntry extends TenantModel {
/**
* Table name
*/
static get tableName() {
return 'bills_payments_entries';
}
/**
* Timestamps columns.
*/
get timestamps() {
return [];
}
/**
* Relationship mapping.
*/
static get relationMappings() {
const Bill = require('models/Bill');
return {
bill: {
relation: Model.BelongsToOneRelation,
modelClass: Bill.default,
join: {
from: 'bills_payments_entries.billId',
to: 'bills.id',
},
},
};
}
}