add server to monorepo.

This commit is contained in:
a.bouhuolia
2023-02-03 11:57:50 +02:00
parent 28e309981b
commit 80b97b5fdc
1303 changed files with 137049 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
import { Service, Inject } from 'typedi';
import HasTenancyService from '@/services/Tenancy/TenancyService';
import { CreateWarehouse } from './CreateWarehouse';
@Service()
export class CreateInitialWarehouse {
@Inject()
private createWarehouse: CreateWarehouse;
@Inject()
private tenancy: HasTenancyService;
/**
* Creates a initial warehouse.
* @param {number} tenantId
*/
public createInitialWarehouse = async (tenantId: number) => {
const { __ } = this.tenancy.i18n(tenantId);
return this.createWarehouse.createWarehouse(tenantId, {
name: __('warehouses.primary_warehouse'),
code: '10001',
primary: true,
});
};
}