I am creating a pills reminder app but having issue with creation of logic regardings the sections, I have an entity name "Pills" with following attributes:-
1- name
2- description
3- duration
4- timeMorning
5- timeAfternoon
6- timeEvening
7- timeNight
8- image
I want to populate my table with sections "Morning", "Afternoon", "Evening" and "Night" in such a way that every section have the related scheduled pills.
Note:- One Single pill can be in multiple sections at once as I have option to choose all four time schedules for a single pill entry.
Plus I want the sections in following order:-
1- Morning
2- Afternoon
3- Evening
4- Night
Any help will be appreciated please.
What I have tried:
Currently I am able to populate data into sections with using one single attribute "time" instead of all four separate time attributes but the problem is that in that case I can schedule a pill for only one single time, i.e Morning, Evening. Secondly the sections are not in proper order ie. Morning, Afternoon, Evening and Night