/** Broadcasts transaction lifecycle events (start, commit, rollback) through the EventManager. */
export class TransactionEventBroadcaster {
  em;
  context;
  constructor(em, context) {
    this.em = em;
    this.context = context;
  }
  /** Dispatches a transaction lifecycle event to the EventManager. */
  async dispatchEvent(event, transaction) {
    await this.em.getEventManager().dispatchEvent(event, {
      em: this.em,
      uow: this.em.getUnitOfWork(false),
      transaction,
    });
  }
}
