- Add CaldavService with tsdav/ical.js for CalDAV server communication - Add CaldavController, CaldavRepository, and caldav routes - Add client-side CaldavConfigService with sync(), config CRUD - Add CalDAV settings UI with config load/save in settings screen - Sync on login, auto-login (AuthGuard), periodic timer (calendar), and sync button - Push single events to CalDAV on server-side create/update/delete - Push all events to CalDAV after chat event confirmation - Refactor ChatService to use EventService instead of direct EventRepository - Rename CalDav/calDav to Caldav/caldav for consistent naming - Add Radicale Docker setup for local CalDAV testing - Update PlantUML diagrams and CLAUDE.md with CalDAV architecture
23 lines
657 B
TypeScript
23 lines
657 B
TypeScript
import { CaldavConfig } from "@calchat/shared";
|
|
import mongoose, { Document, Schema } from "mongoose";
|
|
|
|
export interface CaldavConfigDocument extends CaldavConfig, Document {
|
|
toJSON(): CaldavConfig;
|
|
}
|
|
|
|
const CaldavConfigSchema = new Schema<CaldavConfigDocument>(
|
|
{
|
|
userId: { type: String, required: true, index: true },
|
|
serverUrl: { type: String, required: true },
|
|
username: { type: String, required: true },
|
|
password: { type: String, required: true },
|
|
syncIntervalSeconds: { type: Number },
|
|
},
|
|
{ _id: false },
|
|
);
|
|
|
|
export const CaldavConfigModel = mongoose.model<CaldavConfigDocument>(
|
|
"CaldavConfig",
|
|
CaldavConfigSchema,
|
|
);
|