extend chat model with CRUD actions for event changes

- Add ProposedEventChange type with create/update/delete actions
- Replace proposedEvent with proposedChange in ChatMessage
- Add currentDate to AIContext for time-aware AI responses
- Add AI test endpoint for development (/api/ai/test)
- Fix MongoUserRepository type safety with explicit toUser mapping
- Update CLAUDE.md documentation
This commit is contained in:
2026-01-03 19:37:27 +01:00
parent 105a9a4980
commit e553103470
7 changed files with 82 additions and 34 deletions

View File

@@ -45,6 +45,27 @@ app.get('/health', (_, res) => {
res.json({ status: 'ok' });
});
// AI Test endpoint (for development only)
app.post('/api/ai/test', async (req, res) => {
try {
const { message } = req.body;
if (!message) {
res.status(400).json({ error: 'message is required' });
return;
}
const result = await aiProvider.processMessage(message, {
userId: 'test-user',
conversationHistory: [],
existingEvents: [],
currentDate: new Date(),
});
res.json(result);
} catch (error) {
console.error('AI test error:', error);
res.status(500).json({ error: String(error) });
}
});
// Start server
async function start() {
try {