mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 15:20:34 +00:00
add server to monorepo.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import HasTenancyService from '@/services/Tenancy/TenancyService';
|
||||
import { Service, Inject } from 'typedi';
|
||||
|
||||
@Service()
|
||||
export class UpdateInventoryTransactionsWithWarehouse {
|
||||
@Inject()
|
||||
tenancy: HasTenancyService;
|
||||
|
||||
/**
|
||||
* Updates all inventory transactions with primary warehouse.
|
||||
* @param {number} tenantId -
|
||||
* @param {number} warehouseId -
|
||||
*/
|
||||
public run = async (tenantId: number, primaryWarehouseId: number) => {
|
||||
const { InventoryTransaction } = this.tenancy.models(tenantId);
|
||||
|
||||
await InventoryTransaction.query().update({
|
||||
warehouseId: primaryWarehouseId,
|
||||
});
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user