WIP Metadata class.

This commit is contained in:
Ahmed Bouhuolia
2019-09-08 02:41:46 +02:00
parent 70809cb05c
commit 9a8de9ca7d
29 changed files with 1707 additions and 98 deletions

View File

@@ -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);