const metadata = {
  event: "customer_accounts.domain_mapping.activated",
  persistent: true,
  id: "customer_accounts:notify-domain-activated"
};
async function handle(payload, ctx) {
  const data = payload ?? {};
  const id = typeof data.id === "string" ? data.id : null;
  const tenantId = typeof data.tenantId === "string" ? data.tenantId : null;
  const organizationId = typeof data.organizationId === "string" ? data.organizationId : null;
  const hostname = typeof data.hostname === "string" ? data.hostname : "";
  if (!id || !tenantId || !organizationId) return;
  try {
    const eventBus = ctx.resolve("eventBus");
    await eventBus.emitEvent("notifications.create", {
      type: "customer_accounts.domain_mapping.activated",
      tenantId,
      organizationId,
      sourceEntityId: id,
      data: { hostname }
    });
  } catch {
  }
}
export {
  handle as default,
  metadata
};
//# sourceMappingURL=notifyDomainActivated.js.map
