Files
goodgo-platform/apps/api/src/modules/reviews/domain/events/review-deleted.event.ts
Ho Ngoc Hai 2fc2624fa7 feat(api): add reviews module with CRUD endpoints and CQRS
Implement polymorphic reviews system supporting any target type (agent,
property, etc.) with DDD/CQRS architecture following existing patterns.

Endpoints:
- POST /api/reviews — create review (authenticated)
- GET /api/reviews?targetType=&targetId= — list reviews by target
- GET /api/reviews/stats?targetType=&targetId= — aggregate rating stats
- GET /api/reviews/me — list authenticated user's reviews
- DELETE /api/reviews/:id — delete own review

Business rules: 1-5 rating validation, self-review prevention, one
review per user per target. Includes 15 unit tests for all handlers.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-09 00:02:09 +07:00

14 lines
387 B
TypeScript

import { type DomainEvent } from '@modules/shared/domain/domain-event';
export class ReviewDeletedEvent implements DomainEvent {
readonly eventName = 'review.deleted';
readonly occurredAt = new Date();
constructor(
public readonly aggregateId: string,
public readonly userId: string,
public readonly targetType: string,
public readonly targetId: string,
) {}
}