# Crop Diagnostix EventCatalog Documentation > The source of truth for events flowing through functions-delphi (Firebase Cloud Functions). ## Events - [Allocation Added - AllocationAdded - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/AllocationAdded/0.0.1.mdx) - A partner allocated zones to a grower. Written to events/allocation/add/{eventId}. - [Delphi Error - DelphiError - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/DelphiError/0.0.1.mdx) - An error signal from the Delphi backend. Written to events/error/delphi/{eventId}. - [Delphi Success - DelphiSuccess - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/DelphiSuccess/0.0.1.mdx) - A success signal from the Delphi backend. Written to events/success/delphi/{eventId}. - [Field Added - FieldAdded - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/FieldAdded/0.0.1.mdx) - A new field was added for a grower. Written to events/field/add/{eventId}. - [Field Edited - FieldEdited - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/FieldEdited/0.0.1.mdx) - A field was edited. Written to events/field/edit/{eventId}. - [Grower Added - GrowerAdded - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/GrowerAdded/0.0.1.mdx) - A grower was added. Written to events/grower/add/{eventId}. - [Harvest Added - HarvestAdded - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/HarvestAdded/0.0.1.mdx) - A harvest was added. Written to events/harvest/add/{eventId}. - [Harvest Edited - HarvestEdited - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/HarvestEdited/0.0.1.mdx) - A harvest was edited. Written to events/harvest/edit/{eventId}. - [Hermes Error - HermesError - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/HermesError/0.0.1.mdx) - An error signal from the Hermes backend. Written to events/error/hermes/{eventId}. - [Leaf Irrigation Received - LeafIrrigationReceived - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/LeafIrrigationReceived/0.0.1.mdx) - A Leaf field-irrigation alert was received. Written to events/webhook/leafirrigation/{eventId} by the leafIrrigationWebhook endpoint. - [Leaf Operation Received - LeafOperationReceived - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/LeafOperationReceived/0.0.1.mdx) - A Leaf (withleaf.io) operation alert was received. Written to events/webhook/leafoperation/{eventId} by the leafWebhook HTTP endpoint. - [Mailgun Webhook Received - MailgunWebhookReceived - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/MailgunWebhookReceived/0.0.1.mdx) - A Mailgun delivery event (open, bounce, etc.) was received. Written to events/webhook/mailgun/{eventId} by the mailgunWebhook endpoint. - [Partner Added - PartnerAdded - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/PartnerAdded/0.0.1.mdx) - A partner was added. Written to events/partner/add/{eventId}. - [Partner Allocated - PartnerAllocated - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/PartnerAllocated/0.0.1.mdx) - A partner-level allocation signal. Written to events/partner/allocation/{eventId}. - [Plate Added - PlateAdded - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/PlateAdded/0.0.1.mdx) - A plate was added. Written to events/plate/add/{eventId}. - [Plate Edited - PlateEdited - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/PlateEdited/0.0.1.mdx) - A plate was edited. Written to events/plate/edit/{eventId}. - [Plate Prediction Completed - PlatePredictionCompleted - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/PlatePredictionCompleted/0.0.1.mdx) - RNA yield predictions for a plate are ready. Written to events/plate/predictioncomplete/{eventId}. - [Plate Scanned - PlateScanned - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/PlateScanned/0.0.1.mdx) - A plate has been scanned in the lab. Written by the CropDx backend to events/plate/scan/{eventId}. - [Plate Sequencing Completed - PlateSequencingCompleted - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/PlateSequencingCompleted/0.0.1.mdx) - Sequencing for a plate has finished. Written to events/plate/sequencingcomplete/{eventId}. - [Plate Sequencing Results Pulled - PlateSequencingResultsPulled - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/PlateSequencingResultsPulled/0.0.1.mdx) - Run statistics for a plate were pulled from Illumina BaseSpace. Written to events/plate/sequencingresults/{eventId} by the sequencing-results task. - [Purchase Added - PurchaseAdded - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/PurchaseAdded/0.0.1.mdx) - A purchase was added. Written to events/purchase/add/{eventId}. - [Sample Added - SampleAdded - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/SampleAdded/0.0.1.mdx) - A sample was added. Written to events/sample/add/{eventId}. - [Sample Edited - SampleEdited - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/SampleEdited/0.0.1.mdx) - A sample was edited. Written to events/sample/edit/{eventId}. - [Process Delayed Samples - SampleProcessDelayed - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/SampleProcessDelayed/0.0.1.mdx) - On-demand trigger to run the delayed-sample orchestration. Written to events/sample/processdelayed/{docId}. - [Sampler Added - SamplerAdded - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/SamplerAdded/0.0.1.mdx) - A sampler was added. Written to events/sampler/add/{eventId}. - [Sequence Added - SequenceAdded - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/SequenceAdded/0.0.1.mdx) - A sequence was added. Written to events/sequence/add/{eventId}. - [Sequence Dropped - SequenceDropped - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/SequenceDropped/0.0.1.mdx) - A sequence on the plate was dropped (failed QC). Written to events/sequence/dropped/{eventId} by Plate Processor. - [Sequence Edited - SequenceEdited - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/SequenceEdited/0.0.1.mdx) - A sequence was edited. Written to events/sequence/edit/{eventId}. - [Sequence Failed - SequenceFailed - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/SequenceFailed/0.0.1.mdx) - A sequence on the plate failed processing. Written to events/sequence/failed/{eventId} by Plate Processor. - [Sequence Prediction Completed - SequencePredictionCompleted - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/SequencePredictionCompleted/0.0.1.mdx) - Yield prediction is ready for one sequence. Written to events/sequence/predictioncomplete/{eventId} by Plate Processor. - [Sequence Repeat Scanned - SequenceRepeatScanned - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/SequenceRepeatScanned/0.0.1.mdx) - A sample has been scanned again (more than one sequence exists). Written to events/sequence/repeatscan/{eventId} by Plate Processor. - [Sequence Scanned - SequenceScanned - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/SequenceScanned/0.0.1.mdx) - First sequence seen for a sample. Written to events/sequence/scan/{eventId} by Plate Processor. - [Spectroscopy Added - SpectroscopyAdded - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/SpectroscopyAdded/0.0.1.mdx) - A spectroscopy reading was added. Written to events/spectroscopy/add/{eventId}. - [Spectroscopy Edited - SpectroscopyEdited - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/SpectroscopyEdited/0.0.1.mdx) - A spectroscopy reading was edited. Written to events/spectroscopy/edit/{eventId}. - [User Added - UserAdded - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/UserAdded/0.0.1.mdx) - A user was added. Written to events/user/add/{eventId}. - [User Edited - UserEdited - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/UserEdited/0.0.1.mdx) - A user was edited. Written to events/user/edit/{eventId}. - [User Queue Message - UserQueueMessage - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/UserQueueMessage/0.0.1.mdx) - Request to notify a user across all of their channels. Written to events/user/queuemessage/{eventId}. The single fan-in point for user-facing notifications. - [User Send Email - UserSendEmail - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/UserSendEmail/0.0.1.mdx) - Deliver one email to a user. Written to events/user/sendemail/{eventId} by Messaging Service. - [User Send Message - UserSendMessage - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/UserSendMessage/0.0.1.mdx) - Deliver one push notification to a specific FCM token. Written to events/user/sendmessage/{eventId} by Messaging Service. - [User Send SMS - UserSendSMS - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/UserSendSMS/0.0.1.mdx) - Request to deliver one SMS to a user. Written to events/user/sendsms/{eventId}. - [Zone Added - ZoneAdded - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/ZoneAdded/0.0.1.mdx) - A zone was added. Written to events/zone/add/{eventId}. - [Zone Edited - ZoneEdited - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/ZoneEdited/0.0.1.mdx) - A zone was edited. Written to events/zone/edit/{eventId}. - [Zone Generate Report - ZoneGenerateReport - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/ZoneGenerateReport/0.0.1.mdx) - Request to render a PDF report for one zone. Written to events/zone/generatereport/{eventId}. - [Zone Report Generated - ZoneReportGenerated - 0.0.1 ](https://eventcatalog.cropdx.com/docs/events/ZoneReportGenerated/0.0.1.mdx) - A zone report PDF has been rendered and stored. Written to events/zone/reportgenerated/{eventId}. ## Commands ## Queries ## Agents ## Services - [Allocation Service - AllocationService - 0.0.1 ](https://eventcatalog.cropdx.com/docs/services/AllocationService/0.0.1.mdx) - Handlers in src/handlers/allocation.ts: notify growers when a partner allocates zones, plus a partner-allocation Slack notifier. - [CropDx Backend (external) - CropDxBackend - 0.0.1 ](https://eventcatalog.cropdx.com/docs/services/CropDxBackend/0.0.1.mdx) - External producer. The application/backend services (referred to as "Delphi" and "Hermes") that write the top-level business events into Firestore which functions-delphi reacts to. - [Delayed Sample Service - DelayedSampleService - 0.0.1 ](https://eventcatalog.cropdx.com/docs/services/DelayedSampleService/0.0.1.mdx) - Handlers in src/handlers/delayedSamples.ts: chase samples collected 7+ days ago that have not yet reached the lab, via a daily job or on demand. - [Diagnostics Record Notifier - DiagnosticsRecordNotifier - 0.0.1 ](https://eventcatalog.cropdx.com/docs/services/DiagnosticsRecordNotifier/0.0.1.mdx) - Slack notifiers for lab-record record add/edit events, built on the createEventHandler factory in src/handlers/simpleEvents.ts. - [Field & Zone Service - FieldZoneService - 0.0.1 ](https://eventcatalog.cropdx.com/docs/services/FieldZoneService/0.0.1.mdx) - Handlers in src/handlers/fieldAndZone.ts: notify partners of new fields, and drive zone PDF report generation via a rate-limited Cloud Run task. - [Grower Record Notifier - GrowerRecordNotifier - 0.0.1 ](https://eventcatalog.cropdx.com/docs/services/GrowerRecordNotifier/0.0.1.mdx) - Slack notifiers for commercial-record record add/edit events, built on the createEventHandler factory in src/handlers/simpleEvents.ts. - [Leaf Webhook Service - LeafWebhookService - 0.0.1 ](https://eventcatalog.cropdx.com/docs/services/LeafWebhookService/0.0.1.mdx) - HTTP endpoints and handlers in src/handlers/leaf.ts for Leaf (withleaf.io) operation and irrigation alerts. - [Mailgun Webhook Service - MailgunWebhookService - 0.0.1 ](https://eventcatalog.cropdx.com/docs/services/MailgunWebhookService/0.0.1.mdx) - HTTP endpoint and handler in src/handlers/mailgun.ts for Mailgun delivery events (opens, bounces, etc.). - [Messaging Service - MessagingService - 0.0.1 ](https://eventcatalog.cropdx.com/docs/services/MessagingService/0.0.1.mdx) - Handlers in src/handlers/userMessaging.ts. Fans a queuemessage request out to push, email and SMS, and delivers each channel. - [Plate Processor - PlateProcessor - 0.0.1 ](https://eventcatalog.cropdx.com/docs/services/PlateProcessor/0.0.1.mdx) - Firestore-triggered handlers in src/handlers/plate.ts. Consumes plate-level events and fans them out into sequence-level events, user notifications, and rate-limited sequencing-results tasks. - [Sequence Processor - SequenceProcessor - 0.0.1 ](https://eventcatalog.cropdx.com/docs/services/SequenceProcessor/0.0.1.mdx) - Firestore-triggered handlers in src/handlers/sequence.ts. Consumes the per-sequence events fanned out by Plate Processor and writes grower notifications into Data Connect. - [Slack (external) - Slack - 0.0.1 ](https://eventcatalog.cropdx.com/docs/services/Slack/0.0.1.mdx) - External sink. Nearly every handler posts a notification to the SLACK_PLATES_WEBHOOK_URL Slack channel via src/slack.ts. - [Telemetry Notifier - TelemetryNotifier - 0.0.1 ](https://eventcatalog.cropdx.com/docs/services/TelemetryNotifier/0.0.1.mdx) - Simple Slack notifiers for backend success/error signals, built on the createEventHandler factory in src/handlers/simpleEvents.ts. - [User Record Notifier - UserRecordNotifier - 0.0.1 ](https://eventcatalog.cropdx.com/docs/services/UserRecordNotifier/0.0.1.mdx) - Slack notifiers for user-record record add/edit events, built on the createEventHandler factory in src/handlers/simpleEvents.ts. ## Data Products ## Domains - [Diagnostics - Diagnostics - 0.0.1 ](https://eventcatalog.cropdx.com/docs/domains/Diagnostics/0.0.1.mdx) - The laboratory pipeline: plates and sequences move from scan, through sequencing, to RNA yield predictions. This is where the choreography lives — one plate event fans out into many sequence and zone events. - [Grower Management - GrowerManagement - 0.0.1 ](https://eventcatalog.cropdx.com/docs/domains/GrowerManagement/0.0.1.mdx) - The commercial and agronomy side: partners, purchases, allocations, samplers, growers, fields and zones — plus zone PDF report generation. - [Integrations - Integrations - 0.0.1 ](https://eventcatalog.cropdx.com/docs/domains/Integrations/0.0.1.mdx) - Inbound webhooks from third parties (Leaf, Mailgun) and the events they raise. - [Notifications - Notifications - 0.0.1 ](https://eventcatalog.cropdx.com/docs/domains/Notifications/0.0.1.mdx) - Per-user message delivery: the queuemessage fan-out plus push (FCM), email (Mailgun) and SMS (Vonage) channels. - [Platform - Platform - 0.0.1 ](https://eventcatalog.cropdx.com/docs/domains/Platform/0.0.1.mdx) - System telemetry events: success and error signals from the Delphi and Hermes backends, surfaced to Slack. ## Flows - [Allocation added - AllocationAdded - 0.0.1 ](https://eventcatalog.cropdx.com/docs/flows/AllocationAdded/0.0.1.mdx) - What happens when a partner allocates zones to a grower: a Slack post plus an in-app notification and a queued message for every grower user. - [Delayed sample processing - DelayedSampleProcessing - 0.0.1 ](https://eventcatalog.cropdx.com/docs/flows/DelayedSampleProcessing/0.0.1.mdx) - Chasing samples that were collected 7+ days ago but haven't reached the lab: a daily job (or on-demand event) fans out a rate-limited email task per user that notifies and then flips a flag so each sample is chased only once. - [Field added - FieldAdded - 0.0.1 ](https://eventcatalog.cropdx.com/docs/flows/FieldAdded/0.0.1.mdx) - When a grower adds a field, the partner's users are notified — both in-app and through the shared queuemessage pipeline. - [Leaf webhook ingress - LeafWebhookIngress - 0.0.1 ](https://eventcatalog.cropdx.com/docs/flows/LeafWebhookIngress/0.0.1.mdx) - How a Leaf (withleaf.io) alert becomes an internal event and gets enriched: signature-verified HTTP ingress → Firestore event → a consumer that calls back to the Leaf API. Covers both operation and irrigation alerts. - [Mailgun webhook ingress - MailgunWebhookIngress - 0.0.1 ](https://eventcatalog.cropdx.com/docs/flows/MailgunWebhookIngress/0.0.1.mdx) - How a Mailgun delivery event (open, bounce, etc.) enters the system: signature-verified HTTP ingress → Firestore event → Slack summary. - [Plate prediction fan-out - PlatePredictionFanout - 0.0.1 ](https://eventcatalog.cropdx.com/docs/flows/PlatePredictionFanout/0.0.1.mdx) - What actually happens when RNA yield predictions land for a plate: one plate-level event becomes N sequence events, M zone report requests, and a notification per affected user. - [Plate scan fan-out - PlateScanFanout - 0.0.1 ](https://eventcatalog.cropdx.com/docs/flows/PlateScanFanout/0.0.1.mdx) - What happens when a plate is scanned into the lab: one plate scan becomes a per-sequence scan (or repeat-scan) event and a "sample received" notification per first-time sample. - [Plate sequencing completed - PlateSequencingCompleted - 0.0.1 ](https://eventcatalog.cropdx.com/docs/flows/PlateSequencingCompleted/0.0.1.mdx) - The BaseSpace round-trip: a sequencing-complete event enqueues a rate-limited task that pulls run stats from Illumina, writes them back as an event, and a second handler records them in Data Connect. - [Record notifier pattern - RecordNotifierPattern - 0.0.1 ](https://eventcatalog.cropdx.com/docs/flows/RecordNotifierPattern/0.0.1.mdx) - The shared shape behind ~25 simple events: a record add/edit (or telemetry) event fires, a createEventHandler consumer posts one Slack summary, and nothing else happens. Documented once here instead of per event. - [SMS delivery - SmsDelivery - 0.0.1 ](https://eventcatalog.cropdx.com/docs/flows/SmsDelivery/0.0.1.mdx) - How events/user/sendsms is delivered via Vonage — and why the path is inert today: nothing produces the event, and the recipient is hard-coded. - [Zone report generation - ZoneReportGeneration - 0.0.1 ](https://eventcatalog.cropdx.com/docs/flows/ZoneReportGeneration/0.0.1.mdx) - From a report request to a delivered PDF: a generate-report event enqueues a rate-limited task that renders the PDF via a Cloud Run service, writes a report-generated event, and notifies subscribers, grower and partner. ## Channels - [Firestore events collection - firestore-events - 0.0.1 - protocol - firestore](https://eventcatalog.cropdx.com/docs/channels/firestore-events/0.0.1.mdx) - The transport for all internal events: Firestore documents created under events/{domain}/{action}/{eventId}. A document create is the "publish". ## Containers (Databases, External Systems) ## Entities ## Teams ## Users