// The declared domain event. Browser-safe: the SAME value is imported by the // mutation that publishes it, the trigger that reacts to it, and any client that // wants to watch it live — which is what makes the payload type identical // everywhere and a rename impossible to half-apply. import { defineEvent } from '@voltro/protocol' import { Schema } from 'effect' export const orderPlaced = defineEvent({ name: 'order.placed', // The ROUTING key: which subscribers receive this. Only what decides // delivery belongs here — the tenant comes from the subject, never the key. key: Schema.Struct({ orderId: Schema.String }), payload: Schema.Struct({ orderId: Schema.String, tenantId: Schema.String, }), })