mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-27 18:19:48 +00:00
refactor(nestjs): hook up the client with new endpoints
This commit is contained in:
@@ -0,0 +1,107 @@
|
||||
export const InventoryAdjustmentMeta = {
|
||||
defaultFilterField: 'date',
|
||||
defaultSort: {
|
||||
sortOrder: 'DESC',
|
||||
sortField: 'date',
|
||||
},
|
||||
columns: {
|
||||
date: {
|
||||
name: 'inventory_adjustment.field.date',
|
||||
column: 'date',
|
||||
fieldType: 'date',
|
||||
exportable: true,
|
||||
},
|
||||
type: {
|
||||
name: 'inventory_adjustment.field.type',
|
||||
column: 'type',
|
||||
fieldType: 'enumeration',
|
||||
options: [
|
||||
{ key: 'increment', name: 'inventory_adjustment.field.type.increment' },
|
||||
{ key: 'decrement', name: 'inventory_adjustment.field.type.decrement' },
|
||||
],
|
||||
exportable: true,
|
||||
},
|
||||
adjustmentAccount: {
|
||||
name: 'inventory_adjustment.field.adjustment_account',
|
||||
type: 'adjustment_account_id',
|
||||
exportable: true,
|
||||
},
|
||||
reason: {
|
||||
name: 'inventory_adjustment.field.reason',
|
||||
type: 'text',
|
||||
exportable: true,
|
||||
},
|
||||
referenceNo: {
|
||||
name: 'inventory_adjustment.field.reference_no',
|
||||
type: 'text',
|
||||
exportable: true,
|
||||
},
|
||||
description: {
|
||||
name: 'inventory_adjustment.field.description',
|
||||
type: 'text',
|
||||
exportable: true,
|
||||
},
|
||||
publishedAt: {
|
||||
name: 'inventory_adjustment.field.published_at',
|
||||
type: 'date',
|
||||
exportable: true,
|
||||
},
|
||||
createdAt: {
|
||||
name: 'inventory_adjustment.field.created_at',
|
||||
type: 'date',
|
||||
exportable: true,
|
||||
},
|
||||
},
|
||||
fields: {
|
||||
date: {
|
||||
name: 'inventory_adjustment.field.date',
|
||||
column: 'date',
|
||||
fieldType: 'date',
|
||||
},
|
||||
type: {
|
||||
name: 'inventory_adjustment.field.type',
|
||||
column: 'type',
|
||||
fieldType: 'enumeration',
|
||||
options: [
|
||||
{ key: 'increment', name: 'inventory_adjustment.field.type.increment' },
|
||||
{ key: 'decrement', name: 'inventory_adjustment.field.type.decrement' },
|
||||
],
|
||||
},
|
||||
adjustment_account: {
|
||||
name: 'inventory_adjustment.field.adjustment_account',
|
||||
column: 'adjustment_account_id',
|
||||
fieldType: 'relation',
|
||||
|
||||
relationType: 'enumeration',
|
||||
relationKey: 'adjustmentAccount',
|
||||
|
||||
relationEntityLabel: 'name',
|
||||
relationEntityKey: 'slug',
|
||||
},
|
||||
reason: {
|
||||
name: 'inventory_adjustment.field.reason',
|
||||
column: 'reason',
|
||||
fieldType: 'text',
|
||||
},
|
||||
reference_no: {
|
||||
name: 'inventory_adjustment.field.reference_no',
|
||||
column: 'reference_no',
|
||||
fieldType: 'text',
|
||||
},
|
||||
description: {
|
||||
name: 'inventory_adjustment.field.description',
|
||||
column: 'description',
|
||||
fieldType: 'text',
|
||||
},
|
||||
published_at: {
|
||||
name: 'inventory_adjustment.field.published_at',
|
||||
column: 'published_at',
|
||||
fieldType: 'date',
|
||||
},
|
||||
created_at: {
|
||||
name: 'inventory_adjustment.field.created_at',
|
||||
column: 'created_at',
|
||||
fieldType: 'date',
|
||||
},
|
||||
},
|
||||
};
|
||||
@@ -1,7 +1,10 @@
|
||||
import { Model } from 'objection';
|
||||
import { InventoryAdjustmentEntry } from './InventoryAdjustmentEntry';
|
||||
import { TenantBaseModel } from '@/modules/System/models/TenantBaseModel';
|
||||
import { InjectModelMeta } from '@/modules/Tenancy/TenancyModels/decorators/InjectModelMeta.decorator';
|
||||
import { InventoryAdjustmentMeta } from './InventoryAdjustment.meta';
|
||||
|
||||
@InjectModelMeta(InventoryAdjustmentMeta)
|
||||
export class InventoryAdjustment extends TenantBaseModel {
|
||||
public readonly date!: string;
|
||||
public readonly type!: string;
|
||||
@@ -16,7 +19,6 @@ export class InventoryAdjustment extends TenantBaseModel {
|
||||
public readonly warehouseId!: number;
|
||||
|
||||
public readonly createdAt!: Date | string;
|
||||
|
||||
public readonly entries: InventoryAdjustmentEntry[];
|
||||
|
||||
/**
|
||||
@@ -116,11 +118,4 @@ export class InventoryAdjustment extends TenantBaseModel {
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Model settings.
|
||||
*/
|
||||
// static get meta() {
|
||||
// return InventoryAdjustmentSettings;
|
||||
// }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user