reorganize module
This commit is contained in:
54
database/models/calendar_model.rhai
Normal file
54
database/models/calendar_model.rhai
Normal file
@@ -0,0 +1,54 @@
|
||||
// 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;
|
||||
}
|
Reference in New Issue
Block a user