mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
WIP Metadata class.
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import bookshelf from './bookshelf';
|
||||
|
||||
const Account = bookshelf.Model.extend({
|
||||
|
||||
/**
|
||||
* Table name
|
||||
*/
|
||||
@@ -11,6 +10,17 @@ const Account = bookshelf.Model.extend({
|
||||
* Timestamp columns.
|
||||
*/
|
||||
hasTimestamps: ['created_at', 'updated_at'],
|
||||
|
||||
/**
|
||||
* Account model may belongs to account type.
|
||||
*/
|
||||
type() {
|
||||
return this.belongsTo('AccountType', 'account_type_id');
|
||||
},
|
||||
|
||||
balances() {
|
||||
return this.hasMany('AccountBalance', 'accounnt_id');
|
||||
}
|
||||
});
|
||||
|
||||
export default bookshelf.model('Account', Account);
|
||||
|
||||
Reference in New Issue
Block a user