mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
49 lines
1.3 KiB
TypeScript
49 lines
1.3 KiB
TypeScript
import { Knex } from 'knex';
|
|
import { CreateSaleEstimate } from './commands/CreateSaleEstimate.service';
|
|
import { SaleEstimatesSampleData } from './constants';
|
|
import { Injectable } from '@nestjs/common';
|
|
import { CreateSaleEstimateDto } from './dtos/SaleEstimate.dto';
|
|
import { Importable } from '../Import/Importable';
|
|
import { ImportableService } from '../Import/decorators/Import.decorator';
|
|
import { SaleEstimate } from './models/SaleEstimate';
|
|
|
|
@Injectable()
|
|
@ImportableService({ name: SaleEstimate.name })
|
|
export class SaleEstimatesImportable extends Importable{
|
|
constructor(
|
|
private readonly createEstimateService: CreateSaleEstimate
|
|
) {
|
|
super();
|
|
}
|
|
|
|
/**
|
|
* Importing to account service.
|
|
* @param {CreateSaleEstimateDto} createAccountDTO
|
|
* @returns
|
|
*/
|
|
public importable(
|
|
createEstimateDTO: CreateSaleEstimateDto,
|
|
trx?: Knex.Transaction
|
|
) {
|
|
return this.createEstimateService.createEstimate(
|
|
createEstimateDTO,
|
|
trx
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Concurrrency controlling of the importing process.
|
|
* @returns {number}
|
|
*/
|
|
public get concurrency() {
|
|
return 1;
|
|
}
|
|
|
|
/**
|
|
* Retrieves the sample data that used to download accounts sample sheet.
|
|
*/
|
|
public sampleData(): any[] {
|
|
return SaleEstimatesSampleData;
|
|
}
|
|
}
|