mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-27 10:09:48 +00:00
34 lines
789 B
TypeScript
34 lines
789 B
TypeScript
import { BaseModel } from '@/models/Model';
|
|
import { Model, raw } from 'objection';
|
|
|
|
export class InventoryTransactionMeta extends BaseModel {
|
|
transactionNumber!: string;
|
|
description!: string;
|
|
inventoryTransactionId!: number;
|
|
|
|
/**
|
|
* Table name
|
|
*/
|
|
static get tableName() {
|
|
return 'inventory_transaction_meta';
|
|
}
|
|
|
|
/**
|
|
* Relationship mapping.
|
|
*/
|
|
static get relationMappings() {
|
|
const { InventoryTransaction } = require('./InventoryTransaction');
|
|
|
|
return {
|
|
inventoryTransaction: {
|
|
relation: Model.BelongsToOneRelation,
|
|
modelClass: InventoryTransaction,
|
|
join: {
|
|
from: 'inventory_transaction_meta.inventoryTransactionId',
|
|
to: 'inventory_transactions.inventoryTransactionId'
|
|
}
|
|
}
|
|
};
|
|
}
|
|
}
|