This repository has been archived on 2025-08-04. You can view files and clone it, but cannot push or open issues or pull requests.
rhaj/database/models/calendar_model.rhai
2025-04-04 08:28:07 +02:00

55 lines
1.2 KiB
Plaintext

// calendar_model.rhai - Calendar data model
// Create a new calendar object
fn create_calendar(id, name, owner_id, description, color, shared_with, visibility) {
return #{
id: id,
name: name,
owner_id: owner_id,
description: description,
color: color,
shared_with: shared_with,
visibility: visibility
};
}
// Sample calendars data
fn get_sample_calendars() {
let calendars = [];
// Calendar 1: Work Calendar
calendars.push(create_calendar(
"cal1",
"Work Calendar",
"user1",
"Main work calendar for team coordination",
"#4285F4",
["user2", "user3", "user4"],
"team"
));
// Calendar 2: Personal Calendar
calendars.push(create_calendar(
"cal2",
"Personal Calendar",
"user1",
"Personal appointments and reminders",
"#0F9D58",
["user5"],
"private"
));
// Calendar 3: Project Calendar
calendars.push(create_calendar(
"cal3",
"Project Calendar",
"user2",
"Project-specific deadlines and milestones",
"#DB4437",
["user1", "user3", "user4"],
"public"
));
return calendars;
}