Commit Graph

6 Commits

Author SHA1 Message Date
John Yeo
dc90d1dab4 feat: set up test and run tests easier 2025-10-20 10:32:26 +01:00
John Yeo
98ba9f9841 feat: Add CTE utilities and enhance platform users endpoint
## CTE Utils System
- Created comprehensive CTE (Common Table Expression) builder utilities
- Supports declarative query building with automatic relation handling
- Smart strategy selection between JOIN+GROUP BY and subquery patterns
- Handles nested relations with automatic optimization
- Type-safe query construction with Drizzle ORM

## Platform Users Enhancements
- Refactored to use new CTE utils for cleaner query building
- Added analytics middleware to Hono pipeline
- Improved query param handling with queryStringArray helper
- Changed timestamps from ISO strings to milliseconds for consistency
- Extracted cleanOrgSlug utility function

## Other Improvements
- Added analytics middleware for Hono routes
- Enhanced base middleware with better context handling
- Fixed template literal linting in initHono.ts
- Updated logger for better structured logging
- Added test files for CTE development

## File Changes
- New: server/src/db/cteUtils/ - Complete CTE builder system
- New: server/src/honoMiddlewares/analyticsMiddleware.ts
- Modified: handleListPlatformUsers.ts - Refactored with CTE utils
- Modified: platformModels.ts - Updated types and validation

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-14 17:48:10 +01:00
John Yeo
9ed1d0326f fix: currency conversion utils for non decimal currencies like JPY 2025-10-01 11:39:47 +01:00
amianthus
68aa842388 fix: 🐛 npm warnings by using bun instead 2025-08-14 02:56:57 +01:00
Misbah Ansari
a4789c1fb6 done 2025-06-19 18:33:41 +05:30
John Yeo
ff7f46d273 restructured tests 2025-06-10 19:54:05 +01:00