TicketExceptions - Event Catalog

🏠 Home BuildingServices / TicketExceptions / docs

TicketExceptions - Event Catalog

Overview

TicketExceptions uses RabbitMQ via MassTransit 8.3.3 with 27 specialized consumers for exception detection.

Message Bus Architecture

Bus Queue Consumers
TELS vHost tels.mqservices.ticketexceptions 27 consumers
Message Scheduler ticket-exceptions-message-scheduler Quartz-based delayed messages
Flush Cache TELS.TicketExceptions.MQServices.Consumers.FlushCacheConsumer_{MachineName} Cache invalidation

Consumed Events (27 types)

Work Items Events

Message Type Source Consumer Purpose
INewWorkItemV1 Work Items Service WorkItemsConsumer New work item created - check for exceptions
PriorityChange Work Items Service WorkItemsConsumer Priority changed - update exceptions
IStatusEventV1 Work Items Service WorkItemsConsumer Status changed - may resolve exceptions

Bidding Events

Message Type Source Consumer Purpose
IBidConversationAdded Bidding Service BiddingConsumer Bid conversation added
IBidStatusChanged Bidding Service BiddingConsumer Bid status changed - may resolve "bid not received"
IBidModification Bidding Service BiddingConsumer Bid modified

Building Services Events

Message Type Source Consumer Purpose
IAttachmentUpdated Building Services BuildingServicesConsumer Attachment added/updated
INotToExceedExtensionApproved Building Services BuildingServicesConsumer NTE extension approved - resolves exception
INotToExceedExtensionCreated Building Services BuildingServicesConsumer NTE extension created
INotToExceedExtensionDeclined Building Services BuildingServicesConsumer NTE extension declined
IProjectAuthorized Building Services BuildingServicesConsumer Project authorized
IProjectComplexityFlagChanged Building Services BuildingServicesConsumer Complexity flag changed
IUnableToNotifyCustomerOfTicketUpdate Building Services UnableToNotifyServiceProviderConsumer Customer notification failed - create exception

Scheduled Check Events (Internal Commands)

Message Type Consumer Purpose
CheckServiceProviderETA ETAConsumer Check if ETA provided
CheckIfCustomerShouldBeNotifiedOfMissingETA ETAConsumer Check customer notification needed
CheckServiceProviderBidReceived BidNotReceivedConsumer Check bid received
CheckCriticalC2QBidReceived BidNotReceivedConsumer Check critical C2Q bid
CheckServiceProviderMissedCheckIn MissedCheckInConsumer Check missed check-in
CheckServiceProviderMissedCheckout MissedCheckoutConsumer Check missed checkout
CheckServiceProviderPartsNeededLeadTime PartsNeededLeadTimeConsumer Check parts ordered on time
CheckServiceProviderPassedPartsLeadTime PassedPartsLeadTimeConsumer Check parts lead time exceeded
CheckTechDeparted TechDepartedConsumer Check tech departed without completing
CheckBidAutomation BidNotAutomatedConsumer Check bid automation failure
CheckBidRequestNotCreated BidRequestNotCreatedConsumer Check bid request created
CheckD2QInvoiceOrQuoteReceived D2QInvoiceOrQuoteNotReceivedConsumer Check D2Q invoice/quote received
CheckSPNotAssigned SPNotAssignedConsumer Check service provider assigned
CheckNteExtensionApproved NteExtensionNotApprovedConsumer Check NTE extension approval
CheckNteExtensionApprovalFollowUp NteExtensionApprovalFollowUpConsumer Follow up on NTE approval
CheckIfBidClarificationWasNotReceived MissingBidClarificationConsumer Check bid clarification received
CheckIfBidRevalidationWasNotReceived MissingBidRevalidationConsumer Check bid revalidation received
CheckCustomerQuoteApprovedNeedsFollowUp CustomerQuoteApprovedNeedsFollowUpConsumer Check quote approval follow-up
CheckCompletionStatusAutomation CompletionStatusAutomationConsumer Check completion automation
CheckContractedServiceRequiredDocumentUploaded ContractedServiceRequiredDocumentNotUploadedConsumer Check required document uploaded

Other Events

