UNPKG

@mbc-cqrs-serverless/import

Version:
27 lines (26 loc) 1.22 kB
/** * @file import.queue.event.handler.ts * @description This handler is the core worker for processing individual import records. * It listens for messages from the main SQS queue, finds the correct processing * strategy for the record's table type, and executes them sequentially. */ import { IEventHandler } from '@mbc-cqrs-serverless/core'; import { ImportService } from '../import.service'; import { IProcessStrategy } from '../interface/processing-strategy.interface'; import { ImportQueueEvent } from './import.queue.event'; export declare class ImportQueueEventHandler implements IEventHandler<ImportQueueEvent> { private readonly importService; private readonly strategyMap; private readonly logger; constructor(importService: ImportService, strategyMap: Map<string, IProcessStrategy<any, any>>); execute(event: ImportQueueEvent): Promise<any>; /** * Orchestrates the processing of a single import record. */ handleImport(event: ImportQueueEvent): Promise<any>; /** * Executes the full lifecycle (compare, map, save) for a single strategy. * @returns The result of the create/update operation or a status message. */ private executeStrategy; }