feat(api): add inquiries, leads, and agents modules for Agent Portal

Build three new DDD modules following existing CQRS patterns:
- Inquiries: CRUD endpoints for buyer consultation requests with agent notification support
- Leads: Full lead lifecycle management with status state machine and conversion tracking
- Agents: Quality score calculation (event-driven on review changes) and dashboard stats API

All modules include unit tests (14 test files, all 797 tests pass).

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
Ho Ngoc Hai
2026-04-09 10:01:16 +07:00
parent a1a44ef8fb
commit d64bbe97e2
69 changed files with 3420 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
import { type DomainEvent } from '@modules/shared';
export class InquiryCreatedEvent implements DomainEvent {
readonly eventName = 'inquiry.created';
readonly occurredAt = new Date();
constructor(
public readonly aggregateId: string,
public readonly listingId: string,
public readonly userId: string,
) {}
}

View File

@@ -0,0 +1,12 @@
import { type DomainEvent } from '@modules/shared';
export class InquiryReadEvent implements DomainEvent {
readonly eventName = 'inquiry.read';
readonly occurredAt = new Date();
constructor(
public readonly aggregateId: string,
public readonly listingId: string,
public readonly userId: string,
) {}
}