mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
fix: import resource imporements
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { Inject, Service } from 'typedi';
|
||||
import { Importable } from '@/services/Import/Importable';
|
||||
import { CreateCustomer } from './CRUD/CreateCustomer';
|
||||
import { Knex } from 'knex';
|
||||
import { ICustomer, ICustomerNewDTO } from '@/interfaces';
|
||||
|
||||
@Service()
|
||||
export class CustomersImportable extends Importable {
|
||||
@Inject()
|
||||
private createCustomerService: CreateCustomer;
|
||||
|
||||
/**
|
||||
* Mapps the imported data to create a new customer service.
|
||||
* @param {number} tenantId
|
||||
* @param {ICustomerNewDTO} createDTO
|
||||
* @param {Knex.Transaction} trx
|
||||
* @returns {Promise<void>}
|
||||
*/
|
||||
public async importable(
|
||||
tenantId: number,
|
||||
createDTO: ICustomerNewDTO,
|
||||
trx?: Knex.Transaction<any, any[]>
|
||||
): Promise<void> {
|
||||
await this.createCustomerService.createCustomer(tenantId, createDTO, trx);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user