Some checks failed
CI Pipeline (nottags) / security (push) Successful in 17s
CI Pipeline (tags) / security (push) Successful in 17s
CI Pipeline (nottags) / test (push) Failing after 52s
CI Pipeline (tags) / test (push) Failing after 50s
CI Pipeline (tags) / release (push) Has been skipped
CI Pipeline (tags) / metadata (push) Has been skipped
1.3 KiB
1.3 KiB
Project Hints
Architecture
This project follows the @push.rocks/smartstate pattern with the following structure:
- TypeScript source files in
ts/
directory - Test files in
test/
directory - Built files output to
dist_ts/
directory - ES modules configuration (
"type": "module"
)
Key Design Decisions
- Decimal Precision: Uses decimal.js library to avoid JavaScript floating-point errors
- Class Hierarchy: Calculator is the base class, other classes extend it for specific domains
- Naming Convention: Files follow pattern
calculation.classes.*.ts
- Plugin Pattern: Dependencies are imported through
calculation.plugins.ts
Development Workflow
- Run tests:
pnpm test
- Build project:
pnpm build
- Type checking:
tsbuild check test/**/* --skiplibcheck
- Testing uses @git.zone/tstest with expect from @push.rocks/tapbundle
Financial Calculations
- All monetary calculations use decimal arithmetic for accuracy
- Interest calculations support multiple compounding frequencies
- Financial functions follow standard financial formulas
- Currency class handles formatting based on locale conventions
Testing Strategy
- Cross-platform tests in
test.both.ts
- Tests cover accuracy, edge cases, and error handling
- Precision tests ensure decimal accuracy is maintained