Commit Graph

7 Commits

Author SHA1 Message Date
John Yeo
c2c138b02b Merge branch 'staging' into feat/plan-editor 2025-10-14 20:18:04 +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
7f3981e598 Merge branch 'staging' into feat/plan-editor 2025-10-11 23:30:49 +01:00
John Yeo
9f17bb88b2 wip 2025-10-11 15:02:31 +01:00
John Yeo
f493235ca5 fix: apiCustomerV1 processor field 2025-10-08 18:11:14 +01:00
John Yeo
a41e99047a fix: update product query params 2025-10-08 17:06:45 +01:00
John Yeo
348de25cc3 fix: track response version 2025-10-08 14:38:58 +01:00