Fix booking summary end time and enhance calendar event management

**Issue 1: Fix end time display in booking summary**
- Now correctly shows start_time + slot_duration instead of just start_time
- Example: 09:30 → 10:00 for 1 slot (30 mins)

**Issue 2: Confirm create-google-meet-event uses consulting_sessions**
- Verified: Function already updates consulting_sessions table
- The data shown is from OLD consulting_slots table (needs migration)

**Issue 3: Delete calendar events when order is deleted**
- Enhanced delete-order function to delete calendar events before removing order
- Calls delete-calendar-event for each session with calendar_event_id

**Issue 4: Admin can now edit session time and manage calendar events**
- Added time editing inputs (start/end time) in admin dialog
- Added "Delete Link & Calendar Event" button to remove meet link
- Shows calendar event connection status (✓ Event Kalender: Terhubung)
- "Regenerate Link" button creates new meet link + calendar event
- Recalculates session duration when time changes

**Issue 5: Enhanced calendar event description**
- Now includes: Kategori, Client email, Catatan, Session ID
- Format: "Kategori: {topic}\n\nClient: {email}\n\nCatatan: {notes}\n\nSession ID: {id}"

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
dwindown
2025-12-28 14:30:39 +07:00
parent 5ab4e6b974
commit b1bd092eb8
4 changed files with 184 additions and 54 deletions

View File

@@ -235,7 +235,7 @@ serve(async (req: Request): Promise<Response> => {
const eventData = {
summary: `Konsultasi: ${body.topic} - ${body.client_name}`,
description: `Client: ${body.client_email}\n\nNotes: ${body.notes || '-'}\n\nSlot ID: ${body.slot_id}`,
description: `Kategori: ${body.topic}\n\nClient: ${body.client_email}\n\nCatatan: ${body.notes || '-'}\n\nSession ID: ${body.slot_id}`,
start: {
dateTime: startDate.toISOString(),
timeZone: "Asia/Jakarta",