feat(nestjs): migrate to NestJS

This commit is contained in:
Ahmed Bouhuolia
2025-04-07 11:51:24 +02:00
parent f068218a16
commit 55fcc908ef
3779 changed files with 631 additions and 195332 deletions

View File

@@ -0,0 +1,53 @@
import { Model } from 'objection';
import { BaseModel } from '@/models/Model';
import { Item } from '@/modules/Items/models/Item';
// import TenantModel from 'models/TenantModel';
export class InventoryAdjustmentEntry extends BaseModel {
adjustmentId!: number;
index!: number;
itemId!: number;
quantity!: number;
cost!: number;
value!: number;
item!: Item;
/**
* Table name.
*/
static get tableName() {
return 'inventory_adjustments_entries';
}
/**
* Relationship mapping.
*/
static get relationMappings() {
const { InventoryAdjustment } = require('./InventoryAdjustment');
const { Item } = require('../../Items/models/Item');
return {
inventoryAdjustment: {
relation: Model.BelongsToOneRelation,
modelClass: InventoryAdjustment,
join: {
from: 'inventory_adjustments_entries.adjustmentId',
to: 'inventory_adjustments.id',
},
},
/**
* Entry item.
*/
item: {
relation: Model.BelongsToOneRelation,
modelClass: Item,
join: {
from: 'inventory_adjustments_entries.itemId',
to: 'items.id',
},
},
};
}
}