import { Request } from "express"; import { EntityManager } from "typeorm"; import { TransactionBaseService } from "../interfaces"; import { BatchJob } from "../models"; import { BatchJobRepository } from "../repositories/batch-job"; import { BatchJobCreateProps, BatchJobResultError, BatchJobStatus, BatchJobUpdateProps, CreateBatchJobInput, FilterableBatchJobProps } from "../types/batch-job"; import { FindConfig } from "../types/common"; import EventBusService from "./event-bus"; import { StrategyResolverService } from "./index"; type InjectedDependencies = { manager: EntityManager; eventBusService: EventBusService; batchJobRepository: typeof BatchJobRepository; strategyResolverService: StrategyResolverService; }; declare class BatchJobService extends TransactionBaseService { static readonly Events: { CREATED: string; UPDATED: string; PRE_PROCESSED: string; CONFIRMED: string; PROCESSING: string; COMPLETED: string; CANCELED: string; FAILED: string; }; protected readonly batchJobRepository_: typeof BatchJobRepository; protected readonly eventBus_: EventBusService; protected readonly strategyResolver_: StrategyResolverService; protected batchJobStatusMapToProps: Map; constructor({ batchJobRepository, eventBusService, strategyResolverService, }: InjectedDependencies); retrieve(batchJobId: string, config?: FindConfig): Promise; listAndCount(selector?: FilterableBatchJobProps, config?: FindConfig): Promise<[BatchJob[], number]>; create(data: BatchJobCreateProps): Promise; update(batchJobOrId: BatchJob | string, data: BatchJobUpdateProps): Promise; protected updateStatus(batchJobOrId: BatchJob | string, status: BatchJobStatus): Promise; confirm(batchJobOrId: string | BatchJob): Promise; complete(batchJobOrId: string | BatchJob): Promise; cancel(batchJobOrId: string | BatchJob): Promise; setPreProcessingDone(batchJobOrId: string | BatchJob): Promise; setProcessing(batchJobOrId: string | BatchJob): Promise; setFailed(batchJobOrId: string | BatchJob, error?: BatchJobResultError | string): Promise; prepareBatchJobForProcessing(data: CreateBatchJobInput, req: Request): Promise; } export default BatchJobService;