I need to implement an event calendar in firebase.
The requirements are:
- a user(agent) can work for one or more agencies(agent needs to see which artist is free or booked for a specific date)
- a user(manager) can work for one or more agency/venues
- a public user can see list all events for a particular artist / venue
Can somebody please help me find a good firebase structure for storing this data?
calendar:
- calendarId
- timestamp
- description
user-calendars:
- calendar1Id:true
- calendar2Id:true
I think this would be a good structure for a private calendar, but how to get all the events for a particular artist or a particular venue?
venue-events:
-id
-timestamp
-name
agency-events:
-id
-timestamp
-name
users:
-id
-name
agency:
-id
-name
venue:
-id
-name
artist:
-id
-name
Update1:
If I create an event table:
events:
-eventId1
-name: "Firebase is awesome"
-date: 09092017
-artists:
-artist1Id:true
-artost2Id:true
-venues:
-venue1Id:true
Now I have a common event table but for fetching events for a particular artist I would need:
-artist-events:
-artist1Id:
-event1Id:{copy all data of the event}
Morover I would need this also for agency,venue..This is the only effective way to retrive later on my data.
My concern is it will not be too complicated for updating all the nodes?
I use functions but still.
thank you