重构账单查询sql
All checks were successful
Docker Build & Deploy / Build Docker Image (push) Successful in 26s
Docker Build & Deploy / Deploy to Production (push) Successful in 7s
Docker Build & Deploy / Cleanup Dangling Images (push) Successful in 2s
Docker Build & Deploy / WeChat Notification (push) Successful in 2s

This commit is contained in:
SunCheng
2026-01-28 10:58:15 +08:00
parent 5c9d7c5db1
commit b71eadd4f9
19 changed files with 1433 additions and 730 deletions

44
Entity/AGENTS.md Normal file
View File

@@ -0,0 +1,44 @@
# ENTITY LAYER KNOWLEDGE BASE
**Generated:** 2026-01-28
**Parent:** EmailBill/AGENTS.md
## OVERVIEW
Database entities using FreeSql ORM with BaseEntity inheritance pattern.
## STRUCTURE
```
Entity/
├── BaseEntity.cs # Base entity with Snowflake ID
├── GlobalUsings.cs # Common imports
├── BudgetRecord.cs # Budget tracking entity
├── TransactionRecord.cs # Transaction entity
├── EmailMessage.cs # Email processing entity
└── MessageRecord.cs # Message entity
```
## WHERE TO LOOK
| Task | Location | Notes |
|------|----------|-------|
| Base entity pattern | BaseEntity.cs | Snowflake ID, audit fields |
| Budget entities | BudgetRecord.cs, BudgetArchive.cs | Budget tracking |
| Transaction entities | TransactionRecord.cs, TransactionPeriodic.cs | Financial transactions |
| Email entities | EmailMessage.cs, MessageRecord.cs | Email processing |
## CONVENTIONS
- Inherit from BaseEntity for all entities
- Use [Column] attributes for FreeSql mapping
- Snowflake IDs via YitIdHelper.NextId()
- Chinese comments for business logic
- XML docs for public APIs
## ANTI-PATTERNS (THIS LAYER)
- Never use DateTime.Now (use IDateTimeProvider)
- Don't skip BaseEntity inheritance
- Avoid complex business logic in entities
- No database queries in entity classes
## UNIQUE STYLES
- Fluent Chinese naming for business concepts
- Audit fields (CreateTime, UpdateTime) automatic
- Soft delete patterns via UpdateTime nullability