Commit Graph

12 Commits

Author SHA1 Message Date
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
amianthus
0912dcd2cd Merge branch 'staging' into perf/bun-runtime 2025-07-21 11:09:22 +01:00
John Yeo
254b69d1f7 fix: local tunnel using wrong env var 2025-07-19 20:01:35 +01:00
amianthus
585bb55c8b perf: ️ introduce bun runtime in dockerfiles and package.json 2025-07-19 14:26:12 +01:00
Ubuntu
141ad67520 ci: finish automating tests 2025-07-18 14:51:29 +00:00
John Yeo
15e36b433a fix: preview for update prepaid quantity with trial 2025-07-04 17:56:03 +01:00
John Yeo
ecb1f5fbbf feat: auto-detecting base variant with LLM 2025-06-26 12:33:17 +01:00
John Yeo
3932a45f09 fix: reward program errors, default paid product expired 2025-06-25 12:20:28 +01:00
Dominik Koch
7dffe557b6 fix: local deployment on bill gates os
Local deployments on windows didnt seem to work so this pr aims to fix that and hopefully make autumn work everywhere now!
2025-06-19 18:16:14 +02:00
John Yeo
f9c94f0c20 fix: added domain to CORS config for pkey migration 2025-06-18 19:43:37 +01:00
John Yeo
3b1cff357b fix: entity_id now appears in customer products, added test for it 2025-06-18 10:45:15 +01:00
John Yeo
bfc2f92896 added localtunnel to setup 2025-06-17 19:05:51 +01:00