mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
feat(nestjs): migrate to NestJS
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import { Inject, Injectable } from '@nestjs/common';
|
||||
import { TenantModelProxy } from '../System/models/TenantBaseModel';
|
||||
import { InventoryTransaction } from '../InventoryCost/models/InventoryTransaction';
|
||||
|
||||
@Injectable()
|
||||
export class UpdateInventoryTransactionsWithWarehouse {
|
||||
constructor(
|
||||
@Inject(InventoryTransaction.name)
|
||||
private readonly inventoryTransactionModel: TenantModelProxy<
|
||||
typeof InventoryTransaction
|
||||
>,
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Updates all inventory transactions with primary warehouse.
|
||||
* @param {number} warehouseId - Warehouse ID.
|
||||
*/
|
||||
public run = async (primaryWarehouseId: number) => {
|
||||
await this.inventoryTransactionModel().query().update({
|
||||
warehouseId: primaryWarehouseId,
|
||||
});
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user