Entity Documentation Checklist
Entity Documentation (7/7 entities)
Class-Level Comments
Field-Level Comments
Additional Quality Checks
📚 Documentation Structure
indexer/
├── README.md (updated with link to entity docs)
├── ENTITY_DOCUMENTATION_SUMMARY.md (implementation summary)
├── ENTITY_DOCS_CHECKLIST.md (this file)
└── src/
└── database/
└── entities/
├── ENTITY_OWNERSHIP.md (main documentation)
├── raffle.entity.ts (updated with inline docs)
├── ticket.entity.ts (updated with inline docs)
├── user.entity.ts (updated with inline docs)
├── raffle-event.entity.ts (updated with inline docs)
├── platform-stat.entity.ts (updated with inline docs)
├── indexer-cursor.entity.ts (updated with inline docs)
└── dead-letter-event.entity.ts (updated with inline docs)
Manual Verification (Completed)
Suggested Verification (User to run)
cd indexer
# Verify TypeScript syntax
npm run lint
# Verify build succeeds
npm run build
# Run tests
npm run test
📖 Key Documentation Sections
ENTITY_OWNERSHIP.md Contents
Table of Contents - Quick navigation to all entities
Entity Sections (7 total):
Field ownership tables
Updater handler documentation
Idempotency mechanisms
Recalculation safety guidelines
Recalculation Safety - Cross-entity guidelines
Migration Ownership Rules - Guidelines for new migrations
References - Links to related documentation
Inline Documentation Pattern
/**
* Entity description
*
* ## Field Ownership
* - **Raw chain state**: list of fields
* - **Derived**: list of fields
*
* ## Updater Handlers
* - Handler references
*
* ## Recalculation Safety
* - Safe/unsafe guidelines
*
* See: `ENTITY_OWNERSHIP.md` for full documentation
*/
@Entity ( "table_name" )
export class EntityName {
/**
* DERIVED FIELD: Description
* Safe to recalculate: SQL query
*/
@Column ( ...)
derivedField ! : type ;
}
Read ENTITY_OWNERSHIP.md to understand field ownership
Check entity files for inline documentation
Reference updater handlers when modifying processors
Follow migration rules when creating new migrations
Identify if field is raw chain state or derived
For derived fields, use recalculation queries
Check updater handlers for update logic
Verify idempotency keys
Consult recalculation safety guidelines
Use provided SQL examples
Plan maintenance windows for unsafe operations
Verify no concurrent event processing
All documentation follows existing project conventions
Inline comments use JSDoc format for IDE integration
SQL examples use PostgreSQL syntax (project standard)
Documentation is versioned with code (no external wiki)
Links use relative paths for portability
Architecture: docs/ARCHITECTURE.md § Data Model
Processors: indexer/src/processors/
Archiving: indexer/src/maintenance/ARCHIVE_RAFFLE_EVENTS_GUIDE.md
Migrations: indexer/src/database/migrations/