entity-event-handler

Implement entity event handlers triggering side effects after CRUD operations.

7|1|Updated Jun 17, 2021
One-click install
npx skills add https://github.com/duc01226/EasyPlatform --skill entity-event-handler
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: entity-event-handler
Source: https://github.com/duc01226/EasyPlatform/tree/main/.claude/skills/backend-entity-event-handler
Command: npx skills add https://github.com/duc01226/EasyPlatform --skill entity-event-handler

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill helps implement entity event handlers for side effects like notifications, external API calls, and cross-service communications, triggered by CRUD operations.

Core Features & Use Cases

  • Filter by CRUD action (Created, Updated, Deleted)
  • Async handling with request context access
  • Use for notifications, audits, and integrations

Quick Start

Create a handler like SendWelcomeEmailOnCreateUserEntityEventHandler to notify new users.

Frequently Asked Questions about entity-event-handler

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I handle side effects triggered by entity CRUD operations in a CQRS architecture?

Entity event handlers execute side effects after Create, Update, or Delete operations by filtering events in HandleWhen and running logic outside command handlers. This keeps CQRS command logic separate from notifications, audits, and integrations triggered by entity changes.

Can I send notifications when users are created without cluttering my command handler?

Yes. Implement an entity event handler that filters for Created events and executes notification logic asynchronously. Side effects like emails or cross-service messages run in UseCaseEvents after the command completes, keeping handlers clean.

What's the best way to trigger external API calls and audit logs when entities change?

Use entity event handlers with async execution to call external APIs and log audit trails on Created, Updated, or Deleted events. Handlers receive request context and can load repository data, making complex integrations and side effects straightforward.

Do I need to modify my command handlers to implement cross-service messaging for entity updates?

No. Entity event handlers process cross-service messaging independently after CRUD operations. Define handlers that filter by Updated events and publish messages, leaving command handlers focused on state changes only.

How do entity event handlers work with async operations and repository data loading?

Handlers execute as async tasks with full request context access, allowing repository queries to load additional data needed for notifications or integrations. This supports complex workflows without blocking command execution.

When should I use entity event handlers instead of in-command side effects?

Entity event handlers suit CQRS architectures where commands focus on state changes and side effects must run asynchronously. Use them for notifications, analytics, and external integrations to maintain architectural separation and avoid command handler bloat.