Message Type Source Consumer Purpose
SolveZicket Internal SolveZicketConsumer Solve ticket exception
RetryCreateTicketExceptionEvent Internal RetryCreateTicketExceptionConsumer Retry failed exception creation
ICreateOnDemandTicketExceptionCommand API/External OnDemandTicketExceptionConsumer Create exception on demand
FlushCacheRequest API FlushCacheConsumer Cache invalidation
TicketExceptionExternalStatusChanged Zendesk TicketExceptionStatusChangedConsumer External status changed
IArticleNotificationOutcome Compliance Service ComplianceConsumer Article notification result
ContractedServiceDocumentationRequirementMetUpdated Contracted Services ContractedServiceDocumentationRequirementMetConsumer Document requirement met
FollowUpOnContractedServiceDocumentUpload Contracted Services ContractedServiceDocumentationRequirementMetConsumer Document upload follow-up
IUnableToNotifyServiceProvider External UnableToNotifyServiceProviderConsumer SP notification failed

Published Events

Internal Commands (Published by Consumers)

Event Publisher Purpose
CheckServiceProviderETA ETAConsumer Schedule ETA check
CheckIfCustomerShouldBeNotifiedOfMissingETA ETAConsumer Schedule customer notification check

Message Processing Patterns

Synchronization - TicketClaim Middleware

22 of 27 consumers use claim-based synchronization: - Ensures only one message per authorization number processes at a time - Prevents race conditions when multiple events arrive for same work item - Claim acquired before processing, released after - Messages with same authorization number queued until prior processing completes

Retry Strategy

30-second scheduled retry via IMessageScheduler: - Failed exception creation attempts scheduled for retry - Uses Quartz persistence for durable retry - Retry event: RetryCreateTicketExceptionEvent

Scheduled Processing

Quartz-based message scheduling: - Check events scheduled at specific times (e.g., 2 hours after ETA window) - Allows business rule-based delays - Persistent storage ensures no message loss


Queue Configuration

RabbitMQ (TELS vHost)

Setting Value
Host Environment: RMQTELS__Host
Username Environment: RMQTELS__Username
Password Environment: RMQTELS__Password
Connection Format rabbitmq://{host}

Primary Queue

Scheduler Queue

Cache Flush Queue


Message Flow Examples

Exception Creation Flow

External System (e.g., Bidding Service)
  → Publishes IBidStatusChanged
  → RabbitMQ Queue: tels.mqservices.ticketexceptions
  → BiddingConsumer
  → TicketClaim Middleware (acquire lock)
  → Check Exception Rules (is active?)
  → Check Existing Exception
  → Generate Subject/Comment from Call-to-Action
  → Create Exception in PostgreSQL
  → Create Ticket in Zendesk via REST API
  → Store Zendesk Ticket ID
  → TicketClaim Middleware (release lock)

Auto-Solve Flow

External System
  → Publishes Resolution Event (e.g., Bid Received)
  → RabbitMQ Queue
  → Consumer
  → Find Existing Exception for Auth# + Type
  → Mark as "Solved by TBS"
  → Update Zendesk Ticket Status (via REST API)

Scheduled Check Flow

Work Item Created
  → Consumer schedules CheckServiceProviderETA
  → Quartz stores scheduled message
  → 2 hours later...
  → Quartz fires trigger
  → CheckServiceProviderETA published
  → ETAConsumer processes
  → If no ETA provided → Create Exception

Contract Packages

Package Version Events Provided
BuildingServices.Contracts Various IAttachmentUpdated, INotToExceedExtension*, IProjectAuthorized, etc.
TELS.Bidding.Contracts Various IBidConversationAdded, IBidStatusChanged, IBidModification
TELS.Compliance.Contracts Various IArticleNotificationOutcome
TELS.ContractedServices.Contracts Various ContractedService* events
DSE.TELS.Customers.Contracts Various Customer/facility data contracts

Key Files

File Purpose
/TELS.TicketExceptions.MQServices/Program.cs MassTransit configuration, all 27 consumers registered
/TELS.TicketExceptions.MQServices/Consumers/*.cs 27 consumer implementations
/TELS.TicketExceptions.MQServices/Logic/PublishingService.cs Retry logic with 30-second delay
/TELS.TicketExceptions.MQServices/Middleware/TicketClaimMiddleware.cs Synchronization logic

Summary