add event CRUD actions and recurring event expansion
- Implement full CRUD in MongoEventRepository (findById, findByUserId, findByDateRange, update, delete) - Extend ChatService to handle create/update/delete actions with dynamic test responses - Add recurrenceExpander utility using rrule library for RRULE parsing - Add eventFormatters utility for German-localized week/month overviews - Add German translations for days and months in shared Constants - Update client ChatService to support all event actions (action, eventId, updates params)
This commit is contained in:
@@ -5,9 +5,18 @@ import {
|
||||
ConversationSummary,
|
||||
GetMessagesOptions,
|
||||
CreateEventDTO,
|
||||
UpdateEventDTO,
|
||||
EventAction,
|
||||
} from "@caldav/shared";
|
||||
import { ApiClient } from "./ApiClient";
|
||||
|
||||
interface ConfirmEventRequest {
|
||||
action: EventAction;
|
||||
event?: CreateEventDTO;
|
||||
eventId?: string;
|
||||
updates?: UpdateEventDTO;
|
||||
}
|
||||
|
||||
export const ChatService = {
|
||||
sendMessage: async (data: SendMessageDTO): Promise<ChatResponse> => {
|
||||
return ApiClient.post<ChatResponse>("/chat/message", data);
|
||||
@@ -16,9 +25,13 @@ export const ChatService = {
|
||||
confirmEvent: async (
|
||||
conversationId: string,
|
||||
messageId: string,
|
||||
event: CreateEventDTO
|
||||
action: EventAction,
|
||||
event?: CreateEventDTO,
|
||||
eventId?: string,
|
||||
updates?: UpdateEventDTO
|
||||
): Promise<ChatResponse> => {
|
||||
return ApiClient.post<ChatResponse>(`/chat/confirm/${conversationId}/${messageId}`, event);
|
||||
const body: ConfirmEventRequest = { action, event, eventId, updates };
|
||||
return ApiClient.post<ChatResponse>(`/chat/confirm/${conversationId}/${messageId}`, body);
|
||||
},
|
||||
|
||||
rejectEvent: async (
|
||||
|
||||
Reference in New Issue
Block a user