rwadurian/backend/services
Developer 29cf03c1d2 feat(leaderboard-service): Implement complete leaderboard service with DDD architecture
## Features
- Daily/Weekly/Monthly leaderboard management
- Ranking score calculation (effectiveScore = totalTeamPlanting - maxDirectTeamPlanting)
- Virtual ranking system for display purposes
- Real-time ranking updates via scheduled tasks
- Redis caching for hot data
- Kafka messaging for event-driven updates

## Architecture
- Domain-Driven Design (DDD) with Hexagonal Architecture
- NestJS 10.x + TypeScript 5.x
- PostgreSQL 15 + Prisma ORM
- Redis (ioredis) for caching
- Kafka (kafkajs) for messaging
- JWT + Passport for authentication
- Swagger for API documentation

## Domain Layer
- Aggregates: LeaderboardRanking, LeaderboardConfig
- Entities: VirtualAccount
- Value Objects: LeaderboardType, LeaderboardPeriod, RankingScore, RankPosition, UserSnapshot
- Domain Events: LeaderboardRefreshedEvent, ConfigUpdatedEvent, RankingChangedEvent
- Domain Services: LeaderboardCalculationService, VirtualRankingGeneratorService, RankingMergerService

## Infrastructure Layer
- Prisma repositories implementation
- Redis cache service
- Kafka event publisher/consumer
- External service clients (ReferralService, IdentityService)

## Testing
- Unit tests: 72 tests passed (88% coverage on core domain)
- Integration tests: 7 tests passed
- E2E tests: 11 tests passed
- Docker containerized tests: 79 tests passed

## Documentation
- docs/ARCHITECTURE.md - Architecture design
- docs/API.md - API specification
- docs/DEVELOPMENT.md - Development guide
- docs/TESTING.md - Testing guide
- docs/DEPLOYMENT.md - Deployment guide

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-01 03:11:03 -08:00
..
admin-service first commit 2025-11-23 21:21:44 -08:00
authorization-service first commit 2025-11-23 21:21:44 -08:00
backup-service . 2025-11-29 22:25:57 -08:00
identity-service . 2025-11-30 06:44:57 -08:00
leaderboard-service feat(leaderboard-service): Implement complete leaderboard service with DDD architecture 2025-12-01 03:11:03 -08:00
mpc-service feat: 添加MPC多方计算服务模块 2025-11-27 17:31:43 -08:00
planting-service . 2025-11-30 19:04:47 -08:00
referral-service feat(referral-service): Implement complete referral service with DDD architecture 2025-12-01 00:18:20 -08:00
reporting-service first commit 2025-11-23 21:21:44 -08:00
reward-service feat(reward-service): Implement complete reward service with DDD architecture 2025-12-01 01:57:40 -08:00
wallet-service feat(wallet-service): Implement complete wallet service with DDD architecture 2025-11-30 09:13:57 -08:00