modules/FeedProcessor/ProcessorBase.psm1
using module '..\Enums.psm1' using module '.\AuditLog\Message.psm1' class Processor{ #region Public Properties [SOURCE] $source [SOURCE_TYPE] $sourceType [hashtable] $producers [hashtable] $mapExternalKeyPrefix [Message] $message # after aggregation, do it needs to reprocess the messages [bool] $shouldReprocess # is it market type based or by id [bool] $isTypeBased = $false [bool] $haveMarketSeparator = $false [bool] $isEventProcessed [bool] $isMarketProcessed [bool] $needFeedProducer [hashtable] $mapFeedProducer #endregion Processor($sourceType){ $this.sourceType = $sourceType $this.producers = @{} $this.mapExternalKeyPrefix = @{} } #region Inheritable Methods [void] ProcessMessage([PSCustomObject] $line){ $this.message = [Message]::new() $this.isEventProcessed = $false $this.isMarketProcessed = $false $this.message.id = $line.id $this.message.createdAt = $line.created_at $this.message.updatedAt = $line.updated_at $this.message.sourceType = $this.sourceType $this.message.source = $this.source $this.message.changeType = $line.message_type $this.message.metrics = $line.content.dfsMetrics $this.message.line = $line } [void] ProcessEvent([PSCustomObject] $line, [bool] $includeSportData) { throw 'Must override' } [void] ProcessCardinality([PSCustomObject] $line) { throw 'Must override' } [void] ProcessEnrichment([PSCustomObject] $line) { throw 'Must override' } [void] ProcessMarket([PSCustomObject] $line, [Nullable[SEARCH_SCOPE]] $searchScope, [string[]] $marketId, [string[]] $outcomeId) { throw 'Must override' } [bool] isEventRelated([PSCustomObject] $line){ throw 'Must override' } [bool] isEnrichmentRelated([PSCustomObject] $line){ throw 'Must override' } [bool] isMarketRelated([PSCustomObject] $line, [Nullable[SEARCH_SCOPE]] $searchScope, [string[]] $marketId){ throw 'Must override' } [void] Resolve(){ # this is implemented from providers having complex resolving states } #endregion } |