Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to model for both place and user? #543

Open
xjlin0 opened this issue Sep 13, 2022 · 0 comments
Open

How to model for both place and user? #543

xjlin0 opened this issue Sep 13, 2022 · 0 comments

Comments

@xjlin0
Copy link
Contributor

xjlin0 commented Sep 13, 2022

Thanks for creating such a great package to track down time events. Could anyone know how to model the following scenario? I am looking for a way to not overbooking a room.

Let's say there is a building have meeting room 2 and room 3, and user A & B. How can each room has its own calendar so users can find what time's vacant? Also there's a need to show all bookings of the entire building. Currently there's only one event(id: 100) but more will come.

My current thinking: 5 calendars
A main calendar (calendar id 1), room 2 calendar (calendar id 2), room 3 calendar (calendar id 3)
user A calendar (calendar id 4), user B calendar (calendar id 5)

For now only one event: Event(id: 100, calendar: 1) <== this link event to main calendar

EventRelation to link event to both user and room
EventRelation(event: event100, object: room 2 or 3, distinct: 'place')
EventRelation(event: event100, object: user A or B, distinct: 'user')

And Room or User can have their own calendar via Calendar Relation.

erDiagram
    Event ||--|| MainCalendar: model
    Event ||--|{ Room: EventRelation
    Event ||--|{ User: EventRelation
    Room ||--|| RoomsCalendar: CalendarRelation
    User ||--|| UsersCalendar: CalendarRelation
    Event {
    id I00
    calendar I
    }
    MainCalendar {
    id I
    }
    RoomsCalendar {
    id for2or3
    }
    UsersCalendar {
    user forAorB
    }
    Room {
    id room2or3
    }
    User {
    id userAorB
    }
Loading

The problem is the very same meeting now have 3 copies. Say a meeting at Tuesday 10AM, it will have event on main calendar, room calendar and user calendar. If meeting changes we need to change all three Events. Please let me know the best way to model this. thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant